]> granicus.if.org Git - clang/log
clang
12 years ago[analyzer diagnostics] Refactor filtration for PathDiagnosticConsumers that don't...
Ted Kremenek [Tue, 28 Feb 2012 23:27:39 +0000 (23:27 +0000)]
[analyzer diagnostics] Refactor filtration for PathDiagnosticConsumers that don't support cross-file diagnostics
into a common place.  Currently enable this filtration for Plist diagnostics as well.

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

12 years ago[analyzer diagnostics] start prototyping stripping PathDiagnostics of unnecessary...
Ted Kremenek [Tue, 28 Feb 2012 23:06:21 +0000 (23:06 +0000)]
[analyzer diagnostics] start prototyping stripping PathDiagnostics of unnecessary cruft caused by path inlining.

This introduces a concept of a "prunable" PathDiagnosticEvent.  Currently this is a flag, but
we may evolve the concept to make this more dynamically inferred.

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

12 years agoModern objective-c translator. rewriting ivars of aggregate type.
Fariborz Jahanian [Tue, 28 Feb 2012 22:45:07 +0000 (22:45 +0000)]
Modern objective-c translator. rewriting ivars of aggregate type.

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

12 years ago[analyzer] Leaks should be uniqued by the allocation point in the
Anna Zaks [Tue, 28 Feb 2012 22:39:22 +0000 (22:39 +0000)]
[analyzer] Leaks should be uniqued by the allocation point in the
closest function context (RetainCountChecker).

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

12 years agoPrefer bitcast+GEP over ptrtoint+sub+inttoptr: it's semantically equivalent here...
Eli Friedman [Tue, 28 Feb 2012 22:07:56 +0000 (22:07 +0000)]
Prefer bitcast+GEP over ptrtoint+sub+inttoptr: it's semantically equivalent here, and generally nicer to the optimizer.

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

12 years ago[analyzer] Retain release: drop the line number info from the leak
Anna Zaks [Tue, 28 Feb 2012 21:49:08 +0000 (21:49 +0000)]
[analyzer] Retain release: drop the line number info from the leak
message.

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

12 years ago[analyzer] Stats: Add the stats about remove dead bindings, correct the
Anna Zaks [Tue, 28 Feb 2012 21:49:04 +0000 (21:49 +0000)]
[analyzer] Stats: Add the stats about remove dead bindings, correct the
test.

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

12 years ago[driver] Add support for -g2 and -ggdb debug flags.
Chad Rosier [Tue, 28 Feb 2012 20:49:04 +0000 (20:49 +0000)]
[driver] Add support for -g2 and -ggdb debug flags.
rdar://10947759

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

12 years agoAdd -lm by default on Solaris.
David Chisnall [Tue, 28 Feb 2012 20:06:45 +0000 (20:06 +0000)]
Add -lm by default on Solaris.

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

12 years agoIt turns out -fno-cxa-atexit just produces broken code, so disable it on Solaris...
David Chisnall [Tue, 28 Feb 2012 19:15:06 +0000 (19:15 +0000)]
It turns out -fno-cxa-atexit just produces broken code, so disable it on Solaris and we'll ship a __cxa_atexit implementation...

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

12 years agoUn-break clang based on r151638 - What was meant to be a trivial variable name change...
James Molloy [Tue, 28 Feb 2012 18:23:49 +0000 (18:23 +0000)]
Un-break clang based on r151638 - What was meant to be a trivial variable name change went horribly wrong and I forgot to retest afterwards.

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

12 years agoCorrectly track tags and enum members defined in the prototype of a function, and...
James Molloy [Tue, 28 Feb 2012 18:12:11 +0000 (18:12 +0000)]
Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped.

This fixes code such as:

enum e {x, y};
int f(enum {y, x} n) {
  return 0;
}

This finally fixes PR5464 and PR5477.

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

12 years ago[AST] When we @synthesize a property with a user-defined ivar name,
Argyrios Kyrtzidis [Tue, 28 Feb 2012 17:50:39 +0000 (17:50 +0000)]
[AST] When we @synthesize a property with a user-defined ivar name,
make sure to record the source location of the ivar name.
[libclang] When indexing @synthesized objc methods, report the @implementation
as the lexical container.

