]> granicus.if.org Git - clang/log
clang
13 years agoAdd top-level driver option '--serialize-diagnostics' for serialize compiler diagnost...
Ted Kremenek [Fri, 11 Nov 2011 00:07:43 +0000 (00:07 +0000)]
Add top-level driver option '--serialize-diagnostics' for serialize compiler diagnostics to a file.

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

13 years agoImplicit casts from rvalue to lvalue are not meaningful. Don't accidentally add
Richard Smith [Thu, 10 Nov 2011 23:32:36 +0000 (23:32 +0000)]
Implicit casts from rvalue to lvalue are not meaningful. Don't accidentally add
them when performing a const conversion on the implicit object argument for a
member operator call on an rvalue.

No change to the testsuite: the test for this change is that the added
assertion does not fire any more.

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

13 years ago[static analyzer]: only call RemoveDeadBindings() when analyzing non-Expr stmts,...
Ted Kremenek [Thu, 10 Nov 2011 23:26:10 +0000 (23:26 +0000)]
[static analyzer]: only call RemoveDeadBindings() when analyzing non-Expr stmts, entering a basic block, or analyzing non-consumed expressions.  This sigificantly speeds up analysis time, and reduces analysis time down to 27% less than before we linearized the CFG.

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

13 years agoAdd invariant.load metadata to loads from selector references. Allows these loads...
Pete Cooper [Thu, 10 Nov 2011 21:45:06 +0000 (21:45 +0000)]
Add invariant.load metadata to loads from selector references.  Allows these loads to later be moved/combined in the optimizer.  Fixes <rdar://problem/6027699>

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

13 years agoAdd missing dependency for shared library build to CMakeLists. Patch by Johannes...
Eli Friedman [Thu, 10 Nov 2011 20:07:09 +0000 (20:07 +0000)]
Add missing dependency for shared library build to CMakeLists.  Patch by Johannes Obermayr.

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

13 years agoRevert r144273. It causes clang self-host build failure.
Devang Patel [Thu, 10 Nov 2011 17:47:39 +0000 (17:47 +0000)]
Revert r144273. It causes clang self-host build failure.

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

13 years agoserialized diagnostics: simplify code.
Benjamin Kramer [Thu, 10 Nov 2011 11:29:20 +0000 (11:29 +0000)]
serialized diagnostics: simplify code.

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

13 years agoWhenever explicitly activating or deactivating a cleanup, we
John McCall [Thu, 10 Nov 2011 10:43:54 +0000 (10:43 +0000)]
Whenever explicitly activating or deactivating a cleanup, we
need to provide a 'dominating IP' which is guaranteed to
dominate the (de)activation point but which cannot be avoided
along any execution path from the (de)activation point to
the push-point of the cleanup.  Using the entry block is
bad mojo.

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

13 years agoinclude/clang/AST/APValue.h: Try to fix *900* of cast-qual warnings by g++.
NAKAMURA Takumi [Thu, 10 Nov 2011 10:08:04 +0000 (10:08 +0000)]
include/clang/AST/APValue.h: Try to fix *900* of cast-qual warnings by g++.

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

13 years agoc-index-test.c: Fix a comment style. /* It is C source. */
NAKAMURA Takumi [Thu, 10 Nov 2011 10:07:57 +0000 (10:07 +0000)]
c-index-test.c: Fix a comment style. /* It is C source. */

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

13 years agoConstant expression evaluation: support for constexpr member functions.
Richard Smith [Thu, 10 Nov 2011 09:31:24 +0000 (09:31 +0000)]
Constant expression evaluation: support for constexpr member functions.

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

13 years agoc-index-test.c: Fix syntax. It is C source.
NAKAMURA Takumi [Thu, 10 Nov 2011 09:30:15 +0000 (09:30 +0000)]
c-index-test.c: Fix syntax. It is C source.

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

13 years agoFix a subtle bug with cleanups: when activating
John McCall [Thu, 10 Nov 2011 09:22:44 +0000 (09:22 +0000)]
Fix a subtle bug with cleanups:  when activating
a previously-inactive cleanup, not only do we need a
flag variable, but we should also force the cleanup to
query the flag variable.  However, we only need to do
this when we're activating in a context that's
conditionally executed;  otherwise, we may safely
assume that the cleanup is dominated by the activation
point.

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

