Commit Graph

8422 Commits

Author SHA1 Message Date
Chris Lattner 407e7e3ace kill off CheckX86BuiltinFunctionCall
llvm-svn: 115382
2010-10-01 23:40:43 +00:00
Chris Lattner 04b03b1fc4 move imperative code to declarative definitions.
llvm-svn: 115381
2010-10-01 23:35:58 +00:00
Chris Lattner bd6e69368f enhance ASTContext::GetBuiltinType to return a bitmask indicating which arguments
are required to be ICE's.  No clients of this new functionality yet!

llvm-svn: 115366
2010-10-01 22:53:11 +00:00
Francois Pichet 6d76e6cd92 Better diagnostic for superfluous scope specifier inside a class definition for member functions. + Fixit.
Example: 
class A {
   void A::foo(); //warning: extra qualification on member 'foo'
};

llvm-svn: 115347
2010-10-01 21:19:28 +00:00
Douglas Gregor 36ea4d4f45 Revert r115336 ("Thread PerFileData through everything."), because
we're missing the corresponding changes in the LLVM repository.

llvm-svn: 115340
2010-10-01 20:33:34 +00:00
Douglas Gregor 99a26afd49 Extend libclang with an API that determines, given a C++ virtual
member function or an Objective-C method, which other member
functions/methods it overrides.

llvm-svn: 115338
2010-10-01 20:25:15 +00:00
Sebastian Redl 7b1b2268e2 Thread PerFileData through everything. This allows us to remap stuff later.
llvm-svn: 115336
2010-10-01 19:59:15 +00:00
Sebastian Redl 3f6b753f9d Record module loaders and module source order.
llvm-svn: 115334
2010-10-01 19:59:12 +00:00
Chris Lattner 2d084d07c8 fix a bogus "I" that I added to the per-function attribute list.
llvm-svn: 115333
2010-10-01 19:47:04 +00:00
Douglas Gregor 7fb25418ed Implement the C++0x "trailing return type" feature, e.g.,
auto f(int) -> int

from Daniel Wallin!

(With a few minor bug fixes from me).

llvm-svn: 115322
2010-10-01 18:44:50 +00:00
Chris Lattner 8473339100 Various builtins a require an integer constant. Not providing
one results in an obscure error from the backend that doesn't make
sense.  Capture this information in the .def files for builtins with
a new "I" modifier letter indicating the an argument needs to be an ICE.

Nothing uses this yet, but sema will eventually enforce this (eliminating
some special cases from semachecking.cpp) and codegen will use this to 
force an ICE value, preventing backend error messages.

llvm-svn: 115302
2010-10-01 07:13:18 +00:00
Marcin Swiderski 321a707c9c Added methods for inserting CFGAutomaticObjDtors to CFGBlocks,
Fixed some misspells in comments.

llvm-svn: 115236
2010-09-30 22:54:37 +00:00
Devang Patel 91bbb5547d Introduce -flimit-debug-info.
In this experimental mode try avoiding debug info emission for classes as much as possible. The goal is to reduce size of produced debuginfo without reducing quality of debug info in general. This is a work in progress.

llvm-svn: 115188
2010-09-30 19:05:55 +00:00
Argyrios Kyrtzidis 2f23b414e9 Driver: Ignore the found PCH file if its '-include' is not the first one.
llvm-svn: 115158
2010-09-30 16:53:47 +00:00
Gabor Greif 61edf47ec6 typo
llvm-svn: 115148
2010-09-30 15:22:01 +00:00
Marcin Swiderski 99a9040a1f Added two new command line arguments:
-cfg-add-implicit-dtors - sets CFG::BuildOptions::AddImplicitDtors for AnalysisCosumer to true,
-cfg-add-initializers - sets CFG::BuildOptions::AddInitializers for AnalysisCosumer to true.

llvm-svn: 115142
2010-09-30 07:41:24 +00:00
Ted Kremenek e18dd0a84e Change CheckerVisitor so that [Pre,Post]VisitCallExpr only handles CallExprs for simple C functions, not
all CallExprs (including CXXMemberCallExpr, etc.).  Now the generic handler for all CallExprs is [Pre,Post]VisitGenericCallExpr.

Also add [Pre,Post]Visit hooks for CXXMemberCallExpr.

Change GRExprEngine::VisitCXXMemberCallExpr() to do pre/post checker visits of the call.

llvm-svn: 115119
2010-09-30 01:06:26 +00:00
Sebastian Redl 99219f16b9 Make the FileID import map key on FileID.
llvm-svn: 115118
2010-09-30 01:03:06 +00:00
Tom Care 472205be35 Change -analyzer-max-nodes to allow 0 as a parameter. This allows the analyzer to completely analyze a worklist regardless of time taken.
llvm-svn: 115108
2010-09-29 23:48:13 +00:00
Devang Patel a3dc31d8ee ImplicitParamDecl is always implicit.
llvm-svn: 115103
2010-09-29 23:08:00 +00:00
Daniel Dunbar 181ca58074 Basic: Simplify getClangRepositoryPath and getClangRevision.
- I don't like returning StringRef's ever, unless it is actually important for
   performance, which it isn't here.

 - Also, stop validating getClangRevision to be an integer, I don't see a good
   reason to do this.

