Commit Graph

5316 Commits

Author SHA1 Message Date
Ted Kremenek cdf5f4aa7b Remove 'AnalysisContext::setDecl()', as we the Decl associated with an
AnalysisContext should never change. Along the way, propagate some constness
around.

llvm-svn: 79701
2009-08-21 23:58:43 +00:00
Ted Kremenek 00aeae98b5 Constify LocationContext* (parent) and Stmt* fields in LocationContext.
llvm-svn: 79700
2009-08-21 23:39:58 +00:00
Ted Kremenek 608677a2e1 Remove 'SelfRegion' field from both BasicStoreManager and RegionStoreManager.
SelfRegion represented the object bound to 'self' (when analyzing Objective-C
methods) upon entry to a method. Having this region stored on the side ignores
the current stack frame that we might be analyzing (among other things), and is
a problem for interprocedural analysis.

For RegionStoreManager, the value for SelfRegion is just lazily created.

For BasicStoreManager, the value for SelfRegion is bound eagerly to 'self', but
no explicit tracking of SelfRegion on the side is made.

As part of this change, remove the restriction in BasicStoreManager that we only
track ivars for 'self'. This shouldn't actually change anything in terms of
precision, and simplifies the logic.

llvm-svn: 79694
2009-08-21 23:25:54 +00:00
Douglas Gregor 05155d8d7b Implement conversion function templates, along with the ability to use
template argument deduction from a conversion function (C++
[temp.deduct.conv]) with implicit conversions.

llvm-svn: 79693
2009-08-21 23:19:43 +00:00
Ted Kremenek 14536f6ee0 Add LocationContext* field to VarRegion. This is needed for interprocedural analysis.
llvm-svn: 79680
2009-08-21 22:28:32 +00:00
Douglas Gregor 5ed5ae476e Introduce support for constructor templates, which can now be declared
and will participate in overload resolution. Unify the instantiation
of CXXMethodDecls and CXXConstructorDecls, which had already gotten
out-of-sync.

llvm-svn: 79658
2009-08-21 18:42:58 +00:00
Chris Lattner 3ede522ca9 remove a dead warning.
llvm-svn: 79641
2009-08-21 17:15:06 +00:00
Fariborz Jahanian 6c9e5a2b9e Introduce getConstantArrayElementCount API and use it in
construction/destruction of array members.

llvm-svn: 79637
2009-08-21 16:31:06 +00:00
Daniel Dunbar 145c59d079 Fix commentos
llvm-svn: 79610
2009-08-21 08:24:45 +00:00
Daniel Dunbar b3252cc860 Fix refacto.
llvm-svn: 79609
2009-08-21 08:22:12 +00:00
Zhongxing Xu 6be1a4e832 Tie the local check NSErrorCheck to a Decl to pave the way
to untie the ExplodedGraph from a specific Decl.

llvm-svn: 79588
2009-08-21 02:18:44 +00:00
Daniel Dunbar b789d61a6e Remove comma at the end of enumerator list.
llvm-svn: 79586
2009-08-21 00:54:25 +00:00
Argyrios Kyrtzidis 6032ef1aa3 Remove TypeSpecStartLocation from VarDecl/FunctionDecl/FieldDecl, and use DeclaratorInfo to get this information.
llvm-svn: 79584
2009-08-21 00:31:54 +00:00
Douglas Gregor a8eed7dabb Make the new Objective-C "id" and "Class" redefinition types special
types that are preloaded by the PCH file. Fixes PCH breakage
introduced in r79248.

llvm-svn: 79583
2009-08-21 00:27:50 +00:00
Douglas Gregor 3447e76762 Initial support for parsing and representation of member function templates.
llvm-svn: 79570
2009-08-20 22:52:58 +00:00
Sanjiv Gupta b841d1baa1 Issue an error if the user specifies parameters in a function marked as ISR.
llvm-svn: 79544
2009-08-20 17:48:52 +00:00
Fariborz Jahanian 9a84665921 Using "ObjCImplicitSetterGetterRefExpr" instead of "ObjCImplctSetterGetterRefExpr".
A field rename and more comments.

llvm-svn: 79537
2009-08-20 17:02:02 +00:00
John McCall 950aac085d Add syntax examples for the friend declaration types.
Remove an assert trivialized by dominating code.

llvm-svn: 79520
2009-08-20 07:19:42 +00:00
Eli Friedman 629ffb9ad3 Fix bit-field promotion to be a bit closer to the behavior of gcc.
Patch by Enea Zaffanella, with some simplifications/corrections to
isPromotableBitField by me.

llvm-svn: 79510
2009-08-20 04:21:42 +00:00
John McCall 87a44eb98a Basic nested-template implementation.
llvm-svn: 79504
2009-08-20 01:44:21 +00:00
Zhongxing Xu 068928b2a6 Rename: ProgramPoint::getContext() => ProgramPoint::getLocationContext().
llvm-svn: 79502
2009-08-20 01:23:34 +00:00
Argyrios Kyrtzidis 20cf19141f Keep track of the right paren ')' source location in a function declarator.
llvm-svn: 79489
2009-08-19 23:14:54 +00:00
Daniel Dunbar 62c850fb8f Remove now unnecessary helper methods.
llvm-svn: 79460
2009-08-19 20:32:38 +00:00
Daniel Dunbar dec484abfb Convert parts of Rewriter to StringRef based API.
- Please accept my sincere apologies for the gratuitous elimination of code
   duplication, manual string length counting, unnecessary strlen calls, etc.

llvm-svn: 79448
2009-08-19 19:10:30 +00:00
Zhongxing Xu 080fa0522b Get the Decl from the current ExplodedNode. Eventually the diagnostic client
and other core analysis logic will be untied to a particular Decl.

llvm-svn: 79420
2009-08-19 12:50:00 +00:00
Eli Friedman 5ae98ee006 Make integer promotions work correctly on PIC16 and other platforms
where sizeof(short) == sizeof(int).  Move UsualArithmeticConversionsType 
out of Sema, since it was only there as a historical artifact.  Patch by 
Enea Zaffanella.

llvm-svn: 79412
2009-08-19 07:44:53 +00:00
Argyrios Kyrtzidis e918926d31 Introduce LocInfoType which is a Sema-specific implementation detail.
This is a Type subclass that can hold a DeclaratorInfo* when we have type source info coming
out of a declarator that we want to preserve. This is used only at the "border" of Parser/Sema for
passing/getting QualTypes, it does not participate in the type system semantics in any way.

