]> granicus.if.org Git - clang/log
clang
13 years agoMake -E work with module imports
Douglas Gregor [Wed, 14 Sep 2011 23:13:09 +0000 (23:13 +0000)]
Make -E work with module imports

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

13 years agoDon't try to write a macro offset for an identifier that names a non-exported macro...
Douglas Gregor [Wed, 14 Sep 2011 22:14:14 +0000 (22:14 +0000)]
Don't try to write a macro offset for an identifier that names a non-exported macro, for real this time

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

13 years agoRevert my exported-macro hackery. Something is amiss
Douglas Gregor [Wed, 14 Sep 2011 20:57:14 +0000 (20:57 +0000)]
Revert my exported-macro hackery. Something is amiss

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

13 years agoThread safety: small fixes in comments
Caitlin Sadowski [Wed, 14 Sep 2011 20:54:57 +0000 (20:54 +0000)]
Thread safety: small fixes in comments

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

13 years agoMake sure that we actually keep the key length and data length in sync when dealing...
Douglas Gregor [Wed, 14 Sep 2011 20:51:12 +0000 (20:51 +0000)]
Make sure that we actually keep the key length and data length in sync when dealing with non-exported macros

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

13 years agoDisable this test on win32. My "sleep 2" trick didn't seem to work
Douglas Gregor [Wed, 14 Sep 2011 20:38:11 +0000 (20:38 +0000)]
Disable this test on win32. My "sleep 2" trick didn't seem to work

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

13 years agoDon't try to write a macro offset for an identifier that names a non-exported macro
Douglas Gregor [Wed, 14 Sep 2011 20:36:30 +0000 (20:36 +0000)]
Don't try to write a macro offset for an identifier that names a non-exported macro

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

13 years agoAdd test for the driver's handling of modules
Douglas Gregor [Wed, 14 Sep 2011 20:29:10 +0000 (20:29 +0000)]
Add test for the driver's handling of modules

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

13 years agoTeach the driver to always pass down a module cache path. If none is
Douglas Gregor [Wed, 14 Sep 2011 20:28:46 +0000 (20:28 +0000)]
Teach the driver to always pass down a module cache path. If none is
supplied, use something derived from the system's temporary
directory. Depends on LLVM r139725.

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

13 years agoThread safety: reverting to use separate warning for requirement to hold any lock
Caitlin Sadowski [Wed, 14 Sep 2011 20:09:09 +0000 (20:09 +0000)]
Thread safety: reverting to use separate warning for requirement to hold any lock

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

13 years agoThread safety: adding additional documentation to the main thread safety interface...
Caitlin Sadowski [Wed, 14 Sep 2011 20:05:09 +0000 (20:05 +0000)]
Thread safety: adding additional documentation to the main thread safety interface, and making the destructor for the thread safety handler pure virtual

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

13 years agoThread safety: adding test cases for unparseable lock expressions and expanding the...
Caitlin Sadowski [Wed, 14 Sep 2011 20:00:24 +0000 (20:00 +0000)]
Thread safety: adding test cases for unparseable lock expressions and expanding the handling of these expressions

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

13 years agoPlug an abstraction leak and fix a crasher in DiagnoseInvalidRedeclaration
Kaelyn Uhrain [Wed, 14 Sep 2011 19:37:32 +0000 (19:37 +0000)]
Plug an abstraction leak and fix a crasher in DiagnoseInvalidRedeclaration

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

13 years agoPR10864: make sure we correctly delay type-checking for inline asm tied operands...
Eli Friedman [Wed, 14 Sep 2011 19:20:00 +0000 (19:20 +0000)]
PR10864: make sure we correctly delay type-checking for inline asm tied operands with dependent type.  Patch by Likai Liu.

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

13 years agoUse a group for a diagnostics I added late.
Fariborz Jahanian [Wed, 14 Sep 2011 19:02:25 +0000 (19:02 +0000)]
Use a group for a diagnostics I added late.

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

13 years ago[arcmt] Use __bridge_retained when passing an objc object to a CF parameter
Argyrios Kyrtzidis [Wed, 14 Sep 2011 18:17:09 +0000 (18:17 +0000)]
[arcmt] Use __bridge_retained when passing an objc object to a CF parameter
annotated with cf_consumed attribute.

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