13 years agoPR11148: Fix crash-on-invalid if an invalid member declaration is marked as
Richard Smith [Thu, 10 Nov 2011 09:08:44 +0000 (09:08 +0000)]
PR11148: Fix crash-on-invalid if an invalid member declaration is marked as
defaulted or deleted.

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

13 years agoserialized diagnostics: implement full deserialization of clang diagnostics via the...
Ted Kremenek [Thu, 10 Nov 2011 08:43:12 +0000 (08:43 +0000)]
serialized diagnostics: implement full deserialization of clang diagnostics via the libclang API.

I've tested it on simple cases and it works.  Test cases to follow as well as a few tweaks.

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

13 years agoEnter the cleanups for a block outside the enclosing
John McCall [Thu, 10 Nov 2011 08:15:53 +0000 (08:15 +0000)]
Enter the cleanups for a block outside the enclosing
full-expression.  Naturally they're inactive before we enter
the block literal expression.  This restores the intended
behavior that blocks belong to their enclosing scope.

There's a useful -O0 / compile-time optimization that we're
missing here with activating cleanups following straight-line
code from their inactive beginnings.

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

13 years agoConstant expression evaluation: support for evaluation of structs and unions of
Richard Smith [Thu, 10 Nov 2011 06:34:14 +0000 (06:34 +0000)]
Constant expression evaluation: support for evaluation of structs and unions of
literal types, as well as derived-to-base casts for lvalues and
derived-to-virtual-base casts.

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

13 years agoRemoving unused initialization.
David Blaikie [Thu, 10 Nov 2011 05:42:04 +0000 (05:42 +0000)]
Removing unused initialization.

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

13 years agoThere's no good reason to track temporaries in ExprWithCleanups,
John McCall [Thu, 10 Nov 2011 05:35:25 +0000 (05:35 +0000)]
There's no good reason to track temporaries in ExprWithCleanups,
but it is sometimes useful to track blocks.  Do so.  Also
optimize the storage of these expressions.

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

13 years agoTemporary fix for a performance problem Eli spotted. The APValue representation
Richard Smith [Thu, 10 Nov 2011 03:30:42 +0000 (03:30 +0000)]
Temporary fix for a performance problem Eli spotted. The APValue representation
is currently too inefficient to allow us to use it for array initializers, but
fortunately we usually don't yet need to evaluate such initializers.

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

13 years agoReflow lines, remove else-if after returns, rename variable "TydefContext" to
Nick Lewycky [Thu, 10 Nov 2011 00:34:02 +0000 (00:34 +0000)]
Reflow lines, remove else-if after returns, rename variable "TydefContext" to
"TypedefContext". No functionality change.

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

13 years agoFix some additional x86 intrinsics to use "I" (ICE) markings. Fix *mmintrin.h to...
Eli Friedman [Thu, 10 Nov 2011 00:11:13 +0000 (00:11 +0000)]
Fix some additional x86 intrinsics to use "I" (ICE) markings.  Fix *mmintrin.h to take them into account.

<rdar://problem/10341145>

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

13 years agoFix the signature of __sigsetjmp and sigsetjmp. Patch by Dimitry Andric.
Rafael Espindola [Wed, 9 Nov 2011 22:46:10 +0000 (22:46 +0000)]
Fix the signature of __sigsetjmp and sigsetjmp. Patch by Dimitry Andric.

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

13 years agoRemove unnecessary include.
Devang Patel [Wed, 9 Nov 2011 21:08:24 +0000 (21:08 +0000)]
Remove unnecessary include.

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

13 years agoobjc rewriter: use a more specific name for local variable used
Fariborz Jahanian [Wed, 9 Nov 2011 17:41:43 +0000 (17:41 +0000)]
objc rewriter: use a more specific name for local variable used
in fast enumeration rewrite. // rdar://10415026

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

13 years agoWe don't add ExprWithCleanups to the CFG, and getSVal looks
John McCall [Wed, 9 Nov 2011 17:10:36 +0000 (17:10 +0000)]
We don't add ExprWithCleanups to the CFG, and getSVal looks
through it, so we should look through it for the live-values
analysis as well.

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