Fixes rdar://10905472

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

12 years ago[libclang] When indexing an objc property, also provide information about
Argyrios Kyrtzidis [Tue, 28 Feb 2012 17:50:33 +0000 (17:50 +0000)]
[libclang] When indexing an objc property, also provide information about
the getter/setter objc method entities that the property is associated with.

rdar://10244558

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

12 years ago[AST] Associate the getter/setter methods to a property of a objc class extension.
Argyrios Kyrtzidis [Tue, 28 Feb 2012 17:50:28 +0000 (17:50 +0000)]
[AST] Associate the getter/setter methods to a property of a objc class extension.
[libclang] Index the getter/setter methods of a property of a objc class extension.

Fixes rdar://10907597

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

12 years agoSome more Solaris fixes. Now successfully building libc++ on Solaris with clang...
David Chisnall [Tue, 28 Feb 2012 17:10:04 +0000 (17:10 +0000)]
Some more Solaris fixes.  Now successfully building libc++ on Solaris with clang (and linking clang against it).

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

12 years agoRemove stray semi-colons.
Daniel Dunbar [Tue, 28 Feb 2012 15:36:15 +0000 (15:36 +0000)]
Remove stray semi-colons.

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

12 years agoBasic coverage test for conversion-to-block-pointer for lambda expressions.
Eli Friedman [Tue, 28 Feb 2012 03:32:48 +0000 (03:32 +0000)]
Basic coverage test for conversion-to-block-pointer for lambda expressions.

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

12 years ago[analyzer] Leaks should be uniqued by the allocation point in the
Anna Zaks [Tue, 28 Feb 2012 03:07:06 +0000 (03:07 +0000)]
[analyzer] Leaks should be uniqued by the allocation point in the
closest function context (Keychain API).

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

12 years ago[analyzer] Fix Malloc False Positive (PR 12100)
Anna Zaks [Tue, 28 Feb 2012 01:54:22 +0000 (01:54 +0000)]
[analyzer] Fix Malloc False Positive (PR 12100)

When allocated buffer is passed to CF/NS..NoCopy functions, the
ownership is transfered unless the deallocator argument is set to
'kCFAllocatorNull'.

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

12 years agoImplement IRGen for the retain-autorelease in the lambda conversion-to-block-pointer...
Eli Friedman [Tue, 28 Feb 2012 01:08:45 +0000 (01:08 +0000)]
Implement IRGen for the retain-autorelease in the lambda conversion-to-block-pointer outside of ARC.  Testcases coming up soon.

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

12 years ago[analyzer] teach analyzer about ObjC literals, thus trimming out a false positive...
Ted Kremenek [Tue, 28 Feb 2012 00:56:05 +0000 (00:56 +0000)]
[analyzer] teach analyzer about ObjC literals, thus trimming out a false positive with the malloc() checker involving
comparing literal addresses to nil.

Fixes <rdar://problem/10579586>

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

12 years agoRe-enable the Darwin ARM integrated assembler.
Jim Grosbach [Mon, 27 Feb 2012 23:55:25 +0000 (23:55 +0000)]
Re-enable the Darwin ARM integrated assembler.

All known nightly-test failures are fixed.

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

12 years ago[analyzer] Leaks should be uniqued by the allocation point in the
Anna Zaks [Mon, 27 Feb 2012 23:40:55 +0000 (23:40 +0000)]
[analyzer] Leaks should be uniqued by the allocation point in the
closest function context.

This prevents us from uniqueing all leaks from the same allocation
helper. radar://10932226

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

12 years agoFix a test case that was added in r151570. The redirect of output was broken
Richard Trieu [Mon, 27 Feb 2012 23:40:41 +0000 (23:40 +0000)]
Fix a test case that was added in r151570.  The redirect of output was broken
so no testing was actually done.  Further, the commands produce no output.
The redirection has been fixed and the test has been disabled.

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

12 years ago[analyzer] Don't generate an explicit ExplodedNode for StringLiterals; have the SVal...
Ted Kremenek [Mon, 27 Feb 2012 23:34:19 +0000 (23:34 +0000)]
[analyzer] Don't generate an explicit ExplodedNode for StringLiterals; have the SVal lazily generated from Environment::getSVal().

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