llvm-svn: 79394
2009-08-19 01:28:17 +00:00
Argyrios Kyrtzidis 60ed560428 Introduce DeclaratorDecl and pass DeclaratorInfo through the Decl/Sema interfaces.
DeclaratorDecl contains a DeclaratorInfo* to keep type source info.
Subclasses of DeclaratorDecl are FieldDecl, FunctionDecl, and VarDecl.
EnumConstantDecl still inherits from ValueDecl since it has no need for DeclaratorInfo.

Decl/Sema interfaces accept a DeclaratorInfo as parameter but no DeclaratorInfo is created yet.

llvm-svn: 79392
2009-08-19 01:27:57 +00:00
Argyrios Kyrtzidis 3f79ad7405 Introduce DeclaratorInfo and TypeLoc, intended to be used for storing and reading source information for types.
DeclaratorInfo will contain a flat memory block for source information about a type that came out of a declarator.
TypeLoc and its subclasses will be used by clients as wrappers to "traverse" the memory block and read the information.

Both DeclaratorInfo and TypeLoc are not utilized in this commit.

llvm-svn: 79391
2009-08-19 01:27:32 +00:00
Fariborz Jahanian 19380c4b88 Renamed ClassProp data member of ObjCImplctSetterGetterRefExpr
to InterfaceDecl, as it is unrelated to any property and
holds the InterfaceDecl needed for accessing class getter/setter
methods using the dot-syntax.

llvm-svn: 79371
2009-08-18 21:37:33 +00:00
Fariborz Jahanian 88cc2340de Renamed ObjCKVCRefExpr to ObjCImplctSetterGetterRefExpr.
Removed an unnecessary loop to get to setters incoming
argument. Added DoxyGen comments. Still more work
to do in this area (WIP).

llvm-svn: 79365
2009-08-18 20:50:23 +00:00
Anders Carlsson a192947509 Change ActOnReturnStmt to not take a FullExprArg. Instead, Sema will wrap the return expr inside a CXXExprWithTemporaries if needed.
llvm-svn: 79342
2009-08-18 16:11:00 +00:00
Zhongxing Xu 7864b9ea0c Remove unused parameter BugReporter due to previous patch.
llvm-svn: 79328
2009-08-18 08:58:41 +00:00
Zhongxing Xu 4c76dbc758 Now we can get the CFG from the ProgramPoint. No need to pass in the
BugReporter.

llvm-svn: 79327
2009-08-18 08:46:04 +00:00
Ted Kremenek 9b2c79de59 Enhance static analyzer diagnostics by introducing a new 'EnhancedBugReporter'
which allows custom checks to register callback creator functions for creating
BugReporterVisitor objects. This allows various checks to include diagnostics
such as 'assuming value is null' with little extra work. Eventually this API
should be refactored to be cleaner and more simple.

llvm-svn: 79302
2009-08-18 01:05:30 +00:00
David Chisnall 9f57c29053 Initial patch to support definitions of id and Class from headers in Objective-C code.
This currently breaks test/SemaObjC/id-isa-ref.m and issues some spurious warnings when you attempt to assign a struct objc_class* value to a Class variable.  The test case probably should fail as it's written, because without the definition of Class the compiler should not assume struct objc_class* is a valid receiver type, but it's left broken because it would be nice if we could get that passing too for the special case of isa.

Approved by snaroff.

llvm-svn: 79248
2009-08-17 16:35:33 +00:00
Zhongxing Xu a7a35bc2a6 Remove unused variable.
llvm-svn: 79229
2009-08-17 06:30:30 +00:00
Zhongxing Xu 5f078cb844 To make the analysis independent on the locally stored liveness and cfg
of GRStateManager and GRExprEngine, pass the initial location context
to the getInitialState() method.

llvm-svn: 79228
2009-08-17 06:19:58 +00:00
Anders Carlsson b80760bd78 Destroy bound temporaries.
llvm-svn: 79196
2009-08-16 17:50:25 +00:00
Chris Lattner 2ba5ca9d4f Improve the diagnostic emitted when an unused ObjC property getter
is found.  Instead of complaining about a generic "unused expr",
emit:
t.m:7:3: warning: property access result unused - getters should not have side effects

While objc property getters *could* have side effects, according to
the language best practices, they *shouldn't*.  Hopefully the
diagnostic now gets this across.

llvm-svn: 79192
2009-08-16 16:57:27 +00:00
Anders Carlsson 250aada4b9 AddInitializerToDecl can't take a FullExprArg. Make it take an ExprArg, and create the CXXExprWithTemporaries before setting the initializer on the VarDecl.
llvm-svn: 79176
2009-08-16 05:13:48 +00:00
Anders Carlsson bc4c107836 Move builtin call checking out into a separate function, make CheckFunctionCall and CheckBlockCall return bool instead. No intended functionality change.
llvm-svn: 79157
2009-08-16 01:56:34 +00:00
Eli Friedman c96d4963eb Implement __is_empty. Patch by Sean Hunt.
llvm-svn: 79143
2009-08-15 21:55:26 +00:00
Eli Friedman e99c9c5b60 Ignore -Wno-import.
llvm-svn: 79128
2009-08-15 19:28:53 +00:00
Zhongxing Xu e1190f73a9 Extend the ProgramPoint to include the context information LocationContext,
which is either a stack frame context of the function or a local scope 
context.

llvm-svn: 79072
2009-08-15 03:17:38 +00:00
John McCall deb8448690 Disable all recognition of main() in -ffreestanding. Addresses bug #4720.
llvm-svn: 79070
2009-08-15 02:09:25 +00:00
Ted Kremenek 08479ae7fe Change handling of attribute 'malloc' to only accept the attribute on function
declarations (and not function pointers). This is consistent with GCC. Accepting
this attribute on function pointers means that the attribute should be treated
as a type qualifier, which apparently is not what GCC does. We obviously can
change this later should we desire to enhance the 'malloc' attribute in this
way.

llvm-svn: 79060
2009-08-15 00:51:46 +00:00
Anders Carlsson e827123f08 Make the CXXDefaultArgExpr constructor protected and add a static Create function.
llvm-svn: 79013
2009-08-14 18:30:22 +00:00
Mike Stump bcf756cbac Deconflate virtual base offsets from non-virtual base offsets.
Deconflate a virtual base primary from a non-virtual base.

llvm-svn: 78971
2009-08-14 01:44:03 +00:00
Fariborz Jahanian bbd5e8c2cf More toward synthesizing copy assignments. SWIP.
llvm-svn: 78861
2009-08-12 23:34:46 +00:00
Fariborz Jahanian de7d4c264a Patch for synthesizing copy assignment operator.
WIP.

