]> granicus.if.org Git - clang/log
clang
13 years agoPass -fmodule-cache-path along to -cc1 properly
Douglas Gregor [Sat, 17 Sep 2011 02:20:28 +0000 (02:20 +0000)]
Pass -fmodule-cache-path along to -cc1 properly

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

13 years agoWith modules, we can end up loading a new module after we've seen an
Douglas Gregor [Sat, 17 Sep 2011 00:05:03 +0000 (00:05 +0000)]
With modules, we can end up loading a new module after we've seen an
arbitrary amount of code. This forces us to stage the AST writer more
strictly, ensuring that we don't assign a declaration ID to a
declaration until after we're certain that no more modules will get
loaded.

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

13 years agoIn Microsoft mode, warn if an indirect goto jump over a variable initialization.
Francois Pichet [Fri, 16 Sep 2011 23:15:32 +0000 (23:15 +0000)]
In Microsoft mode, warn if an indirect goto jump over a variable initialization.
Also add a test case for the non Microsoft case because such test didn't exist.

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

13 years agoFix massive LiveVariables regression (due to LiveVariables rewrite) by addressing...
Ted Kremenek [Fri, 16 Sep 2011 23:01:39 +0000 (23:01 +0000)]
Fix massive LiveVariables regression (due to LiveVariables rewrite) by addressing two performance problems:

- Speed of "merge()", which merged data flow facts.  This was doing a set canonicalization on every insertion, which was super slow.
  To fix this, we use ImmutableSetRef.

- Visit CFGBlocks in reverse postorder.  This is a huge speedup, as on some test cases the algorithm would take many iterations
  to converge.

This contains a bunch of copy-paste from UninitializedValues.cpp and ThreadSafety.cpp.  The idea
was to get something working first, and then refactor the common logic for all three files into
a separate analysis/library entry point.

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

13 years agoFix search paths for Ubuntu 11.04 x86. Patch by Stepan Dyatkovskiy.
Eli Friedman [Fri, 16 Sep 2011 21:04:38 +0000 (21:04 +0000)]
Fix search paths for Ubuntu 11.04 x86.  Patch by Stepan Dyatkovskiy.

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

13 years ago[analyzer] Refactor: make PathDiagnosticLocation responsible for validation of Source...
Anna Zaks [Fri, 16 Sep 2011 19:18:30 +0000 (19:18 +0000)]
[analyzer] Refactor: make PathDiagnosticLocation responsible for validation of SourceLocations (commit 5 of ?):
 - Get rid of PathDiagnosticLocation(SourceRange r,..) constructor by providing a bunch of create methods.
 - The PathDiagnosticLocation(SourceLocation L,..), which is used by crate methods, will eventually become private.
 - Test difference is in the case when the report starts at the beginning of the function. We used to represent that point as a range of the very first token in the first statement. Now, it's just a single location representing the first character of the first statement.

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

13 years agotest/CodeGen/sse-builtins.c: Make this host-independent to unbreak posix-unlike hosts.
NAKAMURA Takumi [Fri, 16 Sep 2011 03:55:36 +0000 (03:55 +0000)]
test/CodeGen/sse-builtins.c: Make this host-independent to unbreak posix-unlike hosts.

Without -ffreestanding, clang tries to seek /usr/include/stdlib.h in host filesystem, even on Windows hosts.

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

13 years agoMoves calls of checkArithmeticNull() from CreateBuiltinBinOp() into the individual...
Richard Trieu [Fri, 16 Sep 2011 00:53:10 +0000 (00:53 +0000)]
Moves calls of checkArithmeticNull() from CreateBuiltinBinOp() into the individual Check*Operands() functions.

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

13 years agoThread safety: Adding FIXMEs and a couple cleanups
Caitlin Sadowski [Fri, 16 Sep 2011 00:35:54 +0000 (00:35 +0000)]
Thread safety: Adding FIXMEs and a couple cleanups

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

13 years agoTweak the module auto-import heuristics a bit
Douglas Gregor [Fri, 16 Sep 2011 00:22:46 +0000 (00:22 +0000)]
Tweak the module auto-import heuristics a bit

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

13 years agoRemove no longer needed LHSType and RHSType from checkArithmeticNull()
Richard Trieu [Thu, 15 Sep 2011 23:57:21 +0000 (23:57 +0000)]
Remove no longer needed LHSType and RHSType from checkArithmeticNull()

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

