]> granicus.if.org Git - clang/log
clang
12 years agoWhitespace.
Chad Rosier [Wed, 12 Sep 2012 23:03:48 +0000 (23:03 +0000)]
Whitespace.

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

12 years ago[analyzer] Do not report use of undef on "return foo();" when the return type is...
Anna Zaks [Wed, 12 Sep 2012 22:57:40 +0000 (22:57 +0000)]
[analyzer] Do not report use of undef on "return foo();" when the return type is void.

Fixes a false positive found by analyzing LLVM code base.

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

12 years ago[analyzer] Fix another false positive in malloc realloc logic.
Anna Zaks [Wed, 12 Sep 2012 22:57:34 +0000 (22:57 +0000)]
[analyzer] Fix another false positive in malloc realloc logic.

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

12 years ago[analyzer] Teach UndefOrNullArgVisitor to track parent regions.
Anna Zaks [Wed, 12 Sep 2012 22:57:30 +0000 (22:57 +0000)]
[analyzer] Teach UndefOrNullArgVisitor to track parent regions.

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

12 years ago[analyzer] Fix another use of the address of a temporary, like r163402.
Jordan Rose [Wed, 12 Sep 2012 22:48:08 +0000 (22:48 +0000)]
[analyzer] Fix another use of the address of a temporary, like r163402.

Again, GCC is more aggressive about reusing temporary space than we are,
leading to Release build crashes for this undefined behavior.

PR13710 (though it may not be the only problem there)

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

12 years ago[analyzer] Re-add reinterpret_cast virtual call test case from r163644.
Jordan Rose [Wed, 12 Sep 2012 21:50:56 +0000 (21:50 +0000)]
[analyzer] Re-add reinterpret_cast virtual call test case from r163644.

We mostly just don't want to crash analyzing this test case; it's likely
the code found here will actually crash if compiled and run.

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

12 years ago[analyzer] Handle when the dynamic type is worse than the static type.
Jordan Rose [Wed, 12 Sep 2012 21:48:17 +0000 (21:48 +0000)]
[analyzer] Handle when the dynamic type is worse than the static type.

Currently we don't update the dynamic type of a C++ object when it is
cast. This can cause the situation above, where the static type of the
region is now known to be a subclass of the dynamic type.

Once we start updating DynamicTypeInfo in response to the various kinds
of casts in C++, we can re-add this assert to make sure we don't miss
any cases. This work is tracked by <rdar://problem/12287087>.

In -Asserts builds, we will simply not return any runtime definition
when our DynamicTypeInfo is known to be incorrect like this.

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

12 years agoRevert "[analyzer] Use the static type for a virtual call if the dynamic type is...
Jordan Rose [Wed, 12 Sep 2012 21:48:13 +0000 (21:48 +0000)]
Revert "[analyzer] Use the static type for a virtual call if the dynamic type is worse."

Using the static type may be inconsistent with later calls. We should just
report that there is no inlining definition available if the static type is
better than the dynamic type. See next commit.

This reverts r163644 / 19d5886d1704e24282c86217b09d5c6d35ba604d.

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

12 years agoobjective-C++ test for my previous patch.
Fariborz Jahanian [Wed, 12 Sep 2012 21:27:26 +0000 (21:27 +0000)]
objective-C++ test for my previous patch.
// rdar://12280826

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

12 years agoRename isA to isSameOrDerivedFrom.
Daniel Jasper [Wed, 12 Sep 2012 21:14:15 +0000 (21:14 +0000)]
Rename isA to isSameOrDerivedFrom.

There are two evils we can choose from:
- Name overlap between isA-matcher and llvm::isa<>()
- Bad name for what the isA-matcher currently does

After some discussion we have agreed to go with the latter evil.

Review: http://llvm-reviews.chandlerc.com/D40

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

12 years agoobjective-C arc: don't issue no explicit ownership warning when
Fariborz Jahanian [Wed, 12 Sep 2012 20:34:47 +0000 (20:34 +0000)]
objective-C arc: don't issue no explicit ownership warning when
__autoreleasing is explicitely added to param type.
// rdar://12280826

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

12 years agoFix test case for Release builds.
Chad Rosier [Wed, 12 Sep 2012 20:13:11 +0000 (20:13 +0000)]
Fix test case for Release builds.

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

