Commit Graph

28770 Commits

Author SHA1 Message Date
Rafael Espindola 22f60303f2 Don't warn about "clang -use-gold-plugin -c ...". With this users can say
CC="clang -use-gold-plugin" CFLAGS=-emit-llvm ../configure...
and not be hit with a warning for each .c file.

llvm-svn: 126713
2011-02-28 23:29:45 +00:00
Douglas Gregor 9cbc22ba2d Teach Sema::CheckTypenameType to use nested-name-specifiers with
source-location information. We don't actually preserve this
information in any of the resulting TypeLocs (yet), so it doesn't
matter.

llvm-svn: 126693
2011-02-28 22:42:13 +00:00
Devang Patel bbe4ff99e0 Use single code path to handle c++ structs and classes while generating debug info.
llvm-svn: 126691
2011-02-28 22:32:45 +00:00
Argyrios Kyrtzidis 29b8656935 [analyzer] Remove unused checker stuff from AnalysisConsumer and some unused headers.
llvm-svn: 126690
2011-02-28 22:30:38 +00:00
Douglas Gregor ea972d3faa Push nested-name-specifier location information into DeclRefExpr and
MemberExpr, the last of the expressions with qualifiers!

llvm-svn: 126688
2011-02-28 21:54:11 +00:00
Fariborz Jahanian 557c1ed522 Revert r126678.
llvm-svn: 126685
2011-02-28 21:19:34 +00:00
Douglas Gregor 0da1d43e16 Push nested-name-specifier source location information into
UnresolvedLookupExpr and UnresolvedMemberExpr.

Also, improve the computation that checks whether the base of a member
expression (either unresolved or dependent-scoped) is implicit. The
previous check didn't cover all of the cases we use in our
representation, which threw off source-location information for these
expressions (which, in turn, caused some breakage in libclang's token
annotation). 

llvm-svn: 126681
2011-02-28 20:01:57 +00:00
Fariborz Jahanian 79246322a6 objc IRGen for Next runtime message API.
The prototype for objc_msgSend() is technically variadic - 
`id objc_msgSend(id, SEL, ...)`. 
But all method calls should use a prototype that matches the method, 
not the prototype for objc_msgSend itself().
// rdar://9048030

llvm-svn: 126678
2011-02-28 19:55:59 +00:00
Argyrios Kyrtzidis 9eb02dfa89 [analyzer] Remove '-analyzer-check-objc-mem' flag, the nominee for best misnomer award.
llvm-svn: 126676
2011-02-28 19:49:42 +00:00
Argyrios Kyrtzidis af181bb19b Move test/SemaObjC/method-arg-decay.m -> test/Analysis/method-arg-decay.m
llvm-svn: 126675
2011-02-28 19:49:21 +00:00
Argyrios Kyrtzidis 6a1c760760 [analyzer] Run the ExprEngine depending on the CheckerManager having path-sensitive checkers.
llvm-svn: 126674
2011-02-28 19:49:17 +00:00
Argyrios Kyrtzidis 20f5caa518 [analyzer] The current UninitializedValuesChecker will go away, remove '-warn-uninit-values'.
llvm-svn: 126673
2011-02-28 19:49:12 +00:00
Peter Collingbourne 938f7d0e46 Kill 18 month old #if 0'd code in StmtXML.cpp
llvm-svn: 126670
2011-02-28 19:42:30 +00:00
Douglas Gregor dd733fb041 Remove redundant friend declaration
llvm-svn: 126665
2011-02-28 19:17:05 +00:00
Douglas Gregor e16af53619 Push nested-name-specifier source location information into
CXXDependentScopeMemberExpr, and clean up instantiation of
nested-name-specifiers with dependent template specialization types in
the process.

llvm-svn: 126663
2011-02-28 18:50:33 +00:00
Argyrios Kyrtzidis 2c49ec7f1d [analyzer] Migrate NSErrorChecker and DereferenceChecker to CheckerV2.
They cooperate in that NSErrorChecker listens for ImplicitNullDerefEvent events that
DereferenceChecker can dispatch.
ImplicitNullDerefEvent is when we dereferenced a location that may be null.

