]> granicus.if.org Git - clang/log
clang
11 years agoAssert that Parser::ParseStructUnionBody is not called for C++ code.
Andy Gibbs [Wed, 3 Apr 2013 09:31:19 +0000 (09:31 +0000)]
Assert that Parser::ParseStructUnionBody is not called for C++ code.

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

11 years agoCleanup, add comments and address review comments.
Daniel Jasper [Wed, 3 Apr 2013 07:21:51 +0000 (07:21 +0000)]
Cleanup, add comments and address review comments.

No functional changes.

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

11 years ago[modules] If a submodule has re-definitions of the same macro, only the last definiti...
Argyrios Kyrtzidis [Wed, 3 Apr 2013 05:11:33 +0000 (05:11 +0000)]
[modules] If a submodule has re-definitions of the same macro, only the last definition will be used as the "exported" one.

Fixes rdar://13562262

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

11 years agoUse getPredefinesFileID() appropriately.
Douglas Gregor [Wed, 3 Apr 2013 03:16:36 +0000 (03:16 +0000)]
Use getPredefinesFileID() appropriately.

Thanks to Argyrios for the pointer.

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

11 years agoRefactor the Get* functions to be more consistant among themselves.
Richard Trieu [Wed, 3 Apr 2013 03:06:48 +0000 (03:06 +0000)]
Refactor the Get* functions to be more consistant among themselves.

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

11 years agoDo not assume the template argument is an integer only because the
Richard Trieu [Wed, 3 Apr 2013 02:31:17 +0000 (02:31 +0000)]
Do not assume the template argument is an integer only because the
expressions are integer.  It can also be ValueDecl expressions

Use the type information from the TemplateParameterList instead

Patch by Olivier Goffart!

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

11 years agoFix a crasher in Template Diffing.
Richard Trieu [Wed, 3 Apr 2013 02:22:12 +0000 (02:22 +0000)]
Fix a crasher in Template Diffing.

When support was added for declaration arguments, the case of variadic
declaration arguments was not supported.  This patch fixes that problem by
not crashing when certain ValueDecl's are null.

Patch by Olivier Goffart!

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

11 years agoFix a crasher in Template Diffing.
Richard Trieu [Wed, 3 Apr 2013 02:11:36 +0000 (02:11 +0000)]
Fix a crasher in Template Diffing.

Value depenedent expressions for default arguments cannot be evaluated.
Instead, use the desugared template type to get an argument expression that
can be used.  This is needed for both integer and declaration arguements.

Also, move this common code into a separate function.

Patch by Olivier Goffart!

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

11 years agoMove this file into the correct directory.
Eric Christopher [Wed, 3 Apr 2013 01:58:56 +0000 (01:58 +0000)]
Move this file into the correct directory.

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

11 years agoFrom PR9121 gcc defaulted to omitting the frame pointer on linux,
Eric Christopher [Wed, 3 Apr 2013 01:58:53 +0000 (01:58 +0000)]
From PR9121 gcc defaulted to omitting the frame pointer on linux,
however, it doesn't do that unless we're optimizing. Change
that and haul out to a helper function. Also make this a driver
test appropriate rather than an assembly test.

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

11 years agoEscape more @ signs in Doxygen comments.
Jordan Rose [Wed, 3 Apr 2013 01:39:23 +0000 (01:39 +0000)]
Escape more @ signs in Doxygen comments.

Doxygen treats "@command" the same as "\command" in a doc comment, so
whenever we talk about Objective-C things like "@interface" we have to
make sure to escape them.

Let's try to keep Clang -Wdocumentation-clean!

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

11 years ago[analyzer] Better model for copying of array fields in implicit copy ctors.
Jordan Rose [Wed, 3 Apr 2013 01:39:08 +0000 (01:39 +0000)]
[analyzer] Better model for copying of array fields in implicit copy ctors.

- Find the correct region to represent the first array element when
  constructing a CXXConstructorCall.
- If the array is trivial, model the copy with a primitive load/store.
- Don't warn about the "uninitialized" subscript in the AST -- we don't use
  the helper variable that Sema provides.

<rdar://problem/13091608>

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

11 years agoIn ObjC++ on legacy runtimes, push an EH cleanup as well as
John McCall [Wed, 3 Apr 2013 00:56:07 +0000 (00:56 +0000)]
In ObjC++ on legacy runtimes, push an EH cleanup as well as
a normal cleanup when entering a @try or @synchronized to
ensure that we clean that up if an exception is triggered.

