Commit Graph

25894 Commits

Author SHA1 Message Date
Douglas Gregor ac2e43082a Fix handling of dependent nested namespace specifiers in UsingDecls
during template instantiation, from Martin Vejnar!

llvm-svn: 115051
2010-09-29 17:58:28 +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
Daniel Dunbar 37614d875f Frontend/XML: Add support for printing nested structures, patch by Martin Vejnár!
llvm-svn: 115041
2010-09-29 16:09:28 +00:00
Douglas Gregor 1f7d02fb6d Define _Bool, bool, true, and false macros in <stdbool.h> when we're
in a GNU-compatible C++ dialect. Fixes <rdar://problem/8477819>.

llvm-svn: 115028
2010-09-29 04:57:11 +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
Chris Lattner d7821e4ec4 enhance tentative parsing to handle ms extensions, patch by Martin Vejnar!
llvm-svn: 115004
2010-09-28 23:35:09 +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
Ted Kremenek 9fcf3e0a20 Add test case for <rdar://problem/8452791> (fixed in r114392).
llvm-svn: 114989
2010-09-28 21:11:07 +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
Douglas Gregor 1ba435f0f9 When we have two identifiers in a row in Objective-C, make sure to
verify that we aren't in a message-send expression before digging into
the identifier or looking ahead more tokens. Fixes a regression
(<rdar://problem/8483253>) I introduced with bracket insertion.

llvm-svn: 114968
2010-09-28 17:48:56 +00:00
Argyrios Kyrtzidis d6ea6bd2a3 Don't warn with -Wbool-conversions if the user wrote an explicit cast like "(void *)false".
Fixes rdar://8459342.

llvm-svn: 114955
2010-09-28 14:54:11 +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
Sebastian Redl 4102dd5eb5 Fix a bug in loading macro records. Fixes yet another crash in libclang.
llvm-svn: 114940
2010-09-28 02:55:49 +00:00
Sebastian Redl da6a21cdd2 Fix a use of an invalidated reference due to a hash map reallocating.
llvm-svn: 114937
2010-09-28 02:24:44 +00:00
Bill Wendling 11191f11b8 Accidentally committed some temporary changes on my branch when reverting patches.
llvm-svn: 114936
2010-09-28 01:28:56 +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
Sebastian Redl 7abd8d58c2 My previous fix was incorrect for non-chained PCH reuse. Fix again.
llvm-svn: 114922
2010-09-27 23:20:01 +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
Fariborz Jahanian 3567c426c4 Patch to support transparent_union arguments
passed to nonnull attributed functions. Implements radar
6857843.

llvm-svn: 114917
2010-09-27 22:42:37 +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
Bill Wendling 1308667f18 Revert my patch changing the MMX "shift" intrinsics that take immediates into
"shift with non-immediate" intrinsics. It gets here because we they aren't
immediates anymore.

llvm-svn: 114890
2010-09-27 21:22:25 +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
Nico Weber d75488d010 Correctly set "explicit template instantiation" kind on inner structs of templates whose explicit instantiation is first declared and then defined.
Fixes http://llvm.org/pr8207

llvm-svn: 114874
2010-09-27 21:02:09 +00:00
Nico Weber a384e9a5f4 Let lit give helpful advice if 'make test' was not run yet.
llvm-svn: 114869
2010-09-27 20:40:32 +00:00
Daniel Dunbar 32f1b54b69 utils/ABITest: Factor out type naming code slightly.
llvm-svn: 114867
2010-09-27 20:13:24 +00:00
Daniel Dunbar 1998651529 utils/ABITest: Tweak default bit-field types to cover some more interesting cases.
llvm-svn: 114866
2010-09-27 20:13:22 +00:00
Daniel Dunbar 47dd9c2fc5 utils/ABITest: Add a workaround for mismatches due to PR5579.
llvm-svn: 114865
2010-09-27 20:13:19 +00:00
Daniel Dunbar 22ec2c218c utils/ABITest: Add option to skip individual tests by index.
llvm-svn: 114864
2010-09-27 20:13:17 +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
Fariborz Jahanian 30e8d58dbd Copying result of object property reference expression
into a temporary is elidable as well.
(Finishes up radar 8291337).

llvm-svn: 114845
2010-09-27 17:30:38 +00:00
Douglas Gregor a6f74e276d Remove libclang logging code
llvm-svn: 114836
2010-09-27 16:43:25 +00:00
Abramo Bagnara b59a5b6784 Fixed isConstantInitializer for __builtin_choose_expr.
llvm-svn: 114820
2010-09-27 07:13:32 +00:00
Michael J. Spencer 4362a1c987 Fix coding standard mistake from my last commit.
That, and keep aKor happy :P.

llvm-svn: 114816
2010-09-27 06:34:47 +00:00
Michael J. Spencer a0a820fadb Lexer: Implement GCC's version of pragma message.
llvm-svn: 114814
2010-09-27 06:19:02 +00:00
Douglas Gregor 176d286c96 Enable caching of global code completion results in the suggested
libclang options for editing a translation unit.

llvm-svn: 114810
2010-09-27 05:49:58 +00:00
Daniel Dunbar f247675c55 Driver/Linux: Translate rewritten lib options back to standard -l form when
using generic GCC tools.

llvm-svn: 114793
2010-09-25 18:10:05 +00:00