]> granicus.if.org Git - clang/log
clang
13 years agoLazily deserialize Sema::VTableUses. Plus, fix the utterly and
Douglas Gregor [Thu, 28 Jul 2011 19:11:31 +0000 (19:11 +0000)]
Lazily deserialize Sema::VTableUses. Plus, fix the utterly and
completely broken deserialization mapping code we had for VTableUses,
which would have broken horribly as soon as our local-to-global ID
mapping became interesting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136371 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThread safety: Fix typo in documentation
Caitlin Sadowski [Thu, 28 Jul 2011 18:38:36 +0000 (18:38 +0000)]
Thread safety: Fix typo in documentation

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136370 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake Sema::WeakUndeclaredIdentifiers lazily deserialized.
Douglas Gregor [Thu, 28 Jul 2011 18:09:57 +0000 (18:09 +0000)]
Make Sema::WeakUndeclaredIdentifiers lazily deserialized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136368 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd missing documentation onto new member variable.
Jonathan D. Turner [Thu, 28 Jul 2011 17:42:18 +0000 (17:42 +0000)]
Add missing documentation onto new member variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136365 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdded parsing for guarded_var, pt_guarded_var, lockable,
Caitlin Sadowski [Thu, 28 Jul 2011 17:21:07 +0000 (17:21 +0000)]
Added parsing for guarded_var, pt_guarded_var, lockable,
scoped_lockable, and no_thread_safety_analysis attributes, all for thread safety analysis

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136364 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSwitch the ModuleManager over to using a FileManager and FileEntry* as part of its...
Jonathan D. Turner [Thu, 28 Jul 2011 17:20:23 +0000 (17:20 +0000)]
Switch the ModuleManager over to using a FileManager and FileEntry* as part of its lookup instead of the filename.  This is a more correct unique identifier, as symlinks can be handled by the FileManager.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136363 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake Sema::ReferencedSelectors lazily deserialized.
Douglas Gregor [Thu, 28 Jul 2011 14:54:22 +0000 (14:54 +0000)]
Make Sema::ReferencedSelectors lazily deserialized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136357 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMove a Module's ReferencedSelectorsData into the ASTReader itself, so
Douglas Gregor [Thu, 28 Jul 2011 14:41:43 +0000 (14:41 +0000)]
Move a Module's ReferencedSelectorsData into the ASTReader itself, so
that it accumulates referenced selectors from each of the modules/PCH
files as they are loaded. No actual functionality change, yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136356 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake Sema::LocallyScopedExternalDecls lazily deserialized. In theory,
Douglas Gregor [Thu, 28 Jul 2011 14:20:37 +0000 (14:20 +0000)]
Make Sema::LocallyScopedExternalDecls lazily deserialized. In theory,
we could turn this into an on-disk hash table so we don't load the
whole thing the first time we need it. However, it tends to be very,
very small (i.e., empty) for most precompiled headers, so it isn't all
that interesting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136352 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotest/Misc/ast-dump-templates.cpp: Disable this temporarily due to unstable output.
NAKAMURA Takumi [Thu, 28 Jul 2011 12:10:58 +0000 (12:10 +0000)]
test/Misc/ast-dump-templates.cpp: Disable this temporarily due to unstable output.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136348 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotest/CodeGen/2004-03-16-AsmRegisterCrash.c: XTARGET should accept the part of triplet...
NAKAMURA Takumi [Thu, 28 Jul 2011 11:25:02 +0000 (11:25 +0000)]
test/CodeGen/2004-03-16-AsmRegisterCrash.c: XTARGET should accept the part of triplet. ("x86" is not the part of triplet)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136346 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake a note about a missing optimization.
John McCall [Thu, 28 Jul 2011 07:41:22 +0000 (07:41 +0000)]
Make a note about a missing optimization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136340 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a couple of problems with initialization and assignment to
John McCall [Thu, 28 Jul 2011 07:23:35 +0000 (07:23 +0000)]
Fix a couple of problems with initialization and assignment to
__block variables where the act of initialization/assignment
itself causes the __block variable to be copied to the heap
because the variable is of block type and is being assigned
a block literal which captures the variable.