12 years agoHack in a loud error for PR12086. Better than a silent miscompile.
Sebastian Redl [Mon, 27 Feb 2012 23:20:01 +0000 (23:20 +0000)]
Hack in a loud error for PR12086. Better than a silent miscompile.

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

12 years agoWhen evaluating integer expressions include a check for sub-expressions
Argyrios Kyrtzidis [Mon, 27 Feb 2012 23:18:37 +0000 (23:18 +0000)]
When evaluating integer expressions include a check for sub-expressions
depth and error if we exceed a max value, to make sure we avoid a stack overflow.

This is a hacky temporary fix. rdar://10913206.

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

12 years agoAfter numerous requests, have Objective-C 'method declared here' notes mention the...
Ted Kremenek [Mon, 27 Feb 2012 22:55:11 +0000 (22:55 +0000)]
After numerous requests, have Objective-C 'method declared here' notes mention the actual method.  This looks better within an IDE, where text isn't always regurgitated in the presentation of a warning.  Fixes radar 10914035.

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

12 years agoImplement a FIXME for conversion sequence distinction. Should fix PR12092.
Sebastian Redl [Mon, 27 Feb 2012 22:38:26 +0000 (22:38 +0000)]
Implement a FIXME for conversion sequence distinction. Should fix PR12092.

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

12 years agoFix documentation typo.
Ted Kremenek [Mon, 27 Feb 2012 21:40:10 +0000 (21:40 +0000)]
Fix documentation typo.

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

12 years ago[analyzer] Add -analyzer-stats, which hooks up LLVM stats tracking.
Anna Zaks [Mon, 27 Feb 2012 21:33:16 +0000 (21:33 +0000)]
[analyzer] Add -analyzer-stats, which hooks up LLVM stats tracking.

As in http://llvm.org/docs/ProgrammersManual.html#Statistic

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

12 years agoFix a couple bugs in the way we handle array indexes in array bounds checking. Speci...
Eli Friedman [Mon, 27 Feb 2012 21:21:40 +0000 (21:21 +0000)]
Fix a couple bugs in the way we handle array indexes in array bounds checking.  Specifically, make sure we don't ignore explicit casts in indexes, and make sure we use unsigned extension/comparisons on indexes.  Fixes <rdar://problem/10916006>.

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

12 years agoMove "clang/Analysis/Support/SaveAndRestore.h" to "llvm/ADT/SaveAndRestore.h"
Argyrios Kyrtzidis [Mon, 27 Feb 2012 21:09:45 +0000 (21:09 +0000)]
Move "clang/Analysis/Support/SaveAndRestore.h" to "llvm/ADT/SaveAndRestore.h"
to make it more widely available.

Depends on llvm commit r151564

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

12 years agoConvert initializer lists to temporaries in CreateBuiltinBinOp. Allows assignment...
Sebastian Redl [Mon, 27 Feb 2012 20:34:02 +0000 (20:34 +0000)]
Convert initializer lists to temporaries in CreateBuiltinBinOp. Allows assignment of init lists to built-in types and resolves PR12088.

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

12 years agoAdd missing code for compound literals of complex type. <rdar://problem/10938628>
Eli Friedman [Mon, 27 Feb 2012 20:26:13 +0000 (20:26 +0000)]
Add missing code for compound literals of complex type.  <rdar://problem/10938628>

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

12 years agoRevert testing code I committed by mistake in r151464.
Argyrios Kyrtzidis [Mon, 27 Feb 2012 20:21:34 +0000 (20:21 +0000)]
Revert testing code I committed by mistake in r151464.

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

12 years agoJust drop the bitfield from ExtProtoInfo, this struct isn't even heap allocated so...
Benjamin Kramer [Mon, 27 Feb 2012 20:04:30 +0000 (20:04 +0000)]
Just drop the bitfield from ExtProtoInfo, this struct isn't even heap allocated so it doesn't hurt.

MSVC < 10 still has the signed enum bitfield bug, making the top bit unusable.

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