13 years agoChange checkArithmeticNull() to use a NonNullType, instead of checking both the
Richard Trieu [Thu, 15 Sep 2011 23:51:29 +0000 (23:51 +0000)]
Change checkArithmeticNull() to use a NonNullType, instead of checking both the
LHSType and RHSType for everything.

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

13 years agoRemove standard library includes from test; they explode on Windows.
Eli Friedman [Thu, 15 Sep 2011 23:24:35 +0000 (23:24 +0000)]
Remove standard library includes from test; they explode on Windows.

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

13 years agoTweak *mmintrin.h so that they don't make any bad assumptions about alignment (which...
Eli Friedman [Thu, 15 Sep 2011 23:15:27 +0000 (23:15 +0000)]
Tweak *mmintrin.h so that they don't make any bad assumptions about alignment (which probably has little effect in practice, but better to get it right).  Make the load in _mm_loadh_pi and _mm_loadl_pi a single LLVM IR instruction to make optimizing easier for CodeGen.

rdar://10054986

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

13 years agoAdd an experimental flag -fauto-module-import that automatically turns
Douglas Gregor [Thu, 15 Sep 2011 22:00:41 +0000 (22:00 +0000)]
Add an experimental flag -fauto-module-import that automatically turns
#include or #import direcctives of framework headers into module
imports of the corresponding framework module.

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

13 years agoFinish the lex->LHS and rex->RHS cleanup in Sema.
Richard Trieu [Thu, 15 Sep 2011 21:56:47 +0000 (21:56 +0000)]
Finish the lex->LHS and rex->RHS cleanup in Sema.

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

13 years agoAdd test case for mutually recursive modules
Douglas Gregor [Thu, 15 Sep 2011 20:54:06 +0000 (20:54 +0000)]
Add test case for mutually recursive modules

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

13 years agoComment what's going on when we compile a module
Douglas Gregor [Thu, 15 Sep 2011 20:53:28 +0000 (20:53 +0000)]
Comment what's going on when we compile a module

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

13 years agoreverse patch in r139818 to focus on 'self'
Fariborz Jahanian [Thu, 15 Sep 2011 20:40:18 +0000 (20:40 +0000)]
reverse patch in r139818 to focus on 'self'
instead of 'Class'.

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

13 years agoDetect cyclic module dependencies in a manner that is rather more
Douglas Gregor [Thu, 15 Sep 2011 20:40:10 +0000 (20:40 +0000)]
Detect cyclic module dependencies in a manner that is rather more
graceful than running out of stack space.

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

13 years ago[analyzer] Refactor: make PathDiagnosticLocation responsible for validation of Source...
Anna Zaks [Thu, 15 Sep 2011 20:06:34 +0000 (20:06 +0000)]
[analyzer] Refactor: make PathDiagnosticLocation responsible for validation of SourceLocations (commit 4 of ?):
 - The closing brace is always a single location, not a range.
 - The test case previously had a location key 57:1 followed by a range [57:1 - 57:1].

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

13 years agoEliminate the list of modules from the preprocessor options. This was
Douglas Gregor [Thu, 15 Sep 2011 19:48:59 +0000 (19:48 +0000)]
Eliminate the list of modules from the preprocessor options. This was
used back when we had an -import-module command-line option, but it's
no longer used (or useful).

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

13 years agoEliminate the unused -create-module cc1-level option
Douglas Gregor [Thu, 15 Sep 2011 19:45:56 +0000 (19:45 +0000)]
Eliminate the unused -create-module cc1-level option

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

13 years agoRefactor the load of the exception pointer and the exception selector from their
Bill Wendling [Thu, 15 Sep 2011 18:57:19 +0000 (18:57 +0000)]
Refactor the load of the exception pointer and the exception selector from their
storage slot into helper functions.

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

13 years ago[analyzer] Refactor: make PathDiagnosticLocation responsible for validation of Source...
Anna Zaks [Thu, 15 Sep 2011 18:56:07 +0000 (18:56 +0000)]
[analyzer] Refactor: make PathDiagnosticLocation responsible for validation of SourceLocations (commit 2 of ?):
- Fix a fixme and move the logic of creating a PathDiagnosticLocation corresponding to a ProgramPoint into a PathDiagnosticLocation constructor.
- Rename PathDiagnosticLocation::create to differentiate from the added constructor.

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