Apparently GCC did this, so it's hard to argue that we shouldn't
do at least as much.

rdar://12364847

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

11 years agoObjective-C arc [qui]. Don't issue the bridge cast
Fariborz Jahanian [Tue, 2 Apr 2013 23:48:59 +0000 (23:48 +0000)]
Objective-C arc [qui]. Don't issue the bridge cast
warning when doing a __bride cast in non-arc
mode (which has no retain count effect).
// rdar://13514210

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

11 years agoSilencing warnings in MSVC due to duplicate identifiers.
Aaron Ballman [Tue, 2 Apr 2013 23:47:53 +0000 (23:47 +0000)]
Silencing warnings in MSVC due to duplicate identifiers.

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

11 years agoRevert "Revert r178079, it caused PR15637."
Eric Christopher [Tue, 2 Apr 2013 22:59:11 +0000 (22:59 +0000)]
Revert "Revert r178079, it caused PR15637."

This reverts commit r178497 since the backend has been fixed.

Also add a test to ensure that we're emitting template information for unions.

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

11 years agoUpdate assertion string to new name of ArithAssignBinaryOperator
Stefanus Du Toit [Tue, 2 Apr 2013 20:18:18 +0000 (20:18 +0000)]
Update assertion string to new name of ArithAssignBinaryOperator

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

11 years ago[ms-inline asm] Test case for r178566.
Chad Rosier [Tue, 2 Apr 2013 20:03:29 +0000 (20:03 +0000)]
[ms-inline asm] Test case for r178566.

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

11 years agoIf a defaulted special member is implicitly deleted, check whether it's
Richard Smith [Tue, 2 Apr 2013 19:38:47 +0000 (19:38 +0000)]
If a defaulted special member is implicitly deleted, check whether it's
overriding a non-deleted virtual function. The existing check for this doesn't
catch this case, because it fires before we mark the method as deleted.

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

11 years agoObjective-C: Provide fixit hints when warning
Fariborz Jahanian [Tue, 2 Apr 2013 18:57:54 +0000 (18:57 +0000)]
Objective-C: Provide fixit hints when warning
about 'isa' ivar being explicitely accessed
when base is a user class object reference.
// rdar://13503456

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

11 years agoRemove dead store.
Richard Smith [Tue, 2 Apr 2013 18:57:50 +0000 (18:57 +0000)]
Remove dead store.

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

11 years agoAdding a hasLocalQualifiers() AST Matcher.
Edwin Vane [Tue, 2 Apr 2013 18:15:55 +0000 (18:15 +0000)]
Adding a hasLocalQualifiers() AST Matcher.

Updated tests and docs.

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

11 years agoMoved fallthrough regression test to switch-implicit-fallthrough.cpp.
Alexander Kornienko [Tue, 2 Apr 2013 17:55:01 +0000 (17:55 +0000)]
Moved fallthrough regression test to switch-implicit-fallthrough.cpp.

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

11 years ago[ms-cxxabi] Rename enum and remove dead case per Jordan's suggestion
Reid Kleckner [Tue, 2 Apr 2013 17:40:19 +0000 (17:40 +0000)]
[ms-cxxabi] Rename enum and remove dead case per Jordan's suggestion

The IHM_ prefix was a fairly gross abbreviation to try to hit three
characters for uniqueness.

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

11 years ago[ms-cxxabi] Remove unused variable
Reid Kleckner [Tue, 2 Apr 2013 17:24:20 +0000 (17:24 +0000)]
[ms-cxxabi] Remove unused variable

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

11 years ago[ms-cxxabi] Move MS inheritance model calculation into MemberPointerType
Reid Kleckner [Tue, 2 Apr 2013 16:23:57 +0000 (16:23 +0000)]
[ms-cxxabi] Move MS inheritance model calculation into MemberPointerType

Summary:
This makes it possible to share code between lib/AST/MicrosoftCXXABI.cpp
and lib/CodeGen/MicrosoftCXXABI.cpp.  No functionality change.

Also adds comments about the layout of the member pointer structs as I
currently understand them.

Reviewers: rjmccall

CC: timurrrr, cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D590

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