12 years agoRevert "Make clang emit a flag for DW_AT_object_pointer for the artificial"
Eric Christopher [Wed, 12 Sep 2012 18:42:10 +0000 (18:42 +0000)]
Revert "Make clang emit a flag for DW_AT_object_pointer for the artificial"
this should be done on the subprogram, not the variable.

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

12 years ago[ms-inline asm] Add a test case.
Chad Rosier [Wed, 12 Sep 2012 18:34:34 +0000 (18:34 +0000)]
[ms-inline asm] Add a test case.

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

12 years ago[ms-inline asm] Test case for r163729.
Chad Rosier [Wed, 12 Sep 2012 18:25:06 +0000 (18:25 +0000)]
[ms-inline asm] Test case for r163729.

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

12 years ago[ms-inline asm] If we have a single asm operand that maps to multiple
Chad Rosier [Wed, 12 Sep 2012 18:14:25 +0000 (18:14 +0000)]
[ms-inline asm] If we have a single asm operand that maps to multiple
MCOperands then iterate over all of then when computing clobbers, inputs and
outputs.

On x86 the 1-to-many mapping is a memory operand that includes a BaseReg(reg),
MemScale(imm), MemIndexReg(reg), an Expr(MCExpr or imm) and a MemSegReg(reg).
Invalid register (Op.getReg() == 0) are not considered when computing clobber.

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

12 years agoComment parsing: recognize more Doxygen commands
Dmitri Gribenko [Wed, 12 Sep 2012 17:02:40 +0000 (17:02 +0000)]
Comment parsing: recognize more Doxygen commands

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

12 years agoFix a couple of Doxygen issues pointed out by -Wdocumentation.
Dmitri Gribenko [Wed, 12 Sep 2012 17:01:48 +0000 (17:01 +0000)]
Fix a couple of Doxygen issues pointed out by -Wdocumentation.

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

12 years agoRevert "objective-C: warn under a flag if missing argument"
Ted Kremenek [Wed, 12 Sep 2012 16:50:35 +0000 (16:50 +0000)]
Revert "objective-C: warn under a flag if missing argument"

We plan on discussing this more, but we shouldn't have it in the compiler
in an incomplete state.

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

12 years agoRevert "objective-C: warn if selector has nothing but bare"
Ted Kremenek [Wed, 12 Sep 2012 16:50:30 +0000 (16:50 +0000)]
Revert "objective-C: warn if selector has nothing but bare"

We plan on discussing this more.

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

12 years agoclang/test: [PR13820] Suppress LLP64-incompatible tests for ObjC with +Asserts.
NAKAMURA Takumi [Wed, 12 Sep 2012 14:26:42 +0000 (14:26 +0000)]
clang/test: [PR13820] Suppress LLP64-incompatible tests for ObjC with +Asserts.

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

12 years agoclang/test/CodeGen/2008-01-25-ZeroSizedAggregate.c: [PR8833] Add REQUIRES: LP64....
NAKAMURA Takumi [Wed, 12 Sep 2012 14:26:34 +0000 (14:26 +0000)]
clang/test/CodeGen/2008-01-25-ZeroSizedAggregate.c: [PR8833] Add REQUIRES: LP64. It fails with +Asserts for Win64.

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

12 years agoClaim --param ssp-buffer-size, even if the stack protector is not
Joerg Sonnenberger [Wed, 12 Sep 2012 13:51:14 +0000 (13:51 +0000)]
Claim --param ssp-buffer-size, even if the stack protector is not
active.

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

12 years agoclang/test/CodeGenObjC: [PR13820] Suppress LLP64-incompatible tests.
NAKAMURA Takumi [Wed, 12 Sep 2012 10:45:52 +0000 (10:45 +0000)]
clang/test/CodeGenObjC: [PR13820] Suppress LLP64-incompatible tests.

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

12 years agoclang/test/SemaCXX/dcl_ambig_res.cpp: [PR13819] It requires LP64 for now due to __SIZ...
NAKAMURA Takumi [Wed, 12 Sep 2012 10:45:46 +0000 (10:45 +0000)]
clang/test/SemaCXX/dcl_ambig_res.cpp: [PR13819] It requires LP64 for now due to __SIZE_TYPE__.

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