rdar://problem/9814099

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136337 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotest/CodeGen/struct-matching-constraint.c: Fixup not to emit garbage to source tree.
NAKAMURA Takumi [Thu, 28 Jul 2011 04:50:11 +0000 (04:50 +0000)]
test/CodeGen/struct-matching-constraint.c: Fixup not to emit garbage to source tree.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136333 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAST serialization support for the Framework in IndexHeaderMapHeader
Douglas Gregor [Thu, 28 Jul 2011 04:50:02 +0000 (04:50 +0000)]
AST serialization support for the Framework in IndexHeaderMapHeader
fields of HeaderFileInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136332 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIntroduce the "-index-header-map" option, to give special semantics
Douglas Gregor [Thu, 28 Jul 2011 04:45:53 +0000 (04:45 +0000)]
Introduce the "-index-header-map" option, to give special semantics
for quoted header lookup when dealing with not-yet-installed
frameworks. Fixes <rdar://problem/9824020>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136331 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotest/CodeGen/struct-init.c, struct-matching-constraint.c: Tweak commandline, or they...
NAKAMURA Takumi [Thu, 28 Jul 2011 03:53:54 +0000 (03:53 +0000)]
test/CodeGen/struct-init.c, struct-matching-constraint.c: Tweak commandline, or they would not be recognized as armv7 on some hosts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136330 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't set Sema's StdNamespace or StdBadAlloc if they've already been set
Douglas Gregor [Thu, 28 Jul 2011 00:57:24 +0000 (00:57 +0000)]
Don't set Sema's StdNamespace or StdBadAlloc if they've already been set

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136318 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSwitch Sema::DynamicClasses over to LazyVector
Douglas Gregor [Thu, 28 Jul 2011 00:53:40 +0000 (00:53 +0000)]
Switch Sema::DynamicClasses over to LazyVector

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136317 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCut down the number of open/close system calls for output files.
Argyrios Kyrtzidis [Thu, 28 Jul 2011 00:45:10 +0000 (00:45 +0000)]
Cut down the number of open/close system calls for output files.

For PCH files, have only one open/close for temporary + rename to be safe from race conditions.
For all other output files open/close the output file directly.