11 years agoFixed "fallthrough annotation does not directly precede switch label" warning in
Alexander Kornienko [Tue, 2 Apr 2013 15:20:32 +0000 (15:20 +0000)]
Fixed "fallthrough annotation does not directly precede switch label" warning in
case when [[clang::fallthrough]]; is used in a method of a local class.

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

11 years agoFix some inconsistent use of indentation.
Daniel Jasper [Tue, 2 Apr 2013 14:33:13 +0000 (14:33 +0000)]
Fix some inconsistent use of indentation.

Basically we have always special-cased the top-level statement of an
unwrapped line (the one with ParenLevel == 0) and that lead to several
inconsistencies. All added tests were formatted in a strange way, for
example:

Before:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa();
if (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
        .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
            .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()) {
}

After:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa();
if (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
        .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
        .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
        .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()) {
}

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

11 years agoEscape # and $ in dependency files.
Benjamin Kramer [Tue, 2 Apr 2013 13:38:48 +0000 (13:38 +0000)]
Escape # and $ in dependency files.

Fixes PR15642.

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

11 years agoRemove target-specific alignment from test.
Benjamin Kramer [Tue, 2 Apr 2013 13:38:42 +0000 (13:38 +0000)]
Remove target-specific alignment from test.

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

11 years ago[ASan] Emit lifetime markers for local variables in -fsanitize=use-after-scope mode
Alexey Samsonov [Tue, 2 Apr 2013 13:19:46 +0000 (13:19 +0000)]
[ASan] Emit lifetime markers for local variables in -fsanitize=use-after-scope mode

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

11 years agoAlternative handling of comments adjacent to preprocessor directives.
Alexander Kornienko [Tue, 2 Apr 2013 13:04:06 +0000 (13:04 +0000)]
Alternative handling of comments adjacent to preprocessor directives.

Summary: Store comments in ScopedLineState

Reviewers: klimek, djasper

Reviewed By: klimek

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

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

11 years ago[analyzer] Moving cplusplus.NewDelete to alpha.* for now.
Anton Yartsev [Tue, 2 Apr 2013 05:59:24 +0000 (05:59 +0000)]
[analyzer] Moving cplusplus.NewDelete to alpha.* for now.

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

11 years agoAdd -Wstatic-local-in-inline, which warns about using a static local
John McCall [Tue, 2 Apr 2013 02:48:58 +0000 (02:48 +0000)]
Add -Wstatic-local-in-inline, which warns about using a static local
variable in a C99 inline (but not static-inline or extern-inline)
function definition.

The standard doesn't actually say that this doesn't apply to
"extern inline" definitions, but that seems like a useful extension,
and it at least doesn't have the obvious flaw that a static
mutable variable in an externally-available definition does.

rdar://13535367

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

11 years ago[analyzer] Teach invalidateRegions that regions within LazyCompoundVal need to be...
Anna Zaks [Tue, 2 Apr 2013 01:28:24 +0000 (01:28 +0000)]
[analyzer] Teach invalidateRegions that regions within LazyCompoundVal need to be invalidated

Refactor invalidateRegions to take SVals instead of Regions as input and teach RegionStore
about processing LazyCompoundVal as a top-level “escaping” value.

This addresses several false positives that get triggered by the NewDelete checker, but the
underlying issue is reproducible with other checkers as well (for example, MallocChecker).

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

11 years agoun-break remaining gdb buildbot testcases.
Adrian Prantl [Tue, 2 Apr 2013 01:00:48 +0000 (01:00 +0000)]
un-break remaining gdb buildbot testcases.
Make sure we do not generate line info for debugging-related frame setup.
Follow-up to r178361 / rdar://problem/12767564

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

11 years ago[analyzer] For now, don't inline [cd]tors of C++ containers.
Jordan Rose [Tue, 2 Apr 2013 00:26:35 +0000 (00:26 +0000)]
[analyzer] For now, don't inline [cd]tors of C++ containers.

This is a heuristic to make up for the fact that the analyzer doesn't
model C++ containers very well. One example is modeling that
'std::distance(I, E) == 0' implies 'I == E'. In the future, it would be
nice to model this explicitly, but for now it just results in a lot of
false positives.

The actual heuristic checks if the base type has a member named 'begin' or
'iterator'. If so, we treat the constructors and destructors of that type
as opaque, rather than inlining them.

This is intended to drastically reduce the number of false positives
reported with experimental destructor support turned on. We can tweak the
heuristic in the future, but we'd rather err on the side of false negatives
for now.

