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

43275 Коммитов

Автор SHA1 Сообщение Дата
Fariborz Jahanian 51be73daa9 Objective-C modern translator. Don't put line info
into the pre-preprocessed file to be passed to
modern translator when compiling in no debug mode.
// rdar://13138170


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177311 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 19:41:18 +00:00
Rafael Espindola f3260565f4 Use early returns when checking if we already constructed a tool and when
delegating to Generic_GCC::SelectTool (it already updates the tool map).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177305 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 18:50:01 +00:00
Rafael Espindola 26adbe42d1 Remove unused argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177303 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 18:19:46 +00:00
Rafael Espindola af370e6e05 Pass an ArgList to every toolchain constructor. Remove the useIntegratedAs
argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177301 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 18:10:27 +00:00
Rafael Espindola 7ce8d82c41 Inline ShouldUseIntegratedAssembler and move the documentation to
useIntegratedAs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177300 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 17:58:22 +00:00
Rafael Espindola 5470cd27e4 Refactor a bit of duplicated code to useIntegratedAs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177299 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 17:52:57 +00:00
Rafael Espindola e5dce30887 Remove unused argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177293 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 17:25:58 +00:00
Rafael Espindola d532018436 Remove unused argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177287 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 15:33:26 +00:00
Daniel Jasper cf6d76af80 Fix clang-format segfault.
When annotating "lines" starting with ":", clang-format would segfault.
This could actually happen in valid code, e.g.
  #define A :

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177283 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 12:50:26 +00:00
Benjamin Kramer 74c8b794be ObjCDictionaryElements are pod-like.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177282 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 12:41:25 +00:00
Anton Korobeynikov b234e7484b Make sure to use same EABI version for external assembler as for integrated as.
Patch by Andrew Turner!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177252 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 07:59:20 +00:00
David Blaikie 367989b354 Generalize a few debug info test cases
Checking for the annotation comment rather than the metadata values makes these
tests resilient to a coming refactor that will pull these fields out into a
separate metadata node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177237 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-17 20:29:22 +00:00
Manman Ren 7cd84baa53 revert r177211 due to its potential issues
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177222 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-16 04:47:38 +00:00
Jordan Rose a8d937e4bd [analyzer] Model trivial copy/move assignment operators with a bind as well.
r175234 allowed the analyzer to model trivial copy/move constructors as
an aggregate bind. This commit extends that to trivial assignment
operators as well. Like the last commit, one of the motivating factors here
is not warning when the right-hand object is partially-initialized, which
can have legitimate uses.

<rdar://problem/13405162>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177220 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-16 02:14:06 +00:00
Argyrios Kyrtzidis 6aa240c03d Remove -Wspellcheck and replace it with a diagnostic option.
Thanks to Richard S. for pointing out that the warning would show up
with -Weverything.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177218 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-16 01:40:35 +00:00
Jordan Rose 1efffab673 [analyzer] Separate graph trimming from creating the single-path graph.
When we generate a path diagnostic for a bug report, we have to take the
full ExplodedGraph and limit it down to a single path. We do this in two
steps: "trimming", which limits the graph to all the paths that lead to
this particular bug, and "creating the report graph", which finds the
shortest path in the trimmed path to any error node.

With BugReporterVisitor false positive suppression, this becomes more
expensive: it's possible for some paths through the trimmed graph to be
invalid (i.e. likely false positives) but others to be valid. Therefore
we have to run the visitors over each path in the graph until we find one
that is valid, or until we've ruled them all out. This can become quite
expensive.

This commit separates out graph trimming from creating the report graph,
performing the first only once per bug equivalence class and the second
once per bug report. It also cleans up that portion of the code by
introducing some wrapper classes.

This seems to recover most of the performance regression described in my
last commit.

<rdar://problem/13433687>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177216 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-16 01:07:58 +00:00
Jordan Rose c996313273 [analyzer] Eliminate InterExplodedGraphMap class and NodeBackMap typedef.
...in favor of this typedef:

  typedef llvm::DenseMap<const ExplodedNode *, const ExplodedNode *>
          InterExplodedGraphMap;

Use this everywhere the previous class and typedef were used.

Took the opportunity to ArrayRef-ize ExplodedGraph::trim while I'm at it.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177215 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-16 01:07:53 +00:00
Jordan Rose 9a9fe4068e [analyzer] Don't repeat a bug equivalence class if every report is invalid.
I removed this check in the recursion->iteration commit, but forgot that
generatePathDiagnostic may be called multiple times if there are multiple
PathDiagnosticConsumers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177214 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-16 01:07:47 +00:00
Manman Ren 2710ed8fd9 Exploit this-return of a callsite in a this-return function.
For constructors/desctructors that return 'this', if there exists a callsite
that returns 'this' and is immediately before the return instruction, make
sure we are using the return value from the callsite.