llvm-svn: 78841
2009-08-12 21:14:35 +00:00
Nate Begeman 4874592208 Transition the PCH support for ShuffleVectorExpr over to ASTContext allocation
llvm-svn: 78783
2009-08-12 02:28:50 +00:00
Zhongxing Xu 0d375cdcb1 More cleanups.
llvm-svn: 78782
2009-08-12 02:28:32 +00:00
Zhongxing Xu ccffe0953e Remove redundant forward declarations.
llvm-svn: 78781
2009-08-12 02:23:28 +00:00
Nate Begeman f485fb55d8 Fix a fixme by allocating ShuffleVectorExprs in the Context
llvm-svn: 78780
2009-08-12 02:10:25 +00:00
Fariborz Jahanian 3f8917abf6 Patch to warn if a property which is 'assign' by default
may not implement NSCopying protocol in -fobjc-gc[-only] mode.

llvm-svn: 78726
2009-08-11 22:02:25 +00:00
John McCall 2658c4e2d9 Add a FriendClassDecl type for holding declarations of friend types in
the AST, and create such declarations.

llvm-svn: 78719
2009-08-11 21:13:21 +00:00
Fariborz Jahanian b2197042b8 ir-gen support for anonymous union data member
copying in copy constructors and used in
default constructor's initializer list.

llvm-svn: 78700
2009-08-11 18:49:54 +00:00
Benjamin Kramer 9cd050ab07 LLVMContext is a class now.
llvm-svn: 78691
2009-08-11 17:46:57 +00:00
John McCall d1e9d835f3 Argument-dependent lookup for friend declarations. Add a new decl type,
FriendFunctionDecl, and create instances as appropriate.

The design of FriendFunctionDecl is still somewhat up in the air;  you can
befriend arbitrary types of functions --- methods, constructors, etc. ---
and it's not clear that this representation captures that very well.
We'll have a better picture when we start consuming this data in access
control.

llvm-svn: 78653
2009-08-11 06:59:38 +00:00
Douglas Gregor a16548e301 Refactor the template-instantiation logic for expressions into a
generic tree transformation (also used for recanonicalization) and a
small amount of template-instantiation-specific logic.

llvm-svn: 78645
2009-08-11 05:31:07 +00:00
Nate Begeman 5ec4b318e3 Take 2 on AltiVec-style vector initializers.
Fixes PR4704 problems

Addresses Eli's patch feedback re: ugly cast code

Updates all postfix operators to remove ParenListExprs.  While this is awful,
no better solution (say, in the parser) is obvious to me.  Better solutions
welcome.

llvm-svn: 78621
2009-08-10 23:49:36 +00:00
Anders Carlsson ed1674d971 Add a CastInfo struct that will be used for cast information when constructing cast expressions. Right now it only stores the cast kind, but in the future it might store conversion functions and constructors.
llvm-svn: 78599
2009-08-10 21:30:22 +00:00
Chris Lattner 30ba674391 fix a couple of problems with section attributes:
1. Passing something that isn't a string used to cause:
   "argument to annotate attribute was not a string literal"
  make it say "section attribute" instead.

2. Fix the location of the above message to point to the
   bad argument instead of the section token.

3. Implement rdar://4341926, by diagnosing invalid section
   specifiers in the frontend rather than letting them slip all
   the way to the assembler (a QoI win).

An example of #3 is that we used to produce something like this:

/var/folders/n7/n7Yno9ihEm894640nJdSQU+++TI/-Tmp-//ccFPFGtT.s:2:Expected comma after segment-name
/var/folders/n7/n7Yno9ihEm894640nJdSQU+++TI/-Tmp-//ccFPFGtT.s:2:Rest of line ignored. 1st junk character valued 46 (.).

Daniel improved clang to use llvm_report_error, so now we got:

$ clang t.c -c
fatal error: error in backend: Global variable 'x' has an invalid section specifier 'sadf': mach-o section specifier
      requires a segment and section separated by a comma.

with no loc info.  Now we get:

$ clang t.c -fsyntax-only
t.c:4:30: error: argument to 'section' attribute is not valid for this target: mach-o section specifier requires a segment
      and section separated by a comma
int x __attribute__((section("sadf")));
                             ^

which is nice :)

llvm-svn: 78586
2009-08-10 19:03:04 +00:00
Mike Stump 68f0d31f25 Add walking bases in reverse order.
llvm-svn: 78578
2009-08-10 18:21:22 +00:00
Daniel Dunbar 71f22e738a Use LLVM's new error handler API to report back end errors using Diagnostic.
For example,
--
ddunbar@giles:Frontend$ clang -c backend-errors.c
fatal error: error in backend: Global variable 'a' has an invalid section specifier
      'I AM, not, legal': mach-o section specifier uses an unknown section type.
--
compare to:
--
ddunbar@giles:Frontend$ gcc -c backend-errors.c
/var/folders/DQ/DQ8GT3++HESEzT1obWBynE+++TI/-Tmp-//cc45w2pq.s:2:Expected comma after segment-name
/var/folders/DQ/DQ8GT3++HESEzT1obWBynE+++TI/-Tmp-//cc45w2pq.s:2:Rest of line ignored. 1st junk character valued 77 (M).
--

Yay!

I am not tied to my wording choice, we could also go with "uncoverable error"
for the prefix, or just leave it off entirely.

llvm-svn: 78554
2009-08-10 03:40:28 +00:00
Daniel Dunbar 481fe50903 Revert r78535, it is causing a number of failures to build projects.
--- Reverse-merging r78535 into '.':
D    test/Sema/altivec-init.c
U    include/clang/Basic/DiagnosticSemaKinds.td
U    include/clang/AST/Expr.h
U    include/clang/AST/StmtNodes.def
U    include/clang/Parse/Parser.h
U    include/clang/Parse/Action.h
U    tools/clang-cc/clang-cc.cpp
U    lib/Frontend/PrintParserCallbacks.cpp
U    lib/CodeGen/CGExprScalar.cpp
U    lib/Sema/SemaInit.cpp
U    lib/Sema/Sema.h
U    lib/Sema/SemaExpr.cpp
U    lib/Sema/SemaTemplateInstantiateExpr.cpp
U    lib/AST/StmtProfile.cpp
U    lib/AST/Expr.cpp
U    lib/AST/StmtPrinter.cpp
U    lib/Parse/ParseExpr.cpp
U    lib/Parse/ParseExprCXX.cpp