<rdar://problem/13497258>

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

11 years ago[analyzer] Cache whether a function is generally inlineable.
Jordan Rose [Tue, 2 Apr 2013 00:26:29 +0000 (00:26 +0000)]
[analyzer] Cache whether a function is generally inlineable.

Certain properties of a function can determine ahead of time whether or not
the function is inlineable, such as its kind, its signature, or its
location. We can cache this value in the FunctionSummaries map to avoid
rechecking these static properties for every call.

Note that the analyzer may still decide not to inline a specific call to
a function because of the particular dynamic properties of the call along
the current path.

No intended functionality change.

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

11 years ago[analyzer] Use inline storage in the FunctionSummary DenseMap.
Jordan Rose [Tue, 2 Apr 2013 00:26:26 +0000 (00:26 +0000)]
[analyzer] Use inline storage in the FunctionSummary DenseMap.

The summaries lasted for the lifetime of the map anyway; no reason to
include an extra allocation.

Also, use SmallBitVector instead of BitVector to track the visited basic
blocks -- most functions will have less than 64 basic blocks -- and
use bitfields for the other fields to reduce the size of the structure.

No functionality change.

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

11 years ago[analyzer] Allow suppressing diagnostics reported within the 'std' namespace
Jordan Rose [Tue, 2 Apr 2013 00:26:15 +0000 (00:26 +0000)]
[analyzer] Allow suppressing diagnostics reported within the 'std' namespace

This is controlled by the 'suppress-c++-stdlib' analyzer-config flag.
It is currently off by default.

This is more suppression than we'd like to do, since obviously there can
be user-caused issues within 'std', but it gives us the option to wield
a large hammer to suppress false positives the user likely can't work
around.

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

11 years agoFix typo in test
Matt Beaumont-Gay [Mon, 1 Apr 2013 22:58:48 +0000 (22:58 +0000)]
Fix typo in test

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

11 years agoUse the ASYContext::getTypeSizeInChars API to cleanup some ugliness, per John
Chad Rosier [Mon, 1 Apr 2013 22:02:05 +0000 (22:02 +0000)]
Use the ASYContext::getTypeSizeInChars API to cleanup some ugliness, per John
and Jordan's suggestion.  No functional change intendend.

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

11 years agoPR15633: Note that we are EnteringContext when parsing the nested name
Richard Smith [Mon, 1 Apr 2013 21:43:41 +0000 (21:43 +0000)]
PR15633: Note that we are EnteringContext when parsing the nested name
specifier for an enumeration. Also fix a crash-on-invalid if a non-dependent
name specifier is used to declare an enum template.

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

11 years ago[arcmt] Copy the diagnostics so we don't have to worry about invaliding iterators...
Argyrios Kyrtzidis [Mon, 1 Apr 2013 21:12:30 +0000 (21:12 +0000)]
[arcmt] Copy the diagnostics so we don't have to worry about invaliding iterators from the diagnostic list.

Should fix http://llvm.org/PR15500

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

11 years agoR600: Handle -mcpu option v3
Tom Stellard [Mon, 1 Apr 2013 20:56:53 +0000 (20:56 +0000)]
R600: Handle -mcpu option v3

v2:
  - Add a test case

v3:
  - Use the -### clang option in the tests

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

11 years agoR600: Add missing Southern Islands GPU to setCPU() function
Tom Stellard [Mon, 1 Apr 2013 20:56:49 +0000 (20:56 +0000)]
R600: Add missing Southern Islands GPU to setCPU() function

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

11 years agoRevert r178079, it caused PR15637.
Nico Weber [Mon, 1 Apr 2013 20:33:18 +0000 (20:33 +0000)]
Revert r178079, it caused PR15637.

Also add a test for PR15637.

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

11 years agoDon't eagerly deserialize every templated function (and every static data
Richard Smith [Mon, 1 Apr 2013 20:22:16 +0000 (20:22 +0000)]
Don't eagerly deserialize every templated function (and every static data
member inside a class template) when loading a PCH file or module.

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

11 years ago* Attempt to un-break gdb buildbot by emitting a lexical block end only
Adrian Prantl [Mon, 1 Apr 2013 19:02:06 +0000 (19:02 +0000)]
* Attempt to un-break gdb buildbot by emitting a lexical block end only
  when we actually end a lexical block.
* Added new test for line table / block cleanup.
* Follow-up to r177819 / rdar://problem/13115369

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

