Commit Graph

25875 Commits

Author SHA1 Message Date
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
Marcin Swiderski 8b99b8a782 In preparation for adding generation of destructors for objects with automatic storage added:
- LocalScope class with iterator used to pointing into it,
- fat doxygen comment for LocalScope indended usage,
- BlockScopePosPair class used for storing jump targets/sources (for: goto, break, continue), that replaces raw CFGBlock pointer used earlier for this purpose.

llvm-svn: 114790
2010-09-25 11:05:21 +00:00
Fariborz Jahanian c60da031c5 Fix a NYI in IRGen which was due to incorrect AST
for property reference expression (of c++ object type)
in the conditional expression. Fixes // rdar://8291337

llvm-svn: 114783
2010-09-25 01:08:05 +00:00
Douglas Gregor 2fb99df2c3 When setting the globally-visible declarations for a particular
identifier, we may have a Sema object but no translation unit scope
(because parsing is finished). In this case, we still need to update
the IdResolver, which might still be used when writing a PCH
containing another PCH (without chaining). This bug manifested as a
failure with precompiled preambles.

Also, add a little environment-variable-sensitive logging for
libclang.

llvm-svn: 114774
2010-09-24 23:29:12 +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
Douglas Gregor 2c84482abd Teach libclang to enable multithreading in LLVM, since libclang clients are likely to be multithreaded. Also move the printing of timers to somewhere better for multithreaded libclang clients
llvm-svn: 114760
2010-09-24 21:18:36 +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 aa0f2b3016 Fix rewriting of property declared in @protocol's.
Fixed //rdar://8472487.

llvm-svn: 114741
2010-09-24 18:36:58 +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 3aa045491f Update Clang man page to say a little bit more about C++
llvm-svn: 114735
2010-09-24 17:26:14 +00:00
Ted Kremenek 45c42ec2f1 Remove this test for now until I figure out how to get it to work with c-index-test in a portable way.
llvm-svn: 114721
2010-09-24 02:43:32 +00:00
Ted Kremenek 2c2d146488 Pass -fobjc-nonfragile-abi2 in test.
llvm-svn: 114720
2010-09-24 02:00:46 +00:00
Ted Kremenek f93eb1b09e Since this test depends on default ivar synthesis, specify the target triple. This hopefully unbreaks the buildbot
on some archs.

llvm-svn: 114716
2010-09-24 01:51:38 +00:00
Ted Kremenek 25cfb3b511 Update comment in test with reference to bug report.
llvm-svn: 114715
2010-09-24 01:24:15 +00:00
Ted Kremenek 74a9f98522 Default synthesized ivars don't really have a location in the source. Using the location of the @implementation
is just confusing for clients that want to use SourceLocations for syntactic references.

Fixes: <rdar://problem/8470540>
llvm-svn: 114714
2010-09-24 01:23:01 +00:00
Nick Lewycky 6e1ce29b01 Revert r114712 due to failure on darwin buildbot.
llvm-svn: 114713
2010-09-24 00:46:53 +00:00
Nick Lewycky e351fed104 Make -M/-MM behave like in gcc; use -MF first then -o else use stdout.
llvm-svn: 114712
2010-09-23 23:49:25 +00:00
Nick Lewycky e47c245b90 Fix header comment so we don't break emacs.
llvm-svn: 114711
2010-09-23 23:48:20 +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
Nick Lewycky f2b22ab044 Fix typo.
llvm-svn: 114697
2010-09-23 21:43:57 +00:00