13 years agoobjc-arc: warn when a 'retain' block property is
Fariborz Jahanian [Wed, 14 Sep 2011 18:03:46 +0000 (18:03 +0000)]
objc-arc: warn when a 'retain' block property is
declared which does not force a 'copy' of the block literal
object. // rdar://9829425

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

13 years ago[analyzer] Remove redundant copy constructor.
Anna Zaks [Wed, 14 Sep 2011 17:53:23 +0000 (17:53 +0000)]
[analyzer] Remove redundant copy constructor.

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

13 years ago[analyzer] After CFG has been linearized, we can have a situation where an ExpoledNod...
Anna Zaks [Wed, 14 Sep 2011 17:48:01 +0000 (17:48 +0000)]
[analyzer] After CFG has been linearized, we can have a situation where an ExpoledNode has an invalid SourceLocation (which has no correspondence in the source code). This commit is the first step to solve this problem.
 - It adds LocationContext to the PathDiagnosticLocation object and uses it to lookup the enclosing statement with a valid location.
 - So far, the LocationContext is only available when the object is constructed from the ExplodedNode.
 - Already found some subtle bugs(in plist-output-alternate.m) where the intermediate diagnostic steps were not previously shown.

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

13 years agoAdd comment.
Akira Hatanaka [Wed, 14 Sep 2011 17:24:05 +0000 (17:24 +0000)]
Add comment.

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

13 years agoEncode the module hash in base-36, to reduce the length of the strings a bit
Douglas Gregor [Wed, 14 Sep 2011 15:55:12 +0000 (15:55 +0000)]
Encode the module hash in base-36, to reduce the length of the strings a bit

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

13 years agoFormatting.
Eric Christopher [Wed, 14 Sep 2011 01:10:50 +0000 (01:10 +0000)]
Formatting.

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

13 years agoFix comment.
Eli Friedman [Wed, 14 Sep 2011 00:52:45 +0000 (00:52 +0000)]
Fix comment.

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

13 years ago[driver] Add support for the COMPILER_PATH environment variable, which adds the
Chad Rosier [Wed, 14 Sep 2011 00:47:55 +0000 (00:47 +0000)]
[driver] Add support for the COMPILER_PATH environment variable, which adds the
specified path(s) to the list of prefix directories.
rdar://10097714

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

13 years ago[analyzer] Refactor: Make PathDiagnosticLocation responsible for creating a valid...
Anna Zaks [Wed, 14 Sep 2011 00:25:17 +0000 (00:25 +0000)]
[analyzer] Refactor: Make PathDiagnosticLocation responsible for creating a valid object given an ExploadedNode (the same logic can be reused by other checkers).

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

13 years agoFix typo.
Eric Christopher [Tue, 13 Sep 2011 23:45:09 +0000 (23:45 +0000)]
Fix typo.

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

13 years agoAssert that the module hash produced after stripping away non-modular options is...
Douglas Gregor [Tue, 13 Sep 2011 23:20:27 +0000 (23:20 +0000)]
Assert that the module hash produced after stripping away non-modular options is the same as the module hash before stripping those options.

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

13 years agoFor modules, use a hash of the compiler version, language options, and
Douglas Gregor [Tue, 13 Sep 2011 23:15:45 +0000 (23:15 +0000)]
For modules, use a hash of the compiler version, language options, and
target triple to separate modules built under different
conditions. The hash is used to create a subdirectory in the module
cache path where other invocations of the compiler (with the same
version, language options, etc.) can find the precompiled modules.

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

13 years ago[libclang] Remove libclang.darwin.exports, it's not used anymore.
Argyrios Kyrtzidis [Tue, 13 Sep 2011 23:12:36 +0000 (23:12 +0000)]
[libclang] Remove libclang.darwin.exports, it's not used anymore.

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

13 years agoIn general, don't look through explicit casts when trying
John McCall [Tue, 13 Sep 2011 23:08:34 +0000 (23:08 +0000)]
In general, don't look through explicit casts when trying
to find the called declaration.  Explicit casts can radically
change the semantics of a call, and it's no longer really a
builtin call any more than it would be a builtin call if you stored
the function pointer into a variable and called that.

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

13 years agoCorrectly generate IR for casted "builtin" functions, where
John McCall [Tue, 13 Sep 2011 23:05:03 +0000 (23:05 +0000)]
Correctly generate IR for casted "builtin" functions, where
the builtin is really just a predefined declaration.  These are
totally valid to cast.

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