11 years agoOnly merge down a variable type if the previous declaration was
John McCall [Mon, 1 Apr 2013 18:34:28 +0000 (18:34 +0000)]
Only merge down a variable type if the previous declaration was
visible.  There's a lot of potential badness in how we're modelling
these things, but getting this much correct is reasonably easy.

rdar://13535367

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

11 years agoAdding parenType() and innerType() AST Matchers
Edwin Vane [Mon, 1 Apr 2013 18:33:34 +0000 (18:33 +0000)]
Adding parenType() and innerType() AST Matchers

Updated docs and tests.

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

11 years agoCleanup. No functional change intended.
Chad Rosier [Mon, 1 Apr 2013 17:58:03 +0000 (17:58 +0000)]
Cleanup.  No functional change intended.

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

11 years agoThread safety analysis: Turn on checking for non-scalar types by default.
DeLesley Hutchins [Mon, 1 Apr 2013 17:47:37 +0000 (17:47 +0000)]
Thread safety analysis:  Turn on checking for non-scalar types by default.
These were previously enabled as a "beta" feature, but they have now been
extensively tested.

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

11 years agoAdd test for PR12527 (bug has apparently already been fixed).
Richard Smith [Mon, 1 Apr 2013 17:41:23 +0000 (17:41 +0000)]
Add test for PR12527 (bug has apparently already been fixed).

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

11 years ago[libclang] Make clang_Cursor_getArgument work with call-exprs.
Argyrios Kyrtzidis [Mon, 1 Apr 2013 17:38:59 +0000 (17:38 +0000)]
[libclang] Make clang_Cursor_getArgument work with call-exprs.

Patch by Matthias Kleine!

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

11 years agoImprove formatting of function types.
Daniel Jasper [Mon, 1 Apr 2013 17:13:26 +0000 (17:13 +0000)]
Improve formatting of function types.

Before: void * (*a)(int *, SomeType *);
After:  void *(*a)(int *, SomeType *);

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

11 years agoModifed debug-info-byval.cpp test to grep for .string or .asciz.
Jyotsna Verma [Mon, 1 Apr 2013 15:59:25 +0000 (15:59 +0000)]
Modifed debug-info-byval.cpp test to grep for .string or .asciz.
The assembly output for Hexagon contains ".string missing_arg".

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

11 years agoFix typo. This method isn't used anywhere.
Benjamin Kramer [Sun, 31 Mar 2013 20:14:24 +0000 (20:14 +0000)]
Fix typo. This method isn't used anywhere.

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

11 years agoRemove unused default values.
Rafael Espindola [Sat, 30 Mar 2013 23:04:08 +0000 (23:04 +0000)]
Remove unused default values.

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

11 years agoRemove old NVPTX cpus and add new NVPTX cpus
Justin Holewinski [Sat, 30 Mar 2013 14:38:26 +0000 (14:38 +0000)]
Remove old NVPTX cpus and add new NVPTX cpus

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

11 years agoUse kernel metadata to differentiate between kernel and device
Justin Holewinski [Sat, 30 Mar 2013 14:38:24 +0000 (14:38 +0000)]
Use kernel metadata to differentiate between kernel and device
functions for the NVPTX target.

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

11 years agoAdd support for gcc-compatible -mfprnd -mno-fprnd PPC options
Hal Finkel [Sat, 30 Mar 2013 13:47:44 +0000 (13:47 +0000)]
Add support for gcc-compatible -mfprnd -mno-fprnd PPC options

gcc provides -mfprnd and -mno-fprnd for controlling the fprnd target
feature; support these options as well.

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

11 years agoSema: Don't crash when trying to emit a precedence warning on postinc/decrement.
Benjamin Kramer [Sat, 30 Mar 2013 11:56:00 +0000 (11:56 +0000)]
Sema: Don't crash when trying to emit a precedence warning on postinc/decrement.

Post-Inc can occur as a binary call (the infamous dummy int argument), but it's
not really a binary operator.

Fixes PR15628.

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

11 years ago[analyzer] Restructure ExprEngine::VisitCXXNewExpr to do a bit less work.
Jordan Rose [Sat, 30 Mar 2013 01:31:48 +0000 (01:31 +0000)]
[analyzer] Restructure ExprEngine::VisitCXXNewExpr to do a bit less work.

No functionality change.

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