llvm-svn: 78551
2009-08-10 03:01:36 +00:00
Ryan Flynn e64ffc277c warn, as gcc does, if __attribute__((malloc)) applied to function returning non-pointer type
llvm-svn: 78542
2009-08-09 22:36:29 +00:00
Ryan Flynn 1f1fdc070e map previously ignored __attribute((malloc)) to noalias attribute of llvm function's return
llvm-svn: 78541
2009-08-09 20:07:29 +00:00
Nate Begeman a96114ed08 AltiVec-style vector initializer syntax, vec4 a = (vec4)(a, b, c, d);
In addition to being defined by the AltiVec PIM, this is also the vector
initializer syntax used by OpenCL, so that vector literals are compatible
with macro arguments.

llvm-svn: 78535
2009-08-09 17:55:44 +00:00
Ryan Flynn 2f08571e4d PR4700 - remove shift by 0 warning
llvm-svn: 78488
2009-08-08 19:18:23 +00:00
Anders Carlsson 68e0b68289 Introduce a new PragmaPack attribute, and use it for #pragma pack. The PackedAttr now only represents __attribute__((packed)).
This is necessary because #pragma pack and __attribute__((packed)) have different semantics. No functionality change yet, but this lays the groundwork for fixing a record layout bug.

llvm-svn: 78483
2009-08-08 18:23:56 +00:00
Edward O'Callaghan c69169d175 Patch should implement packed enums - PR4098. Credit to Anders Johnsen.
llvm-svn: 78471
2009-08-08 14:36:57 +00:00
Anders Carlsson c5c57c3b86 Get rid of Stmt::Clone now that we can reference count statements instead.
llvm-svn: 78452
2009-08-08 02:50:17 +00:00
Douglas Gregor 2c742024ff Introduce reference counting for statements and expressions, using it
to allow sharing of nodes. Simplifies some aspects of template
instantiation, and fixes both PR3444 and <rdar://problem/6757457>.

llvm-svn: 78450
2009-08-08 01:41:12 +00:00
Anders Carlsson 8fc489da2a Add a CK_ArrayToPointerDecay cast kind.
llvm-svn: 78434
2009-08-07 23:48:20 +00:00
Anders Carlsson ec143777ba Add CK_ToUnion and use it for aggregate expression codegen.
llvm-svn: 78429
2009-08-07 23:22:37 +00:00
John McCall c7e8e795fa Just add global scope to the associated namespaces set instead of tracking it
separately.  Add the framework (currently unfed) for finding friend declarations
during argument-dependent lookup.

llvm-svn: 78414
2009-08-07 22:18:02 +00:00
Mike Stump d9687fded6 Add rbegin and rend for virtual bases, might come in handy some day.
llvm-svn: 78412
2009-08-07 21:44:39 +00:00
Mike Stump c266c6d797 Add ability to generate vcall offsets for primary virtual base.
llvm-svn: 78396
2009-08-07 19:00:50 +00:00
Mike Stump b93185d05a Fix some const_cast issues. This is the beginning of the rabbit hole.
llvm-svn: 78393
2009-08-07 18:05:12 +00:00
Ryan Flynn f53fab87d8 PR3333: warn when shifting by invalid amount
llvm-svn: 78385
2009-08-07 16:20:20 +00:00
Douglas Gregor e26a285c8f Separate Stmt::Destroy into the entrypoint for destroying a statement
or expression (Destroy) from the virtual function used to actually
destroy a given expression (DoDestroy). 