We don't need to keep 'this' alive through the callsite. It also enables
optimizations in the backend, such as tail call optimization.

rdar://12818789


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177211 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-16 00:11:09 +00:00
Richard Trieu 70e82dc7a2 Improve template diffing handling of default integer values.
When the template argument is both default and value dependent, the expression
retrieved for the default argument cannot be evaluated, thus never matching
any argument value.  To get the proper value, get the template argument
from the desugared template specialization.  Also, output the original
expression to provide more information about the argument mismatch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177209 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 23:55:09 +00:00
Anna Zaks 0621c45dcd [analyzer] Address a TODO in the StreamChecker; otherwise the output is non-deterministic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177207 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 23:34:31 +00:00
Anna Zaks 74c0d69884 [analyzer] Use isLiveRegion to determine when SymbolRegionValue is dead.
Fixes a FIXME, improves dead symbol collection, suppresses a false positive,
which resulted from reusing the same symbol twice for simulation of 2 calls to the same function.

Fixing this lead to 2 possible false negatives in CString checker. Since the checker is still alpha and
the solution will not require revert of this commit, move the tests to a FIXME section.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177206 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 23:34:29 +00:00
Anna Zaks f510f5cd57 [analyzer] BugReporterVisitors: handle the case where a ternary operator is wrapped in a cast.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177205 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 23:34:25 +00:00
Anna Zaks f8ba81e8bb [analyzer] Address Jordan’s review of r177138 (a micro optimization)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177204 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 23:34:22 +00:00
Ted Kremenek 316dd5467b Fix buffer underrun (invalid read) triggered during diagnostic rendering. The test would overflow when computing '0 - 1'.
I don't have a good testcase for this that does not depend on system headers.
It did not trigger with preprocessed output, and I had trouble reducing the example.

Fixes <rdar://problem/13324594>.

Thanks to Michael Greiner for reporting this issue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177201 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 23:09:37 +00:00
Argyrios Kyrtzidis 9cc3ed4e4d [modules] Don't record the macros from the predefines buffer.
These will be available in the current translation unit anyway, for
modules they only waste space and deserialization time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177197 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 22:43:10 +00:00
Douglas Gregor 4a18c3b25a <rdar://problem/13426257> Introduce SDKSettings.plist as an input file dependency for PCH/modules.
When we're building a precompiled header or module against an SDK on
Darwin, there will be a file SDKSettings.plist in the sysroot. Since
stat()'ing every system header on which a module or PCH file depends
is performance suicide, we instead stat() just SDKSettings.plist. This
hack works well on Darwin; it's unclear how we want to handle this on
other platforms. If there is a canonical file, we should use it; if
not, we either have to take the performance hit of stat()'ing system
headers repeatedly or roll the dice by not checking anything.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177194 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 22:15:07 +00:00
Ted Kremenek 9de50947ba Simplify print logic, per feedback from Jordan Rose.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177193 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 22:02:46 +00:00
Ted Kremenek 7adf3a9f84 Enhance -Wtautological-constant-out-of-range-compare to include the name of the enum constant.
This is QoI.  Fixes <rdar://problem/13076064>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177190 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 21:50:10 +00:00
Jordan Rose 2f13eb116e [analyzer] Make GRBugReporter::generatePathDiagnostic iterative, not recursive.
The previous generatePathDiagnostic() was intended to be tail-recursive,
restarting and trying again if a report was marked invalid. However:
 (1) this leaked all the cloned visitors, which weren't being deleted, and
 (2) this wasn't actually tail-recursive because some local variables had
     non-trivial destructors.

This was causing us to overflow the stack on inputs with large numbers of
reports in the same equivalence class, such as sqlite3.c. Being iterative
at least prevents us from blowing out the stack, but doesn't solve the
performance issue: suppressing thousands (yes, thousands) of paths in the
same equivalence class is expensive. I'm looking into that now.

<rdar://problem/13423498>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177189 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 21:41:55 +00:00
Jordan Rose cc08ca9b3c [analyzer] Collect stats on the max # of bug reports in an equivalence class.
We discovered that sqlite3.c currently has 2600 reports in a single
equivalence class; it would be good to know if this is a recent
development or what.