11 years ago[analyzer] Handle caching out while evaluating a C++ new expression.
Jordan Rose [Sat, 30 Mar 2013 01:31:42 +0000 (01:31 +0000)]
[analyzer] Handle caching out while evaluating a C++ new expression.

Evaluating a C++ new expression now includes generating an intermediate
ExplodedNode, and this node could very well represent a previously-
reachable state in the ExplodedGraph. If so, we can short-circuit the
rest of the evaluation.

Caught by the assertion a few lines later.

<rdar://problem/13510065>

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

11 years ago[analyzer] Add debug helper LocationContext::dumpStack().
Jordan Rose [Sat, 30 Mar 2013 01:31:35 +0000 (01:31 +0000)]
[analyzer] Add debug helper LocationContext::dumpStack().

Sample output:
  #0 void construct(pointer __p, llvm::ImutAVLTree<llvm::ImutContainerInfo<clang::ento::BugType *> > *const &__val)
  #1 void push_back(const value_type &__x)
  #2 void destroy()
  #3 void release()
  #4 void ~ImmutableSet()

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

11 years ago[analyzer] Garbage removed
Anton Yartsev [Sat, 30 Mar 2013 01:24:21 +0000 (01:24 +0000)]
[analyzer] Garbage removed

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

11 years ago[analyzer] Test added
Anton Yartsev [Sat, 30 Mar 2013 01:22:45 +0000 (01:22 +0000)]
[analyzer] Test added

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

11 years ago[analyzer] Enabled unix.Malloc checker.
Anton Yartsev [Sat, 30 Mar 2013 00:50:37 +0000 (00:50 +0000)]
[analyzer] Enabled unix.Malloc checker.
+ Refactoring.

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

11 years ago[analyzer] Tests for intersections with other checkers from MallocChecker.cpp factore...
Anton Yartsev [Sat, 30 Mar 2013 00:43:02 +0000 (00:43 +0000)]
[analyzer] Tests for intersections with other checkers from MallocChecker.cpp factored out to  NewDelete-intersections.mm

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

11 years agogeneralize testcase
Adrian Prantl [Fri, 29 Mar 2013 23:15:55 +0000 (23:15 +0000)]
generalize testcase

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

11 years ago[analyzer] Address Jordan’s review of r178309 - do not register an extra visitor...
Anna Zaks [Fri, 29 Mar 2013 22:32:38 +0000 (22:32 +0000)]
[analyzer] Address Jordan’s review of r178309 - do not register an extra visitor for nil receiver

We can check if the receiver is nil in the node that corresponds to the StmtPoint of the message send.
At that point, the receiver is guaranteed to be live. We will find at least one unreclaimed node due to
my previous commit (look for StmtPoint instead of PostStmt) and the fact that the nil receiver nodes are tagged.

+ a couple of extra tests.

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

11 years ago[analyzer] Look for a StmtPoint node instead of PostStmt in trackNullOrUndefValue.
Anna Zaks [Fri, 29 Mar 2013 22:32:34 +0000 (22:32 +0000)]
[analyzer] Look for a StmtPoint node instead of PostStmt in trackNullOrUndefValue.

trackNullOrUndefValue tries to find the first node that matches the statement it is tracking.
Since we collect PostStmt nodes (in node reclamation), none of those might be on the
current path, so relax the search to look for any StmtPoint.

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

11 years ago[libclang] Add test case for r178374.
Argyrios Kyrtzidis [Fri, 29 Mar 2013 22:16:32 +0000 (22:16 +0000)]
[libclang] Add test case for r178374.

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

11 years agoWhen looking for overridden ObjC methods, don't ignore 'hidden' ones.
Argyrios Kyrtzidis [Fri, 29 Mar 2013 21:51:48 +0000 (21:51 +0000)]
When looking for overridden ObjC methods, don't ignore 'hidden' ones.

When using modules we should not ignore overridden methods from
categories that are hidden because the module is not visible.
This will give more consistent results (when imports change) and it's more
correct since the methods are indeed overridden even if they are not "visible"
for lookup purposes.

rdar://13350796

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

11 years ago[libclang] If libclang logging is enabled, print all compiler diagnostics to stderr...
Argyrios Kyrtzidis [Fri, 29 Mar 2013 21:51:44 +0000 (21:51 +0000)]
[libclang] If libclang logging is enabled, print all compiler diagnostics to stderr instead of capturing them.

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