Depends on llvm r136310. rdar://9082880 & http://llvm.org/PR9374.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136315 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSwitch Sema::ExtVectorDecls over to LazyVector.
Douglas Gregor [Thu, 28 Jul 2011 00:39:29 +0000 (00:39 +0000)]
Switch Sema::ExtVectorDecls over to LazyVector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136314 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix thinko in last checkin.
Eric Christopher [Thu, 28 Jul 2011 00:30:42 +0000 (00:30 +0000)]
Fix thinko in last checkin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136311 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove the need for a header and specify a triple so that the type
Eric Christopher [Thu, 28 Jul 2011 00:28:22 +0000 (00:28 +0000)]
Remove the need for a header and specify a triple so that the type
sizes make sense.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136309 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix this up for clang codegen versus llvm-gcc.
Eric Christopher [Thu, 28 Jul 2011 00:25:28 +0000 (00:25 +0000)]
Fix this up for clang codegen versus llvm-gcc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136308 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix this test to work for arm and on all platforms.
Eric Christopher [Thu, 28 Jul 2011 00:22:59 +0000 (00:22 +0000)]
Fix this test to work for arm and on all platforms.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136307 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd template instantiations to the output of -ast-dump.
Richard Trieu [Thu, 28 Jul 2011 00:19:05 +0000 (00:19 +0000)]
Add template instantiations to the output of -ast-dump.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136306 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd a triple to this test and make sure it passes on arm where it was
Eric Christopher [Thu, 28 Jul 2011 00:13:53 +0000 (00:13 +0000)]
Add a triple to this test and make sure it passes on arm where it was
supposed to.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136305 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCorrect the triple here.
Eric Christopher [Thu, 28 Jul 2011 00:11:03 +0000 (00:11 +0000)]
Correct the triple here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136304 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThis works on arm.
Eric Christopher [Thu, 28 Jul 2011 00:10:10 +0000 (00:10 +0000)]
This works on arm.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136303 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoApparently this does work on arm.
Eric Christopher [Thu, 28 Jul 2011 00:09:38 +0000 (00:09 +0000)]
Apparently this does work on arm.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136302 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThis was meant to test arm anyhow, make the registers agree with the
Eric Christopher [Thu, 28 Jul 2011 00:08:06 +0000 (00:08 +0000)]
This was meant to test arm anyhow, make the registers agree with the
instruction and the architecture for which the instruction exists.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136301 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove this test, it's actually testing something that clang doesn't support.
Eric Christopher [Thu, 28 Jul 2011 00:03:07 +0000 (00:03 +0000)]
Remove this test, it's actually testing something that clang doesn't support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136300 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoXFAIL this test on ARM. Filed PR10518 to track.
Eric Christopher [Wed, 27 Jul 2011 23:48:42 +0000 (23:48 +0000)]
XFAIL this test on ARM. Filed PR10518 to track.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136299 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove the optimization option for this test.
Eric Christopher [Wed, 27 Jul 2011 23:46:26 +0000 (23:46 +0000)]
Remove the optimization option for this test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136298 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoNo one cares about ppc, but make this work for arm and x86 and xfail the rest.
Eric Christopher [Wed, 27 Jul 2011 23:44:48 +0000 (23:44 +0000)]
No one cares about ppc, but make this work for arm and x86 and xfail the rest.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136297 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTest for r136294.
Chad Rosier [Wed, 27 Jul 2011 23:37:42 +0000 (23:37 +0000)]
Test for r136294.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136296 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThe -fapple-kext flag was designed to "do the right thing" for building code for
Chad Rosier [Wed, 27 Jul 2011 23:36:45 +0000 (23:36 +0000)]
The -fapple-kext flag was designed to "do the right thing" for building code for
use in KEXTs. However, users/Xcode still need to tweak the linker flags to do
the right thing, and end up using -Xlinker, for example.  Instead, have the
driver "do the right thing" when linking when -fapple-kext is present on the
command line, and we should have Xcode use -fapple-kext instead of setting other
flags like -Xlinker -kext or -nodefaultlibs.
rdar://7809940

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136294 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTurn Sema::DelegatingCtorDecls into a LazyVector.
Douglas Gregor [Wed, 27 Jul 2011 21:57:17 +0000 (21:57 +0000)]
Turn Sema::DelegatingCtorDecls into a LazyVector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136273 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThe lock operand to an @synchronized statement is also
John McCall [Wed, 27 Jul 2011 21:50:02 +0000 (21:50 +0000)]
The lock operand to an @synchronized statement is also
supposed to be a full-expression;  make it so.  In ARC, make sure
we retain the lock for the entire protected block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136271 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSwitch Sema::UnusedFileScopedDecls over to a LazyVector.
Douglas Gregor [Wed, 27 Jul 2011 21:45:57 +0000 (21:45 +0000)]
Switch Sema::UnusedFileScopedDecls over to a LazyVector.
  - Added LazyVector::erase() to support this use case.
  - Factored out the LazyDecl-of-Decls to RecordData translation in
  the ASTWriter. There is still a pile of code duplication here to
  eliminate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136270 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd a utility function to the Lexer, which makes it easier to find a token after...
Anna Zaks [Wed, 27 Jul 2011 21:43:43 +0000 (21:43 +0000)]
Add a utility function to the Lexer, which makes it easier to find a token after the given location. (It is a generalized version of trans::findLocationAfterSemi from ArcMigrate, which will be changed to use the Lexer utility).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136268 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIntroduce a new data structure, LazyVector, which is a vector whose
Douglas Gregor [Wed, 27 Jul 2011 20:58:46 +0000 (20:58 +0000)]
Introduce a new data structure, LazyVector, which is a vector whose
contents are lazily loaded on demand from an external source (e.g., an
ExternalASTSource or ExternalSemaSource). The "loaded" entities are
kept separate from the "local" entities, so that the two can grow
independently.