(For the curious, the different reports in an equivalence class represent
the same bug found along different paths. When we're suppressing false
positives, we need to go through /every/ path to make sure there isn't a
valid path to a bug. This is a flaw in our after-the-fact suppression,
made worse by the fact that that function isn't particularly optimized.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177188 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 21:41:53 +00:00
Jordan Rose 05cb2eb0a7 [analyzer] Include opcode in dumping a SymSymExpr.
For debugging use only; no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177187 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 21:41:50 +00:00
Jordan Rose 6a15f39a6b [analyzer] Look through ExprWhenCleanups when trying to track a NULL.
Silences a few false positives in LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177186 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 21:41:46 +00:00
Jordan Rose 62bbe07f5a Add some assertions to appease the static analyzer.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177185 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 21:41:35 +00:00
David Blaikie 454d5b3ab3 Remove unnecessary default in covered switch over enum
This cleans up the Clang -Werror build that was broken by r177180.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177184 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 21:12:54 +00:00
Daniel Dunbar e738fc5145 [AST] Add a fast path to ConstantArrayType::getNumAddressingBits().
- This fast path is almost 100% effective on real code, and lets us avoid
   multiple allocations of 128-bit APSInt objects in the common case.

 - As with any overflow-check-skipping-code, I'd appreciate someone double
   checking my logic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177183 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 20:55:27 +00:00
Fariborz Jahanian 1fd8d46d22 c: perform integer overflow check on all binary
operations. // rdar://13423975


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177181 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 20:47:07 +00:00
Richard Trieu 8e694d2134 Refactor template diffing to store an enum that records which type of
difference is stored inside a DiffNode.  This should not change any
diagnostic messages.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177180 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 20:35:18 +00:00
Edwin Vane ad7e160e36 ClangTool output cleanup
Information messages sent to stdout by ClangTool now only happen when the
-debug flag is set.

Error messages that used to go to stdout now go to stderr.

Author: Ariel J Bernal <ariel.j.bernal@intel.com>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177177 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 20:14:01 +00:00
Bob Wilson c90cc9374f Revert "Remove a pointless assertion."
This reverts commit r177158.

I'm blindly reverting this because it appears to be breaking numerous
buildbots.  I'll reapply if it doesn't turn out to be the culprit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177165 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 17:12:43 +00:00
Adrian Prantl 6b6a9b3f7b Force column info only for direct inlined functions. This should strike
the balance between expected behavior and compatibility with the gdb
testsuite.
(GDB gets confused if we break an expression into multiple debug
stmts so we enable this behavior only for inlined functions. For the
full experience people can still use -gcolumn-info.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177164 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 17:09:05 +00:00
Fariborz Jahanian a30bab4b5d c: Also chek for integer overflow for '%' operator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177163 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 17:03:56 +00:00
Fariborz Jahanian 2cd889d6d9 c: add the missing binary operatory when checking
for integer overflow. // rdar://13423975


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177162 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 16:36:04 +00:00
Sylvestre Ledru b7e86be441 Take in account the triplet 'powerpc-linux-gnuspe' for PowerPC SPE. Done for the port of Debian on this arch. More information on: http://wiki.debian.org/PowerPCSPEPort Patch by Roland Stigge
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177161 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 16:22:43 +00:00
Nico Weber 7e0786f08e Remove a pointless assertion.
FindNodeOrInsertPos() is called 10 lines earlier already, and the function
early-returns there if the result is != 0. InsertPos isn't recomputed after
that check, so this assert is always trivially true. (And it has nothing to
do with if T is canonical or not.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177158 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 15:02:37 +00:00
Daniel Jasper 3af59ce065 Improve formatting of chained calls.
clang-format already prevented sequences like:
  ...
  SomeParameter).someFunction(
  ...

as those are quite confusing. This failed on:
  ...
  SomeParameter).someFunction(otherFunction(
  ...

Fixed in this patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177157 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 14:57:30 +00:00
Alexander Kornienko 1fdd8b351e Indent all lines in a multi-line comment by the same amount.
Summary:
Do this to avoid spoling nicely formatted multi-line comments (e.g.
with code examples or similar stuff).

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177153 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 13:42:02 +00:00
Alexey Samsonov e310b1a770 Fixup for r176934. More careful setup of path to llvm-symbolizer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177145 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 07:29:58 +00:00
Anna Zaks 810169e7a1 [analyzer] Refactor checks in IDC visitor for consistency and speed
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177138 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 01:15:14 +00:00
Anna Zaks dc9c160ded [analyzer] Teach trackNullOrUndef to look through ternary operators
Allows the suppression visitors trigger more often.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177137 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 01:15:12 +00:00