11 years ago[cmake] Add clang-headers as a dependency of libclang and if we have to copy them
Argyrios Kyrtzidis [Fri, 29 Mar 2013 21:51:40 +0000 (21:51 +0000)]
[cmake] Add clang-headers as a dependency of libclang and if we have to copy them
for the IDE case, also create a symlink inside the libclang.dylib directory.

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

11 years agoSema: Warn on sizeof on binary ops on decayed arrays.
Benjamin Kramer [Fri, 29 Mar 2013 21:43:21 +0000 (21:43 +0000)]
Sema: Warn on sizeof on binary ops on decayed arrays.

The array will decay into a pointer, creating an unexpected result.
sizeof(array + int) is an easy to make typo for sizeof(array) + int.

This was motivated by a NetBSD security bug, used sizeof(key - r) instead of
sizeof(key) - r, reducing entropy in a random number generator.
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/subr_cprng.c.diff?r1=1.14&r2=1.15&only_with_tag=MAIN&f=h

Differential Revision: http://llvm-reviews.chandlerc.com/D571

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

11 years agoBugfix/Followup for r177086.
Adrian Prantl [Fri, 29 Mar 2013 19:20:35 +0000 (19:20 +0000)]
Bugfix/Followup for r177086.
* Store the .block_descriptor (instead of self) in the alloca so we
  can guarantee that all captured variables are available at -O0.
* Add the missing OpDeref for the alloca.
rdar://problem/12767564

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

11 years agoImprovement on r177086.
Adrian Prantl [Fri, 29 Mar 2013 19:20:29 +0000 (19:20 +0000)]
Improvement on r177086.
* Let DIType for block-captured self to point to the completed cached
  interface type.
rdar://problem/12767564

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

11 years agoHexagon: Set Hexagon tool-chain when configured as OSless target.
Jyotsna Verma [Fri, 29 Mar 2013 19:09:20 +0000 (19:09 +0000)]
Hexagon: Set Hexagon tool-chain when configured as OSless target.

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

11 years agoRemove sign-compare warning on systems that still use 32 bit time_ts.
Benjamin Kramer [Fri, 29 Mar 2013 17:39:43 +0000 (17:39 +0000)]
Remove sign-compare warning on systems that still use 32 bit time_ts.

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

11 years agoFix thinko (and the bots): We still want to warn in C.
Rafael Espindola [Fri, 29 Mar 2013 07:56:05 +0000 (07:56 +0000)]
Fix thinko (and the bots): We still want to warn in C.

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

11 years agoDon't special case one line extern "C" decls.
Rafael Espindola [Fri, 29 Mar 2013 07:02:31 +0000 (07:02 +0000)]
Don't special case one line extern "C" decls.

We already avoided warning for

extern "C" const char *Version_string = "2.9";

now we also don't produce any warnings for

extern "C" {
  extern const char *Version_string2 = "2.9";
}

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

11 years agoAdd RDSEED intrinsic support defined in AVX2 extension
Michael Liao [Fri, 29 Mar 2013 05:17:55 +0000 (05:17 +0000)]
Add RDSEED intrinsic support defined in AVX2 extension

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

11 years agoAdd XTEST intrinsic defined in TSX extension
Michael Liao [Fri, 29 Mar 2013 05:14:06 +0000 (05:14 +0000)]
Add XTEST intrinsic defined in TSX extension

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

11 years ago[cfg] Always guard (when AddStaticInitBranches == true) DeclStmts for static variable...
Ted Kremenek [Fri, 29 Mar 2013 00:42:56 +0000 (00:42 +0000)]
[cfg] Always guard (when AddStaticInitBranches == true) DeclStmts for static variables, not just ones with explicit initializers

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