Switch Sema::TentativeDefinitions from a normal vector that is eagerly
populated by the ASTReader into one of these LazyVectors, making the
ASTReader a bit more like me (i.e., lazy).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136262 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSilence gcc warning
Peter Collingbourne [Wed, 27 Jul 2011 20:32:00 +0000 (20:32 +0000)]
Silence gcc warning

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136258 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoForbid address-space-qualified function types, per TR 18037
Peter Collingbourne [Wed, 27 Jul 2011 20:30:05 +0000 (20:30 +0000)]
Forbid address-space-qualified function types, per TR 18037

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136257 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix TR 18037 citation in SemaType.cpp
Peter Collingbourne [Wed, 27 Jul 2011 20:29:53 +0000 (20:29 +0000)]
Fix TR 18037 citation in SemaType.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136256 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCodeGen: rename CodeGenModule::Runtime to ObjCRuntime
Peter Collingbourne [Wed, 27 Jul 2011 20:29:46 +0000 (20:29 +0000)]
CodeGen: rename CodeGenModule::Runtime to ObjCRuntime

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136254 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix typo in test.
Eli Friedman [Wed, 27 Jul 2011 20:09:36 +0000 (20:09 +0000)]
Fix typo in test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136251 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake CodeGen for array delete involving incomplete class work without crashing. ...
Eli Friedman [Wed, 27 Jul 2011 18:54:57 +0000 (18:54 +0000)]
Make CodeGen for array delete involving incomplete class work without crashing.  Should fix regression on g++.dg/init/delete1.C.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136241 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoChange Preprocessor::getTotalMemory() to use llvm::capacity_in_bytes().
Ted Kremenek [Wed, 27 Jul 2011 18:41:23 +0000 (18:41 +0000)]
Change Preprocessor::getTotalMemory() to use llvm::capacity_in_bytes().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136239 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoChange PreprocessingRecord::getTotalMemory() to use llvm::capacity_in_bytes().
Ted Kremenek [Wed, 27 Jul 2011 18:41:20 +0000 (18:41 +0000)]
Change PreprocessingRecord::getTotalMemory() to use llvm::capacity_in_bytes().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136238 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoChange HeaderSearch::getTotalMemory() to use llvm::capacity_in_bytes().
Ted Kremenek [Wed, 27 Jul 2011 18:41:18 +0000 (18:41 +0000)]
Change HeaderSearch::getTotalMemory() to use llvm::capacity_in_bytes().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136237 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoChange SourceManager::getDataStructureSizes() to use llvm::capacity_in_bytes().
Ted Kremenek [Wed, 27 Jul 2011 18:41:16 +0000 (18:41 +0000)]
Change SourceManager::getDataStructureSizes() to use llvm::capacity_in_bytes().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136236 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoChange ASTContext::getSideTableAllocatedMemory() to use llvm::capacity_in_bytes().
Ted Kremenek [Wed, 27 Jul 2011 18:41:12 +0000 (18:41 +0000)]
Change ASTContext::getSideTableAllocatedMemory() to use llvm::capacity_in_bytes().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136235 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoModules don't require validation of the predefines buffer
Douglas Gregor [Wed, 27 Jul 2011 16:30:06 +0000 (16:30 +0000)]
Modules don't require validation of the predefines buffer

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136224 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake this darwin only for now while investigating to clear up x86_64
Eric Christopher [Wed, 27 Jul 2011 16:26:09 +0000 (16:26 +0000)]
Make this darwin only for now while investigating to clear up x86_64
Release+Asserts linux tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136223 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUpdate C++0x status page to reflect support for unicode string and character literals...
Douglas Gregor [Wed, 27 Jul 2011 15:10:09 +0000 (15:10 +0000)]
Update C++0x status page to reflect support for unicode string and character literals, from Craig Topper

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136216 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd support for C++0x unicode string and character literals, from Craig Topper!
Douglas Gregor [Wed, 27 Jul 2011 05:40:30 +0000 (05:40 +0000)]
Add support for C++0x unicode string and character literals, from Craig Topper!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136210 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[arcmt] Revert r135382, there's a different approach in r135764. rdar://9821111.
Argyrios Kyrtzidis [Wed, 27 Jul 2011 05:28:22 +0000 (05:28 +0000)]
[arcmt] Revert r135382, there's a different approach in r135764. rdar://9821111.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136209 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[arcmt] More automatic transformations and safety improvements; rdar://9615812 :
Argyrios Kyrtzidis [Wed, 27 Jul 2011 05:28:18 +0000 (05:28 +0000)]
[arcmt] More automatic transformations and safety improvements; rdar://9615812 :