13 years agoWhen we load the first module, make sure that we wire up the ASTConsumer to the newly...
Douglas Gregor [Thu, 15 Sep 2011 18:47:32 +0000 (18:47 +0000)]
When we load the first module, make sure that we wire up the ASTConsumer to the newly-created ASTReader. This makes sure that CodeGen sees the declarations it is interested in

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

13 years agoObjective-c: Conversion from type Class to any root class type is allowed
Fariborz Jahanian [Thu, 15 Sep 2011 18:30:22 +0000 (18:30 +0000)]
Objective-c: Conversion from type Class to any root class type is allowed
in class methods with no warning. //rdar://10109725

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

13 years agoThread safety: changing naming in error messages based on reviewer comments
Caitlin Sadowski [Thu, 15 Sep 2011 18:13:32 +0000 (18:13 +0000)]
Thread safety: changing naming in error messages based on reviewer comments

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

13 years agoThread safety: test cases originally from gcc annotalysis branch. We are
Caitlin Sadowski [Thu, 15 Sep 2011 18:07:32 +0000 (18:07 +0000)]
Thread safety: test cases originally from gcc annotalysis branch. We are
relicensing them under the license for llvm.

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

13 years ago[PCH] Overhaul how preprocessed entities are [de]serialized.
Argyrios Kyrtzidis [Thu, 15 Sep 2011 18:02:56 +0000 (18:02 +0000)]
[PCH] Overhaul how preprocessed entities are [de]serialized.

-Use an array of offsets for all preprocessed entities
-Get rid of the separate array of offsets for just macro definitions;
 for references to macro definitions use an index inside the preprocessed
 entities array.
-Deserialize each preprocessed entity lazily, at first request; not in bulk.

Paves the way for binary searching of preprocessed entities that will offer
efficiency and will simplify things on the libclang side a lot.

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

13 years agoThread safety: cleaning up FIXME for trylocks
Caitlin Sadowski [Thu, 15 Sep 2011 17:50:19 +0000 (17:50 +0000)]
Thread safety: cleaning up FIXME for trylocks

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

13 years agoThread safety: completeing the implementation of shared/exclusive locks required...
Caitlin Sadowski [Thu, 15 Sep 2011 17:43:08 +0000 (17:43 +0000)]
Thread safety: completeing the implementation of shared/exclusive locks required attributes

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

13 years agoThread safety: refactoring various out of scope warnings to use the same inteface...
Caitlin Sadowski [Thu, 15 Sep 2011 17:25:19 +0000 (17:25 +0000)]
Thread safety: refactoring various out of scope warnings to use the same inteface. This eliminates a lot of unnecessary duplicated code.

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

13 years agoTeach LangOptions::resetNonModularOptions to actually do what it says it does
Douglas Gregor [Thu, 15 Sep 2011 14:56:27 +0000 (14:56 +0000)]
Teach LangOptions::resetNonModularOptions to actually do what it says it does

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

13 years agoPTX: Define target options
Justin Holewinski [Thu, 15 Sep 2011 12:13:38 +0000 (12:13 +0000)]
PTX: Define target options

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

13 years agoRewrite this loop to use partial destruction; I'm not sure it's
John McCall [Thu, 15 Sep 2011 06:49:18 +0000 (06:49 +0000)]
Rewrite this loop to use partial destruction;  I'm not sure it's
possible for that to matter right now, but eventually I think we'll
need to unify this better, and then it might.  Also, use a more
efficient looping structure.

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

13 years agoSorry, that assertion actually already exists.
John McCall [Thu, 15 Sep 2011 01:55:23 +0000 (01:55 +0000)]
Sorry, that assertion actually already exists.

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

13 years agoWe don't generate null initializer expressions anymore, and
John McCall [Thu, 15 Sep 2011 01:54:21 +0000 (01:54 +0000)]
We don't generate null initializer expressions anymore, and
we don't need to.

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

13 years ago[analyzer] Refactor: make PathDiagnosticLocation responsible for validation of Source...
Anna Zaks [Thu, 15 Sep 2011 01:08:34 +0000 (01:08 +0000)]
[analyzer] Refactor: make PathDiagnosticLocation responsible for validation of SourceLocations (commit 2 of ?):
- Modify all PathDiagnosticLocation constructors that take Stmt to also requre LocationContext.
- Add a constructor which should be used in case there is no valid statement/location (it will grab the location of the enclosing function).

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

13 years agoEmit debug info for c++0x nullptr.
Devang Patel [Wed, 14 Sep 2011 23:14:14 +0000 (23:14 +0000)]
Emit debug info for c++0x nullptr.

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

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