12 years agoclang/test: [PR8833] Introduce the feature "LP64" to suppress LLP64-incompatible...
NAKAMURA Takumi [Wed, 12 Sep 2012 10:45:40 +0000 (10:45 +0000)]
clang/test: [PR8833] Introduce the feature "LP64" to suppress LLP64-incompatible tests.

I think some of them could be rewritten to fit also LLP64.

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

12 years agoclang/test/PCH/missing-file.cpp: Try to suppress accidental false on Windows.
NAKAMURA Takumi [Wed, 12 Sep 2012 10:38:08 +0000 (10:38 +0000)]
clang/test/PCH/missing-file.cpp: Try to suppress accidental false on Windows.

%t.h might be touched by scanners as a hot file on Windows, to fail to remove %.h with single run.

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

12 years agoclang/test/lit.cfg: Fix a typo in comment.
NAKAMURA Takumi [Wed, 12 Sep 2012 10:38:03 +0000 (10:38 +0000)]
clang/test/lit.cfg: Fix a typo in comment.

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

12 years agoFix a test failure.
Evgeniy Stepanov [Wed, 12 Sep 2012 09:39:37 +0000 (09:39 +0000)]
Fix a test failure.

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

12 years agoMake -faddress-sanitizer on Android link to the new-style runtime.
Evgeniy Stepanov [Wed, 12 Sep 2012 09:09:08 +0000 (09:09 +0000)]
Make -faddress-sanitizer on Android link to the new-style runtime.

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

12 years agoConvert a few more getAs cases to castAs where we immediately call a member function.
Ted Kremenek [Wed, 12 Sep 2012 06:50:29 +0000 (06:50 +0000)]
Convert a few more getAs cases to castAs where we immediately call a member function.

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

12 years agoFix regression where "looping back to the head of" PathDiagnosticEvents
Ted Kremenek [Wed, 12 Sep 2012 06:22:18 +0000 (06:22 +0000)]
Fix regression where "looping back to the head of" PathDiagnosticEvents
were not emitted.

Fixes <rdar://problem/12280665>.

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

12 years agoTeach -Wuninitialized to recognize __attribute__((analyzer_noreturn))
Ted Kremenek [Wed, 12 Sep 2012 05:53:43 +0000 (05:53 +0000)]
Teach -Wuninitialized to recognize __attribute__((analyzer_noreturn))
for halting the propagation of uninitialized value tracking along
a path.  Unlike __attribute__((noreturn)), this attribute (which
is used by clients of the static analyzer) can be used to annotate
functions that essentially never return, but in rare cares may be
allowed to return for (special) debugging purposes.  This attribute
has been shown in reducing false positives in the static analyzer
by pruning false postives, and is equally applicable here.

Handling this attribute in the CFG itself is another option, but
this is not something all clients (e.g., possibly -Wunreachable-code)
would want to see.

Addresses <rdar://problem/12281583>.

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

12 years agoPost new checker build.
Ted Kremenek [Wed, 12 Sep 2012 05:11:29 +0000 (05:11 +0000)]
Post new checker build.

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

12 years agoAdjust some analyzer tests to place widely shared inputs inside of an
Chandler Carruth [Wed, 12 Sep 2012 01:11:10 +0000 (01:11 +0000)]
Adjust some analyzer tests to place widely shared inputs inside of an
'Inputs' subdirectory.

The general desire has been to have essentially all of the non-test
input files live in such directories, with some exceptions for obvious
and common patterns like 'foo.c' using 'foo.h'.

This came up because our distributed test runner couldn't find some of
the headers, for example with stl.cpp.

No functionality changed, just shuffling around here.

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

12 years agoFix up more "$t"s in this test that should be "%t"s.
Chandler Carruth [Wed, 12 Sep 2012 01:11:05 +0000 (01:11 +0000)]
Fix up more "$t"s in this test that should be "%t"s.

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

12 years agoPR13811: Add a FunctionParmPackExpr node to handle references to function
Richard Smith [Wed, 12 Sep 2012 00:56:43 +0000 (00:56 +0000)]
PR13811: Add a FunctionParmPackExpr node to handle references to function
parameter packs where the reference is not being expanded but the pack has
been. Previously, Clang would segfault in such cases.

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