- Replace calling -zone with 'nil'. -zone is obsolete in ARC.
- Allow removing retain/release on a static global var.
- Fix assertion hit when scanning for name references outside a NSAutoreleasePool scope.
- Automatically add bridged casts for results of objc method calls and when calling CFRetain, for example:

NSString *s;
CFStringRef ref = [s string];   -> CFStringRef ref = (__bridge CFStringRef)([s string]);
ref = s.string;                 -> ref = (__bridge CFStringRef)(s.string);
ref = [NSString new];           -> ref = (__bridge_retained CFStringRef)([NSString new]);
ref = [s newString];            -> ref = (__bridge_retained CFStringRef)([s newString]);
ref = [[NSString alloc] init];  -> ref = (__bridge_retained CFStringRef)([[NSString alloc] init]);
ref = [[s string] retain];      -> ref = (__bridge_retained CFStringRef)([s string]);
ref = CFRetain(s);              -> ref = (__bridge_retained CFTypeRef)(s);
ref = [s retain];               -> ref = (__bridge_retained CFStringRef)(s);

- Emit migrator error when trying to cast to CF type the result of autorelease/release:
  for

CFStringRef f3() {
  return (CFStringRef)[[[NSString alloc] init] autorelease];
}

emits:

t.m:12:10: error: [rewriter] it is not safe to cast to 'CFStringRef' the result of 'autorelease' message; a __bridge cast may result in a pointer to a destroyed object and a __bridge_retained may leak the object
  return (CFStringRef)[[[NSString alloc] init] autorelease];
         ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
t.m:12:3: note: [rewriter] remove the cast and change return type of function to 'NSString *' to have the object automatically autoreleased
  return (CFStringRef)[[[NSString alloc] init] autorelease];
  ^

- Before changing attributes to weak/unsafe_unretained, check if the backing ivar
  is set to a +1 object, in which case use 'strong' instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136208 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEasier debugging with Visual Studio Visualizers, from Nikola Smiljanic!
Douglas Gregor [Wed, 27 Jul 2011 05:22:46 +0000 (05:22 +0000)]
Easier debugging with Visual Studio Visualizers, from Nikola Smiljanic!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136207 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoClean up the analysis of the collection operand to ObjC
John McCall [Wed, 27 Jul 2011 01:07:15 +0000 (01:07 +0000)]
Clean up the analysis of the collection operand to ObjC
for-in statements;  specifically, make sure to close over any
temporaries or cleanups it might require.  In ARC, this has
implications for the lifetime of the collection, so emit it
with a retain and release it upon exit from the loop.

rdar://problem/9817306

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136204 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIn Microsoft mode, if we are within a templated function and we can't resolve Identif...
Francois Pichet [Wed, 27 Jul 2011 01:05:24 +0000 (01:05 +0000)]
In Microsoft mode, if we are within a templated function and we can't resolve Identifier during BuildCXXNestedNameSpecifier, then extend the SS with Identifier. This will have  the effect of resolving Identifier during template instantiation.  The goal is to be able to resolve a function call whose nested-name-specifier is located inside a dependent base class.

class C {
public:
    static void foo2() {  }
};

template <class T> class A {
public:
   typedef C D;
};

template <class T> class B : public A<T> {
public:
  void foo() { D::foo2(); }
};

Note that this won't work if the NestedNameSpecifier refers to a type.
This fixes 1 error when parsing the MSVC 2010 standard headers file with clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136203 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoHandle different sized wchar_t for windows.
Eric Christopher [Tue, 26 Jul 2011 23:56:49 +0000 (23:56 +0000)]
Handle different sized wchar_t for windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136192 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoclang_getCXTUResourceUsage: report memory used by HeaderSearch.
Ted Kremenek [Tue, 26 Jul 2011 23:46:11 +0000 (23:46 +0000)]
clang_getCXTUResourceUsage: report memory used by HeaderSearch.