12 years agoSpeculatively attempt to work around a hypothetical but unreproduced MSVC issue
Richard Smith [Mon, 27 Feb 2012 19:56:34 +0000 (19:56 +0000)]
Speculatively attempt to work around a hypothetical but unreproduced MSVC issue
in r151494.

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

12 years agoTest case for r151429/r151430, which ensures llvm.lifetime intrinsics are not
Chad Rosier [Mon, 27 Feb 2012 18:45:03 +0000 (18:45 +0000)]
Test case for r151429/r151430, which ensures llvm.lifetime intrinsics are not
being emitted at -O0, but are emitted when optimizations are enabled.

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

12 years agoSerialize InitListExpr's initializesStdInitializerList bit, so it's not left uninitia...
Benjamin Kramer [Mon, 27 Feb 2012 13:20:39 +0000 (13:20 +0000)]
Serialize InitListExpr's initializesStdInitializerList bit, so it's not left uninitialized.

Found by valgrind.

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

12 years agoObjcInterfaceTypes are also complete types for the type cache.
Eric Christopher [Mon, 27 Feb 2012 08:23:23 +0000 (08:23 +0000)]
ObjcInterfaceTypes are also complete types for the type cache.

Fixes rdar://10934887

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

12 years agoMake this test a bit more robust for debug info changes.
Eric Christopher [Mon, 27 Feb 2012 08:22:57 +0000 (08:22 +0000)]
Make this test a bit more robust for debug info changes.

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

12 years agoEnsure that we delete default constructors in the right cases. Don't delete the
Richard Smith [Mon, 27 Feb 2012 06:07:25 +0000 (06:07 +0000)]
Ensure that we delete default constructors in the right cases. Don't delete the
default constructor of a union if it has a const member with no user-provided
default constructor.

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

12 years agoFix decltype crash-on-invalid, if we don't find a matching ')' for an ill-formed
Richard Smith [Mon, 27 Feb 2012 05:24:00 +0000 (05:24 +0000)]
Fix decltype crash-on-invalid, if we don't find a matching ')' for an ill-formed
decltype expression.

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

12 years agoTests for r151508.
Richard Smith [Sun, 26 Feb 2012 23:49:01 +0000 (23:49 +0000)]
Tests for r151508.

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

12 years agoHalf of PR12088: parse braced-init-lists on the RHS of assignment operators.
Richard Smith [Sun, 26 Feb 2012 23:40:27 +0000 (23:40 +0000)]
Half of PR12088: parse braced-init-lists on the RHS of assignment operators.

If the assignment operator is a scalar type, we continue to incorrectly reject
the initializer, but semantic analysis (and codegen) is correct for overloaded
operators.

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

12 years ago[clang.py] Test Cursor.__ne__
Gregory Szorc [Sun, 26 Feb 2012 21:56:32 +0000 (21:56 +0000)]
[clang.py] Test Cursor.__ne__

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

12 years agoReorder members to save padding.
Benjamin Kramer [Sun, 26 Feb 2012 20:37:14 +0000 (20:37 +0000)]
Reorder members to save padding.

There's more potential here, but these Exprs aren't used that often so I don't feel like doing heroic bit packing right now.

-8 bytes on every class changed (x86_64).

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

12 years agoMove CharacterLiteral, FloatingLiteral and UnaryExprOrTypeTraitExpr flags over into...
Benjamin Kramer [Sun, 26 Feb 2012 19:47:25 +0000 (19:47 +0000)]
Move CharacterLiteral, FloatingLiteral and UnaryExprOrTypeTraitExpr flags over into Stmt.

Apply the inheritance-padding trick to FloatingLiteral.
Shrinks CharacterLiteral from 32 to 24 bytes and the other two from 40 to 32 bytes (x86_64).

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

12 years agoMake clever use of padding to shrink IntegerLiterals.
Benjamin Kramer [Sun, 26 Feb 2012 18:34:12 +0000 (18:34 +0000)]
Make clever use of padding to shrink IntegerLiterals.

Inheritance allows us to use padding across classes.
40 -> 32 bytes on x86_64.

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

12 years agoBit pack StringLiteral.
Benjamin Kramer [Sun, 26 Feb 2012 18:34:07 +0000 (18:34 +0000)]
Bit pack StringLiteral.