llvm-svn: 78375
2009-08-07 06:08:38 +00:00
Ted Kremenek 2f6eb14af4 Fix a couple false positive "uninitialized value" warnings with RegionStore
involving reasoning about unions (which we don't handle yet).

llvm-svn: 78342
2009-08-06 21:43:54 +00:00
John McCall 2c5206d22e Drop the friend-inner-class diagnostic from an extwarn to an ext and don't
guard its report on GNUMode.

llvm-svn: 78338
2009-08-06 21:21:21 +00:00
John McCall 93343b9466 Permit a class to friend its members in C++0x, without restriction.
Permit a class to friend its class members in C++ 98, as long as extensions
are enabled (and even when they aren't, only give an extwarn about it).

llvm-svn: 78332
2009-08-06 20:49:32 +00:00
Benjamin Kramer bd7d13fb70 Silence gcc warning about non-virtual destructors.
llvm-svn: 78306
2009-08-06 12:59:58 +00:00
Zhongxing Xu 99e49073bc I forgot adding this header for r78298.
llvm-svn: 78302
2009-08-06 12:49:15 +00:00
Zhongxing Xu 107f75989c Last step of template cleanup: merge *BuilderImpl to *Builder.
Some Builders need further cleanup.

llvm-svn: 78301
2009-08-06 12:48:26 +00:00
Zhongxing Xu 82003da8d3 Core analysis engine template cleanup step 2:
merge GRCoreEngineImpl and GRCoreEngine.

Introduce a new interface class GRSubEngine as the subengine of GRCoreEngine.
GRExprEngine subclasses GRSubEngine now.

llvm-svn: 78298
2009-08-06 10:00:15 +00:00
Zhongxing Xu c5ce335f81 Fix comment.
llvm-svn: 78296
2009-08-06 09:22:08 +00:00
Zhongxing Xu c90a0c2e81 Core analysis engine template cleanup step 2:
merge ExplodedGraphImpl and ExplodedGraph.

llvm-svn: 78291
2009-08-06 06:28:40 +00:00
Ted Kremenek 2c85f17922 Refactor RegionStoreManager::RemoveDeadBindings to also scan the bindings of LazyCompoundSVals.
llvm-svn: 78284
2009-08-06 04:50:20 +00:00
Douglas Gregor d806156d54 Support nested-name-specifiers for C++ member access expressions, e.g.,
this->Base::foo

from James Porter!

llvm-svn: 78278
2009-08-06 03:17:00 +00:00
John McCall 07e91c04ba First pass at friend semantics.
llvm-svn: 78274
2009-08-06 02:15:43 +00:00
Zhongxing Xu 20227f71d7 As GRState seems general enough, it is time to merge some template classes
and their impl base classes. This can greatly simply some code of the core 
analysis engine. This patch merges ExplodedNodeImpl into ExplodedNode.

llvm-svn: 78270
2009-08-06 01:32:16 +00:00
Ted Kremenek fa41714d8d Implement lazy "copying" of structures and arrays in RegionStore. While
RegionStore already lazily abstracted the contents of arrays and structs, when
doing an assignment from one array/struct to another we did an explicit
element-wise copy, which resulted in a loss of laziness and huge performance
problem when analyzing many code bases.

Now RegionStoreManager handles such assignments using a new SVal could
'LazyCompoundSVal', which basically means the value of a given struct or array
(a MemRegion*) in a specific state (GRState). When we do a load from a field
whose encompassing struct binds to a LazyCompoundSVal, we essentially do a field
lookup in the original structure. This means we have essentially zero copying of
data for structs/arrays and everything stays lazy.

llvm-svn: 78268
2009-08-06 01:20:57 +00:00
Owen Anderson 758428f4e3 Update for LLVM API change.
llvm-svn: 78259
2009-08-05 23:18:46 +00:00
Mike Stump d8fe7b2792 Calculate the primary base class better and use that when laying down
the vtable.  Still a work in progress.

llvm-svn: 78252
2009-08-05 22:37:18 +00:00
Benjamin Kramer cf4371a689 Translate -mcmodel=X to -code-model X and pass it to clang-cc. Patch by Pawel Worach!
llvm-svn: 78190
2009-08-05 14:30:52 +00:00
Benjamin Kramer 72e211a47a Add support for the -fno-omit-frame-pointer option. Patch by Roman Divacky!
llvm-svn: 78188
2009-08-05 12:11:11 +00:00
Douglas Gregor 99709de6ae Fix a comment that trailed off
llvm-svn: 78167
2009-08-05 05:39:53 +00:00
Douglas Gregor 2211d345d2 Introduce the canonical type smart pointers, and use them in a few places to
tighten up the static type system.

llvm-svn: 78164
2009-08-05 05:36:45 +00:00
Zhongxing Xu fe97165587 If the UnaryOperator has non-location type, use its type to create the
constant value. If the UnaryOperator has location type, create the
constant with int type and pointer width.

This fixes the bug that all pointer increments 'p++' evaluated to Unknown.

llvm-svn: 78147
2009-08-05 02:51:59 +00:00
Fariborz Jahanian 800f37262c Support for use of default argument in constructors.
work in progress.

llvm-svn: 78132
2009-08-05 00:26:10 +00:00
Douglas Gregor d6ff33294a Refactor template instantiation for types into a generic tree
transformation template (TreeTransform) that handles the
transformation and reconstruction of AST nodes. Template instantiation
for types is a (relatively small) customization of the generic tree
transformation.

llvm-svn: 78071
2009-08-04 16:50:30 +00:00
Fariborz Jahanian 10ff786e1e Compare matching selectors in current and
super class(s) and warn on any parameter
type mismatch if potentially unsafe. 

llvm-svn: 78029
2009-08-04 01:07:16 +00:00
Ted Kremenek fb50bf5a6f Per advice that Doug Gregor gave me several months ago, clean up the
implementation of '#pragma unused' by not constructing intermediate
DeclRefExprs, but instead do the name lookup directly.  The
implementation is greatly simplified.

Along the way, degrade '#pragma unused(undeclaredvariable)' to a
warning instead of being a hard error.  This implements:

<rdar://problem/6761874> [sema] allow #pragma unused to reference undefined variable (with warning)

llvm-svn: 78019
2009-08-03 23:24:57 +00:00
Ted Kremenek 72ddac6cb8 Regression fix: reset 'DisplayedFunction' when a new function/method decl gets analyzed.
llvm-svn: 77996
2009-08-03 21:01:21 +00:00
John McCall 49bfce4227 Refactor methods on DeclSpec to take a diagnostic& parameter, and reflect this
elsewhere.  Very slightly decouples DeclSpec users from knowing the exact
diagnostics to report, and makes it easier to provide different diagnostics in
some places.

llvm-svn: 77990
2009-08-03 20:12:06 +00:00
John McCall 898cd0fced Templatize BadSpecifier and introduce DeclSpec::getSpecifier(T) for the
remaining specifier enums T.

llvm-svn: 77981
2009-08-03 18:47:27 +00:00
Zhongxing Xu 9ad0b46a80 add a bunch of routine methods to AnalysisContext.
llvm-svn: 77961
2009-08-03 07:23:22 +00:00
Eli Friedman 5032139548 Tweak diagnostic wording; patch by Sean Hunt.
llvm-svn: 77955
2009-08-03 05:14:16 +00:00
Zhongxing Xu b9a45a46f1 now we can let AnalysisManager to own the PathDiagnosticClient.
llvm-svn: 77945
2009-08-03 03:27:37 +00:00
Zhongxing Xu bcbe44fa90 Create only one AnalysisManager for each translation unit. In HandleCode(),
reset the current analysis context of the AnalysisManager.

llvm-svn: 77943
2009-08-03 03:13:46 +00:00
Zhongxing Xu 4f4b643afa Add LocationContext classes to enable creation of cross function
ProgramPoints. ProgramPoints will refer to them in the furture.

llvm-svn: 77941
2009-08-03 02:52:14 +00:00
Douglas Gregor 55137cbc85 Produce a warning that partial ordering of function templates is not yet supported
llvm-svn: 77928
2009-08-02 23:46:29 +00:00
Douglas Gregor 9dc8bd327f Keep track of the template arguments deduced when matching a class
template partial specialization. Then, use those template arguments
when instantiating members of that class template partial
specialization. Fixes PR4607.

llvm-svn: 77925
2009-08-02 23:24:31 +00:00
Anders Carlsson 4ab4f7f416 Use the correct cast kind for dynamic_cast.
llvm-svn: 77905
2009-08-02 19:07:59 +00:00
Ted Kremenek ca7935d347 Remove RegionViews and RegionCasts. These are no longer used.
llvm-svn: 77876
2009-08-02 05:15:23 +00:00
Ted Kremenek f106ab91ff RegionStoreManager::RemoveDeadBindings() now removes dead 'default' bindings as well.
llvm-svn: 77875
2009-08-02 05:00:15 +00:00
Ted Kremenek cee28a4c4d Generalize the interface of 'StoreManager::RemoveDeadBindings()' to manipulate the entire GRState, not just the Store.
llvm-svn: 77870
2009-08-02 04:45:08 +00:00
Ted Kremenek 1f22aa7433 This is a fairly large patch, which resulted from a cascade of changes
made to RegionStore (and related classes) in order to handle some
analyzer failures involving casts and manipulation of symbolic memory.

The root of the change is in StoreManager::CastRegion().  Instead of
using ad hoc heuristics to decide when to layer an ElementRegion on a
casted MemRegion, we now always layer an ElementRegion when the cast
type is different than the original type of the region.  This carries
the current cast information associated with a region around without
resorting to the error prone recording of "casted types" in GRState.

Along with this new policy of layering ElementRegions, I added a new
algorithm to strip away existing ElementRegions when they simply
represented casts of a base memory object.  This algorithm computes
the raw "byte offset" that an ElementRegion represents from the base
region, and allows the new ElementRegion to be based off that offset.
The added benefit is that this naturally handles a series of casts of
a MemRegion without building up a set of redundant ElementRegions
(thus canonicalizing the region view).

Other related changes that cascaded from this one (as tests were
failing in RegionStore):

- Revamped RegionStoreManager::InvalidateRegion() to completely remove
  all bindings and default values from a region and all subregions.
  Now invalidated fields are not bound directly to new symbolic
  values; instead the base region has a "default" symbol value from
  which "derived symbols" can be created.  The main advantage of this
  approach is that it allows us to invalidate a region hierarchy and
  then lazily instantiate new values no matter how deep the hierarchy
  went (i.e., regardless of the number of field accesses,
  e.g. x->f->y->z->...).  The previous approach did not do this.

- Slightly reworked RegionStoreManager::RemoveDeadBindings() to also
  incorporate live symbols and live regions that do not have direct
  bindings but also have "default values" used for lazy instantiation.
  The changes to 'InvalidateRegion' revealed that these were necessary
  in order to achieve lazy instantiation of values in the region store
  with those bindings being removed too early.

- The changes to InvalidateRegion() and RemoveDeadBindings() revealed
  a serious bug in 'getSubRegionMap()' where not all region -> subregion
  relationships involved in actually bindings (explicit and implicit)
  were being recorded.  This has been fixed by using a worklist algorithm
  to iteratively fill in the region map.

- Added special support to RegionStoreManager::Bind()/Retrieve() to handle
  OSAtomicCompareAndSwap in light of the new 'CastRegion' changes and the
  layering of ElementRegions.

- Fixed a bug in SymbolReaper::isLive() where derived symbols were not
  being marked live if the symbol they were derived from was also live.
  This fix was critical for getting lazy instantiation in RegionStore
  to work.

- Tidied up the implementation of ValueManager::getXXXSymbolVal() methods
  to use SymbolManager::canSymbolicate() to decide whether or not a
  symbol should be symbolicated.

- 'test/Analysis/misc-ps-xfail.m' now passes; that test case has been
  moved to 'test/Analysis/misc-ps.m'.

- Tweaked some pretty-printing of MemRegions, and implemented
  'ElementRegion::getRawOffset()' for use with the CastRegion changes.

llvm-svn: 77782
2009-08-01 06:17:29 +00:00
Mike Stump 183c3d2f59 Add beginnigs of rtti generation, wire up more of -fno-exceptions.
llvm-svn: 77751
2009-07-31 23:15:31 +00:00
Mike Stump 67829f6493 And now we can generate a simple vtable. Still a work in progress...
llvm-svn: 77737
2009-07-31 21:43:43 +00:00
Douglas Gregor 1b2596ba36 Allow one to update the type representation of the declaration specifiers. Will be used by an upcoming commit.
llvm-svn: 77703
2009-07-31 18:34:30 +00:00
Douglas Gregor 4571a4a760 Fix 80-col violation
llvm-svn: 77683
2009-07-31 16:50:39 +00:00
Douglas Gregor 352169aed4 Canonicalize dependent extended vector types.
llvm-svn: 77663
2009-07-31 03:54:25 +00:00
John McCall 9bb74a5ef5 Rename Action::TagKind to Action::TagUseKind, which removes both a misnomer
and a name collision.

llvm-svn: 77658
2009-07-31 02:45:11 +00:00
John McCall ef50e99783 sp.
llvm-svn: 77656
2009-07-31 02:20:35 +00:00
Anders Carlsson a076d14514 Add CK_DerivedToBase and use it PerformObjectMemberConversion.
llvm-svn: 77652
2009-07-31 01:23:52 +00:00
Anders Carlsson a26159261c Add a CastKind enum to CastExpr. Right now it's not used for much but it will be :)
llvm-svn: 77650
2009-07-31 00:48:10 +00:00
Ted Kremenek df4b3dc3a4 Fix use-after-release bug introduced in r77585 where the PathDiagnosticClient
created by AnalysisConsumer would be released by an instance of AnalysisManager
and then reused by later instances of AnalysisManager. Ownership of the
PathDiagnosticClient now belongs (for now) in AnalysisConsumer.

We also need this layering (for now) because the HTMLDiagnostiClient requires
that the entire translation unit be processed before emitting diagnostics. This
is done in its destructor (which should also be fixed, but that is another
issue).

This fixes PR 4653.

llvm-svn: 77648
2009-07-31 00:34:52 +00:00
Douglas Gregor f3f955279b Build canonical types for dependently-sized array types.
llvm-svn: 77647
2009-07-31 00:23:35 +00:00
Douglas Gregor a21f6c3c71 Canonicalization of dependent C++0x decltype types.
llvm-svn: 77643
2009-07-30 23:36:40 +00:00
Douglas Gregor a5dd9f858f Canonicalization for dependent typeof(expr) types.
llvm-svn: 77639
2009-07-30 23:18:24 +00:00
Fariborz Jahanian aa01d2a532 Patch for future ir-gen for destructor calls.
llvm-svn: 77608
2009-07-30 17:49:11 +00:00
Douglas Gregor 1530138fd0 Support out-of-line definitions of the members of class template
partial specializations.

llvm-svn: 77606
2009-07-30 17:40:51 +00:00
Zhongxing Xu 4b03d4913a Make AnalysisManager into its own source file and a pure data management class.
Move all components creation code into AnalysisConsumer::DigestAnalyzerOptions().

llvm-svn: 77585
2009-07-30 09:11:52 +00:00
Ryan Flynn 7d470f3466 PR3679 - handle #pragma weak
llvm-svn: 77573
2009-07-30 03:15:39 +00:00
Zhongxing Xu 14407bf25a This patch collects all analysis context data into a new class
AnalysisContext.

llvm-svn: 77563
2009-07-30 01:17:21 +00:00
Mike Stump 776d3401d2 Fix type to be consistent with the rest of the code.
llvm-svn: 77560
2009-07-30 01:02:10 +00:00
Eli Friedman b0e2986baf Add support for -Wno-long-long.
llvm-svn: 77552
2009-07-30 00:04:39 +00:00
Argyrios Kyrtzidis bd92767014 Add support for ObjC message expressions, in the Analyzer:
-Accept an ObjC method and find all message expressions that this method may respond to.
-Accept an ObjC message expression and find all methods that may respond to it.

llvm-svn: 77551
2009-07-30 00:03:55 +00:00
Argyrios Kyrtzidis 2eff90515f Support ObjC methods as Entities.
llvm-svn: 77547
2009-07-29 23:41:46 +00:00
Argyrios Kyrtzidis 97fb3e5323 Use a STL helper template 'pair_value_iterator', by both DeclReferenceMap and SelectorMap.
llvm-svn: 77545
2009-07-29 23:41:33 +00:00
Argyrios Kyrtzidis 2e592966f8 Add ObjCMethodDecl::isThisDeclarationADefinition().
llvm-svn: 77544
2009-07-29 23:41:26 +00:00
Argyrios Kyrtzidis d70a92139f Index the selectors and provide the translation units that contain them
through the IndexProvider.

llvm-svn: 77543
2009-07-29 23:41:18 +00:00
Argyrios Kyrtzidis f7f56741e0 Add TranslationUnit::getSelectorMap().
llvm-svn: 77542
2009-07-29 23:41:08 +00:00
Argyrios Kyrtzidis b8470e4f75 Introduce SelectorMap whose purpose is to map selectors to objc methods and message exprs,
inside a particular ASTContext.

llvm-svn: 77541
2009-07-29 23:40:58 +00:00
Argyrios Kyrtzidis d219a9a763 Introduce the GlobalSelector class in the Indexing library.
GlobalSelector is an ASTContext-independent way to refer to Objective C selectors.

llvm-svn: 77538
2009-07-29 23:40:32 +00:00
Argyrios Kyrtzidis 91d3df0b53 -Introduce the idx::Analyzer class used for getting indexing information, like finding
references of a declaration across translation units.

-Modify the index-test tool to use it.

llvm-svn: 77536
2009-07-29 23:40:14 +00:00
Argyrios Kyrtzidis a82e8848ee Introduce TULocation and TULocationHandler classes.
TULocation is like ASTLocation but also contains the TranslationUnit* that
the ASTLocation originated from.

llvm-svn: 77535
2009-07-29 23:40:02 +00:00
Argyrios Kyrtzidis af79296645 Modify the Indexer class so that it can return the TranslationUnit that internal
decls originated from.

llvm-svn: 77534
2009-07-29 23:39:52 +00:00
Argyrios Kyrtzidis 4560276cf5 Add Entity::getInternalDecl() to be used only on Entities that refer to internal
(in translation unit) declarations.

llvm-svn: 77533
2009-07-29 23:39:42 +00:00
Argyrios Kyrtzidis bc6c64de44 Constify ASTLocation::print.
llvm-svn: 77532
2009-07-29 23:39:35 +00:00
Argyrios Kyrtzidis f11952052c Fix some comments.
llvm-svn: 77531
2009-07-29 23:39:25 +00:00
Argyrios Kyrtzidis 82150b38d2 Add getDeclReferenceMap() to the abstract interface of TranslationUnit class.
llvm-svn: 77530
2009-07-29 23:39:18 +00:00
Argyrios Kyrtzidis f1a0fd852f Introduce a helper template for the Handler classes and use it instead
of the iterator of the Indexer class.

llvm-svn: 77528
2009-07-29 23:39:03 +00:00
Argyrios Kyrtzidis 14df96c730 Accept Handler objects in parameters as references.
Reinforces that they shouldn't be null and it's a bit more natural when
they are passed as stack objects.

llvm-svn: 77526
2009-07-29 23:38:45 +00:00
Argyrios Kyrtzidis 9ddd99ade7 Rename EntityHandler::HandleEntity to Handle.
llvm-svn: 77525
2009-07-29 23:38:35 +00:00
Argyrios Kyrtzidis dd9ee4aa04 -Make IndexProvider an abstract interface for getting indexing information.
-Introduce Indexer as an IndexProvider implementation.

llvm-svn: 77524
2009-07-29 23:38:21 +00:00
Douglas Gregor b6b8f9e291 Make tag declarations redeclarable. This change has three purposes:
1) Allow the Index library (and any other interested client) to walk
  the set of declarations for a given tag (enum, union, class,
  whatever). At the moment, this information is not readily available.

  2) Reduce our dependence on TagDecl::TypeForDecl being mapped down
  to a TagType (for which getDecl() will return the tag definition, if
  one exists). This property won't exist for class template partial
  specializations.

  3) Make the canonical declaration of a TagDecl actually canonical,
  e.g., so that it does not change when the tag is defined.

