]> granicus.if.org Git - clang/log
clang
13 years agoRemove an unused function (found by Clang's -Wunused-function)
Chandler Carruth [Fri, 29 Jul 2011 00:15:44 +0000 (00:15 +0000)]
Remove an unused function (found by Clang's -Wunused-function)

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

13 years agoobjective-c: warn if implementation of a method in category
Fariborz Jahanian [Thu, 28 Jul 2011 23:19:50 +0000 (23:19 +0000)]
objective-c: warn if implementation of a method in category
masks an existing method in its primary class, class extensions,
and primary class's non-optional protocol methods; as primary
class, or one of its subclass's will implement this method.
This warning has potential of being noisy so it has its own
group.  // rdar://7020493

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

13 years agoSome documentation fixes so that we are explicit about which iteration order is sourc...
Jonathan D. Turner [Thu, 28 Jul 2011 23:15:22 +0000 (23:15 +0000)]
Some documentation fixes so that we are explicit about which iteration order is source-order.  Also, removing unused NextInSource field of Module.

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

13 years agoReally remove FlatStoreManager and BasicStoreManager, this time from the driver....
Ted Kremenek [Thu, 28 Jul 2011 23:08:16 +0000 (23:08 +0000)]
Really remove FlatStoreManager and BasicStoreManager, this time from the driver.  Also remove associated tests.  Sorry for the messy commits; this is the result of a botched Git merge.

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

13 years agoRemove flat store tests.
Ted Kremenek [Thu, 28 Jul 2011 23:08:04 +0000 (23:08 +0000)]
Remove flat store tests.

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

13 years agoRemove FlatStoreManager and BasicStoreManager. The latter has long been obsolete...
Ted Kremenek [Thu, 28 Jul 2011 23:08:02 +0000 (23:08 +0000)]
Remove FlatStoreManager and BasicStoreManager.  The latter has long been obsolete and the former has no had development in a long time.

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

13 years ago[analyzer] Overhaul how the static analyzer expects CFGs by forcing CFGs to be linear...
Ted Kremenek [Thu, 28 Jul 2011 23:07:59 +0000 (23:07 +0000)]
[analyzer] Overhaul how the static analyzer expects CFGs by forcing CFGs to be linearized only when used by the static analyzer.  This required a rewrite of LiveVariables, and exposed a ton of subtle bugs.

The motivation of this large change is to drastically simplify the logic in ExprEngine going forward.

Some fallout is that the output of some BugReporterVisitors is not as accurate as before; those will
need to be fixed over time.  There is also some possible performance regression as RemoveDeadBindings
will be called frequently; this can also be improved over time.

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

13 years ago[analyzer] fix bug in malloc checker where the tracked symbol would not properly...
Ted Kremenek [Thu, 28 Jul 2011 23:07:51 +0000 (23:07 +0000)]
[analyzer] fix bug in malloc checker where the tracked symbol would not properly be removed from the state.

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

13 years ago[analyzer] add accessor to StoreRef.
Ted Kremenek [Thu, 28 Jul 2011 23:07:49 +0000 (23:07 +0000)]
[analyzer] add accessor to StoreRef.

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

13 years ago[analyzer] Add StoreManager::includedInBindings() to to query whether a region is...
Ted Kremenek [Thu, 28 Jul 2011 23:07:46 +0000 (23:07 +0000)]
[analyzer] Add StoreManager::includedInBindings() to to query whether a region is used in any bindings.

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

13 years ago[analyzer] Add safety checking in RegionStoreManager for string literal underruns.
Ted Kremenek [Thu, 28 Jul 2011 23:07:43 +0000 (23:07 +0000)]
[analyzer] Add safety checking in RegionStoreManager for string literal underruns.

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

13 years ago[analyzer] Teach Environment to not look through MaterializeTemporaryExprs.
Ted Kremenek [Thu, 28 Jul 2011 23:07:41 +0000 (23:07 +0000)]
[analyzer] Teach Environment to not look through MaterializeTemporaryExprs.

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

13 years ago[analyzer] Fix bug in ObjCMessage where casts were being incorrectly ignored.
Ted Kremenek [Thu, 28 Jul 2011 23:07:38 +0000 (23:07 +0000)]
[analyzer] Fix bug in ObjCMessage where casts were being incorrectly ignored.

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

13 years ago[analyzer] fix handling of MaterializeTemporaryExpr by binding the result value to
Ted Kremenek [Thu, 28 Jul 2011 23:07:36 +0000 (23:07 +0000)]
[analyzer] fix handling of MaterializeTemporaryExpr by binding the result value to
the proper expression.

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

13 years agoIntroduce the local-global mapping for preprocessed entities, and use
Douglas Gregor [Thu, 28 Jul 2011 22:39:26 +0000 (22:39 +0000)]
Introduce the local-global mapping for preprocessed entities, and use
it appropriately. Also, patch up a place where we were failing to map
local macro definition IDs into global macro definition IDs.

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

13 years agoUse local-to-global mapping appropriately for macro definitions in the ASTReader
Douglas Gregor [Thu, 28 Jul 2011 22:16:57 +0000 (22:16 +0000)]
Use local-to-global mapping appropriately for macro definitions in the ASTReader

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

13 years agoUse the local -> global mapping functions for selectors more
Douglas Gregor [Thu, 28 Jul 2011 21:16:51 +0000 (21:16 +0000)]
Use the local -> global mapping functions for selectors more
consistently in the ASTReader.

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

13 years agoTeach the ASTReader to perform local and global mapping of identifier
Douglas Gregor [Thu, 28 Jul 2011 20:55:49 +0000 (20:55 +0000)]
Teach the ASTReader to perform local and global mapping of identifier
IDs properly, although the mapping itself is still trivial.

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

13 years agoAdd a fixit for removal of unused label.
Anna Zaks [Thu, 28 Jul 2011 20:52:06 +0000 (20:52 +0000)]
Add a fixit for removal of unused label.

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

13 years agoFix a test case that was intermittently failing. The issue was that instantiations...
Richard Trieu [Thu, 28 Jul 2011 20:30:10 +0000 (20:30 +0000)]
Fix a test case that was intermittently failing.  The issue was that instantiations are not stored in an order preserving structure, so the print order may be impacted.  Modified test case to do two FileCheck passes to ensure that both instantiations are in the same place.

Test originially commited at r136306 and temporarily silenced at r136348.

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

13 years agoAdded basic parsing for all remaining attributes, thread safety
Caitlin Sadowski [Thu, 28 Jul 2011 20:12:35 +0000 (20:12 +0000)]
Added basic parsing for all remaining attributes, thread safety
analysis. This includes checking that the attributes are applied in the
correct contexts and with the correct number of arguments.

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

13 years agoAnother test case for the &/* mismatch fixit.
Anna Zaks [Thu, 28 Jul 2011 19:55:52 +0000 (19:55 +0000)]
Another test case for the &/* mismatch fixit.

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

13 years agoAdd */& mismatch fixit generation to the Sema::DiagnoseAssignmentResult().
Anna Zaks [Thu, 28 Jul 2011 19:51:27 +0000 (19:51 +0000)]
Add */& mismatch fixit generation to the  Sema::DiagnoseAssignmentResult().

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

13 years agoMake the deserialization of Sema::PendingInstantiations lazy. At this
Douglas Gregor [Thu, 28 Jul 2011 19:49:54 +0000 (19:49 +0000)]
Make the deserialization of Sema::PendingInstantiations lazy. At this
point, ASTReader::InitializeSema() has very little interesting work,
*except* issues stemming from preloaded declarations. That's something
we'll still need to cope with.

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

13 years agoRefactor the */& mismatch fixit generation out of SemaOverload and provide a simple...
Anna Zaks [Thu, 28 Jul 2011 19:46:48 +0000 (19:46 +0000)]
Refactor the */& mismatch fixit generation out of SemaOverload and provide a simple conversion checking function.

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

13 years agoPromote the deserialized PendingInstantiations vector from being a
Douglas Gregor [Thu, 28 Jul 2011 19:26:52 +0000 (19:26 +0000)]
Promote the deserialized PendingInstantiations vector from being a
Module member to being an ASTReader member; we want it to be
centralized for lazy deserialization.

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

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