48 -> 40 bytes on x86_64.

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

12 years agoReduce padding in MemberExpr.
Benjamin Kramer [Sun, 26 Feb 2012 18:34:02 +0000 (18:34 +0000)]
Reduce padding in MemberExpr.

56 -> 48 bytes on x86_64.

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

12 years agoCompoundLiteralExpr: Pair a bool with a pointer.
Benjamin Kramer [Sun, 26 Feb 2012 18:33:56 +0000 (18:33 +0000)]
CompoundLiteralExpr: Pair a bool with a pointer.

48 -> 40 bytes on x86_64.

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

12 years agoShuffle members of DesignatedInitExpr to avoid padding.
Benjamin Kramer [Sun, 26 Feb 2012 17:31:32 +0000 (17:31 +0000)]
Shuffle members of DesignatedInitExpr to avoid padding.

40 -> 32 bytes on x86_64.

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

12 years agoBit pack ExtProtoInfo.
Benjamin Kramer [Sun, 26 Feb 2012 16:55:55 +0000 (16:55 +0000)]
Bit pack ExtProtoInfo.

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

12 years agoMove FullSourceLoc::dump into the .cpp file, the used attribute made us emit this...
Benjamin Kramer [Sun, 26 Feb 2012 16:55:50 +0000 (16:55 +0000)]
Move FullSourceLoc::dump into the .cpp file, the used attribute made us emit this into every TU that includes SourceLocation.h.

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

12 years agoOkay, makes sense to change all the occurences to match clang.EXE.
Benjamin Kramer [Sun, 26 Feb 2012 14:55:10 +0000 (14:55 +0000)]
Okay, makes sense to change all the occurences to match clang.EXE.

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

12 years agoAllow any file extension for the clang binary in the linux-header-search test.
Benjamin Kramer [Sun, 26 Feb 2012 14:50:31 +0000 (14:50 +0000)]
Allow any file extension for the clang binary in the linux-header-search test.

Turns out this can be .exe or .EXE, depending on the build system.

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

12 years agoDon't assert when trying to diagnose why a class with a constructor template is
Richard Smith [Sun, 26 Feb 2012 10:50:32 +0000 (10:50 +0000)]
Don't assert when trying to diagnose why a class with a constructor template is
non-trivial.

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

12 years agoAdd the critical crtbegin.o files necessary for any of the tests in
Chandler Carruth [Sun, 26 Feb 2012 10:46:17 +0000 (10:46 +0000)]
Add the critical crtbegin.o files necessary for any of the tests in
r151482 and r151484 to work. Sorry about the fallout...

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

12 years agoA follow-up to r151482 which added support for powerpc and powerpc64
Chandler Carruth [Sun, 26 Feb 2012 09:21:43 +0000 (09:21 +0000)]
A follow-up to r151482 which added support for powerpc and powerpc64
Debian multiarch libraries, this should in theory add support for those
platform's header search rules. I don't have a system to check this
with, so review appreciated. I've added the corresponding tests
referring to the debian multiarch tree.

We are starting to have a relatively completely tested Linux platform
for header search and library search, with several interesting
peculiarities. We should point people at the debian_multiarch_tree when
suggesting new tests. Folks with Debian systems that can check this for
correctness, it would be much appreciated. The missing chunks I know of
are testing bi-arch peudo-cross-compiling toolchains betwen 32-bit and
64-bit variants of platforms, and the MIPS and ARM Debian toolchains.

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

12 years agoEnsure that we delete destructors in the right cases. Specifically:
Richard Smith [Sun, 26 Feb 2012 09:11:52 +0000 (09:11 +0000)]
Ensure that we delete destructors in the right cases. Specifically:
 - variant members with nontrivial destructors make the containing class's
   destructor deleted
 - check for a virtual destructor after checking for overridden methods in the
   base class(es)
 - check for an inaccessible operator delete for a class with a virtual
   destructor.

Do not try to call an anonymous union field's destructor from the destructor of
the containing class.

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

12 years agoAdd support for PPC and PPC64 multiarch toolchains on Debain.
Chandler Carruth [Sun, 26 Feb 2012 09:03:21 +0000 (09:03 +0000)]
Add support for PPC and PPC64 multiarch toolchains on Debain.