llvm-svn: 77523
2009-07-29 23:36:44 +00:00
Ted Kremenek c23c7e6a51 Change uses of:
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
  Type::getAsRecordType() -> Type::getAs<RecordType>()
  Type::getAsPointerType() -> Type::getAs<PointerType>()
  Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>()
  Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>()
  Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>()
  Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>()
  Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
  Type::getAsTagType() -> Type::getAs<TagType>()
  
And remove Type::getAsReferenceType(), etc.

This change is similar to one I made a couple weeks ago, but that was partly
reverted pending some additional design discussion. With Doug's pending smart
pointer changes for Types, it seemed natural to take this approach.

llvm-svn: 77510
2009-07-29 21:53:49 +00:00
Ted Kremenek 4301526e8d Remove 'StoreManager::OldCastRegion()', TypedViewRegion (which only
OldCastRegion used), and the associated command line option
'-analyzer-store=old-basic-cast'.

llvm-svn: 77509
2009-07-29 21:43:22 +00:00
Douglas Gregor aa87ebc0c1 [llvm up]
A template name can refer to a set of overloaded function
templates. Model this in TemplateName, which can now refer to an
OverloadedFunctionDecl that contains function templates. This removes
an unspeakable hack in Sema::isTemplateName.

llvm-svn: 77488
2009-07-29 18:26:50 +00:00
Ted Kremenek bca70671e7 Make StoreManager::InvalidateRegion() virtual, move the current implementation
in StoreManager to RegionStoreManager, and create a special, highly reduced
version in BasicStoreManager.

