Commit Graph

145465 Commits

Author SHA1 Message Date
Han Ming Ong 7b641e97ed <rdar://problem/13100435>
Don't discount regions that vmmap is not discounting.

llvm-svn: 177202
2013-03-15 23:19:44 +00:00
Ted Kremenek 90d7fa12d0 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.

llvm-svn: 177201
2013-03-15 23:09:37 +00:00
Jim Ingham e7b849e4fb Convert the -a option in "image lookup" to a address-expression, and pass the context
in the -a address expression lookup in "image list" so that it actually works.

llvm-svn: 177200
2013-03-15 23:09:19 +00:00
Jakob Stoklund Olesen a4a361df5b Add SchedRW as an Instruction field.
Don't require instructions to inherit Sched<...>. Sometimes it is more
convenient to say:

  let SchedRW = ... in {
    ...
  }

Which is now possible.

llvm-svn: 177199
2013-03-15 22:51:13 +00:00
Matt Kopec 862884327f Rework TestChangedValueAPI.py to account for gcc setting multiple breakpoints.
llvm-svn: 177198
2013-03-15 22:49:52 +00:00
Argyrios Kyrtzidis 0aef0f032f [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.

llvm-svn: 177197
2013-03-15 22:43:10 +00:00
Jim Ingham f48e20e15d Make the conditional break test case a little more robust.
llvm-svn: 177196
2013-03-15 22:19:27 +00:00
Jim Ingham 31938cad9c The regular expression command object was resetting the execution context of the
resolved command, which it should not do.  It should adopt whatever context the
regular expression command was called with.  This was causing regular expression
commands run inside breakpoint commands to adopt the currently selected context,
not the one coming from the breakpoint that we hit.

<rdar://problem/13411771>

llvm-svn: 177195
2013-03-15 22:18:26 +00:00
Douglas Gregor 49491f7861 <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.

llvm-svn: 177194
2013-03-15 22:15:07 +00:00
Ted Kremenek e943ce1ace Simplify print logic, per feedback from Jordan Rose.
llvm-svn: 177193
2013-03-15 22:02:46 +00:00
Matt Kopec f99f0b8cf7 Fix Makefile.rules where no icc is installed and -C gcc is used.
Patch by Ashok Thirumurthi.

llvm-svn: 177192
2013-03-15 21:55:13 +00:00
Ted Kremenek b7d7dd4dbf Enhance -Wtautological-constant-out-of-range-compare to include the name of the enum constant.
This is QoI.  Fixes <rdar://problem/13076064>.

llvm-svn: 177190
2013-03-15 21:50:10 +00:00
Jordan Rose e42122e6b4 [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>

llvm-svn: 177189
2013-03-15 21:41:55 +00:00
Jordan Rose a45fc81180 [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.)

llvm-svn: 177188
2013-03-15 21:41:53 +00:00
Jordan Rose 06f68eda4d [analyzer] Include opcode in dumping a SymSymExpr.
For debugging use only; no functionality change.

llvm-svn: 177187
2013-03-15 21:41:50 +00:00
Jordan Rose ecaa7d2c3d [analyzer] Look through ExprWhenCleanups when trying to track a NULL.
Silences a few false positives in LLVM.

llvm-svn: 177186
2013-03-15 21:41:46 +00:00
Jordan Rose 755a2ffd79 Add some assertions to appease the static analyzer.
No functionality change.

llvm-svn: 177185
2013-03-15 21:41:35 +00:00
David Blaikie c28422445a Remove unnecessary default in covered switch over enum
This cleans up the Clang -Werror build that was broken by r177180.

llvm-svn: 177184
2013-03-15 21:12:54 +00:00
Daniel Dunbar 99514845df [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.

llvm-svn: 177183
2013-03-15 20:55:27 +00:00
David Blaikie 7e138ff572 Remove IR scenario tests.
These are a burden to maintain & use hand crafted IR to test particular DWARF
generation cases in LLVM. If someone thinks there's high value coverage here
they can rephrase these as IR+dwarfdump tests in the LLVM regression suite so
they'll be portable/easily executed by all developers.

llvm-svn: 177182
2013-03-15 20:52:10 +00:00
Fariborz Jahanian 28c781f039 c: perform integer overflow check on all binary
operations. // rdar://13423975

llvm-svn: 177181
2013-03-15 20:47:07 +00:00
Richard Trieu b4cff1184a 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.

llvm-svn: 177180
2013-03-15 20:35:18 +00:00
Edwin Vane 2032fb973b Don't include outer-most explicit cast in nullptr replacement
The outer-most explicit cast is now left alone by the Use-Nullptr transform to
maintain the type of the expression and avoid introducing ambiguities.

Fixes PR15395.

Author: Ariel J Bernal <ariel.j.bernal@intel.com>
llvm-svn: 177179
2013-03-15 20:18:08 +00:00
Daniel Dunbar 3145eb8e54 [ADT] Fix StringSet::insert() to not allocate on every lookup.
- The previous implementation always constructed the StringMap entry, even if
   the key was present in the set.

llvm-svn: 177178
2013-03-15 20:16:59 +00:00
Edwin Vane 34794c5b3d 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>
llvm-svn: 177177
2013-03-15 20:14:01 +00:00
Matt Kopec c6672c8783 Rollback r177173. Some OSs may not have ptrace extensions which lldb expects when building. This needs to be accounted for.
llvm-svn: 177176
2013-03-15 20:00:39 +00:00
Michael J. Spencer d932d41190 [Support][Path][Windows] Fix dangling else. Don't call CloseHandle when CloseFD is false.
llvm-svn: 177175
2013-03-15 19:25:47 +00:00
Matt Kopec 0de53f062f Add icc support to the test suite
-adds icc to the lit of compilers to run the tests
-adds icc test decorators
-skip TestAnonymous.py for icc

Patch by Ashok Thirumurthi.

llvm-svn: 177174
2013-03-15 19:10:12 +00:00
Matt Kopec 6773276351 Add ptrace extensions to query a register set.
Patch by Ashok Thirumurthi.

llvm-svn: 177173
2013-03-15 19:06:45 +00:00
Enrico Granata 559008649b Porting the Objective-C Class data type’s summary from Python to C++
llvm-svn: 177172
2013-03-15 18:55:30 +00:00
Enrico Granata f68f732746 Moving CFBag and NSBundle summaries from Python to C++
Temporarily disabled non-code-running summaries for CF*Dictionary and NSCountedSet

llvm-svn: 177171
2013-03-15 18:44:08 +00:00
Arnold Schwaighofer 9d7a3827e4 ARM cost model: Fix costs for some vector selects
I was too pessimistic in r177105. Vector selects that fit into a legal register
type lower just fine. I was mislead by the code fragment that I was using. The
stores/loads that I saw in those cases came from lowering the conditional off
an address.

Changing the code fragment to:

%T0_3 = type <8 x i18>
%T1_3 = type <8 x i1>

define void @func_blend3(%T0_3* %loadaddr, %T0_3* %loadaddr2,
                         %T1_3* %blend, %T0_3* %storeaddr) {
  %v0 = load %T0_3* %loadaddr
  %v1 = load %T0_3* %loadaddr2
==> FROM:
  ;%c = load %T1_3* %blend
==> TO:
  %c = icmp slt %T0_3 %v0, %v1
==> USE:
  %r = select %T1_3 %c, %T0_3 %v0, %T0_3 %v1

  store %T0_3 %r, %T0_3* %storeaddr
  ret void
}

revealed this mistake.

radar://13403975

llvm-svn: 177170
2013-03-15 18:31:01 +00:00
Silviu Baranga 82dd6ac3bc Adding an A15 specific optimization pass for interactions between S/D/Q registers. The pass handles all the required transformations pre-regalloc.
llvm-svn: 177169
2013-03-15 18:28:25 +00:00
Edwin Vane 52c326ec78 Prevent nullptr_t-typed exprs from being replaced
The Use-Nullptr transform was replacing nullptr_t-typed expressions because in
the AST such expressions have an implicit NullToPointer cast around them. Now
the transform ignores these expressions.

Fixes PR15414.

llvm-svn: 177168
2013-03-15 18:10:07 +00:00
Benjamin Kramer 2f5457141a ARM: Fix an old refacto.
Fixes PR15520.

llvm-svn: 177167
2013-03-15 17:27:39 +00:00
Enrico Granata ebafd2f187 <rdar://problem/13194155>
Fixing an issue where threads and frames could get out of sync and cause ValueObjects to fail to retrieve their values correctly

llvm-svn: 177166
2013-03-15 17:25:04 +00:00
Bob Wilson c8541f2bf2 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.

llvm-svn: 177165
2013-03-15 17:12:43 +00:00
Adrian Prantl 5acf8a3ac5 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.)

llvm-svn: 177164
2013-03-15 17:09:05 +00:00
Fariborz Jahanian 1c150a0d0d c: Also chek for integer overflow for '%' operator.
llvm-svn: 177163
2013-03-15 17:03:56 +00:00
Fariborz Jahanian 352eeafa0a c: add the missing binary operatory when checking
for integer overflow. // rdar://13423975

llvm-svn: 177162
2013-03-15 16:36:04 +00:00
Sylvestre Ledru e0bf581a81 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
llvm-svn: 177161
2013-03-15 16:22:43 +00:00
Hal Finkel 8d7fbc9dad Enable unaligned memory access on PPC for scalar types
Unaligned access is supported on PPC for non-vector types, and is generally
more efficient than manually expanding the loads and stores.

A few of the existing test cases were using expanded unaligned loads and stores
to test other features (like load/store with update), and for these test cases,
unaligned access remains disabled.

llvm-svn: 177160
2013-03-15 15:27:13 +00:00
Arnold Schwaighofer f5284ff61f ARM cost model: Fix cost of fptrunc and fpext instructions
A vector fptrunc and fpext simply gets split into scalar instructions.

radar://13192358

llvm-svn: 177159
2013-03-15 15:10:47 +00:00
Nico Weber 966b331251 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.)

llvm-svn: 177158
2013-03-15 15:02:37 +00:00
Daniel Jasper 9b33424d6f 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.

llvm-svn: 177157
2013-03-15 14:57:30 +00:00
Alexander Potapenko 845b575370 [libsanitizer] StopTheWorld in sanitizer_common
StopTheWorld puts the process in a suspended state before running the
user-supplied callback. To be used in TSan and in leak checking code.

Linux implementation provided.

Patch by Sergey Matveev (earthdok@google.com)

llvm-svn: 177156
2013-03-15 14:37:21 +00:00
Alexey Samsonov 3a6b6b9d55 [Sanitizer] Don't intercept frexpf and frexpl on Windows. Add frexp declaration to asan_intercepted_functions.h
llvm-svn: 177155
2013-03-15 14:02:21 +00:00
Alexey Samsonov 9aecdfe34d [TSan] Switch TSan runtime to use ThreadRegistry class from sanitizer_common
llvm-svn: 177154
2013-03-15 13:48:44 +00:00
Alexander Kornienko 79d6c72e0e 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

llvm-svn: 177153
2013-03-15 13:42:02 +00:00
Hal Finkel b0fac42987 Protect PPC Altivec patterns with a predicate
In preparation for the addition of other SIMD ISA extensions (such as QPX) we
need to make sure that all Altivec patterns are properly predicated on having
Altivec support.

No functionality change intended (one test case needed to be updated b/c it
assumed that Altivec intrinsics would be supported without enabling Altivec
support).

llvm-svn: 177152
2013-03-15 13:21:21 +00:00