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

43341 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor e91544210a Remove local path from test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177925 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-25 21:52:42 +00:00
Douglas Gregor 87ab066c70 Use <time.h> rather than <sys/time.h>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177924 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-25 21:51:16 +00:00
Douglas Gregor 5d835266d5 Use xargs rather than
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177923 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-25 21:49:54 +00:00
Matt Beaumont-Gay b63d8d2609 Fix a layering violation introduced in r177705.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177922 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-25 21:32:02 +00:00
Douglas Gregor 5dca66c3d0 Use 'touch -t', which both BSD and Linux support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177921 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-25 21:27:57 +00:00
Nick Lewycky cdd81e5a68 Try harder to be signal-safe inside our signal handler. The most prominent behavioural
difference is that we no longer clean the token before emitting it. This fixes a bug where
clang hangs in the middle of crashing because the crash handler calls malloc from inside
a crash that happened inside of free.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177919 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-25 21:24:30 +00:00
Douglas Gregor d44d2872b2 <rdar://problem/13434605> Periodically prune the module cache so that it does not grow forever.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177918 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-25 21:19:16 +00:00
Nick Lewycky fd61d6fe0a Correct indentation. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177916 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-25 21:10:14 +00:00
Bill Wendling 14df23bd11 Emit an error message instead of crashing when dereferencing an incomplete pointer type.
If the ASM statement is dereferencing an incomplete pointer type, issue an error
instead of crashing.
<rdar://problem/12700799>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177915 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-25 21:09:49 +00:00
Chad Rosier 1f1df1f48e IR-gen should not generate an MMX types unless the code is explicitly using MMX
intrinsics.
rdar://13213542


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177911 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-25 21:00:27 +00:00
Anna Zaks 5db8fac5f3 [analyzer] Set concrete offset bindings to UnknownVal when processing symbolic offset binding, even if no bindings are present.
This addresses an undefined value false positive from concreteOffsetBindingIsInvalidatedBySymbolicOffsetAssignment.

Fixes PR14877; radar://12991168.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177905 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-25 20:43:24 +00:00
Fariborz Jahanian 4eb17e553c Added PR number for failing win64 tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177886 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-25 18:56:45 +00:00
Daniel Jasper 0ff72fc9fa Re-add clang-format tests to clang/test.
Also now use -strict-whitespace as the tests are confusing otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177853 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-25 09:14:25 +00:00
Anton Yartsev 2de19edab6 [analyzer] Adds cplusplus.NewDelete checker that check for memory leaks, double free, and use-after-free problems of memory managed by new/delete.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177849 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-25 01:35:45 +00:00
Jordan Rose 8f7bfb40b7 [analyzer] Teach ConstraintManager to ignore NonLoc <> NonLoc comparisons.
These aren't generated by default, but they are needed when either side of
the comparison is tainted.

Should fix our internal buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177846 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-24 20:25:22 +00:00
Benjamin Kramer f4492448a2 Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177842 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-24 16:04:55 +00:00
Rafael Espindola 2951187534 Reject -no-integrated-as on windows.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177840 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-24 15:06:53 +00:00
Guy Benyei 1db7040604 Generate metadata to implement the -cl-kernel-arg-info option.
OpenCL 1.2 spec. 5.7.3.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177839 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-24 13:58:12 +00:00
Benjamin Kramer e8b87f9086 Don't actually invoke codegen in driver test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177838 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-24 11:30:15 +00:00
Nadav Rotem 495cfa4630 Make clang to mark static stack allocations with lifetime markers to enable a more aggressive stack coloring.
Patch by John McCall with help by Shuxin Yang.
rdar://13115369



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177819 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-23 06:43:35 +00:00
Bob Wilson 4a79296094 Revert svn r176894 and r177658.
Changing -ccc-install-dir to affect cc1's resource-dir setting broke our
internal LNT tests. After discussing the situation with Jim, we've decided to
pursue an alternate approach. We really want the resource-dir to be located
relative to clang, even when using -ccc-install-dir, but we're going to
add a fallback setting for the libc++ headers if they don't exist alongside
the compiler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177815 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-23 05:17:59 +00:00
John McCall b6a6079449 Under ARC, when we're passing the address of a strong variable
to an out-parameter using the indirect-writeback conversion,
and we copied the current value of the variable to the temporary,
make sure that we register an intrinsic use of that value with
the optimizer so that the value won't get released until we have
a chance to retain it.