llvm-svn: 126659
2011-02-28 17:36:18 +00:00
Argyrios Kyrtzidis a15dfec3f5 [analyzer] Introduce "event" mechanism in CheckerManager.
A checker can register as receiver/listener of "events" (basically it registers a callback
with a function getting called with an argument of the event type) and other checkers can
register as "dispatchers" and can pass an event object to all the listeners.
This allows cooperation amongst checkers but with very loose coupling.

llvm-svn: 126658
2011-02-28 17:36:09 +00:00
Argyrios Kyrtzidis 98b570ecad [analyzer] Run AST checkers for ObjCMethodDecls.
llvm-svn: 126657
2011-02-28 17:36:04 +00:00
Douglas Gregor 5a064725d6 Eliminate the last remains of TemplateSpecializationTypes with
dependent template names. There is still a lot of redundant code in
TreeTransform to cope with TemplateSpecializationTypes, which I'll
remove in stages.

llvm-svn: 126656
2011-02-28 17:23:35 +00:00
David Chisnall da20991a1b Make -fobjc-nonfragile-abi and -fgnu-runtime imply -fblocks (unless -fno-blocks is specified), because this combination of flags defines an Objective-C runtime that includes a blocks runtime.
llvm-svn: 126654
2011-02-28 17:11:43 +00:00
Douglas Gregor cce5c97ac3 Unbreak CMake build
llvm-svn: 126653
2011-02-28 14:32:11 +00:00
Axel Naumann aa627ba724 From Vassil Vassilev:
* Add default implementations (no-op) for ExternalASTSource's pure virtual functions. There are valid use cases that can live with these defaults.
* Move ExternalASTSource's out of line implementations into separate source file.
* Whitespace, forward decl, #include cleanup.

llvm-svn: 126648
2011-02-28 11:22:50 +00:00
NAKAMURA Takumi f5ea88b8ab test: Add the feature "shell". Frontend/dependency-gen.c would be executable with shell.
The feature "shell" is implemented in llvm/test.

llvm-svn: 126646
2011-02-28 09:41:07 +00:00
Chandler Carruth 306f98c241 Add a test case that would have caught the bug fixed in r126640.
I've only covered C++'s flags here, we should probably do something
similar for ObjC flags.

llvm-svn: 126641
2011-02-28 07:38:09 +00:00
Chandler Carruth 74f8711802 Fix a tiny goof in the Driver's logic which caused the explicit presence
of -fexceptions to disably C++ exceptions. The correct code was in the
ObjC branch, this just mirrors that logic on the C++ side of things.
Thanks to John Wiegley for pointing this out.

llvm-svn: 126640
2011-02-28 07:25:18 +00:00
Chris Lattner 35d3ac5e9e Make skipping of vardecls more precise: it's ok to skip a decl if the entire
compound stmt containing the decl is skipped.

llvm-svn: 126639
2011-02-28 07:22:44 +00:00
Chris Lattner 62208c395a make switch constant folding a bit stronger, handling a missed case.
llvm-svn: 126638
2011-02-28 07:16:14 +00:00
NAKAMURA Takumi 8fbf64f420 [PR9321] "make install" does not need install c-index-test. It is used for testing.
llvm-svn: 126634
2011-02-28 05:21:34 +00:00
NAKAMURA Takumi f7c666c38a CMake: [PR9321] Don't install include/clang/**/*.td.
llvm-svn: 126633
2011-02-28 05:21:27 +00:00
Peter Collingbourne 2f1e36bfd0 Rename tok::eom to tok::eod.
The previous name was inaccurate as this token in fact appears at
the end of every preprocessing directive, not just macro definitions.
No functionality change, except for a diagnostic tweak.

llvm-svn: 126631
2011-02-28 02:37:51 +00:00
Anders Carlsson e96ab55b28 Add a -fcxx-exceptions flag to the frontend, which can be used to enable
C++ exceptions, even when exceptions have been turned off using -fno-exceptions.
Make the -fobjc-exceptions flag do the same thing, but for Objective-C exceptions.

C++ and Objective-C exceptions can also be disabled using -fno-cxx-excptions and
-fno-objc-exceptions.