These changes are in preparation for future RegionStore-specific changes to
InvalidateRegion.

llvm-svn: 77483
2009-07-29 18:16:25 +00:00
Ted Kremenek ccf3335939 Add 'MemRegion::getBaseRegion()', a utility method to strip ElementRegions with
index 0.  This will be used for refinements to InvalidateRegion and CastRegion.

llvm-svn: 77481
2009-07-29 18:14:27 +00:00
Sebastian Redl 63c4da01c8 Check for identical types in C++ catch expression. Patch by Erik Verbruggen.
llvm-svn: 77475
2009-07-29 17:15:45 +00:00
Douglas Gregor 0004417e81 Use the new statement/expression profiling code to unique dependent
template arguments, as in template specialization types. This permits
matching out-of-line definitions of members for class templates that
involve non-type template parameters.

llvm-svn: 77462
2009-07-29 16:09:57 +00:00
Steve Naroff d390fd99d9 Incorporate feedback from Chris (on r76979).
llvm-svn: 77452
2009-07-29 14:06:03 +00:00
Zhongxing Xu 52bd6e8fee delete an undefined method.
llvm-svn: 77446
2009-07-29 08:00:02 +00:00
Fariborz Jahanian 82e2874270 Code refactoring to define getCXXRecordDeclForPointerType
and use it in several places.