llvm-svn: 115071
2010-09-29 19:15:29 +00:00
Daniel Dunbar 8caf6415a8 Add support for attribute((naked)), patch by Zoxc on cfe-commits!
- Minor style tweaks by me.

llvm-svn: 115056
2010-09-29 18:20:25 +00:00
Daniel Dunbar b800fdb063 Basic: Add support for git svn to get the repo version in clang executable,
patch by Jonathan Mulder!

llvm-svn: 115049
2010-09-29 17:57:10 +00:00
Douglas Gregor 457104e98b Move the management of the set of conversion functions in a C++ class
into CXXRecordDecl. The only part that we do not handle this way are
using declarations, since that would require extra name lookup that we
don't currently want to pay for. This fixes <rdar://problem/8459981>,
so that LLDB can build a CXXRecordDecl and magically get all of the
right bits set.

llvm-svn: 115026
2010-09-29 04:25:11 +00:00
Craig Silverstein 0be2dbb6a2 Visit the type information for CXXUnresolvedConstructExpr, just like
we do for the similar CXXTemporaryObjectExpr.  OKed by chandlerc and
wan.

llvm-svn: 115025
2010-09-29 04:14:20 +00:00
Douglas Gregor 8fb9512966 Move the maintenance of CXXRecordDecl::DefinitionData's Abstract bit
completely into CXXRecordDecl, by adding a new completeDefinition()
function. This required a little reshuffling of the final-overrider
checking code, since the "abstract" calculation in the presence of
abstract base classes needs to occur in
CXXRecordDecl::completeDefinition() but we don't want to compute final
overriders more than one in the common case.

llvm-svn: 115007
2010-09-29 00:15:42 +00:00
Douglas Gregor 7d9120c3ed Teach FunctionDecl::setPure() to (indirectly) mark the Abstract bit in
CXXRecordDecl::DefinitionData, rather than having Sema mark the bit.

llvm-svn: 114993
2010-09-28 21:55:22 +00:00
Douglas Gregor 11c024bbeb Reinstate r114925 and r114929, both steps toward
<rdar://problem/8459981>.

llvm-svn: 114984
2010-09-28 20:50:54 +00:00
Fariborz Jahanian 1db5c941ad vla expressions used in __typeof__ must be evaluated.
Fixes rdar://8476159.

llvm-svn: 114982
2010-09-28 20:42:35 +00:00
Douglas Gregor 9d5938ae8a Centralize the management of CXXRecordDecl::DefinitionData's Empty bit
in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>.

This reinstates r114924, with one crucial bug fix: we were ignoring
the implicit fields created by anonymous structs/unions when updating
the bits in CXXRecordDecl, which means that a class/struct containing
only an anonymous class/struct would be considered "empty". Hilarity
follows. 

llvm-svn: 114980
2010-09-28 20:38:10 +00:00
Sebastian Redl 750272d912 Follow-up to r114978, used wrong tag.
llvm-svn: 114979
2010-09-28 20:28:50 +00:00
Sebastian Redl c1ca90a246 Move ExternalSemaSource::ReadMethodPool's implementation to Sema.cpp so that the header can get away with forward declarations only for ObjCMethodList and Selector. Fixes <rdar://8467631>.
llvm-svn: 114978
2010-09-28 20:23:00 +00:00
Douglas Gregor a832d3e2cc Reinstate r114921, which I've exonerated via a self-host build.
Centralize the management of CXXRecordDecl::DefinitionData's Aggregate
and PlainOldData bits in CXXRecordDecl itself. Another milepost on the
road toward <rdar://problem/8459981>.

llvm-svn: 114977
2010-09-28 19:45:33 +00:00
Argyrios Kyrtzidis 9f48354b71 Don't warn for an unused label if it has 'unused' attribute. Fixes rdar://8483139.
llvm-svn: 114954
2010-09-28 14:54:07 +00:00
Bill Wendling 6d8c442e08 Temporarily revert 114929 114925 114924 114921. It looked like they (or at least
one of them) was causing a series of failures:

http://google1.osuosl.org:8011/builders/clang-x86_64-darwin10-selfhost/builds/4518

svn merge -c -114929 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114929 into '.':
U    include/clang/Sema/Sema.h
U    include/clang/AST/DeclCXX.h
U    lib/Sema/SemaDeclCXX.cpp
U    lib/Sema/SemaTemplateInstantiateDecl.cpp
U    lib/Sema/SemaDecl.cpp
U    lib/Sema/SemaTemplateInstantiate.cpp
U    lib/AST/DeclCXX.cpp
svn merge -c -114925 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114925 into '.':
G    include/clang/AST/DeclCXX.h
G    lib/Sema/SemaDeclCXX.cpp
G    lib/AST/DeclCXX.cpp
svn merge -c -114924 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114924 into '.':
G    include/clang/AST/DeclCXX.h
G    lib/Sema/SemaDeclCXX.cpp
G    lib/Sema/SemaDecl.cpp
G    lib/AST/DeclCXX.cpp
U    lib/AST/ASTContext.cpp
svn merge -c -114921 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114921 into '.':
G    include/clang/AST/DeclCXX.h
G    lib/Sema/SemaDeclCXX.cpp
G    lib/Sema/SemaDecl.cpp
G    lib/AST/DeclCXX.cpp