This required converting the StringMaps to use a BumpPtrAllocator.  I measured the
compile time and saw no observable regression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136190 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoclang_getCXTUResourceUsage: Report memory used by data structures in SourceManager.
Ted Kremenek [Tue, 26 Jul 2011 23:46:06 +0000 (23:46 +0000)]
clang_getCXTUResourceUsage: Report memory used by data structures in SourceManager.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136189 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUse the correct definition for memset.
Eric Christopher [Tue, 26 Jul 2011 23:44:22 +0000 (23:44 +0000)]
Use the correct definition for memset.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136188 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake this darwin only to simplify the padding calculations per arch.
Eric Christopher [Tue, 26 Jul 2011 23:39:23 +0000 (23:39 +0000)]
Make this darwin only to simplify the padding calculations per arch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136185 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRe-fix r136172 so it isn't an error; apparently, some people are fond of their undefi...
Eli Friedman [Tue, 26 Jul 2011 23:27:24 +0000 (23:27 +0000)]
Re-fix r136172 so it isn't an error; apparently, some people are fond of their undefined behavior.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136183 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThis appears to be passing on all hosts.
Eric Christopher [Tue, 26 Jul 2011 23:26:00 +0000 (23:26 +0000)]
This appears to be passing on all hosts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136182 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThis patch implements as much of the narrowing conversion error specified by
Jeffrey Yasskin [Tue, 26 Jul 2011 23:20:30 +0000 (23:20 +0000)]
This patch implements as much of the narrowing conversion error specified by
[dcl.init.list] as is possible without generalized initializer lists or full
constant expression support, and adds a c++0x-compat warning in C++98 mode.

The FixIt currently uses a typedef's basename without qualification, which is
likely to be incorrect on some code.  If it's incorrect on too much code, we
should write a function to get the string that refers to a type from a
particular context.

The warning is currently off by default. I'll fix LLVM and clang before turning
it on.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136181 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDisable the optimization that skips emission of complete, non-virtual
Douglas Gregor [Tue, 26 Jul 2011 23:18:30 +0000 (23:18 +0000)]
Disable the optimization that skips emission of complete, non-virtual
destructors of abstract classes. It's undefined behavior to actually
call the destructor (e.g., via delete), but the presence of code that
calls this destructor doesn't make the program
ill-formed. Fixes <rdar://problem/9819242>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136180 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTry a little hack to fix the memset duplication on windows.
Eric Christopher [Tue, 26 Jul 2011 23:18:10 +0000 (23:18 +0000)]
Try a little hack to fix the memset duplication on windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136179 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTry harder to fix these for windows.
Eric Christopher [Tue, 26 Jul 2011 23:12:06 +0000 (23:12 +0000)]
Try harder to fix these for windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136177 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoGeneralize for various build bots.
Eric Christopher [Tue, 26 Jul 2011 22:52:35 +0000 (22:52 +0000)]
Generalize for various build bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136173 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDiagnose trying to delete a pointer to an abstract class with a non-virtual destructo...
Eli Friedman [Tue, 26 Jul 2011 22:50:18 +0000 (22:50 +0000)]
Diagnose trying to delete a pointer to an abstract class with a non-virtual destructor. PR10504.