rdar://13195034

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177813 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-23 02:35:54 +00:00
Richard Trieu 060fe33d41 Strip off local qualifiers when converting from RecordType to
TemplateSpecializationType during template type diffing.  This allows the
correct printing of diffing qualifiers on templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177809 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-23 01:38:36 +00:00
Jordan Rose 4708b3dde8 [analyzer] Teach constraint managers about unsigned comparisons.
In C, comparisons between signed and unsigned numbers are always done in
unsigned-space. Thus, we should know that "i >= 0U" is always true, even
if 'i' is signed. Similarly, "u >= 0" is also always true, even though '0'
is signed.

Part of <rdar://problem/13239003> (false positives related to std::vector)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177806 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-23 01:21:33 +00:00
Jordan Rose a339cd66be [analyzer] Loc-Loc operations (subtraction or comparison) produce a NonLoc.
For two concrete locations, we were producing another concrete location and
then casting it to an integer. We should just create a nonloc::ConcreteInt
to begin with.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177805 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-23 01:21:29 +00:00
Jordan Rose e30024c96f [analyzer] CmpRuns.py: Accept single files as input.
This allows us to compare two direct invocations of the analyzer on a
single source file without having to wrap the output plists in their
own directories.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177804 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-23 01:21:26 +00:00
Jordan Rose 281698935f [analyzer] Also transform "a < b" to "(b - a) > 0" in the constraint manager.
We can support the full range of comparison operations between two locations
by canonicalizing them as subtraction, as in the previous commit.

This won't work (well) if either location includes an offset, or (again)
if the comparisons are not consistent about which region comes first.

<rdar://problem/13239003>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177803 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-23 01:21:23 +00:00
Jordan Rose 8569281fb7 Add reverseComparisonOp and negateComparisonOp to BinaryOperator.
...and adopt them in the analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177802 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-23 01:21:20 +00:00
Jordan Rose 78114a58f8 [analyzer] Translate "a != b" to "(b - a) != 0" in the constraint manager.
Canonicalizing these two forms allows us to better model containers like
std::vector, which use "m_start != m_finish" to implement empty() but
"m_finish - m_start" to implement size(). The analyzer should have a
consistent interpretation of these two symbolic expressions, even though
it's not properly reasoning about either one yet.