llvm-svn: 77411
2009-07-29 00:44:13 +00:00
Mike Stump 93246cc475 Some minor cleanups, thanks Chris.
llvm-svn: 77402
2009-07-28 23:57:15 +00:00
Mike Stump 2adb4dab54 Some style fixes, thanks Chris.
llvm-svn: 77400
2009-07-28 23:47:15 +00:00
Mike Stump bce7a27d22 Add support for -Wmissing-noreturn.
llvm-svn: 77391
2009-07-28 23:11:12 +00:00
Douglas Gregor a8e02e7863 Refactor the code that produces a TemplateSpecializationType, so that
canonicalization for dependent TemplateSpecializationTypes occurs
within ASTContext::getTemplateSpecializationType. Also, move template
argument canonicalization into ASTContext::getCanonicalTemplateArgument.

llvm-svn: 77388
2009-07-28 23:00:59 +00:00
Mike Stump 3bf1ab48d3 Add noreturn support for blocks.
llvm-svn: 77377
2009-07-28 22:04:01 +00:00
Ted Kremenek 2d2ee236cf Add missing break statement.
llvm-svn: 77356
2009-07-28 19:34:30 +00:00
Mike Stump 9b706bcd98 Update comments.
llvm-svn: 77355
2009-07-28 19:31:47 +00:00
Ted Kremenek faf0c64d9d Fix regression in attribute 'nonnull' checking when a transition node
was created but not added to the destination NodeSet.  This fixes PR 4630.

llvm-svn: 77353
2009-07-28 19:24:31 +00:00
Anders Carlsson fc8cfa8b9f Add a field for C++ specific data to ASTRecordLayout. Use it to store the non-virtual size and alignment + base offsets.
llvm-svn: 77352
2009-07-28 19:24:15 +00:00
John McCall 8945266f3d Bounds checking for address spaces.
llvm-svn: 77303
2009-07-28 06:52:18 +00:00
John McCall 7be52a8179 Reimplement QualifierSet using a single word, as requested by dgregor.
llvm-svn: 77299
2009-07-28 05:41:20 +00:00
Argyrios Kyrtzidis f390c43c3c Implement ObjCMethodDecl::getCanonicalDecl().
llvm-svn: 77298
2009-07-28 05:11:17 +00:00
Argyrios Kyrtzidis a56fa19ac6 -Add ObjCCategoryImplDecl::getCategoryClass() which returns the category interface decl.
-Correct ObjCMethodDecl::getNextRedeclaration(); A method in a ObjCCategoryImplDecl should point to
a method in the associated ObjCCategoryDecl, not the ObjCInterfaceDecl.

llvm-svn: 77297
2009-07-28 05:11:05 +00:00
Mike Stump a4de80b8b1 Make longjmp a real builtin.
llvm-svn: 77291
2009-07-28 02:25:19 +00:00
John McCall caa1945306 Allow functions to be marked "implicit return zero" and so mark main().
Codegen by initializing the return value with its LLVM type's null value.

llvm-svn: 77288
2009-07-28 01:00:58 +00:00
Douglas Gregor 5c193b9e18 Add a Profile function for statements so that we can (eventually) determine
when statements and expressions are equivalent.

llvm-svn: 77284
2009-07-28 00:33:38 +00:00
Mike Stump 82a9e445b7 Make sure to move the comment with the code.
llvm-svn: 77279
2009-07-28 00:07:08 +00:00
Ted Kremenek 04ade6f1cb (1) Enable PlistDiagnostics to take an option "PathDiagnosticClientFactory"
object that it can use to forward PathDiagnostics for further processing. Along
with this feature, the PlistDiagnostics object logs which files are created by
the forwarding of the PathDiagnostics.

(2) Create a new PathDiagnosticClientFactory object for HTMLDiagnostics,
allowing other PathDiagnosticClients to forward PathDiagnostics through an
opaque interface.

(3) Create a "plist-html" diagnostics option in AnalysisConsumer to allow the
    logging of HTML files created in a hybrid Plist+HTML diagnostic client.

llvm-svn: 77264
2009-07-27 22:13:39 +00:00
Owen Anderson e05f2ed478 Update for LLVM API change.
llvm-svn: 77249
2009-07-27 21:00:51 +00:00
Mike Stump ca6c875e47 Add noreturn for exit.
llvm-svn: 77237
2009-07-27 19:14:18 +00:00
Argyrios Kyrtzidis 067c407c48 Make ObjCImplDecl inherit from ObjCContainerDecl.
ObjCContainerDecl now is the root class for objc decls that contain methods.

llvm-svn: 77235
2009-07-27 19:04:32 +00:00
Douglas Gregor 4d37791bc3 Fix typo in error message
llvm-svn: 77224
2009-07-27 18:33:18 +00:00
Ryan Flynn e5dc8594ea PR3575 - warn on declared variable or function attributes after a definition, which are currently ignored.
llvm-svn: 77095
2009-07-25 22:29:44 +00:00
Argyrios Kyrtzidis 39c348d915 Refactor ObjCImplDecl::getInstanceMethod/getClassMethod into one
ObjCImplDecl::getMethod.

llvm-svn: 77094
2009-07-25 22:16:03 +00:00
Argyrios Kyrtzidis 553376be19 Refactor ObjCInterfaceDecl::lookupInstanceMethod/lookupClassMethod into one
ObjCInterfaceDecl::lookupMethod.

llvm-svn: 77093
2009-07-25 22:15:51 +00:00
Argyrios Kyrtzidis e6ed65bee0 Refactor ObjCProtocolDecl::lookupInstanceMethod/lookupClassMethod into one
ObjCProtocolDecl::lookupMethod.

llvm-svn: 77092
2009-07-25 22:15:38 +00:00
Argyrios Kyrtzidis 6de0560b97 Refactor ObjCContainerDecl::getInstanceMethod/getClassMethod into one
ObjCContainerDecl::getMethod.

Avoids code duplication.

llvm-svn: 77091
2009-07-25 22:15:22 +00:00