I'm not completely sure the standard allows us to reject this, but if it doesn't, it should. :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136172 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRewrite match line to be friendlier to misc buildbots.
Eric Christopher [Tue, 26 Jul 2011 22:44:31 +0000 (22:44 +0000)]
Rewrite match line to be friendlier to misc buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136169 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRewrite matching line to be friendlier to misc buildbots.
Eric Christopher [Tue, 26 Jul 2011 22:43:37 +0000 (22:43 +0000)]
Rewrite matching line to be friendlier to misc buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136168 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAttempt to rewrite the matching for this test to pacify the windows
Eric Christopher [Tue, 26 Jul 2011 22:42:01 +0000 (22:42 +0000)]
Attempt to rewrite the matching for this test to pacify the windows
build bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136166 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove unused diagnostic definition.
Anna Zaks [Tue, 26 Jul 2011 22:34:49 +0000 (22:34 +0000)]
Remove unused diagnostic definition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136165 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRework the match here to silence release mode windows buildbots.
Eric Christopher [Tue, 26 Jul 2011 22:32:44 +0000 (22:32 +0000)]
Rework the match here to silence release mode windows buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136164 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAttempt to generalize this test for release mode buildbots.
Eric Christopher [Tue, 26 Jul 2011 22:31:33 +0000 (22:31 +0000)]
Attempt to generalize this test for release mode buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136163 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTry to generalize the match to quiet the windows build bot.
Eric Christopher [Tue, 26 Jul 2011 22:27:01 +0000 (22:27 +0000)]
Try to generalize the match to quiet the windows build bot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136162 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoA couple minor issues with Sema for delete:
Eli Friedman [Tue, 26 Jul 2011 22:25:31 +0000 (22:25 +0000)]
A couple minor issues with Sema for delete:

1. Attempting to delete an expression of incomplete class type should be an error, not a warning.

2. If someone tries to delete a pointer to an incomplete class type, make sure we actually emit
the delete expression after we warn.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136161 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUse unsigned long long for uint64_t. Fixes part of the windows buildbot.
Eric Christopher [Tue, 26 Jul 2011 22:19:01 +0000 (22:19 +0000)]
Use unsigned long long for uint64_t. Fixes part of the windows buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136160 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMigrate most of the rest of test/FrontendC from llvm and migrate
Eric Christopher [Tue, 26 Jul 2011 22:17:02 +0000 (22:17 +0000)]
Migrate most of the rest of test/FrontendC from llvm and migrate
most of them to FileCheck.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136159 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdjust check for release mode.
Eric Christopher [Tue, 26 Jul 2011 22:07:13 +0000 (22:07 +0000)]
Adjust check for release mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136158 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIn ARC we emit an error when compiling:
Argyrios Kyrtzidis [Tue, 26 Jul 2011 21:48:26 +0000 (21:48 +0000)]
In ARC we emit an error when compiling:

@interface Foo : NSObject
@property (readonly) id myProp;
@end

@implementation Foo
@synthesize myProp;
@end

t.m:9:13: error: ARC forbids synthesizing a property of an Objective-C object with unspecified storage attribute
@synthesize myProp;
            ^

which is fine, we want the ownership of the synthesized ivar to be explicit. But we should _not_ emit an error
for the following cases, because we can get the ownership either from the declared ivar or from the property type:

@interface Foo : NSObject {
__weak id _myProp1;
id myProp2;
}
@property (readonly) id myProp1;
@property (readonly) id myProp2;
@property (readonly) __strong id myProp3;
@end

@implementation Foo
@synthesize myProp1 = _myProp1;
@synthesize myProp2;
@synthesize myProp3;
@end

rdar://9844006.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136155 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMigrate:
Eric Christopher [Tue, 26 Jul 2011 21:42:32 +0000 (21:42 +0000)]
Migrate:

       CodeGen/2003-08-21-WideString.c
       CodeGen/2003-10-02-UnionLValueError.c
       CodeGen/2004-02-20-Builtins.c
       CodeGen/2008-01-04-WideBitfield.c
       CodeGen/2002-07-14-MiscTests3.c
       CodeGen/2005-04-09-ComplexOps.c
       CodeGen/2008-12-23-AsmIntPointerTie.c
       CodeGen/2005-07-20-SqrtNoErrno.c
       CodeGen/2005-01-02-VAArgError-ICE.c
       CodeGen/2004-06-17-UnorderedCompares.c
       CodeGen/2002-06-25-FWriteInterfaceFailure.c
       CodeGen/2002-02-18-64bitConstant.c
       CodeGen/2002-05-24-Alloca.c
       CodeGen/2006-01-13-Includes.c
       CodeGen/2007-09-27-ComplexIntCompare.c
       CodeGen/2004-02-13-IllegalVararg.c
       CodeGen/2007-09-12-PragmaPack.c
       CodeGen/2002-08-02-UnionTest.c