13 years agoDefine some built-ins macros on mips32 platform, from Simon Atanasyan!
Douglas Gregor [Wed, 9 Nov 2011 15:17:16 +0000 (15:17 +0000)]
Define some built-ins macros on mips32 platform, from Simon Atanasyan!

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

13 years agoUpdate test.
Benjamin Kramer [Wed, 9 Nov 2011 12:43:30 +0000 (12:43 +0000)]
Update test.

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

13 years agoTry to fix an issue on some hosts where the 'lib' in the builtin include
Chandler Carruth [Wed, 9 Nov 2011 08:26:57 +0000 (08:26 +0000)]
Try to fix an issue on some hosts where the 'lib' in the builtin include
path is actually a multilib.

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

13 years agoFixing 80 col violations (& removing any trailing whitespace on files I was touching...
David Blaikie [Wed, 9 Nov 2011 06:07:30 +0000 (06:07 +0000)]
Fixing 80 col violations (& removing any trailing whitespace on files I was touching anyway)

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

13 years agoFix 80 cols violations & remove trailing whitespace.
David Blaikie [Wed, 9 Nov 2011 05:30:24 +0000 (05:30 +0000)]
Fix 80 cols violations & remove trailing whitespace.

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

13 years agoReflow one line I missed in previous cleanup commit. No functionality change.
Nick Lewycky [Wed, 9 Nov 2011 04:27:23 +0000 (04:27 +0000)]
Reflow one line I missed in previous cleanup commit. No functionality change.

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

13 years agoMinor cleanup, mostly reindenting. Remove one helper function that just called
Nick Lewycky [Wed, 9 Nov 2011 04:25:21 +0000 (04:25 +0000)]
Minor cleanup, mostly reindenting. Remove one helper function that just called
the other helper functions, since we already differentiated the cases it was
testing between. No functionality change.

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

13 years agoFix an issue that Duncan discovered on a specific (no longer current)
Chandler Carruth [Wed, 9 Nov 2011 03:46:20 +0000 (03:46 +0000)]
Fix an issue that Duncan discovered on a specific (no longer current)
version of Ubuntu. It has a very broken multiarch configuration, and so
we need special logic to handle it correctly. Fixing and testing this
uncovered a few other trivial issues with the logic that are fixed as
well.

I added tests to cover this as it is hard to notice if you install
recent versions of the OS.

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

13 years agoEmit the copy and dipose helpers for ARC __strong
John McCall [Wed, 9 Nov 2011 03:17:26 +0000 (03:17 +0000)]
Emit the copy and dipose helpers for ARC __strong
block-typed __block variables using objc_retainBlock
and objc_dispose.  Previously we were using
_Block_object_assign and _Block_object_destroy
with BLOCK_BYREF_CALLER, which causes the runtime
to completely ignore the retain and release.
In most cases this doesn't cause catastrophe
because the retain/release are balanced and
because the block in the variable was copied
upon assignment there.  However, the stack
copy of the variable will be released when
it goes out of scope, which is a problem if
that value was released due to an assignment
to the heap copy.  Similarly, a leak can occur
if the variable is assigned after the copy to
the heap.

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

13 years agoWorkaround for compilers that don't implement C++ DR45, from Tom Honermann!
Douglas Gregor [Wed, 9 Nov 2011 03:05:27 +0000 (03:05 +0000)]
Workaround for compilers that don't implement C++ DR45, from Tom Honermann!

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

13 years agoPut ext_offsetof_extended_field_designator under the warning flag
Douglas Gregor [Wed, 9 Nov 2011 03:01:42 +0000 (03:01 +0000)]
Put ext_offsetof_extended_field_designator under the warning flag
-Wextended-offsetof, from Jeff Walden!

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

13 years agoDon't crash when transforming an ill-formed pseudo-destructor
Douglas Gregor [Wed, 9 Nov 2011 02:19:47 +0000 (02:19 +0000)]
Don't crash when transforming an ill-formed pseudo-destructor
expression. Fixes PR11339.

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

13 years agoExtract the blocks-related ARC tests into their own file.
John McCall [Wed, 9 Nov 2011 02:16:13 +0000 (02:16 +0000)]
Extract the blocks-related ARC tests into their own file.

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

13 years agoIntroduce proper spacing after the Objective-C parameter qualifiers
Douglas Gregor [Wed, 9 Nov 2011 02:13:45 +0000 (02:13 +0000)]
Introduce proper spacing after the Objective-C parameter qualifiers
(bycopy, inout, etc.). Fixes <rdar://problem/10402900>.

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

13 years agoConstant expression evaluation: support for default arguments.
Richard Smith [Wed, 9 Nov 2011 02:12:41 +0000 (02:12 +0000)]
Constant expression evaluation: support for default arguments.

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

13 years agoRemove extra ';'
Devang Patel [Wed, 9 Nov 2011 01:57:23 +0000 (01:57 +0000)]
Remove extra ';'

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

13 years ago[PCH] Fix reading from PCH of diagnostic pragmas.
Argyrios Kyrtzidis [Wed, 9 Nov 2011 01:24:17 +0000 (01:24 +0000)]
[PCH] Fix reading from PCH of diagnostic pragmas.

In certain cases ASTReader would call the normal DiagnosticsEngine API to initialize
the state of diagnostic pragmas but DiagnosticsEngine would try to compare source locations
leading to crash because the main FileID was not yet initialized.

Yet another case of the ASTReader trying to use the normal APIs and inadvertently breaking
invariants. Fix this by having the ASTReader set up the internal state directly.

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

13 years agoAdd "I" (ICE) annotations onto a few more x86 intrinsics.
Eli Friedman [Wed, 9 Nov 2011 01:08:43 +0000 (01:08 +0000)]
Add "I" (ICE) annotations onto a few more x86 intrinsics.

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

13 years agoDon't crash on invalid objc code.
Argyrios Kyrtzidis [Wed, 9 Nov 2011 00:22:48 +0000 (00:22 +0000)]
Don't crash on invalid objc code.

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

13 years ago[arcmt] Take into account that all properties are strong-by-default now and fix the...
Argyrios Kyrtzidis [Tue, 8 Nov 2011 23:09:34 +0000 (23:09 +0000)]
[arcmt] Take into account that all properties are strong-by-default now and fix the test.

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

13 years agoBind function "r-values" as l-values when emitting them as
John McCall [Tue, 8 Nov 2011 22:54:08 +0000 (22:54 +0000)]
Bind function "r-values" as l-values when emitting them as
opaque values.  Silly C type system.

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

13 years agoobjc: Don't crash on missing @interface decl.
Fariborz Jahanian [Tue, 8 Nov 2011 22:51:27 +0000 (22:51 +0000)]
objc: Don't crash on missing @interface decl.
// rdar://10415026

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

13 years ago[analyzer] Testing: test with all the non-experimental checker packages.
Anna Zaks [Tue, 8 Nov 2011 22:41:25 +0000 (22:41 +0000)]
[analyzer] Testing: test with all the non-experimental checker packages.

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

13 years ago[analyzer] Testing: support for regenerate reference output
Anna Zaks [Tue, 8 Nov 2011 22:41:22 +0000 (22:41 +0000)]
[analyzer] Testing: support for regenerate reference output

Change the flow of the SATestAdd so that it could be used for regenerating
the reference output without exiting with an error.

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

13 years ago[arcmt] Now that readonly properties are strong-by-default, do not add redundant...
Argyrios Kyrtzidis [Tue, 8 Nov 2011 22:10:58 +0000 (22:10 +0000)]
[arcmt] Now that readonly properties are strong-by-default, do not add redundant 'strong'.

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

13 years agoFix comment typos
Douglas Gregor [Tue, 8 Nov 2011 21:07:04 +0000 (21:07 +0000)]
Fix comment typos

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

13 years agoobjc-arc: 'readonly' property of retainable object
Fariborz Jahanian [Tue, 8 Nov 2011 20:58:53 +0000 (20:58 +0000)]
objc-arc: 'readonly' property of retainable object
type is strong by default too. // rdar://10410903

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

13 years agoSort contents of exports file. No functionality change.
Ted Kremenek [Tue, 8 Nov 2011 20:42:13 +0000 (20:42 +0000)]
Sort contents of exports file.  No functionality change.

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

13 years agoserialized diagnostics: serialize the version info in a separate meta block.
Ted Kremenek [Tue, 8 Nov 2011 20:27:29 +0000 (20:27 +0000)]
serialized diagnostics: serialize the version info in a separate meta block.

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

13 years ago[analyzer] Remove redundant check from DivZeroChecker
Anna Zaks [Tue, 8 Nov 2011 19:56:35 +0000 (19:56 +0000)]
[analyzer] Remove redundant check from DivZeroChecker

Analysis by Ted:
"
    if (stateZero && !stateNotZero) {

is checking to see if:

  (A)  "it is possible for the value to be zero"   (stateZero)

    AND

  (B) "it is not possible for the value to be non-zero"  (!stateNotZero)

That said, the only way for both B to be true AND A to be false is if the path is completely infeasible by the time we reach the divide-by-zero check.  For the most part (all cases?), such cases should automatically get pruned out at branches (i.e., an infeasible path gets dropped), which is the case in our tests.  So the question is whether or not such an infeasible path might not get dropped earlier?  I can't envision any right now.

Indeed, the rest of the checker assumes that if the bug condition didn't fire then 'stateNotZero' is non-NULL:

    C.addTransition(stateNotZero);
"

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

13 years ago[analyzer] Testing: Display the number of reported differences in the main log.
Anna Zaks [Tue, 8 Nov 2011 19:56:31 +0000 (19:56 +0000)]
[analyzer] Testing: Display the number of reported differences in the main log.

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

13 years agoThis test isn't portable to non-x86 platforms; specify a triple.
Eli Friedman [Tue, 8 Nov 2011 19:55:32 +0000 (19:55 +0000)]
This test isn't portable to non-x86 platforms; specify a triple.

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

13 years agoMark the overloaded atomic builtins as having custom type checking,
Douglas Gregor [Tue, 8 Nov 2011 19:45:38 +0000 (19:45 +0000)]
Mark the overloaded atomic builtins as having custom type checking,
which they do. This avoids all of the default argument promotions that
we (1) don't want, and (2) undo during that custom type checking, and
makes sure that we don't run into trouble during template
instantiation. Fixes PR11320.

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

13 years agoMisc fixes for clang driver on Mips Linux. Patch by Simon Atanasyan.
Eli Friedman [Tue, 8 Nov 2011 19:43:37 +0000 (19:43 +0000)]
Misc fixes for clang driver on Mips Linux.  Patch by Simon Atanasyan.

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

13 years agoFrom Vassil Vassilev: add checks for removing Decls for more use cases.
Axel Naumann [Tue, 8 Nov 2011 18:21:06 +0000 (18:21 +0000)]
From Vassil Vassilev: add checks for removing Decls for more use cases.

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

13 years agoAdd a default system include of '/include'. This isn't particularly
Chandler Carruth [Tue, 8 Nov 2011 17:19:47 +0000 (17:19 +0000)]
Add a default system include of '/include'. This isn't particularly
useful when using Clang as a system-compiler, but its harmless. When
using Clang as a cross-compiler, this can be very handy as quite a few
toolchains ship their libc headers here rather than under
'/usr/include'.

For reference, this is the beginning of my work to also make the Clang
driver more suitable as a cross-compiler.

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

13 years ago[arcmt] Now that properties are strong by default, avoid adding redundant '(strong)'
Argyrios Kyrtzidis [Tue, 8 Nov 2011 05:56:11 +0000 (05:56 +0000)]
[arcmt] Now that properties are strong by default, avoid adding redundant '(strong)'
property attribute.

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

13 years ago[arcmt] NSViewController does not support weak.
Argyrios Kyrtzidis [Tue, 8 Nov 2011 05:56:08 +0000 (05:56 +0000)]
[arcmt] NSViewController does not support weak.

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

13 years agoCheck pointer types for arguments of Neon load/store macros. rdar://9958031
Bob Wilson [Tue, 8 Nov 2011 05:04:11 +0000 (05:04 +0000)]
Check pointer types for arguments of Neon load/store macros. rdar://9958031

The Neon load/store intrinsics need to be implemented as macros to avoid
hiding alignment attributes on the pointer arguments, and the macros can
only evaluate those pointer arguments once (in case they have side effects),
so it has been hard to get the right type checking for those pointers.
I tried various alternatives in the arm_neon.h header, but it's much more
straightforward to just check directly in Sema.

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

13 years agoMisc fixes to pcmp*stri.
Eli Friedman [Tue, 8 Nov 2011 04:13:51 +0000 (04:13 +0000)]
Misc fixes to pcmp*stri.

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

13 years agoFix the layout of vb-tables and vf-tables in the MS C++ ABI.
John McCall [Tue, 8 Nov 2011 04:01:03 +0000 (04:01 +0000)]
Fix the layout of vb-tables and vf-tables in the MS C++ ABI.
Based on work by Dmitry Sokolov!

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

13 years agolib/CodeGen/CGBuiltin.cpp: Tweak the identifier "Type" to appease msvc.
NAKAMURA Takumi [Tue, 8 Nov 2011 03:27:04 +0000 (03:27 +0000)]
lib/CodeGen/CGBuiltin.cpp: Tweak the identifier "Type" to appease msvc.

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

13 years agoTypePrinter: print OpenCL address space names. Patch by Richard
Peter Collingbourne [Tue, 8 Nov 2011 02:52:58 +0000 (02:52 +0000)]
TypePrinter: print OpenCL address space names.  Patch by Richard
Membarth, test case by myself.

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

13 years agoDeclPrinter: print the declaration's storage class specifier as
Peter Collingbourne [Tue, 8 Nov 2011 02:52:52 +0000 (02:52 +0000)]
DeclPrinter: print the declaration's storage class specifier as
written, instead of the resolved storage class, which might not be
legal to specify on the declaration (such as out-of-line definitions
of static class members in C++, and __local variables in OpenCL).
Initial patch by Richard Membarth.

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

13 years agoSome tests missed from r144056.
Richard Smith [Tue, 8 Nov 2011 02:18:13 +0000 (02:18 +0000)]
Some tests missed from r144056.

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

13 years ago[arcmt] When we already removed a __weak, don't try to change it to __unsafe_unretained
Argyrios Kyrtzidis [Tue, 8 Nov 2011 02:02:38 +0000 (02:02 +0000)]
[arcmt] When we already removed a __weak, don't try to change it to __unsafe_unretained
later on, or we will end up with a redundant '__unsafe_unretained'.

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

13 years agoRevert r143972, which didn't actually compile under -Wnon-virtual-dtor.
Matt Beaumont-Gay [Tue, 8 Nov 2011 01:53:17 +0000 (01:53 +0000)]
Revert r143972, which didn't actually compile under -Wnon-virtual-dtor.

(TIL: -Wnon-virtual-dtor is not in -Wall.)

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

13 years agoFix a cluster of related issues involving value-dependence and constant
Richard Smith [Tue, 8 Nov 2011 01:31:09 +0000 (01:31 +0000)]
Fix a cluster of related issues involving value-dependence and constant
expression evaluation:
 - When folding a non-value-dependent expression, we may try to use the
   initializer of a value-dependent variable. If that happens, give up.
 - In C++98, actually check that a const, non-volatile DeclRefExpr inside an ICE
   is of integral or enumeration type (a reference isn't OK!)
 - In C++11, DeclRefExprs for objects of const literal type initialized with
   value-dependent expressions are themselves value-dependent.
 - So are references initialized with value-dependent expressions (though this
   case is missing from the C++11 standard, along with many others).

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

13 years agoClean up type flags for overloaded Neon builtins. No functional change.
Bob Wilson [Tue, 8 Nov 2011 01:16:11 +0000 (01:16 +0000)]
Clean up type flags for overloaded Neon builtins.  No functional change.

This patch just adds a simple NeonTypeFlags class to replace the various
hardcoded constants that had been used until now.  Unfortunately I couldn't
figure out a good way to avoid duplicating that class between clang and
TableGen, but since it's small and rarely changes, that's not so bad.

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

13 years ago[analyzer] Testing infrastructure: flush the output between projects.
Anna Zaks [Tue, 8 Nov 2011 00:27:56 +0000 (00:27 +0000)]
[analyzer] Testing infrastructure: flush the output between projects.

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

13 years agoThere are some crazy cases that LookupMethodInReceiverType
John McCall [Mon, 7 Nov 2011 22:49:50 +0000 (22:49 +0000)]
There are some crazy cases that LookupMethodInReceiverType
doesn't duplicate, but they all surface as implicit
properties.  It's also a useful optimization to not
duplicate the implicit getter lookup.  So, trust the
getter lookup that was already done in these cases.

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

13 years ago[analyzer] Make sure scan-build catches all clang failures.
Anna Zaks [Mon, 7 Nov 2011 22:38:10 +0000 (22:38 +0000)]
[analyzer] Make sure scan-build catches all clang failures.

scan-build ignores clang failures in some cases, which might lead to
silent failure suppression. For example, if clang command line
argument is wrong. (Addresses radar://10406598)

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

13 years agoconstexpr: static data members declared constexpr are required to have an
Richard Smith [Mon, 7 Nov 2011 22:16:17 +0000 (22:16 +0000)]
constexpr: static data members declared constexpr are required to have an
initializer; all other constexpr variables are merely required to be
initialized. In particular, a user-provided constexpr default constructor can be
used for such initialization.

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

13 years agoWhen we notice that a member function is defined with "= delete" or "=
Douglas Gregor [Mon, 7 Nov 2011 20:56:01 +0000 (20:56 +0000)]
When we notice that a member function is defined with "= delete" or "=
default", make a note of which is used when creating the
initial declaration. Previously, we would wait until later to handle
default/delete as a definition, but this is too late: when adding the
declaration, we already treated the declaration as "user-provided"
when in fact it was merely "user-declared".

Fixes PR10861 and PR10442, along with a bunch of FIXMEs.

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

13 years agoWhitespace.
Chad Rosier [Mon, 7 Nov 2011 19:52:29 +0000 (19:52 +0000)]
Whitespace.

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

13 years agoTablegenify -g options.
Chad Rosier [Mon, 7 Nov 2011 19:51:54 +0000 (19:51 +0000)]
Tablegenify -g options.

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

13 years agoRemove test with int128 printing since it breaks on some platforms.
Richard Trieu [Mon, 7 Nov 2011 19:30:35 +0000 (19:30 +0000)]
Remove test with int128 printing since it breaks on some platforms.

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

13 years agoAdd missing part of test
Douglas Gregor [Mon, 7 Nov 2011 18:54:12 +0000 (18:54 +0000)]
Add missing part of test

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

13 years agoASTConsumer::handleTopLevelDecl will end up getting called for
Douglas Gregor [Mon, 7 Nov 2011 18:53:57 +0000 (18:53 +0000)]
ASTConsumer::handleTopLevelDecl will end up getting called for
function template instantiations. Fixes <rdar://problem/10398005> / PR11312.

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

13 years ago[arcmt] Fix handling NSMakeCollectable inside an objc method.
Argyrios Kyrtzidis [Mon, 7 Nov 2011 18:46:50 +0000 (18:46 +0000)]
[arcmt] Fix handling NSMakeCollectable inside an objc method.

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

13 years ago[arcmt] In GC, handle (assign) @properties.
Argyrios Kyrtzidis [Mon, 7 Nov 2011 18:46:46 +0000 (18:46 +0000)]
[arcmt] In GC, handle (assign) @properties.

-Move __strong/__weak added to a property type to the property attribute,
e.g.  "@property (assign) __weak Foo *prop;" --> "@property (weak) Foo *prop;"

-Remove (assign) in a property so that it becomes strong-by-default in ARC.

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

13 years ago[arcmt] Map property decls to their GC attributes.
Argyrios Kyrtzidis [Mon, 7 Nov 2011 18:40:32 +0000 (18:40 +0000)]
[arcmt] Map property decls to their GC attributes.

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

13 years agoAdd support for printing integer literals of type short, unsigned short,
Richard Trieu [Mon, 7 Nov 2011 18:40:31 +0000 (18:40 +0000)]
Add support for printing integer literals of type short, unsigned short,
__int128_t and __uint128_t.  Short and unsigned short integer literals support
is only to work around a crasher as reported in PR11179 and will be removed
once Clang no longer builds short integer literals.

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

13 years ago[arcmt] In GC, change '__weak' -> '__unsafe_unretained' when applied
Argyrios Kyrtzidis [Mon, 7 Nov 2011 18:40:29 +0000 (18:40 +0000)]
[arcmt] In GC, change '__weak' -> '__unsafe_unretained' when applied
to objects of classes that don't support ARC weak

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

13 years agoWhen applying ARC __weak to a non-objc pointer, do not give error that
Argyrios Kyrtzidis [Mon, 7 Nov 2011 18:40:21 +0000 (18:40 +0000)]
When applying ARC __weak to a non-objc pointer, do not give error that
__weak is unsupported by the deployment target, since it is going to be
ignored anyway.

Makes it easier for incremental migration from GC.

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

13 years agoBetter fix for -Wnon-virtual-dtor
Matt Beaumont-Gay [Mon, 7 Nov 2011 18:30:47 +0000 (18:30 +0000)]
Better fix for -Wnon-virtual-dtor

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

13 years agoRemove duplicate listings for core.DivideZero
Matt Beaumont-Gay [Mon, 7 Nov 2011 18:00:03 +0000 (18:00 +0000)]
Remove duplicate listings for core.DivideZero

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

13 years agoDrastically simplify the mapping from the declaration corresponding to
Douglas Gregor [Mon, 7 Nov 2011 17:43:18 +0000 (17:43 +0000)]
Drastically simplify the mapping from the declaration corresponding to
the injected-class-name of a class (or class template) to the
declaration that results from substituting the given template
arguments. Previously, we would actually perform a substitution into
the injected-class-name type and then retrieve the resulting
declaration. However, in certain, rare circumstances involving
deeply-nested member templates, we would get the wrong substitution
arguments.

This new approach just matches up the declaration with a declaration
that's part of the current context (or one of its parents), which will
either be an instantiation (during template instantiation) or the
declaration itself (during the definition of the template). This is
both more efficient (we're avoiding a substitution) and more correct
(we can't get the template arguments wrong in the member-template
case).

Fixes <rdar://problem/9676205>.

Reinstated, now that we have the fix in r143967.

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

13 years agoTighten up the conditions under which we consider ourselves to be
Douglas Gregor [Mon, 7 Nov 2011 17:33:42 +0000 (17:33 +0000)]
Tighten up the conditions under which we consider ourselves to be
entering the context of a nested-name-specifier. Fixes
<rdar://problem/10397846>.

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

13 years agoAppease -Wnon-virtual-dtor
Matt Beaumont-Gay [Mon, 7 Nov 2011 17:16:31 +0000 (17:16 +0000)]
Appease -Wnon-virtual-dtor

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

13 years agoFix an unsafe use of Twine.
Benjamin Kramer [Mon, 7 Nov 2011 16:02:25 +0000 (16:02 +0000)]
Fix an unsafe use of Twine.

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

13 years agoConstant expression evaluation: support for arrays.
Richard Smith [Mon, 7 Nov 2011 09:22:26 +0000 (09:22 +0000)]
Constant expression evaluation: support for arrays.

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

13 years agoRip out one of the features I added for the driver-include-management.
Chandler Carruth [Mon, 7 Nov 2011 09:17:31 +0000 (09:17 +0000)]
Rip out one of the features I added for the driver-include-management.
We don't actually need a separate flag for non-sysrooted paths as the
driver has to manage the sysroot anyways. The driver is not infrequently
adding paths to the header search based on their existence on the
filesystem. For that, it has to add the sysroot anyways, we should pass
it on down to CC1 already joined. More importantly, the driver cannot in
all cases distinguish between sysrooted paths and paths that are
relative to the Clang binary's installation directory. Essentially, we
always need to ignore the system root for these internal header search
options. It turns out in most of the places we were already providing
the system root in the driver, and then another one in CC1 so this fixes
several bugs.

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

13 years agoFix Linux libc++ usage. Somehow this slipped through during the port.
Chandler Carruth [Mon, 7 Nov 2011 09:01:17 +0000 (09:01 +0000)]
Fix Linux libc++ usage. Somehow this slipped through during the port.

Test cases for this and all the rest of the port are still in the works,
but will wait for a fixed computer and post 3.0 merging...

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