llvm-svn: 114933
2010-09-28 01:09:49 +00:00
Douglas Gregor 1f93ffb3e6 Centralize the management of CXXRecordDecl::DefinitionData's
HasTrivialConstructor, HasTrivialCopyConstructor,
HasTrivialCopyAssignment, and HasTrivialDestructor bits in
CXXRecordDecl's methods. This completes all but the Abstract bit and
the set of conversion functions, both of which will require a bit of
extra work. The majority of <rdar://problem/8459981> is now
implemented (but not all of it).

llvm-svn: 114929
2010-09-28 00:00:00 +00:00
Douglas Gregor d22553cf21 Centralize the management of CXXRecordDecl::DefinitionData's
Polymorphic bit in CXXRecordDecl itself. Yes, this is also part of
<rdar://problem/8459981>.

llvm-svn: 114925
2010-09-27 23:39:06 +00:00
Douglas Gregor 01daafc58a Centralize the management of CXXRecordDecl::DefinitionData's Empty bit
in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>.

llvm-svn: 114924
2010-09-27 23:31:14 +00:00
Douglas Gregor 1be93f5143 Centralize the management of CXXRecordDecl::DefinitionData's Aggregate
and PlainOldData bits in CXXRecordDecl itself. Another milepost on the
road toward <rdar://problem/8459981>.

llvm-svn: 114921
2010-09-27 23:16:44 +00:00
Douglas Gregor 8f9ebe54b3 Centralize the handling of CXXRecordDecl::DefinitionData's
DeclaredDestructor and UserDeclaredDestructor bits in CXXRecordDecl
itself. Another step on the road to <rdar://problem/8459981>.

llvm-svn: 114918
2010-09-27 22:48:58 +00:00
Douglas Gregor ec3bec0c7a Kill FunctionDecl's IsCopyAssignment bit; it duplicated what could
already be determined by isCopyAssignmentOperator(), and was set too
late in the process for all clients to see the appropriate
value. Cleanup only; no functionality change.

llvm-svn: 114916
2010-09-27 22:37:28 +00:00
Sebastian Redl 9609b4f1a8 When chaining PCHs, only write PPRecords that don't come from PCH, and give them the correct IDs. Fixes a crash in XCode.
llvm-svn: 114913
2010-09-27 22:18:47 +00:00
Douglas Gregor a1ce1f80cf Centralize the handling of
CXXRecordDecl::DefinitionData::DeclaredCopyAssignment, for
copy-assignment operators. Another step toward <rdar://problem/8459981>.

llvm-svn: 114899
2010-09-27 22:06:20 +00:00
Douglas Gregor d30e79f839 Clean up the handling of the DeclaredDefaultConstructor and
DeclaredCopyConstructor bits in CXXRecordDecl's DefinitionData
structure. Rather than having Sema call addedConstructor or set the
bits directly at semi-random places, move all of the logic for
managing these bits into CXXRecordDecl itself and tie the
addedConstructor call into DeclContext::addDecl().

This makes it easier for AST-building clients to get the right bits
set in DefinitionData, and is one small part of <rdar://problem/8459981>.

llvm-svn: 114889
2010-09-27 21:17:54 +00:00
Daniel Dunbar 2e0db09078 Frontend: Teach clang -cc1as to respond to -v.
llvm-svn: 114863
2010-09-27 20:13:13 +00:00
Fariborz Jahanian cb67d7b7c2 Issue warning for trivial cases of nonnull attributes
(on functions with no pointer arguments) but only when
the attribute has not been coming from a macro 
instantiation in a header file. Fixes first part
of radar 6857843.

llvm-svn: 114860
2010-09-27 19:05:51 +00:00
Anders Carlsson 991285e425 Allow the use of C++0x deleted functions as an extension in C++98.
llvm-svn: 114762
2010-09-24 21:25:25 +00:00
Daniel Dunbar 4ed214a191 Driver: Add -fallow-unsupported which disables some of the eager error'ing we do
to prevent users from trying unsupported stuff. Useful for testing.

llvm-svn: 114749
2010-09-24 19:39:37 +00:00
Fariborz Jahanian 8fb87aec78 Patch implements passing arrays to functions expecting
vla. Implements pr7827.

llvm-svn: 114737
2010-09-24 17:30:16 +00:00
Douglas Gregor 0ac41389a4 Synchronize globally-cached code completion results with the results
provided when the optimization is disabled. In particular, split
the completion context CCC_Other into two contexts: CCC_Other, which
means that it's an undisclosed context for which any other results are
unwelcome, and CCC_Recovery, which is used in recovery cases.

Since we're now using the completion context within the completion
results builder, make sure that it's always set to something.

Fixes <rdar://problem/8470644>.

llvm-svn: 114704
2010-09-23 23:01:17 +00:00