12 years agoMake clang emit a flag for DW_AT_object_pointer for the artificial
Eric Christopher [Wed, 12 Sep 2012 00:27:32 +0000 (00:27 +0000)]
Make clang emit a flag for DW_AT_object_pointer for the artificial
args where it should (implicit first arguments). FileCheck-ize a
test as well and update tests to take into account the object
pointer flag.

rdar://9797999

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

12 years ago[ms-inline asm] isDef/NumDefs in this context only refer to register definitions...
Chad Rosier [Tue, 11 Sep 2012 23:53:48 +0000 (23:53 +0000)]
[ms-inline asm] isDef/NumDefs in this context only refer to register definitions, not memory definitions.

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

12 years ago[ms-inline asm] As of r163657 this check is unnecessary.
Chad Rosier [Tue, 11 Sep 2012 23:48:00 +0000 (23:48 +0000)]
[ms-inline asm] As of r163657 this check is unnecessary.

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

12 years ago[ms-inline asm] Don't consider tokens or immediates when computing clobbers, inputs...
Chad Rosier [Tue, 11 Sep 2012 23:13:15 +0000 (23:13 +0000)]
[ms-inline asm] Don't consider tokens or immediates when computing clobbers, inputs and outputs.

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

12 years agoThread-safety analysis: fix bug in expression matching code.
DeLesley Hutchins [Tue, 11 Sep 2012 23:04:49 +0000 (23:04 +0000)]
Thread-safety analysis: fix bug in expression matching code.

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

12 years agoobjective-C: warn if selector has nothing but bare
Fariborz Jahanian [Tue, 11 Sep 2012 21:27:45 +0000 (21:27 +0000)]
objective-C: warn if selector has nothing but bare
':' in its name. // rdar://8366823

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

12 years agoRevert "[analyzer] Disable STL inlining. Blocked by PR13724."
Jordan Rose [Tue, 11 Sep 2012 20:26:49 +0000 (20:26 +0000)]
Revert "[analyzer] Disable STL inlining. Blocked by PR13724."

While PR13724 is still an issue, it's not actually an issue in the STL.
We can keep this option around in case there turn out to be widespread
false positives due to poor modeling of the C++ standard library functions,
but for now we'd like to get more data.

This reverts r163633 / c6baadceec1d5148c20ee6c902a102233c547f62.

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

12 years agoComment parsing: handle non-builtin commands correctly. After semantic
Dmitri Gribenko [Tue, 11 Sep 2012 19:22:03 +0000 (19:22 +0000)]
Comment parsing: handle non-builtin commands correctly.  After semantic
analysis registers a command, it becomes a "known" command for the lexer, since
it has an ID.  Having this freedom of choice to register a command is a good
thing since BriefParser does not need this.

But the parser should still invoke the correct semantic analysis method
(actOnUnknownCommand) in this case.

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

12 years ago[analyzer] Use the static type for a virtual call if the dynamic type is worse.
Jordan Rose [Tue, 11 Sep 2012 18:47:13 +0000 (18:47 +0000)]
[analyzer] Use the static type for a virtual call if the dynamic type is worse.

reinterpret_cast does not provide any of the usual type information that
static_cast or dynamic_cast provide -- only the new type. This can get us
in a situation where the dynamic type info for an object is actually a
superclass of the static type, which does not match what CodeGen does at all.
In these cases, just fall back to the static type as the best possible type
for devirtualization.

Should fix the crashes on our internal buildbot.

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

12 years agoFix warning from r163642
DeLesley Hutchins [Tue, 11 Sep 2012 18:32:12 +0000 (18:32 +0000)]
Fix warning from r163642

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

12 years agoThread safety analysis: fix bug related to lock_returned attribute
DeLesley Hutchins [Tue, 11 Sep 2012 18:27:46 +0000 (18:27 +0000)]
Thread safety analysis: fix bug related to lock_returned attribute
on templates.

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

12 years agoobjective-C: warn under a flag if missing argument
Fariborz Jahanian [Tue, 11 Sep 2012 17:24:26 +0000 (17:24 +0000)]
objective-C: warn under a flag if missing argument
name results in unintended selector name.
// rdar://12263549

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

12 years ago[analyzer] Disable STL inlining. Blocked by PR13724.
Anna Zaks [Tue, 11 Sep 2012 17:15:39 +0000 (17:15 +0000)]
[analyzer] Disable STL inlining. Blocked by PR13724.

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