Patch from Michel Dänzer, sent our way via Jeremy Huddleston who added
64-bit support. I just added one other place where powerpc64-linux-gnu
was missing (we only had powerpc64-unknown-linux-gnu).

I've also added a tree to test out the debian multiarch stuff. I don't
use debian regularly, so I'm not certain this is entirely accurate. If
anyone wants to check it against a debian system and fix any
inaccuracies, fire away. This way at least folks can see how this is
*supposed* to be tested.

It'd be particularly good to get the Debian MIPS toolchains tested in
this way.

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

12 years agoMake sure we don't try to produce a definition of an implicitly-deleted function
Richard Smith [Sun, 26 Feb 2012 07:51:39 +0000 (07:51 +0000)]
Make sure we don't try to produce a definition of an implicitly-deleted function

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

12 years agoUpdate release notes and language extensions pages to note that support for
Richard Smith [Sun, 26 Feb 2012 07:09:21 +0000 (07:09 +0000)]
Update release notes and language extensions pages to note that support for
generalized initializers is available.

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

12 years agoSpecial members which are defaulted or deleted on their first declaration are
Richard Smith [Sun, 26 Feb 2012 00:31:33 +0000 (00:31 +0000)]
Special members which are defaulted or deleted on their first declaration are
trivial if the implicit declaration would be. Don't forget to set the Trivial
flag on the special member as well as on the class. It doesn't seem ideal that
we have two separate mechanisms for storing this information, but this patch
does not attempt to address that.

This leaves us in an interesting position where the has_trivial_X trait for a
class says 'yes' for a deleted but trivial X, but is_trivially_Xable says 'no'.
This seems to be what the standard requires.

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

12 years agoRevert r151460 as it is not enough to address the issue.
Argyrios Kyrtzidis [Sat, 25 Feb 2012 23:21:37 +0000 (23:21 +0000)]
Revert r151460 as it is not enough to address the issue.

Original log:
When evaluating integer expressions handle logical operators outside
VisitBinaryOperator() to reduce stack pressure for source with huge number
of logical operators.

Fixes rdar://10913206.

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

12 years agoRichard Smith pointed out that there already is a proposal for init list mangling.
Sebastian Redl [Sat, 25 Feb 2012 22:59:28 +0000 (22:59 +0000)]
Richard Smith pointed out that there already is a proposal for init list mangling.

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

12 years agoWhen evaluating integer expressions handle logical operators outside
Argyrios Kyrtzidis [Sat, 25 Feb 2012 21:38:16 +0000 (21:38 +0000)]
When evaluating integer expressions handle logical operators outside
VisitBinaryOperator() to reduce stack pressure for source with huge number
of logical operators.

Fixes rdar://10913206.

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

12 years agoInitializer lists are now supported.
Sebastian Redl [Sat, 25 Feb 2012 20:51:27 +0000 (20:51 +0000)]
Initializer lists are now supported.

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

12 years agoCodeGen support for global variables of type std::initializer_list<X>.
Sebastian Redl [Sat, 25 Feb 2012 20:51:20 +0000 (20:51 +0000)]
CodeGen support for global variables of type std::initializer_list<X>.

This emits a backing array with internal linkage and fills it with data,
then has the initializer_list point at the array. Dynamic initialization
and global destructors are correctly supported.

What doesn't work is nested initializer_lists. I have no idea how to
get them to work, either. However, these should be very rare, and so
I'll just call it a known bug and declare generalized initializers
DONE!

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

12 years agoFix crashers on unexpected std::initializer_list layouts. Found by inspection.
Sebastian Redl [Sat, 25 Feb 2012 20:51:13 +0000 (20:51 +0000)]
Fix crashers on unexpected std::initializer_list layouts. Found by inspection.

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

12 years agoBetter mangling for new-expressions. Also, although we can't mangle arbitrary initial...
Sebastian Redl [Sat, 25 Feb 2012 20:51:07 +0000 (20:51 +0000)]
Better mangling for new-expressions. Also, although we can't mangle arbitrary initializer lists yet (we will need this), turn the crash into a controlled error.

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

