Граф коммитов

43618 Коммитов

Автор SHA1 Сообщение Дата
Edwin Vane 7b69cd0944 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
2013-04-02 18:15:55 +00:00
Alexander Kornienko 8b0822b304 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
2013-04-02 17:55:01 +00:00
Reid Kleckner cb428a1ac0 [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
2013-04-02 17:40:19 +00:00
Reid Kleckner 4ba4929527 [ms-cxxabi] Remove unused variable
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178550 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-02 17:24:20 +00:00
Reid Kleckner 4410489163 [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
2013-04-02 16:23:57 +00:00
Alexander Kornienko b0707c9a93 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
2013-04-02 15:20:32 +00:00
Daniel Jasper 3791130df5 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
2013-04-02 14:33:13 +00:00
Benjamin Kramer ddc15c40d2 Escape # and $ in dependency files.
Fixes PR15642.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178540 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-02 13:38:48 +00:00
Benjamin Kramer 7d1be7368e Remove target-specific alignment from test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178539 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-02 13:38:42 +00:00
Alexey Samsonov 4f01ed4205 [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
2013-04-02 13:19:46 +00:00
Alexander Kornienko f52d527907 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
2013-04-02 13:04:06 +00:00
Anton Yartsev 3d11708c49 [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
2013-04-02 05:59:24 +00:00
John McCall b421d926cd 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
2013-04-02 02:48:58 +00:00
Anna Zaks 658a28479d [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
2013-04-02 01:28:24 +00:00
Adrian Prantl 7959194fde 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
2013-04-02 01:00:48 +00:00
Jordan Rose c63a460d78 [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
2013-04-02 00:26:35 +00:00
Jordan Rose c9092bb5eb [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
2013-04-02 00:26:29 +00:00
Jordan Rose 992acb2269 [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
2013-04-02 00:26:26 +00:00
Jordan Rose a12643622a [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
2013-04-02 00:26:15 +00:00
Matt Beaumont-Gay f12a25b55b Fix typo in test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178510 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-01 22:58:48 +00:00
Chad Rosier d94a3a06b7 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
2013-04-01 22:02:05 +00:00
Richard Smith 725fe0ede4 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
2013-04-01 21:43:41 +00:00
Argyrios Kyrtzidis e40e496fce [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
2013-04-01 21:12:30 +00:00
Tom Stellard e25d2f6c5b 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
2013-04-01 20:56:53 +00:00
Tom Stellard 3b848ec836 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
2013-04-01 20:56:49 +00:00
Nico Weber bd0152fb25 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
2013-04-01 20:33:18 +00:00
Richard Smith f396ad9b1f 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
2013-04-01 20:22:16 +00:00
Adrian Prantl efb72adbae * 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
2013-04-01 19:02:06 +00:00
John McCall 5b8740f840 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
2013-04-01 18:34:28 +00:00
Edwin Vane 88be2fdec7 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
2013-04-01 18:33:34 +00:00
Chad Rosier e3faa6ec80 Cleanup. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178481 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-01 17:58:03 +00:00
DeLesley Hutchins dd0a1f58a5 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
2013-04-01 17:47:37 +00:00
Richard Smith 6d11877a22 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
2013-04-01 17:41:23 +00:00
Argyrios Kyrtzidis e9ebd852ec [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
2013-04-01 17:38:59 +00:00
Daniel Jasper 81d2d38d2d 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
2013-04-01 17:13:26 +00:00
Jyotsna Verma bf27951d67 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
2013-04-01 15:59:25 +00:00
Benjamin Kramer 04863a86d1 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
2013-03-31 20:14:24 +00:00
Rafael Espindola 9f8bd33a1c Remove unused default values.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178435 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-30 23:04:08 +00:00
Justin Holewinski affa3af144 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
2013-03-30 14:38:26 +00:00
Justin Holewinski dca8f336e6 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
2013-03-30 14:38:24 +00:00
Hal Finkel fe6b271365 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
2013-03-30 13:47:44 +00:00
Benjamin Kramer 66dca6eaaa 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
2013-03-30 11:56:00 +00:00
Jordan Rose 76f7761dae [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
2013-03-30 01:31:48 +00:00
Jordan Rose e6f2bf8628 [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
2013-03-30 01:31:42 +00:00
Jordan Rose 75f8bd0131 [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
2013-03-30 01:31:35 +00:00
Anton Yartsev 5184dd45b0 [analyzer] Garbage removed
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178398 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-30 01:24:21 +00:00
Anton Yartsev 70be6d8401 [analyzer] Test added
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178397 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-30 01:22:45 +00:00
Anton Yartsev 8e452e7d6e [analyzer] Enabled unix.Malloc checker.
+ Refactoring.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178388 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-30 00:50:37 +00:00
Anton Yartsev 1f3b5d990e [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
2013-03-30 00:43:02 +00:00
Adrian Prantl c22856d98b generalize testcase
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178383 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-29 23:15:55 +00:00