12 years agoFix namespace nesting and remove windows line endings.
Rafael Espindola [Tue, 11 Sep 2012 14:17:47 +0000 (14:17 +0000)]
Fix namespace nesting and remove windows line endings.

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

12 years agoJust revert r163605 for now. It broke the build and had some
Chandler Carruth [Tue, 11 Sep 2012 10:40:21 +0000 (10:40 +0000)]
Just revert r163605 for now. It broke the build and had some
questionable elements to the patch.

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

12 years agoSelect the correct, or, failing that, compatible, dialect when invoked as cc,
David Chisnall [Tue, 11 Sep 2012 09:58:54 +0000 (09:58 +0000)]
Select the correct, or, failing that, compatible, dialect when invoked as cc,
c89, c99, and so on.  No change to the default dialect when invoked as clang /
clang++.

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

12 years agoSwitch a SmallPtrSet/SmallVector pair over to SetVector.
Douglas Gregor [Tue, 11 Sep 2012 07:19:42 +0000 (07:19 +0000)]
Switch a SmallPtrSet/SmallVector pair over to SetVector.

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

12 years agoRemove unused macro definition
Douglas Gregor [Tue, 11 Sep 2012 06:33:46 +0000 (06:33 +0000)]
Remove unused macro definition

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

12 years agoFix typo in comment
Douglas Gregor [Tue, 11 Sep 2012 06:30:16 +0000 (06:30 +0000)]
Fix typo in comment

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

12 years agoRemove some redundancy from constant aggregate emission. No functionality change.
Richard Smith [Tue, 11 Sep 2012 05:51:06 +0000 (05:51 +0000)]
Remove some redundancy from constant aggregate emission. No functionality change.

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

12 years ago[libclang] Fix getting a cursor inside an angled #include directive.
Argyrios Kyrtzidis [Tue, 11 Sep 2012 02:17:21 +0000 (02:17 +0000)]
[libclang] Fix getting a cursor inside an angled #include directive.

Fixed by pointing the end location of the preprocessed entity for the #include
at the closing '>', instead of the start of '<'.

rdar://11113134

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

12 years agoUpdate comment and space.
Eric Christopher [Tue, 11 Sep 2012 01:36:56 +0000 (01:36 +0000)]
Update comment and space.

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