11 years ago[analyzer] Add static initializer test case (from <rdar://problem/13227740>).
Ted Kremenek [Fri, 29 Mar 2013 00:32:36 +0000 (00:32 +0000)]
[analyzer] Add static initializer test case (from <rdar://problem/13227740>).

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

11 years agoRevert r178273 as it broke the Linux bootstrap due to false positives
Timur Iskhodzhanov [Fri, 29 Mar 2013 00:22:03 +0000 (00:22 +0000)]
Revert r178273 as it broke the Linux bootstrap due to false positives

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

11 years agoAdd static analyzer support for conditionally executing static initializers.
Ted Kremenek [Fri, 29 Mar 2013 00:09:28 +0000 (00:09 +0000)]
Add static analyzer support for conditionally executing static initializers.

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

11 years agoAdd configuration plumbing to enable static initializer branching in the CFG for...
Ted Kremenek [Fri, 29 Mar 2013 00:09:22 +0000 (00:09 +0000)]
Add configuration plumbing to enable static initializer branching in the CFG for the analyzer.

This setting still isn't enabled yet in the analyzer.  This is
just prep work.

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

11 years agoObjective-C: Produce precise diagnostic when
Fariborz Jahanian [Thu, 28 Mar 2013 23:39:11 +0000 (23:39 +0000)]
Objective-C: Produce precise diagnostic when
'isa' ivar is accessed provided it is the first
ivar. Fixit hint will follow in another patch.
This is continuation of // rdar://13503456

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

11 years ago[analyzer] Document existence of ConstPointerEscape.
Anna Zaks [Thu, 28 Mar 2013 23:15:32 +0000 (23:15 +0000)]
[analyzer] Document existence of ConstPointerEscape.

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

11 years ago[analyzer] Add support for escape of const pointers and use it to allow “newed” point...
Anna Zaks [Thu, 28 Mar 2013 23:15:29 +0000 (23:15 +0000)]
[analyzer] Add support for escape of const pointers and use it to allow “newed” pointers to escape

Add a new callback that notifies checkers when a const pointer escapes. Currently, this only works
for const pointers passed as a top level parameter into a function. We need to differentiate the const
pointers escape from regular escape since the content pointed by const pointer will not change;
if it’s a file handle, a file cannot be closed; but delete is allowed on const pointers.

This should suppress several false positives reported by the NewDelete checker on llvm codebase.

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

11 years ago[analyzer] Apply the suppression rules to the nil receiver only if the value particip...
Anna Zaks [Thu, 28 Mar 2013 23:15:22 +0000 (23:15 +0000)]
[analyzer] Apply the suppression rules to the nil receiver only if the value participates in the computation of the nil we warn about.

We should only suppress a bug report if the IDCed or null returned nil value is directly related to the value we are warning about. This was
not the case for nil receivers - we would suppress a bug report that had an IDCed nil receiver on the path regardless of how it’s
related to the warning.

1) Thread EnableNullFPSuppression parameter through the visitors to differentiate between tracking the value which
is directly responsible for the bug and other values that visitors are tracking (ex: general tracking of nil receivers).
2) in trackNullOrUndef specifically address the case when a value of the message send is nil due to the receiver being nil.

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

11 years ago[ms-cxxabi] Add more tests for r178297
Reid Kleckner [Thu, 28 Mar 2013 23:11:29 +0000 (23:11 +0000)]
[ms-cxxabi] Add more tests for r178297

This covers a few cases where the class of a member pointer is not a
CXXRecordDecl.

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

11 years ago[sema] Check the result of getAsCXXRecordDecl() to fix the build
Reid Kleckner [Thu, 28 Mar 2013 22:15:11 +0000 (22:15 +0000)]
[sema] Check the result of getAsCXXRecordDecl() to fix the build

I'm not 100% sure what should happen here to find the real
CXXRecordDecl.

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

11 years agoWarn about more than the first unused variable when -Werror is set.
Matt Beaumont-Gay [Thu, 28 Mar 2013 21:46:45 +0000 (21:46 +0000)]
Warn about more than the first unused variable when -Werror is set.

To do this, thread DiagnosticErrorTrap's hasUnrecoverableErrorOccurred through
to Scope.

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

11 years ago[sema] Remove unused variable from r178283
Reid Kleckner [Thu, 28 Mar 2013 20:54:13 +0000 (20:54 +0000)]
[sema] Remove unused variable from r178283

Wouldn't it be cool if we had a compiler for Windows that could warn
about these things?

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

11 years ago[ms-cxxabi] Correctly compute the size of member pointers
Reid Kleckner [Thu, 28 Mar 2013 20:02:56 +0000 (20:02 +0000)]
[ms-cxxabi] Correctly compute the size of member pointers

Summary:
This also relaxes the requirement on Windows that the member pointer
class type be a complete type (http://llvm.org/PR12070).  We still ask
for a complete type to instantiate any templates (MSVC does this), but
if that fails we continue as normal, relying on any inheritance
attributes on the declaration.

Reviewers: rjmccall

CC: triton, timurrrr, cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D568

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