13 years agoO64 will not be supported.
Akira Hatanaka [Tue, 13 Sep 2011 22:47:52 +0000 (22:47 +0000)]
O64 will not be supported.

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

13 years agomips*-*-psp is no longer supported as a target.
Akira Hatanaka [Tue, 13 Sep 2011 22:46:13 +0000 (22:46 +0000)]
mips*-*-psp is no longer supported as a target.

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

13 years agoSplit the two invalid uses of the unqualified Foobar at line 3 to two lines
Kaelyn Uhrain [Tue, 13 Sep 2011 22:31:32 +0000 (22:31 +0000)]
Split the two invalid uses of the unqualified Foobar at line 3 to two lines
so that it is clearer which use triggered which error.

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

13 years agoRe-commit r139643.
Eli Friedman [Tue, 13 Sep 2011 22:21:56 +0000 (22:21 +0000)]
Re-commit r139643.

Make clang use Acquire loads and Release stores where necessary.

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

13 years agoRevert r139643 while I look into it; it's breaking selfhost.
Eli Friedman [Tue, 13 Sep 2011 22:08:16 +0000 (22:08 +0000)]
Revert r139643 while I look into it; it's breaking selfhost.

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

13 years ago[libclang] Introduce clang_getPresumedLocation which works like clang_getExpansionLoc...
Argyrios Kyrtzidis [Tue, 13 Sep 2011 21:49:08 +0000 (21:49 +0000)]
[libclang] Introduce clang_getPresumedLocation which works like clang_getExpansionLocation
but takes into account #line directives coming from preprocessed files.

Patch by Vinay Sajip!

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