12 years agoTemporarily revert r151288:
Chad Rosier [Sat, 25 Feb 2012 20:32:43 +0000 (20:32 +0000)]
Temporarily revert r151288:
ARM: enable the integrated assembler by default for Darwin.

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

12 years agoCMake: install libclang.dll to $CMAKE_INSTALL_PREFIX/bin.
NAKAMURA Takumi [Sat, 25 Feb 2012 16:46:50 +0000 (16:46 +0000)]
CMake: install libclang.dll to $CMAKE_INSTALL_PREFIX/bin.

Patch by Joe Groff.

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

12 years agoArrayRef'ize various functions in the AST/Parser/Sema.
Ahmed Charles [Sat, 25 Feb 2012 11:00:22 +0000 (11:00 +0000)]
ArrayRef'ize various functions in the AST/Parser/Sema.

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

12 years agoAccept __has_feature(__feature__) as a synonym for __has_feature(feature) (and
Richard Smith [Sat, 25 Feb 2012 10:41:10 +0000 (10:41 +0000)]
Accept __has_feature(__feature__) as a synonym for __has_feature(feature) (and
likewise for __has_extension). Patch by Jonathan Sauer!

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

12 years agoFix r151443 to only apply C++11's exception for non-static data member access
Richard Smith [Sat, 25 Feb 2012 10:20:59 +0000 (10:20 +0000)]
Fix r151443 to only apply C++11's exception for non-static data member access
in cases where we would otherwise disallow the access, and add a -Wc++98-compat
diagnostic for this C++11 feature.

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

12 years agoPR11956: C++11's special exception for accessing non-static data members from
Richard Smith [Sat, 25 Feb 2012 10:04:07 +0000 (10:04 +0000)]
PR11956: C++11's special exception for accessing non-static data members from
unevaluated operands applies within member functions, too.

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

12 years agoFix assertion (too few Diag arguments) when diagnosing a deleted operator delete
Richard Smith [Sat, 25 Feb 2012 09:42:26 +0000 (09:42 +0000)]
Fix assertion (too few Diag arguments) when diagnosing a deleted operator delete

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

12 years agoTeach CXXRecordDecl::hasIrrelevantDestructor to check the base classes and
Richard Smith [Sat, 25 Feb 2012 07:33:38 +0000 (07:33 +0000)]
Teach CXXRecordDecl::hasIrrelevantDestructor to check the base classes and
data members for deleted or user-provided destructors.

Now it's computed in advance, serialize it, and in passing fix all the other
record DefinitionData flags whose serialization was missing.

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

12 years agoFix a regression from r151117: ADL requires that we attempt to complete any
Richard Smith [Sat, 25 Feb 2012 06:24:24 +0000 (06:24 +0000)]
Fix a regression from r151117: ADL requires that we attempt to complete any
associated classes, since it can find friend functions declared within them,
but overload resolution does not otherwise require argument types to be
complete.

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

12 years agoPrevent llvm.lifetime intrinsics from being emitted at -O0.
Chad Rosier [Sat, 25 Feb 2012 02:56:13 +0000 (02:56 +0000)]
Prevent llvm.lifetime intrinsics from being emitted at -O0.
rdar://10921594

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

12 years agoWork-in-progress for lambda conversion-to-block operator. Still need to implement...
Eli Friedman [Sat, 25 Feb 2012 02:48:22 +0000 (02:48 +0000)]
Work-in-progress for lambda conversion-to-block operator.  Still need to implement the retain+autorelease outside of ARC, and there's a bug that causes the generated code to crash in ARC (which I think is unrelated to my code, although I'm not completely sure).

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

12 years agoDon't record nested macro expansions in the preprocessing record,
Argyrios Kyrtzidis [Sat, 25 Feb 2012 02:41:16 +0000 (02:41 +0000)]
Don't record nested macro expansions in the preprocessing record,
it can only bring pain when dealing with preprocessor abuse (see: boost).

rdar://10898986

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

12 years agoRetainCountChecker: don't adjust the retain count when analyzing a ReturnStmt unless...
Ted Kremenek [Sat, 25 Feb 2012 02:09:09 +0000 (02:09 +0000)]
RetainCountChecker: don't adjust the retain count when analyzing a ReturnStmt unless we are in the top-level call frame.  We can do more later, but this makes the checker self-consistent (and fixes a crash).

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