The other unfortunate thing is that while the size() expression will only
ever be written "m_finish - m_start", the comparison may be written
"m_finish == m_start" or "m_start == m_finish". Right now the analyzer does
not attempt to canonicalize those two expressions, since it doesn't know
which length expression to pick. Doing this correctly will probably require
implementing unary minus as a new SymExpr kind (<rdar://problem/12351075>).

For now, the analyzer inverts the order of arguments in the comparison to
build the subtraction, on the assumption that "begin() != end()" is
written more often than "end() != begin()". This is purely speculation.

<rdar://problem/13239003>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177801 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-23 01:21:16 +00:00
Jordan Rose 8958efacf8 [analyzer] Use SymExprs to represent '<loc> - <loc>' and '<loc> == <loc>'.
We just treat this as opaque symbols, but even that allows us to handle
simple cases where the same condition is tested twice. This is very common
in the STL, which means that any project using the STL gets spurious errors.

Part of <rdar://problem/13239003>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177800 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-23 01:21:05 +00:00
Fariborz Jahanian 168613735d documentation parsing: when providing code completion comment
for a getter used in property-dot syntax, if geter has its own
comment use it. // rdar://12791315



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177797 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-23 01:10:45 +00:00
Anna Zaks b095782ec0 [analyzer] Warn when a nil key or value are passed to NSMutableDictionary and ensure it works with subscripting.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177789 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-23 00:39:21 +00:00
Anna Zaks 683d25656f [analyzer] Correct the stale comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177788 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-23 00:39:17 +00:00
Richard Smith 76e6e1377f If a .syms file is available alongside a sanitizer runtime, pass it to the
linker via --dynamic-list instead of using --export-dynamic. This reduces the
size of the dynamic symbol table, and thus of the binary (in some cases by up
to ~30%).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177783 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-23 00:30:08 +00:00
Bill Wendling 984f2783ad Use RequireCompleteType() instead of isIncompleteType().
isIncompleteType() returns true or false for template types depending on whether
the type is instantiated yet. In this context, that's arbitrary. The better way
to check for a complete type is RequireCompleteType().

Thanks to Eli Friedman for noticing this!

<rdar://problem/12700799>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177768 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22 21:33:46 +00:00
Ted Kremenek 88de5a0963 Add test case for PR 12921.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177767 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22 21:30:22 +00:00
Douglas Gregor ed2fc2a311 <rdar://problem/13479539> Only rebuild the global module cache when we're allowed to.
This eliminates excessive rebuilds of the global module cache.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177766 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22 21:26:48 +00:00
Jordan Rose 0f3a34fb7f Revert "[analyzer] Break cycles (optionally) when trimming an ExplodedGraph."
The algorithm used here was ridiculously slow when a potential back-edge
pointed to a node that already had a lot of successors. The previous commit
makes this feature unnecessary anyway.

This reverts r177468 / f4cf6b10f8.

Conflicts:

	lib/StaticAnalyzer/Core/BugReporter.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177765 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22 21:15:33 +00:00
Jordan Rose 228094a28f [analyzer] Use a forward BFS instead of a reverse BFS to find shortest paths.
For a given bug equivalence class, we'd like to emit the report with the
shortest path. So far to do this we've been trimming the ExplodedGraph to
only contain relevant nodes, then doing a reverse BFS (starting at all the
error nodes) to find the shortest paths from the root. However, this is
fairly expensive when we are suppressing many bug reports in the same
equivalence class.

r177468-9 tried to solve this problem by breaking cycles during graph
trimming, then updating the BFS priorities after each suppressed report
instead of recomputing the whole thing. However, breaking cycles is not
a cheap operation because an analysis graph minus cycles is still a DAG,
not a tree.

This fix changes the algorithm to do a single forward BFS (starting from the
root) and to use that to choose the report with the shortest path by looking
at the error nodes with the lowest BFS priorities. This was Anna's idea, and
has the added advantage of requiring no update step: we can just pick the
error node with the next lowest priority to produce the next bug report.

<rdar://problem/13474689>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177764 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22 21:15:28 +00:00
Jordan Rose 03af377b27 [analyzer] Fix test to actually test what was intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177763 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22 21:15:26 +00:00
Jordan Rose 1aa4f50191 [analyzer] Fix ExprEngine::ViewGraph to handle C++ initializers.
Debugging aid only, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177762 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22 21:15:16 +00:00
Argyrios Kyrtzidis 9317ab94bb [PCH/Modules] De/Serialize MacroInfos separately than MacroDirectives.
-Serialize the macro directives history into its own section
-Get rid of the macro updates section
-When de/serializing an identifier from a module, associate only one macro per
 submodule that defined+exported it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177761 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22 21:12:57 +00:00
Argyrios Kyrtzidis baa74bd396 [modules] When a MacroInfo object is deserialized, allocate and store its submodule ID.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177760 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22 21:12:51 +00:00
Reid Kleckner a8a0f769ff [ms-cxxabi] Implement member data pointers for non-dynamic classes
Summary:
For non-dynamic classes (no virtual bases), member data pointers are
simple offsets from the base of the record.  Dynamic classes use an
aggregate for member data pointers and are therefore currently
unsupported.

Unlike Itanium, the ms ABI uses 0 to represent null for polymorphic
classes.  Non-polymorphic classes use -1 like Itanium, since 0 is a
valid field offset.

Reviewers: rjmccall

CC: timurrrr, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177753 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22 19:02:54 +00:00
Douglas Gregor fa69fc1912 <rdar://problem/13479539> Simplify ModuleManager/GlobalModuleIndex interaction to eliminate a pile of extraneous stats().
The refactoring in r177367 introduced a serious performance bug where
the "lazy" resolution of module file names in the global module index
to actual module file entries in the module manager would perform
repeated negative stats(). The new interaction requires the module
manager to inform the global module index when a module file has been
loaded, eliminating the extraneous stat()s and a bunch of bookkeeping
on both sides.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177750 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22 18:50:14 +00:00
Fariborz Jahanian c02ddb23c0 documentation parsing. Provide code completion comment
for self.GetterName where GetterName is the getter method 
for a property with name different from the property name 
(declared via a property getter attribute) // rdar://12791315


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177744 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22 17:55:27 +00:00
Fariborz Jahanian 82f0aff67d These tests fail on our Window64 machine.
Feel free to revert them (or let me know and I will revert)
if they shouldn't be.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177743 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22 17:42:39 +00:00
Daniel Jasper 627707b936 Better fix for r177725.
It turns out that

-foo;

can be an objective C method declaration. So instead of the previous
solution, recognize objective C methods only if we are in a declaration
scope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177740 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22 16:55:40 +00:00
Daniel Jasper c363dbb204 Align comments to surrounding unformatted comments.
Before:
int a; // not formatted
// formatting this line only

After:
int a; // not formatted
       // formatting this line only

This makes clang-format stable independent of whether the whole
file or single lines are formatted in most cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177739 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22 16:25:51 +00:00
Reid Kleckner 92e44d911c [cxxabi] Get ptrdiff_t from the CodeGenModule instead of caching it
As the comment says, it's a little silly to cache it in the ABI code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177738 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22 16:13:10 +00:00