12 years agoThe type of the self and cmd variables should be artificial. (Note
Eric Christopher [Tue, 11 Sep 2012 01:36:54 +0000 (01:36 +0000)]
The type of the self and cmd variables should be artificial. (Note
that the types aren't artificial the args are, but this is currently
represented by an artificial type.)

Found by inspection.

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

12 years ago[ms-inline asm] Add $$ before numeric constants in the IR.
Chad Rosier [Tue, 11 Sep 2012 00:51:28 +0000 (00:51 +0000)]
[ms-inline asm] Add $$ before numeric constants in the IR.

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

12 years agoFix buffer overflow.
Eli Friedman [Tue, 11 Sep 2012 00:36:26 +0000 (00:36 +0000)]
Fix buffer overflow.

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

12 years ago[analyzer] Member function calls that use qualified names are non-virtual.
Jordan Rose [Tue, 11 Sep 2012 00:31:02 +0000 (00:31 +0000)]
[analyzer] Member function calls that use qualified names are non-virtual.

C++11 [expr.call]p1: ...If the selected function is non-virtual, or if the
  id-expression in the class member access expression is a qualified-id,
  that function is called. Otherwise, its final overrider in the dynamic type
  of the object expression is called.

<rdar://problem/12255556>

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

12 years ago[analyzer] Turn stl inlining back on.
Anna Zaks [Mon, 10 Sep 2012 23:59:02 +0000 (23:59 +0000)]
[analyzer] Turn stl inlining back on.

The one reported bug, which was exposed by stl inlining, is addressed in
r163558.

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

12 years ago[analyzer] Do not count calls to small functions when computing stack
Anna Zaks [Mon, 10 Sep 2012 23:35:11 +0000 (23:35 +0000)]
[analyzer] Do not count calls to small functions when computing stack
depth.

We only want to count how many substantial functions we inlined. This
is an improvement to r163558.

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

12 years ago[PCH] Add a null check to avoid crashing.
Argyrios Kyrtzidis [Mon, 10 Sep 2012 23:28:22 +0000 (23:28 +0000)]
[PCH] Add a null check to avoid crashing.

Unfortunately, no test case. rdar://11960120

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

12 years agoProvide fixed target triples to make test results consistent across ARM hosts.
David Blaikie [Mon, 10 Sep 2012 23:06:08 +0000 (23:06 +0000)]
Provide fixed target triples to make test results consistent across ARM hosts.

Patch by David Tweed, review by myself and John McCall.

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

12 years ago[libclang] Do index 'extern' declarations inside functions.
Argyrios Kyrtzidis [Mon, 10 Sep 2012 22:58:04 +0000 (22:58 +0000)]
[libclang] Do index 'extern' declarations inside functions.

rdar://12257073

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

12 years ago[analyzer] Add an option to enable/disable objc inlining.
Anna Zaks [Mon, 10 Sep 2012 22:56:41 +0000 (22:56 +0000)]
[analyzer] Add an option to enable/disable objc inlining.

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

12 years agoRevert "Remove clang man page reference to -Oz. It's not an option we want people...
Ted Kremenek [Mon, 10 Sep 2012 22:50:05 +0000 (22:50 +0000)]
Revert "Remove clang man page reference to -Oz.  It's not an option we want people to use, and is around for historical reasons."

This should be discussed more first.

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

12 years ago[analyzer] Add ipa-always-inline-size option (with 3 as the default).
Anna Zaks [Mon, 10 Sep 2012 22:37:19 +0000 (22:37 +0000)]
[analyzer] Add ipa-always-inline-size option (with 3 as the default).

The option allows to always inline very small functions, whose size (in
number of basic blocks) is set using -analyzer-config
ipa-always-inline-size option.

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

12 years agoFix PR13784: instantiation of an abstract class in a conditional operator.
David Blaikie [Mon, 10 Sep 2012 22:05:41 +0000 (22:05 +0000)]
Fix PR13784: instantiation of an abstract class in a conditional operator.

A couple of missing "RequireNonAbstractType" calls in conditional operator
handling. I looked for opportunities to tie this check in to all relevant
callers of PerformCopyInitialization (couldn't be all callers since this is
called for base subobject copying too, where it's acceptable to copy abstract
types) but the callers varied too much & in many cases had substantial code
or conditionals on the RequireNonAbstractType call, the
PerformCopyInitialization call, or the code between the two calls.

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

12 years agoMove the null check outside of the loop, no functionality change.
Argyrios Kyrtzidis [Mon, 10 Sep 2012 22:04:26 +0000 (22:04 +0000)]
Move the null check outside of the loop, no functionality change.

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

12 years ago[PCH] When loading fields from external storage make sure to also
Argyrios Kyrtzidis [Mon, 10 Sep 2012 22:04:22 +0000 (22:04 +0000)]
[PCH] When loading fields from external storage make sure to also
load in the IndirectField declarations as well.

Field designators in initializer lists depend on traversing the fields
decl chain to find the indirect fields.

Fixes rdar://12239321

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

12 years ago[analyzer] Make the defaults explicit for each of the new config options.
Jordan Rose [Mon, 10 Sep 2012 21:54:24 +0000 (21:54 +0000)]
[analyzer] Make the defaults explicit for each of the new config options.

Also, document both new inlining options in IPA.txt.

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

12 years ago[analyzer] For now, don't inline C++ standard library functions.
Jordan Rose [Mon, 10 Sep 2012 21:27:35 +0000 (21:27 +0000)]
[analyzer] For now, don't inline C++ standard library functions.

This is a (heavy-handed) solution to PR13724 -- until we know we can do
a good job inlining the STL, it's best to be consistent and not generate
more false positives than we did before. We can selectively whitelist
certain parts of the 'std' namespace that are known to be safe.

This is controlled by analyzer config option 'c++-stdlib-inlining', which
can be set to "true" or "false".

This commit also adds control for whether or not to inline any templated
functions (member or non-member), under the config option
'c++-template-inlining'. This option is currently on by default.

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

12 years agoRemove redundant semicolons which are null statements.
Dmitri Gribenko [Mon, 10 Sep 2012 21:20:09 +0000 (21:20 +0000)]
Remove redundant semicolons which are null statements.

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

12 years agoComment AST: TableGen'ize all command lists in CommentCommandTraits.cpp.
Dmitri Gribenko [Mon, 10 Sep 2012 20:32:42 +0000 (20:32 +0000)]
Comment AST: TableGen'ize all command lists in CommentCommandTraits.cpp.

Now we have a list of all commands.  This is a good thing in itself, but it
also enables us to easily implement typo correction for command names.

With this change we have objects that contain information about each command,
so it makes sense to resolve command name just once during lexing (currently we
store command names as strings and do a linear search every time some property
value is needed).  Thus comment token and AST nodes were changed to contain a
command ID -- index into a tables of builtin and registered commands.  Unknown
commands are registered during parsing and thus are also uniformly assigned an
ID.  Using an ID instead of a StringRef is also a nice memory optimization
since ID is a small integer that fits into a common bitfield in Comment class.

This change implies that to get any information about a command (even a command
name) we need a CommandTraits object to resolve the command ID to CommandInfo*.
Currently a fresh temporary CommandTraits object is created whenever it is
needed since it does not have any state.  But with this change it has state --
new commands can be registered, so a CommandTraits object was added to
ASTContext.

Also, in libclang CXComment has to be expanded to include a CXTranslationUnit
so that all functions working on comment AST nodes can get a CommandTraits
object.  This breaks binary compatibility of CXComment APIs.

Now clang_FullComment_getAsXML(CXTranslationUnit TU, CXComment CXC) doesn't
need TU parameter anymore, so it was removed.  This is a source-incompatible
change for this C API.

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

12 years agoRemove clang man page reference to -Oz. It's not an option we want people to use...
Ted Kremenek [Mon, 10 Sep 2012 20:10:37 +0000 (20:10 +0000)]
Remove clang man page reference to -Oz.  It's not an option we want people to use, and is around for historical reasons.

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

12 years agoThread-safety analysis: differentiate between two forms of analysis; a precise
DeLesley Hutchins [Mon, 10 Sep 2012 19:58:23 +0000 (19:58 +0000)]
Thread-safety analysis: differentiate between two forms of analysis; a precise
analysis that may give false positives because it is confused by aliasing, and
a less precise analysis that has fewer false positives, but may have false
negatives.  The more precise warnings are enabled by -Wthread-safety-precise.
An additional note clarify the warnings in the precise case.

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

12 years agoNow that I have a test file to work with, disable the Filecheck part of this test.
Ted Kremenek [Mon, 10 Sep 2012 19:50:17 +0000 (19:50 +0000)]
Now that I have a test file to work with, disable the Filecheck part of this test.

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

12 years agoCorrectly 'cat' out test files.
Ted Kremenek [Mon, 10 Sep 2012 19:13:08 +0000 (19:13 +0000)]
Correctly 'cat' out test files.

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

12 years agoFix another case where we should be using isBeforeInTranslationUnit().
Ted Kremenek [Mon, 10 Sep 2012 19:07:56 +0000 (19:07 +0000)]
Fix another case where we should be using isBeforeInTranslationUnit().

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

12 years agoAdd a few more cases where we should be using isBeforeInTranslationUnit().
Ted Kremenek [Mon, 10 Sep 2012 19:02:33 +0000 (19:02 +0000)]
Add a few more cases where we should be using isBeforeInTranslationUnit().

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

12 years agoAs a debugging aid to unbreak the buildbots, cat the plist files so I can view them...
Ted Kremenek [Mon, 10 Sep 2012 18:38:43 +0000 (18:38 +0000)]
As a debugging aid to unbreak the buildbots, cat the plist files so I can view them on different builders.

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

12 years agoMore tweaking and test cases for call to super
Fariborz Jahanian [Mon, 10 Sep 2012 18:04:25 +0000 (18:04 +0000)]
More tweaking and  test cases for call to super
annotations. // rdar://6386358

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

12 years agoRe-enable FileCheck testing of retain-release.m test, and force
Ted Kremenek [Mon, 10 Sep 2012 17:35:24 +0000 (17:35 +0000)]
Re-enable FileCheck testing of retain-release.m test, and force
a C++ dialect.  Let's see if this is the portability issue with this test.

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

12 years agoobjective-C: Improving diagnostocs for missing call to
Fariborz Jahanian [Mon, 10 Sep 2012 16:51:09 +0000 (16:51 +0000)]
objective-C: Improving diagnostocs for missing call to
super's annotated methods. // rdar://6386358

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

12 years agoTemporarily disable FileCheck part of this test.
Ted Kremenek [Mon, 10 Sep 2012 15:16:32 +0000 (15:16 +0000)]
Temporarily disable FileCheck part of this test.

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

12 years agoAllow vector types in pseudo-destructor expressions. Fixes PR13798.
Douglas Gregor [Mon, 10 Sep 2012 14:57:06 +0000 (14:57 +0000)]
Allow vector types in pseudo-destructor expressions. Fixes PR13798.

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

12 years agoWorkaround for MacOSX build failure with gcc <= 4.4
Alexander Kornienko [Mon, 10 Sep 2012 14:54:38 +0000 (14:54 +0000)]
Workaround for MacOSX build failure with gcc <= 4.4

Summary:
A better solution to http://llvm.org/bugs/show_bug.cgi?id=13777
Named namespace + more unique name to make ODR violations unlikely.

Reviewers: chandlerc, doug.gregor, klimek

Reviewed By: doug.gregor

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D38

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

12 years agoRevert "Revert Ted's r163489 and r163490, due to breakage."
Ted Kremenek [Mon, 10 Sep 2012 14:50:55 +0000 (14:50 +0000)]
Revert "Revert Ted's r163489 and r163490, due to breakage."

I need to see how this breaks on other platforms when I fix the issue
that Benjamin Kramer pointed out.

This includes r163489 and r163490, plus a two line change.

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

12 years agoMake helper functions static.
Benjamin Kramer [Mon, 10 Sep 2012 11:57:16 +0000 (11:57 +0000)]
Make helper functions static.

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

12 years agoWrong crtbegin/crtend pair used for PIE on Android.
Evgeniy Stepanov [Mon, 10 Sep 2012 10:30:12 +0000 (10:30 +0000)]
Wrong crtbegin/crtend pair used for PIE on Android.

Android uses the same flavour of crt*.o for PIE and non-PIE executables, and a
different one for DSOs. GNU/Linux, on the other hand, uses one set of crt*.o
for non-PIE executables, and another for both PIE executables and DSOs.

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

12 years agoRevert Ted's r163489 and r163490, due to breakage.
NAKAMURA Takumi [Mon, 10 Sep 2012 09:17:27 +0000 (09:17 +0000)]
Revert Ted's r163489 and r163490, due to breakage.

r163489, "Take another crack at stabilizing the emission order of analyzer"
r163490, "Use isBeforeInTranslationUnitThan() instead of operator<."

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

12 years agoMIPS: Use -march=arch option to select either generic MIPS ISA,
Simon Atanasyan [Mon, 10 Sep 2012 08:32:41 +0000 (08:32 +0000)]
MIPS: Use -march=arch option to select either generic MIPS ISA,
or the name of a particular processor.

The patch reviewed by Douglas Gregor.

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

12 years agoUse isBeforeInTranslationUnitThan() instead of operator<.
Ted Kremenek [Mon, 10 Sep 2012 06:56:07 +0000 (06:56 +0000)]
Use isBeforeInTranslationUnitThan() instead of operator<.

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

12 years agoTake another crack at stabilizing the emission order of analyzer
Ted Kremenek [Mon, 10 Sep 2012 06:20:06 +0000 (06:20 +0000)]
Take another crack at stabilizing the emission order of analyzer
diagnostics without using FoldingSetNodeIDs.  This is done
by doing a complete recursive comparison of the PathDiagnostics.

Note that the previous method of comparing FoldingSetNodeIDs did
not end up relying on unstable things such as pointer addresses, so
I suspect this may still have some issues on various buildbots because
I'm not sure if the true source of non-determinism has been eliminated.
The tests pass for me, so the only way to know is to commit this change
and see what happens.

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

12 years agoHave PathDiagnosticPiece::getString() return a StringRef instead
Ted Kremenek [Mon, 10 Sep 2012 06:19:53 +0000 (06:19 +0000)]
Have PathDiagnosticPiece::getString() return a StringRef instead
of a std::string.

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

12 years agoIndent the "message" key in analyzer plist output.
Ted Kremenek [Mon, 10 Sep 2012 06:19:43 +0000 (06:19 +0000)]
Indent the "message" key in analyzer plist output.

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