llvm-svn: 126630
2011-02-28 02:27:16 +00:00
Anders Carlsson 64965ad75d Fix CMake build.
llvm-svn: 126629
2011-02-28 02:13:22 +00:00
Ken Dyck 1b4420ed42 Retry r126357. Use CharUnits for the Size and DataSize calculations when
they are known to be exact multiples of the width of the char type. Add a
test case to CodeGen/union.c that would have caught the problem with the
previous attempt. No change in functionality intended.

llvm-svn: 126628
2011-02-28 02:01:38 +00:00
Argyrios Kyrtzidis 4b45f6628e [analyzer] Introduce SVal::getAsVarDecl().
llvm-svn: 126627
2011-02-28 01:28:18 +00:00
Argyrios Kyrtzidis 6d6801c5c7 [analzyer] Migrate CallAndMessageChecker to CheckerV2.
llvm-svn: 126626
2011-02-28 01:28:13 +00:00
Argyrios Kyrtzidis 64fe456a6b [analyzer] ExprEngine should not depend on checkers for not crashing.
llvm-svn: 126625
2011-02-28 01:28:08 +00:00
Argyrios Kyrtzidis 0a5a41d799 [analyzer] Migrate AdjustedReturnValueChecker to CheckerV2.
llvm-svn: 126624
2011-02-28 01:28:05 +00:00
Argyrios Kyrtzidis 6fff2e3d36 [analyzer] Migrate AttrNonNullChecker to CheckerV2.
llvm-svn: 126623
2011-02-28 01:28:01 +00:00
Argyrios Kyrtzidis 4f7745a3b1 [analyzer] ExprEngine should not depend on checkers for not crashing.
llvm-svn: 126622
2011-02-28 01:27:57 +00:00
Argyrios Kyrtzidis 68ed625bd3 [analyzer] Migrate VLASizeChecker to CheckerV2.
llvm-svn: 126621
2011-02-28 01:27:54 +00:00
Argyrios Kyrtzidis ae468f77fa [analyzer] Migrate DivZeroChecker to CheckerV2.
llvm-svn: 126620
2011-02-28 01:27:50 +00:00
Argyrios Kyrtzidis 4dc7fb37cb [analyzer] Migrate ReturnUndefChecker to CheckerV2.
llvm-svn: 126619
2011-02-28 01:27:46 +00:00
Argyrios Kyrtzidis da6c7568e2 [analyzer] Migrate UndefinedArraySubscriptChecker to CheckerV2.
llvm-svn: 126618
2011-02-28 01:27:41 +00:00
Argyrios Kyrtzidis 098874a2f8 [analyzer] Migrate UndefinedAssignmentChecker to CheckerV2.
llvm-svn: 126617
2011-02-28 01:27:37 +00:00
Argyrios Kyrtzidis 753b3ca32f [analyzer] Migrate UndefBranchChecker to CheckerV2.
llvm-svn: 126616
2011-02-28 01:27:33 +00:00
Argyrios Kyrtzidis 60b6da721f [analyzer] Migrate UndefCapturedBlockVarChecker to CheckerV2.
llvm-svn: 126615
2011-02-28 01:27:26 +00:00
Argyrios Kyrtzidis d4d3cee6e4 [analyzer] Migrate UndefResultChecker to CheckerV2.
llvm-svn: 126614
2011-02-28 01:27:22 +00:00
Argyrios Kyrtzidis 142dbbfcd8 [analyzer] Migrate NoReturnFunctionChecker to CheckerV2.
llvm-svn: 126613
2011-02-28 01:27:17 +00:00
Argyrios Kyrtzidis 3e7ab19863 [analyzer] Move the DeadStores checker out of the 'core' package.
-Now it gets enabled with '-analyzer-checker=DeadStores'.
-The driver passes the above flag by default.

llvm-svn: 126612
2011-02-28 01:27:12 +00:00
Argyrios Kyrtzidis f3ed8b631d [analyzer] Migrate BuiltinFunctionChecker to CheckerV2.
llvm-svn: 126611
2011-02-28 01:27:07 +00:00