13 years ago[PCH] Fix a regression that r139441 introduced (decls were getting passed
Argyrios Kyrtzidis [Tue, 13 Sep 2011 21:35:00 +0000 (21:35 +0000)]
[PCH] Fix a regression that r139441 introduced (decls were getting passed
to the consumer without being fully deserialized).

The regression was on compiling boost.python and it was too difficult to get a reduced
test case unfortunately.

Also modify the logic of how objc methods are getting passed to the consumer;
codegen depended on receiving objc methods before the implementation decl.
Since the interesting objc methods are ones with a body and such methods only
exist inside an ObjCImplDecl, deserialize and pass to consumer all the methods
of ObCImplDecl when we see one.

Fixes http://llvm.org/PR10922 & rdar://10117105.

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

13 years agoMake clang use Acquire loads and Release stores where necessary.
Eli Friedman [Tue, 13 Sep 2011 21:31:32 +0000 (21:31 +0000)]
Make clang use Acquire loads and Release stores where necessary.

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

13 years agoTurn off the generation of unaligned atomic load/store; I'm going to explicitly error...
Eli Friedman [Tue, 13 Sep 2011 20:48:30 +0000 (20:48 +0000)]
Turn off the generation of unaligned atomic load/store; I'm going to explicitly error out on such cases in the backend, at least for the moment.

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

13 years agoWhen building a module on-demand, clear out the "non-modular" language
Douglas Gregor [Tue, 13 Sep 2011 20:44:41 +0000 (20:44 +0000)]
When building a module on-demand, clear out the "non-modular" language
and preprocessor options (such as macro definitions) first.

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

13 years ago[libclang] Correct annotation and taking of cursor for objc class references
Argyrios Kyrtzidis [Tue, 13 Sep 2011 18:49:56 +0000 (18:49 +0000)]
[libclang] Correct annotation and taking of cursor for objc class references
inside the IBOutletCollection attribute.

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

13 years agoRename InterFace -> Interface, no functionality change.
Argyrios Kyrtzidis [Tue, 13 Sep 2011 18:49:52 +0000 (18:49 +0000)]
Rename InterFace -> Interface, no functionality change.

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

13 years agoA strong property of block type has "copy" setter semantics, not "retain".
John McCall [Tue, 13 Sep 2011 18:49:24 +0000 (18:49 +0000)]
A strong property of block type has "copy" setter semantics, not "retain".
This is consistent with the behavior of assigning into a __strong l-value,
and it's also necessary for ensuring that the ivar doesn't end up a dangling
reference.  We decided not to change the behavior of "retain" properties, but
just to make them warnings/errors when of block type.

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

13 years agoAdd the location of the interface reference to IBOutletCollectionAttr.
Argyrios Kyrtzidis [Tue, 13 Sep 2011 18:41:59 +0000 (18:41 +0000)]
Add the location of the interface reference to IBOutletCollectionAttr.
Depends on a llvm tablegen commit.

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

13 years agoRefactoring, mostly to give ObjCPropertyDecls stronger invariants for
John McCall [Tue, 13 Sep 2011 18:31:23 +0000 (18:31 +0000)]
Refactoring, mostly to give ObjCPropertyDecls stronger invariants for
their semantic attributes and then to take advantage of that.

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

13 years agoSwitch the serialization of LangOptions over to use the .def file. We
Douglas Gregor [Tue, 13 Sep 2011 18:26:39 +0000 (18:26 +0000)]
Switch the serialization of LangOptions over to use the .def file. We
should no longer have the serialization of LangOptions out of sync
with the structure itself (yay).

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

13 years agoThread safety: Initializing var before exhaustive switch statement to deal with extra...
Caitlin Sadowski [Tue, 13 Sep 2011 18:01:58 +0000 (18:01 +0000)]
Thread safety: Initializing var before exhaustive switch statement to deal with extraneous warning produced by gcc but not clang

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

13 years ago[libclang]
Argyrios Kyrtzidis [Tue, 13 Sep 2011 17:39:31 +0000 (17:39 +0000)]
[libclang]
-Allow cursor visitation of an attribute using its source range
-Add C++ 'final' and 'override' attributes as cursor kinds
-Simplify the logic that marks 'final' and 'override' attributes as tokens.

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

13 years agoSwitch LangOptions over to a .def file that describes header of the
Douglas Gregor [Tue, 13 Sep 2011 17:21:33 +0000 (17:21 +0000)]
Switch LangOptions over to a .def file that describes header of the
language options. Use that .def file to declare the LangOptions class
and initialize all of its members, eliminating a source of annoying
initialization bugs.

AST serialization changes are next up.

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

13 years ago[driver] Add follow up comment for r139551 to ensure the unused option is not
Chad Rosier [Tue, 13 Sep 2011 16:46:01 +0000 (16:46 +0000)]
[driver] Add follow up comment for r139551 to ensure the unused option is not
removed in the future.
rdar://10110352 and PR10908

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

13 years agoKeep the source range of attributes. Depends on a llvm tablegen commit.
Argyrios Kyrtzidis [Tue, 13 Sep 2011 16:05:58 +0000 (16:05 +0000)]
Keep the source range of attributes. Depends on a llvm tablegen commit.

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

13 years agoRecord the full source range of an attribute.
Argyrios Kyrtzidis [Tue, 13 Sep 2011 16:05:53 +0000 (16:05 +0000)]
Record the full source range of an attribute.

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

13 years agoAdd a struct-size check for modules when dealing with module-private fields
Douglas Gregor [Tue, 13 Sep 2011 15:37:05 +0000 (15:37 +0000)]
Add a struct-size check for modules when dealing with module-private fields

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

13 years agoIn Microsoft mode, downgrade "goto into protected scope" from error to warning if...
Francois Pichet [Tue, 13 Sep 2011 10:26:51 +0000 (10:26 +0000)]
In Microsoft mode, downgrade "goto into protected scope" from error to warning if we are jumping over a variable initialization via a goto.

This fixes a few errors when parsing MFC code with clang.

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

13 years agoSwitch -Wreturn-type to completely rely on the CFG model of no-return.
Chandler Carruth [Tue, 13 Sep 2011 09:53:58 +0000 (09:53 +0000)]
Switch -Wreturn-type to completely rely on the CFG model of no-return.
This deletes a bunch of crufty code, and allows more logic sharing
between the analyzer and the warnings.

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

13 years agoAdd a bit to the CFGBlock to track when it contains a no-return
Chandler Carruth [Tue, 13 Sep 2011 09:53:55 +0000 (09:53 +0000)]
Add a bit to the CFGBlock to track when it contains a no-return
CFGElement. This will allow greatly simplifying the logic in
-Wreturn-type.

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

13 years agoConsolidate the logic for building a no-return CFG block into a single
Chandler Carruth [Tue, 13 Sep 2011 09:13:49 +0000 (09:13 +0000)]
Consolidate the logic for building a no-return CFG block into a single
location with a single comment rather than scattering it in three
places.

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

13 years agoDon't use native atomics on ivars whose size is not a power of two,
John McCall [Tue, 13 Sep 2011 07:33:34 +0000 (07:33 +0000)]
Don't use native atomics on ivars whose size is not a power of two,
even on architectures that support unaligned access (which is the
only way this is otherwise legal, given that ivars apparently do
not honor alignment attributes).

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

13 years agoThis test seems pretty low-value.
John McCall [Tue, 13 Sep 2011 07:24:27 +0000 (07:24 +0000)]
This test seems pretty low-value.

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

13 years agoEnhance the CFG construction to detect no-return destructors for
Chandler Carruth [Tue, 13 Sep 2011 06:09:01 +0000 (06:09 +0000)]
Enhance the CFG construction to detect no-return destructors for
temporary objects and local variables. When detected, these split the
block, marking the new one as having only the exit block as a successor.
This prevents a large number of false positives in warnings sensitive to
no-return constructs such as -Wreturn-type, and fixes the remainder of
PR10063 along with several variations of this bug that had not been
reported. The test cases are extended across the board to cover these
patterns.

This also checks in a stress test for these types of CFGs. The stress
test declares some 32k variables, a mixture of no-return and normal
destructors. Previously, this resulted in roughly 2500 CFG blocks, but
didn't model any of the no-return destructors. With this patch, it
results in over 33k blocks, many of them now unreachable.

The nice thing about how the analyzer is set up? This causes *no*
regression in performance of building the CFG. It actually in some cases
makes it faster, as best I can benchmark. The analysis for -Wreturn-type
(and any other that cares about no-return code paths) is technically
slower now as it has to look at many more candidate blocks, but it
computes the correct answer. I have more test cases to follow, I think
they all work now. Also I have further work that should dramatically
simplify analyses in the presence of no-return.

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

13 years agoHandle reference properties correctly in the trivial-getter check.
John McCall [Tue, 13 Sep 2011 06:00:03 +0000 (06:00 +0000)]
Handle reference properties correctly in the trivial-getter check.

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

13 years agoAlways emit bitfield properties using expression behavior, even if they're
John McCall [Tue, 13 Sep 2011 05:36:29 +0000 (05:36 +0000)]
Always emit bitfield properties using expression behavior, even if they're
atomic.  This is probably something we should warn about.

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

13 years agoUnify the decision of how to emit property getters and setters into a
John McCall [Tue, 13 Sep 2011 03:34:09 +0000 (03:34 +0000)]
Unify the decision of how to emit property getters and setters into a
single code path.  Use atomic loads and stores where necessary.  Load and
store anything of the appropriate size and alignment with primitive
operations instead of going through the call.

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

13 years agoWhen compiling a module on-demand, re-use the diagnostics client
Douglas Gregor [Tue, 13 Sep 2011 01:26:44 +0000 (01:26 +0000)]
When compiling a module on-demand, re-use the diagnostics client
already provided. This required a little bit of clean-up in the way
that VerifyDiagnosticsClient managed ownership of its underlying
"primary" client, because now it will no longer always take ownership.

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

13 years agoWhen an import statement fails to find a module in the module cache,
Douglas Gregor [Mon, 12 Sep 2011 23:31:24 +0000 (23:31 +0000)]
When an import statement fails to find a module in the module cache,
but there is a corresponding umbrella header in a framework, build the
module on-the-fly so it can be immediately loaded at the import
statement. This is very much proof-of-concept code, with details to be
fleshed out over time.

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

13 years agoPrivatize the setter/getter call generation methods, plus some minor
John McCall [Mon, 12 Sep 2011 23:06:44 +0000 (23:06 +0000)]
Privatize the setter/getter call generation methods, plus some minor
modernization.  No functionality change.

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

13 years ago[driver] Ignore the '--' option, rather then fail. Do so to match gcc's
Chad Rosier [Mon, 12 Sep 2011 22:43:01 +0000 (22:43 +0000)]
[driver] Ignore the '--' option, rather then fail. Do so to match gcc's
behavior.
rdar://10110352 and PR10908

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

13 years ago[analyzer] CmpRuns can now optionally delete empty reports.
Anna Zaks [Mon, 12 Sep 2011 22:40:36 +0000 (22:40 +0000)]
[analyzer] CmpRuns can now optionally delete empty reports.

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

13 years agoThread safety: small formatting change
Caitlin Sadowski [Mon, 12 Sep 2011 22:28:41 +0000 (22:28 +0000)]
Thread safety: small formatting change

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

13 years ago[libclang] For getDeclFromExpr in CIndex.cpp, associate the decl of
Argyrios Kyrtzidis [Mon, 12 Sep 2011 22:17:26 +0000 (22:17 +0000)]
[libclang] For getDeclFromExpr in CIndex.cpp, associate the decl of
a DeclRefExpr, MemberExpr, etc. with a CastExpr if it is ImplicitCast,
since the implicit cast is the one that is invisible in source code.

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

13 years ago[analyzer] CmpRuns.cmpScanBuildResults() should be easy to call from other modules.
Anna Zaks [Mon, 12 Sep 2011 21:32:41 +0000 (21:32 +0000)]
[analyzer] CmpRuns.cmpScanBuildResults() should be easy to call from other modules.

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

13 years agoRename CmpRuns into CmpRuns.py so that it could be used as a module.
Anna Zaks [Mon, 12 Sep 2011 21:07:18 +0000 (21:07 +0000)]
Rename CmpRuns into CmpRuns.py so that it could be used as a module.

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

13 years agoIntroduce a cc1-level option to provide the path to the module cache,
Douglas Gregor [Mon, 12 Sep 2011 20:41:59 +0000 (20:41 +0000)]
Introduce a cc1-level option to provide the path to the module cache,
where the compiler will look for module files. Eliminates the
egregious hack where we looked into the header search paths for
modules.

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

13 years agoKill off an irrelevant FIXME
Douglas Gregor [Mon, 12 Sep 2011 18:58:37 +0000 (18:58 +0000)]
Kill off an irrelevant FIXME

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

13 years agoBy popular demand, enumerate all builtin types!
Devang Patel [Mon, 12 Sep 2011 18:50:21 +0000 (18:50 +0000)]
By popular demand, enumerate all builtin types!

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

13 years agoRefactor CheckAdditionOperands() to use early return for pointer addition.
Richard Trieu [Mon, 12 Sep 2011 18:37:54 +0000 (18:37 +0000)]
Refactor CheckAdditionOperands() to use early return for pointer addition.

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

13 years agoDiagnose attempt to mark function-local declarations as __module_private__.
Douglas Gregor [Mon, 12 Sep 2011 18:37:38 +0000 (18:37 +0000)]
Diagnose attempt to mark function-local declarations as __module_private__.

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

13 years ago[analyzer] Simplify the test, use generic/more descriptive names.
Anna Zaks [Mon, 12 Sep 2011 18:28:35 +0000 (18:28 +0000)]
[analyzer] Simplify the test, use generic/more descriptive names.

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

13 years agoAdd an assert so that new builtins do not sneak without proper debug info.
Devang Patel [Mon, 12 Sep 2011 18:24:46 +0000 (18:24 +0000)]
Add an assert so that new builtins do not sneak without proper debug info.

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

13 years agoUpdate test to fix windows buildbot.
Devang Patel [Mon, 12 Sep 2011 18:11:52 +0000 (18:11 +0000)]
Update test to fix windows buildbot.

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

13 years ago[libclang] In ASTUnit::Parse copy the CompilerInvocation object instead of
Argyrios Kyrtzidis [Mon, 12 Sep 2011 18:09:38 +0000 (18:09 +0000)]
[libclang] In ASTUnit::Parse copy the CompilerInvocation object instead of
modifying directly for the preamble.

This avoids an awful, hard to find, bug where "PreprocessorOpts.DisablePCHValidation = true"
would be persistent for subsequent reparses of the translation unit which would result
in defines, present in command-line but not in the PCH, being ignored.

Fixes rdar://9615399.

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

13 years ago[libclang] Make c-index-test check CINDEXTEST_REMAP_AFTER_TRIAL environment variable,
Argyrios Kyrtzidis [Mon, 12 Sep 2011 18:09:31 +0000 (18:09 +0000)]
[libclang] Make c-index-test check CINDEXTEST_REMAP_AFTER_TRIAL environment variable,
which when set it determines the trial number after which the remapping of files should
take effect.

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

13 years agoFix two comments from warn to emit error to match the actual diagnostic used.
Richard Trieu [Mon, 12 Sep 2011 18:08:02 +0000 (18:08 +0000)]
Fix two comments from warn to emit error to match the actual diagnostic used.

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

13 years ago[analyzer] Fix a failure encountered while analyzing bind (radar://10105448).
Anna Zaks [Mon, 12 Sep 2011 18:07:30 +0000 (18:07 +0000)]
[analyzer] Fix a failure encountered while analyzing bind (radar://10105448).

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

13 years agoDoxygen comments.
Anna Zaks [Mon, 12 Sep 2011 17:57:20 +0000 (17:57 +0000)]
Doxygen comments.

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

13 years ago[analyzer] Fix a new failure encountered while building Adium exposed as a result...
Anna Zaks [Mon, 12 Sep 2011 17:56:08 +0000 (17:56 +0000)]
[analyzer] Fix a new failure encountered while building Adium exposed as a result of r138196(radar://10087620). ObjectiveC property of type int has a value of type ObjCPropRef, which is a Loc.

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

13 years ago[analyzer] Test for -analyze-function on ObjectiveC to accompany r139439.
Anna Zaks [Mon, 12 Sep 2011 17:48:08 +0000 (17:48 +0000)]
[analyzer] Test for -analyze-function on ObjectiveC to accompany r139439.

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

13 years agoFix debug info encodings for char16_t and char32_t.
Devang Patel [Mon, 12 Sep 2011 17:11:58 +0000 (17:11 +0000)]
Fix debug info encodings for char16_t and char32_t.

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

13 years agoAllow __module_private__ on fields
Douglas Gregor [Mon, 12 Sep 2011 16:11:24 +0000 (16:11 +0000)]
Allow __module_private__ on fields

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

13 years agoRemove the restriction on module-private friends. Since the friend
Douglas Gregor [Mon, 12 Sep 2011 15:48:15 +0000 (15:48 +0000)]
Remove the restriction on module-private friends. Since the friend
declaration may be the first declaration, we want the ability to that
declaration to be marked module-private.

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

13 years agoOnly predefine the __EXCEPTIONS macro if C++ exceptions are turned on.
Douglas Gregor [Mon, 12 Sep 2011 15:17:19 +0000 (15:17 +0000)]
Only predefine the __EXCEPTIONS macro if C++ exceptions are turned on.
Only predefine the OBJC_ZEROCOST_EXCEPTIONS macro if Objective-C
exceptions are turned on. Fixes PR10910.

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

13 years agoSilence ?: precendence warning when parenthesis are present.
Hans Wennborg [Mon, 12 Sep 2011 12:07:30 +0000 (12:07 +0000)]
Silence ?: precendence warning when parenthesis are present.

Fixes PR10898. The warning should be silent when there are parenthesis
around the condition expression.

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

13 years agoSilence "end of non-void function" warnings with llvm_unreachable and add an assert.
Benjamin Kramer [Sat, 10 Sep 2011 21:52:04 +0000 (21:52 +0000)]
Silence "end of non-void function" warnings with llvm_unreachable and add an assert.

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

13 years agoobjc rewriter - more fixes to support compiling the rewritten
Fariborz Jahanian [Sat, 10 Sep 2011 17:01:56 +0000 (17:01 +0000)]
objc rewriter - more fixes to support compiling the rewritten
test case having instancetype. Fix in rewriter is unrelated to
using of instancetype. Test case uses other feature not yet
supported in the rewriter. There is more work to do, but this
is an ongoing task and not urgent at this time.

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

13 years agoremove pedantic ;
Chris Lattner [Sat, 10 Sep 2011 16:13:42 +0000 (16:13 +0000)]
remove pedantic ;

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

13 years agoModernize and comment; no functionality change.
John McCall [Sat, 10 Sep 2011 09:30:49 +0000 (09:30 +0000)]
Modernize and comment;  no functionality change.

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

13 years agoSimplify the generation of Objective-C setters, at least a little.
John McCall [Sat, 10 Sep 2011 09:17:20 +0000 (09:17 +0000)]
Simplify the generation of Objective-C setters, at least a little.
Use a more portable heuristic for deciding when to emit a single
atomic store;  it's possible that I've lost information here, but
I'm not sure how much of the logic before was intentionally arch-specific
and how much was just not quite consistent.

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

13 years agoRename the ARC cast kinds to start with "ARC".
John McCall [Sat, 10 Sep 2011 06:18:15 +0000 (06:18 +0000)]
Rename the ARC cast kinds to start with "ARC".

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

13 years agoCorrectly referring to the null pointer as 'null' not the macro 'NULL' in the boolean...
David Blaikie [Sat, 10 Sep 2011 05:47:59 +0000 (05:47 +0000)]
Correctly referring to the null pointer as 'null' not the macro 'NULL' in the boolean conversion diagnostic message.

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