12 years ago[arcmt] GC migrator: don't try to remove redundant __strong, it does
Argyrios Kyrtzidis [Sat, 25 Feb 2012 01:57:42 +0000 (01:57 +0000)]
[arcmt] GC migrator: don't try to remove redundant __strong, it does
more harm than good.

Fixes rdar://10522805&10521433

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

12 years agoImprove the diagnostic in ARC mode when a conditional with an Objective-C type and...
Eli Friedman [Sat, 25 Feb 2012 00:23:44 +0000 (00:23 +0000)]
Improve the diagnostic in ARC mode when a conditional with an Objective-C type and void* is used.  <rdar://problem/10486347>.

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

12 years agoTrying to increase my Ohloh ranking with trivial tweaks
Douglas Gregor [Sat, 25 Feb 2012 00:16:17 +0000 (00:16 +0000)]
Trying to increase my Ohloh ranking with trivial tweaks

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

12 years agoBugfix: bogus warning -- "invalid use of non-static data member",
DeLesley Hutchins [Sat, 25 Feb 2012 00:11:55 +0000 (00:11 +0000)]
Bugfix: bogus warning -- "invalid use of non-static data member",
when a class is forward declared, and the reference to the data
member in question does not occur within a method body.

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

12 years agoSimplify check per Eli's comment
Douglas Gregor [Sat, 25 Feb 2012 00:06:47 +0000 (00:06 +0000)]
Simplify check per Eli's comment

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

12 years agoAdd test for C++ DR899.
Douglas Gregor [Fri, 24 Feb 2012 23:57:42 +0000 (23:57 +0000)]
Add test for C++ DR899.

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

12 years ago[analyzer] Malloc: reason about the ObjC messages and C++.
Anna Zaks [Fri, 24 Feb 2012 23:56:53 +0000 (23:56 +0000)]
[analyzer] Malloc: reason about the ObjC messages and C++.

Assume none of the ObjC messages defined in system headers free memory,
except for the ones containing 'freeWhenDone' selector. Currently, just
assume that the region escapes to the messages with 'freeWhenDone'
(ideally, we want to treat it as 'free()').

For now, always assume that regions escape when passed to C++ methods.

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

12 years agoImplement C++11 [over.match.copy]p1b2, which allows the use of
Douglas Gregor [Fri, 24 Feb 2012 23:56:31 +0000 (23:56 +0000)]
Implement C++11 [over.match.copy]p1b2, which allows the use of
explicit conversion functions to initialize the argument to a
copy/move constructor that itself is the subject of direct
initialization. Since we don't have that much context in overload
resolution, we end up threading more flags :(.

Fixes <rdar://problem/10903741> / PR10456.

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

12 years agoFix a stupid mistake in r151133. Reported to me by Joerg Sonnenberger.
Eli Friedman [Fri, 24 Feb 2012 23:53:49 +0000 (23:53 +0000)]
Fix a stupid mistake in r151133.  Reported to me by Joerg Sonnenberger.

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

12 years agoRemove FIXME: as Eli points out, the behavior here is now correct.
Richard Smith [Fri, 24 Feb 2012 23:21:24 +0000 (23:21 +0000)]
Remove FIXME: as Eli points out, the behavior here is now correct.

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

12 years agoFor the purposes of building LLVM types, a forward-declared
Douglas Gregor [Fri, 24 Feb 2012 22:40:36 +0000 (22:40 +0000)]
For the purposes of building LLVM types, a forward-declared
enumeration type with a fixed underlying type is complete. Fixes
<rdar://problem/10916155>.

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

12 years agoBack out __decltype warning from r151377: we should either warn on all the GNU
Richard Smith [Fri, 24 Feb 2012 22:30:04 +0000 (22:30 +0000)]
Back out __decltype warning from r151377: we should either warn on all the GNU
__keywords or none of them.

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

12 years agoMake helper static.
Benjamin Kramer [Fri, 24 Feb 2012 22:19:42 +0000 (22:19 +0000)]
Make helper static.

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