from test/FrontendC with changes to remove header file includes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136153 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoReport more memory using in Preprocessor::getTotalMemory() and PreprocessingRecord...
Ted Kremenek [Tue, 26 Jul 2011 21:17:24 +0000 (21:17 +0000)]
Report more memory using in Preprocessor::getTotalMemory() and PreprocessingRecord::getTotalMemory().

Most of the memory was already reported; but now we report more memory from side data structures.

Fixes <rdar://problem/9379717>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136150 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMigrate CodeGen/2007-03-05-DataLayout.c from test/FrontendC with changes
Eric Christopher [Tue, 26 Jul 2011 20:44:55 +0000 (20:44 +0000)]
Migrate CodeGen/2007-03-05-DataLayout.c from test/FrontendC with changes
to remove header file includes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136134 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMigrate CodeGen/2005-02-20-AggregateSAVEEXPR.c from test/FrontendC with
Eric Christopher [Tue, 26 Jul 2011 20:38:19 +0000 (20:38 +0000)]
Migrate CodeGen/2005-02-20-AggregateSAVEEXPR.c from test/FrontendC with
changes to remove any #include lines.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136129 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMigrate CodeGen/2009-09-24-SqrtErrno.c from test/FrontendC with changes
Eric Christopher [Tue, 26 Jul 2011 20:31:17 +0000 (20:31 +0000)]
Migrate CodeGen/2009-09-24-SqrtErrno.c from test/FrontendC with changes
to avoid header inclusions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136128 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMigrate CodeGen/2002-03-11-LargeCharInString.c from test/FrontendC and
Eric Christopher [Tue, 26 Jul 2011 20:29:08 +0000 (20:29 +0000)]
Migrate CodeGen/2002-03-11-LargeCharInString.c from test/FrontendC and
modify to avoid any outside includes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136127 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd CodeGen/2009-07-15-pad-wchar_t-array.c migrated from test/FrontendC
Eric Christopher [Tue, 26 Jul 2011 20:27:12 +0000 (20:27 +0000)]
Add CodeGen/2009-07-15-pad-wchar_t-array.c migrated from test/FrontendC
and modified to avoid includes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136126 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMigrate wchar-const.c with fixes and FileCheck from llvm/test/FrontendC.
Eric Christopher [Tue, 26 Jul 2011 18:39:16 +0000 (18:39 +0000)]
Migrate wchar-const.c with fixes and FileCheck from llvm/test/FrontendC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136114 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert r136046 while fixing handling of e.g. &foo[index_one_past_size]
Kaelyn Uhrain [Tue, 26 Jul 2011 18:36:36 +0000 (18:36 +0000)]
Revert r136046 while fixing handling of e.g. &foo[index_one_past_size]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136113 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThis patch extends the previous patch by starting to incorporate more functionality...
Jonathan D. Turner [Tue, 26 Jul 2011 18:21:30 +0000 (18:21 +0000)]
This patch extends the previous patch by starting to incorporate more functionality, like lookup-by-name and exporting lookup tables, into the module manager.  Methods now have documentation.  A few more functions have been switched over to the new iterator style and away from manual/explicit iteration.  Ultimately we want to move away from name lookup here, as symlinks make filenames not a safe unique value, but we use it here as a stopgap before better measures are in place (namely instead using FileEntry* from a global FileManager).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136107 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoProvide fixit for static use of objective-c type
Fariborz Jahanian [Tue, 26 Jul 2011 17:58:54 +0000 (17:58 +0000)]
Provide fixit for static use of objective-c type
in few more places and in each instance, fix up
the type to the expected type. // rdar://9603056

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136103 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEliminate a bunch of temporary strings.
Benjamin Kramer [Tue, 26 Jul 2011 16:59:25 +0000 (16:59 +0000)]
Eliminate a bunch of temporary strings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136092 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd new libclang API, clang_codeCompleteGetObjCSelector(), which
Douglas Gregor [Tue, 26 Jul 2011 15:24:30 +0000 (15:24 +0000)]
Add new libclang API, clang_codeCompleteGetObjCSelector(), which
provides the partial Objective-C selector used in a code
completion. From Connor Wakamo!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136084 91177308-0d34-0410-b5e6-96231b3b80d8