platform/upstream/llvm.git
11 years agoRemove -Wspellcheck and replace it with a diagnostic option.
Argyrios Kyrtzidis [Sat, 16 Mar 2013 01:40:35 +0000 (01:40 +0000)]
Remove -Wspellcheck and replace it with a diagnostic option.

Thanks to Richard S. for pointing out that the warning would show up
with -Weverything.

llvm-svn: 177218

11 years agoNS(Mutable)IndexSet formatter moves from Python to C++
Enrico Granata [Sat, 16 Mar 2013 01:18:00 +0000 (01:18 +0000)]
NS(Mutable)IndexSet formatter moves from Python to C++

llvm-svn: 177217

11 years ago[analyzer] Separate graph trimming from creating the single-path graph.
Jordan Rose [Sat, 16 Mar 2013 01:07:58 +0000 (01:07 +0000)]
[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>

llvm-svn: 177216

11 years ago[analyzer] Eliminate InterExplodedGraphMap class and NodeBackMap typedef.
Jordan Rose [Sat, 16 Mar 2013 01:07:53 +0000 (01:07 +0000)]
[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.

llvm-svn: 177215

11 years ago[analyzer] Don't repeat a bug equivalence class if every report is invalid.
Jordan Rose [Sat, 16 Mar 2013 01:07:47 +0000 (01:07 +0000)]
[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.

llvm-svn: 177214

11 years agoConverting more data formatters to C++ - NSBundle, CFBinaryHeap, NSMachPort and NSNot...
Enrico Granata [Sat, 16 Mar 2013 00:50:25 +0000 (00:50 +0000)]
Converting more data formatters to C++ - NSBundle, CFBinaryHeap, NSMachPort and NSNotification

llvm-svn: 177213

11 years agoThis should be nothing but a load-time optimization. I'm trying to reduce load time...
Howard Hinnant [Sat, 16 Mar 2013 00:17:53 +0000 (00:17 +0000)]
This should be nothing but a load-time optimization.  I'm trying to reduce load time initializers and this is a big one.  No visible functionality change intended.

llvm-svn: 177212

11 years agoExploit this-return of a callsite in a this-return function.
Manman Ren [Sat, 16 Mar 2013 00:11:09 +0000 (00:11 +0000)]
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

llvm-svn: 177211

11 years agoDefine more SchedWrites for annotating X86 instructions.
Jakob Stoklund Olesen [Sat, 16 Mar 2013 00:02:17 +0000 (00:02 +0000)]
Define more SchedWrites for annotating X86 instructions.

Since almost all X86 instructions can fold loads, use a multiclass to
define register/memory pairs of SchedWrites.

An X86FoldableSchedWrite represents the register version of an
instruction. It holds a reference to the SchedWrite to use when the
instruction folds a load.

This will be used inside multiclasses that define rr and rm instruction
versions together.

llvm-svn: 177210

11 years agoImprove template diffing handling of default integer values.
Richard Trieu [Fri, 15 Mar 2013 23:55:09 +0000 (23:55 +0000)]
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.

llvm-svn: 177209

11 years ago<rdar://problem/13194155>
Greg Clayton [Fri, 15 Mar 2013 23:54:07 +0000 (23:54 +0000)]
<rdar://problem/13194155>

Variables view out of sync with lldb in Xcode is now fixed. Depending on what happened stack frames could get out of date and a stale shared pointer (one that is no longer a current frame in a thread) could end up being used.

Now we don't store a weak_ptr to a frame in the ExecutionContextRef class, we just store its stack ID and we always regrab the frame from the thread by stack ID.

llvm-svn: 177208

11 years ago[analyzer] Address a TODO in the StreamChecker; otherwise the output is non-determini...
Anna Zaks [Fri, 15 Mar 2013 23:34:31 +0000 (23:34 +0000)]
[analyzer] Address a TODO in the StreamChecker; otherwise the output is non-deterministic.

llvm-svn: 177207

11 years ago[analyzer] Use isLiveRegion to determine when SymbolRegionValue is dead.
Anna Zaks [Fri, 15 Mar 2013 23:34:29 +0000 (23:34 +0000)]
[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.

llvm-svn: 177206

11 years ago[analyzer] BugReporterVisitors: handle the case where a ternary operator is wrapped...
Anna Zaks [Fri, 15 Mar 2013 23:34:25 +0000 (23:34 +0000)]
[analyzer] BugReporterVisitors: handle the case where a ternary operator is wrapped in a cast.

llvm-svn: 177205

11 years ago[analyzer] Address Jordan’s review of r177138 (a micro optimization)
Anna Zaks [Fri, 15 Mar 2013 23:34:22 +0000 (23:34 +0000)]
[analyzer] Address Jordan’s review of r177138 (a micro optimization)

llvm-svn: 177204

11 years agoPerformance improvements to the IsObjCNil () - we only try to resolve the value if...
Enrico Granata [Fri, 15 Mar 2013 23:33:15 +0000 (23:33 +0000)]
Performance improvements to the IsObjCNil () - we only try to resolve the value if the variable under consideration truly is an “Objective-C thing”
This also changes the ClangASTContext to make sure that id is correctly marked as being such an ObjC thing

llvm-svn: 177203

11 years ago<rdar://problem/13100435>
Han Ming Ong [Fri, 15 Mar 2013 23:19:44 +0000 (23:19 +0000)]
<rdar://problem/13100435>

Don't discount regions that vmmap is not discounting.

llvm-svn: 177202

11 years agoFix buffer underrun (invalid read) triggered during diagnostic rendering. The test...
Ted Kremenek [Fri, 15 Mar 2013 23:09:37 +0000 (23:09 +0000)]
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

11 years agoConvert the -a option in "image lookup" to a address-expression, and pass the context
Jim Ingham [Fri, 15 Mar 2013 23:09:19 +0000 (23:09 +0000)]
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

11 years agoAdd SchedRW as an Instruction field.
Jakob Stoklund Olesen [Fri, 15 Mar 2013 22:51:13 +0000 (22:51 +0000)]
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

11 years agoRework TestChangedValueAPI.py to account for gcc setting multiple breakpoints.
Matt Kopec [Fri, 15 Mar 2013 22:49:52 +0000 (22:49 +0000)]
Rework TestChangedValueAPI.py to account for gcc setting multiple breakpoints.

llvm-svn: 177198

11 years ago[modules] Don't record the macros from the predefines buffer.
Argyrios Kyrtzidis [Fri, 15 Mar 2013 22:43:10 +0000 (22:43 +0000)]
[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

11 years agoMake the conditional break test case a little more robust.
Jim Ingham [Fri, 15 Mar 2013 22:19:27 +0000 (22:19 +0000)]
Make the conditional break test case a little more robust.

llvm-svn: 177196

11 years agoThe regular expression command object was resetting the execution context of the
Jim Ingham [Fri, 15 Mar 2013 22:18:26 +0000 (22:18 +0000)]
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

11 years ago<rdar://problem/13426257> Introduce SDKSettings.plist as an input file dependency...
Douglas Gregor [Fri, 15 Mar 2013 22:15:07 +0000 (22:15 +0000)]
<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

11 years agoSimplify print logic, per feedback from Jordan Rose.
Ted Kremenek [Fri, 15 Mar 2013 22:02:46 +0000 (22:02 +0000)]
Simplify print logic, per feedback from Jordan Rose.

llvm-svn: 177193

11 years agoFix Makefile.rules where no icc is installed and -C gcc is used.
Matt Kopec [Fri, 15 Mar 2013 21:55:13 +0000 (21:55 +0000)]
Fix Makefile.rules where no icc is installed and -C gcc is used.

Patch by Ashok Thirumurthi.

llvm-svn: 177192

11 years agoEnhance -Wtautological-constant-out-of-range-compare to include the name of the enum...
Ted Kremenek [Fri, 15 Mar 2013 21:50:10 +0000 (21:50 +0000)]
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

11 years ago[analyzer] Make GRBugReporter::generatePathDiagnostic iterative, not recursive.
Jordan Rose [Fri, 15 Mar 2013 21:41:55 +0000 (21:41 +0000)]
[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

11 years ago[analyzer] Collect stats on the max # of bug reports in an equivalence class.
Jordan Rose [Fri, 15 Mar 2013 21:41:53 +0000 (21:41 +0000)]
[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

11 years ago[analyzer] Include opcode in dumping a SymSymExpr.
Jordan Rose [Fri, 15 Mar 2013 21:41:50 +0000 (21:41 +0000)]
[analyzer] Include opcode in dumping a SymSymExpr.

For debugging use only; no functionality change.

llvm-svn: 177187

11 years ago[analyzer] Look through ExprWhenCleanups when trying to track a NULL.
Jordan Rose [Fri, 15 Mar 2013 21:41:46 +0000 (21:41 +0000)]
[analyzer] Look through ExprWhenCleanups when trying to track a NULL.

Silences a few false positives in LLVM.

llvm-svn: 177186

11 years agoAdd some assertions to appease the static analyzer.
Jordan Rose [Fri, 15 Mar 2013 21:41:35 +0000 (21:41 +0000)]
Add some assertions to appease the static analyzer.

No functionality change.

llvm-svn: 177185

11 years agoRemove unnecessary default in covered switch over enum
David Blaikie [Fri, 15 Mar 2013 21:12:54 +0000 (21:12 +0000)]
Remove unnecessary default in covered switch over enum

This cleans up the Clang -Werror build that was broken by r177180.

llvm-svn: 177184

11 years ago[AST] Add a fast path to ConstantArrayType::getNumAddressingBits().
Daniel Dunbar [Fri, 15 Mar 2013 20:55:27 +0000 (20:55 +0000)]
[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

11 years agoRemove IR scenario tests.
David Blaikie [Fri, 15 Mar 2013 20:52:10 +0000 (20:52 +0000)]
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

11 years agoc: perform integer overflow check on all binary
Fariborz Jahanian [Fri, 15 Mar 2013 20:47:07 +0000 (20:47 +0000)]
c: perform integer overflow check on all binary
operations. // rdar://13423975

llvm-svn: 177181

11 years agoRefactor template diffing to store an enum that records which type of
Richard Trieu [Fri, 15 Mar 2013 20:35:18 +0000 (20:35 +0000)]
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

11 years agoDon't include outer-most explicit cast in nullptr replacement
Edwin Vane [Fri, 15 Mar 2013 20:18:08 +0000 (20:18 +0000)]
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

11 years ago[ADT] Fix StringSet::insert() to not allocate on every lookup.
Daniel Dunbar [Fri, 15 Mar 2013 20:16:59 +0000 (20:16 +0000)]
[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

11 years agoClangTool output cleanup
Edwin Vane [Fri, 15 Mar 2013 20:14:01 +0000 (20:14 +0000)]
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

11 years agoRollback r177173. Some OSs may not have ptrace extensions which lldb expects when...
Matt Kopec [Fri, 15 Mar 2013 20:00:39 +0000 (20:00 +0000)]
Rollback r177173. Some OSs may not have ptrace extensions which lldb expects when building. This needs to be accounted for.

llvm-svn: 177176

11 years ago[Support][Path][Windows] Fix dangling else. Don't call CloseHandle when CloseFD is...
Michael J. Spencer [Fri, 15 Mar 2013 19:25:47 +0000 (19:25 +0000)]
[Support][Path][Windows] Fix dangling else. Don't call CloseHandle when CloseFD is false.

llvm-svn: 177175

11 years agoAdd icc support to the test suite
Matt Kopec [Fri, 15 Mar 2013 19:10:12 +0000 (19:10 +0000)]
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

11 years agoAdd ptrace extensions to query a register set.
Matt Kopec [Fri, 15 Mar 2013 19:06:45 +0000 (19:06 +0000)]
Add ptrace extensions to query a register set.

Patch by Ashok Thirumurthi.

llvm-svn: 177173

11 years agoPorting the Objective-C Class data type’s summary from Python to C++
Enrico Granata [Fri, 15 Mar 2013 18:55:30 +0000 (18:55 +0000)]
Porting the Objective-C Class data type’s summary from Python to C++

llvm-svn: 177172

11 years agoMoving CFBag and NSBundle summaries from Python to C++
Enrico Granata [Fri, 15 Mar 2013 18:44:08 +0000 (18:44 +0000)]
Moving CFBag and NSBundle summaries from Python to C++

Temporarily disabled non-code-running summaries for CF*Dictionary and NSCountedSet

llvm-svn: 177171

11 years agoARM cost model: Fix costs for some vector selects
Arnold Schwaighofer [Fri, 15 Mar 2013 18:31:01 +0000 (18:31 +0000)]
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

11 years agoAdding an A15 specific optimization pass for interactions between S/D/Q registers...
Silviu Baranga [Fri, 15 Mar 2013 18:28:25 +0000 (18:28 +0000)]
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

11 years agoPrevent nullptr_t-typed exprs from being replaced
Edwin Vane [Fri, 15 Mar 2013 18:10:07 +0000 (18:10 +0000)]
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

11 years agoARM: Fix an old refacto.
Benjamin Kramer [Fri, 15 Mar 2013 17:27:39 +0000 (17:27 +0000)]
ARM: Fix an old refacto.

Fixes PR15520.

llvm-svn: 177167

11 years ago<rdar://problem/13194155>
Enrico Granata [Fri, 15 Mar 2013 17:25:04 +0000 (17:25 +0000)]
<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

11 years agoRevert "Remove a pointless assertion."
Bob Wilson [Fri, 15 Mar 2013 17:12:43 +0000 (17:12 +0000)]
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

11 years agoForce column info only for direct inlined functions. This should strike
Adrian Prantl [Fri, 15 Mar 2013 17:09:05 +0000 (17:09 +0000)]
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

11 years agoc: Also chek for integer overflow for '%' operator.
Fariborz Jahanian [Fri, 15 Mar 2013 17:03:56 +0000 (17:03 +0000)]
c: Also chek for integer overflow for '%' operator.

llvm-svn: 177163

11 years agoc: add the missing binary operatory when checking
Fariborz Jahanian [Fri, 15 Mar 2013 16:36:04 +0000 (16:36 +0000)]
c: add the missing binary operatory when checking
for integer overflow. // rdar://13423975

llvm-svn: 177162

11 years agoTake in account the triplet 'powerpc-linux-gnuspe' for PowerPC SPE. Done for the...
Sylvestre Ledru [Fri, 15 Mar 2013 16:22:43 +0000 (16:22 +0000)]
Take in account the triplet 'powerpc-linux-gnuspe' for PowerPC SPE. Done for the port of Debian on this arch. More information on: wiki.debian.org/PowerPCSPEPort Patch by Roland Stigge

llvm-svn: 177161

11 years agoEnable unaligned memory access on PPC for scalar types
Hal Finkel [Fri, 15 Mar 2013 15:27:13 +0000 (15:27 +0000)]
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

11 years agoARM cost model: Fix cost of fptrunc and fpext instructions
Arnold Schwaighofer [Fri, 15 Mar 2013 15:10:47 +0000 (15:10 +0000)]
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

11 years agoRemove a pointless assertion.
Nico Weber [Fri, 15 Mar 2013 15:02:37 +0000 (15:02 +0000)]
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

11 years agoImprove formatting of chained calls.
Daniel Jasper [Fri, 15 Mar 2013 14:57:30 +0000 (14:57 +0000)]
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

11 years ago[libsanitizer] StopTheWorld in sanitizer_common
Alexander Potapenko [Fri, 15 Mar 2013 14:37:21 +0000 (14:37 +0000)]
[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

11 years ago[Sanitizer] Don't intercept frexpf and frexpl on Windows. Add frexp declaration to...
Alexey Samsonov [Fri, 15 Mar 2013 14:02:21 +0000 (14:02 +0000)]
[Sanitizer] Don't intercept frexpf and frexpl on Windows. Add frexp declaration to asan_intercepted_functions.h

llvm-svn: 177155

11 years ago[TSan] Switch TSan runtime to use ThreadRegistry class from sanitizer_common
Alexey Samsonov [Fri, 15 Mar 2013 13:48:44 +0000 (13:48 +0000)]
[TSan] Switch TSan runtime to use ThreadRegistry class from sanitizer_common

llvm-svn: 177154

11 years agoIndent all lines in a multi-line comment by the same amount.
Alexander Kornienko [Fri, 15 Mar 2013 13:42:02 +0000 (13:42 +0000)]
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

11 years agoProtect PPC Altivec patterns with a predicate
Hal Finkel [Fri, 15 Mar 2013 13:21:21 +0000 (13:21 +0000)]
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

11 years ago[Sanitizer] Don't link tests with -lpthread on Android.
Alexey Samsonov [Fri, 15 Mar 2013 12:54:01 +0000 (12:54 +0000)]
[Sanitizer] Don't link tests with -lpthread on Android.

llvm-svn: 177151

11 years ago[sanitizer] fix gcc build warnings
Kostya Serebryany [Fri, 15 Mar 2013 12:27:52 +0000 (12:27 +0000)]
[sanitizer] fix gcc build warnings

llvm-svn: 177149

11 years ago[asan] Add ForEachChunk() to sanitizer allocators. Patch by Sergey Matveev
Kostya Serebryany [Fri, 15 Mar 2013 11:39:41 +0000 (11:39 +0000)]
[asan] Add ForEachChunk() to sanitizer allocators. Patch by Sergey Matveev

llvm-svn: 177147

11 years ago[Sanitizer] Generalize compile/link flags for sanitizer_common tests on Android and...
Alexey Samsonov [Fri, 15 Mar 2013 10:39:26 +0000 (10:39 +0000)]
[Sanitizer] Generalize compile/link flags for sanitizer_common tests on Android and on other platforms.

llvm-svn: 177146

11 years agoFixup for r176934. More careful setup of path to llvm-symbolizer
Alexey Samsonov [Fri, 15 Mar 2013 07:29:58 +0000 (07:29 +0000)]
Fixup for r176934. More careful setup of path to llvm-symbolizer

llvm-svn: 177145

11 years agoFixup for r176933: more careful setup of path to llvm-symbolizer
Alexey Samsonov [Fri, 15 Mar 2013 07:27:49 +0000 (07:27 +0000)]
Fixup for r176933: more careful setup of path to llvm-symbolizer

llvm-svn: 177144

11 years ago[Sanitizer] Build sanitizer_common tests w/o RTTI. Move ThreadRegistry class members...
Alexey Samsonov [Fri, 15 Mar 2013 07:08:52 +0000 (07:08 +0000)]
[Sanitizer] Build sanitizer_common tests w/o RTTI. Move ThreadRegistry class members below methods.

llvm-svn: 177143

11 years agoUse NumBaseBits in a few more places in SmallBitVector instead of recalculating it...
Craig Topper [Fri, 15 Mar 2013 06:01:42 +0000 (06:01 +0000)]
Use NumBaseBits in a few more places in SmallBitVector instead of recalculating it. No functional change.

llvm-svn: 177142

11 years agoFix the FDE encoding to be relative on ELF.
Rafael Espindola [Fri, 15 Mar 2013 05:51:57 +0000 (05:51 +0000)]
Fix the FDE encoding to be relative on ELF.

This is a very late complement to r130637 which fixed this on x86_64. Fixes
pr15448.

Since it looks like that every elf architecture uses this encoding when using
cfi, make it the default for elf. Just exclude mips64el. It has a lovely
.ll -> .o test (ef_frame.ll) that tests that nothing changes in the binary
content of the .eh_frame produced by llc. Oblige it.

llvm-svn: 177141

11 years agoAllocate the RS spill slot for any PPC function with spills and a large stack frame
Hal Finkel [Fri, 15 Mar 2013 05:06:04 +0000 (05:06 +0000)]
Allocate the RS spill slot for any PPC function with spills and a large stack frame

For spills into a large stack frame, the FI-elimination code uses the register
scavenger to obtain a free GPR for use with an r+r-addressed load or store.
When there are no available GPRs, the scavenger gets one by using its spill
slot. Previously, we were not always allocating that spill slot and the RS
would assert when the spill slot was needed.

I don't currently have a small test that triggered the assert, but I've
created a small regression test that verifies that the spill slot is now
added when the stack frame is sufficiently large.

llvm-svn: 177140

11 years agoRolled back r176719 because settings with file
Sean Callanan [Fri, 15 Mar 2013 01:39:44 +0000 (01:39 +0000)]
Rolled back r176719 because settings with file
names were broken.

<rdar://problem/13422580>

llvm-svn: 177139

11 years ago[analyzer] Refactor checks in IDC visitor for consistency and speed
Anna Zaks [Fri, 15 Mar 2013 01:15:14 +0000 (01:15 +0000)]
[analyzer] Refactor checks in IDC visitor for consistency and speed

llvm-svn: 177138

11 years ago[analyzer] Teach trackNullOrUndef to look through ternary operators
Anna Zaks [Fri, 15 Mar 2013 01:15:12 +0000 (01:15 +0000)]
[analyzer] Teach trackNullOrUndef to look through ternary operators

Allows the suppression visitors trigger more often.

llvm-svn: 177137

11 years agoTurn anonymous type in anonymous union warning back on after cleaning up
Eric Christopher [Fri, 15 Mar 2013 00:43:00 +0000 (00:43 +0000)]
Turn anonymous type in anonymous union warning back on after cleaning up
issues.

llvm-svn: 177136

11 years agoSilence anonymous type in anonymous union warnings.
Eric Christopher [Fri, 15 Mar 2013 00:42:55 +0000 (00:42 +0000)]
Silence anonymous type in anonymous union warnings.

llvm-svn: 177135

11 years agoPR15290: 'this' is not permitted in the declaration of a friend function,
Richard Smith [Fri, 15 Mar 2013 00:41:52 +0000 (00:41 +0000)]
PR15290: 'this' is not permitted in the declaration of a friend function,
therefore references to members should not be transformed into implicit uses of
'this'. Patch by Ismail Pazarbasi!

llvm-svn: 177134

11 years agoSilence anonymous type in anonymous union warnings.
Eric Christopher [Fri, 15 Mar 2013 00:32:52 +0000 (00:32 +0000)]
Silence anonymous type in anonymous union warnings.

llvm-svn: 177133

11 years agoFix a virtual destructor warning.
Eric Christopher [Fri, 15 Mar 2013 00:20:17 +0000 (00:20 +0000)]
Fix a virtual destructor warning.

Patch by Manuel Klimek!

llvm-svn: 177132

11 years agoAdd a triple to the test.
Nadav Rotem [Fri, 15 Mar 2013 00:10:23 +0000 (00:10 +0000)]
Add a triple to the test.

llvm-svn: 177131

11 years agoUnaligned loads should use the VMOVUPS opcode.
Nadav Rotem [Thu, 14 Mar 2013 23:49:44 +0000 (23:49 +0000)]
Unaligned loads should use the VMOVUPS opcode.

llvm-svn: 177130

11 years agoRemove some unused variables to clean the Clang -Werror build
David Blaikie [Thu, 14 Mar 2013 23:11:07 +0000 (23:11 +0000)]
Remove some unused variables to clean the Clang -Werror build

(these were added in r177089)

llvm-svn: 177129

11 years ago[mips] Set isAllocatable bit of unallocatable register classes to 0.
Akira Hatanaka [Thu, 14 Mar 2013 23:09:19 +0000 (23:09 +0000)]
[mips] Set isAllocatable bit of unallocatable register classes to 0.

llvm-svn: 177128

11 years agoDiagnose about extern "C" functions returning c++ objects
Fariborz Jahanian [Thu, 14 Mar 2013 23:09:00 +0000 (23:09 +0000)]
Diagnose about extern "C" functions returning c++ objects
on first declaration only. // rdar://13364028

llvm-svn: 177127

11 years agoDon't try to typo-correct 'super' in an objc method.
Argyrios Kyrtzidis [Thu, 14 Mar 2013 22:56:43 +0000 (22:56 +0000)]
Don't try to typo-correct 'super' in an objc method.

This created 2 issues:

1) Performance issue, since typo-correction with PCH/modules is rather expensive.
2) Correctness issue, since if it managed to "correct" 'super' then bogus compiler errors would
be emitted, like this:

3.m:8:3: error: unknown type name 'super'; did you mean 'super1'?
  super.x = 0;
  ^~~~~
  super1
t3.m:5:13: note: 'super1' declared here
typedef int super1;
            ^
t3.m:8:8: error: expected identifier or '('
  super.x = 0;
       ^

llvm-svn: 177126

11 years ago<rdar://problem/12537646>
Greg Clayton [Thu, 14 Mar 2013 22:52:17 +0000 (22:52 +0000)]
<rdar://problem/12537646>

lldb remembers not-found source file, setting target.source-map doesn't make it re-check for it. Now this is fixed. Each time the source path remappings get updated, the modification ID in the PathMappingList gets bumped and then we know the re-check for sources.

llvm-svn: 177125

11 years agoAdd a testcase for r177118.
Adrian Prantl [Thu, 14 Mar 2013 22:49:05 +0000 (22:49 +0000)]
Add a testcase for r177118.

llvm-svn: 177124

11 years agoFix r177112: Add ProcResGroup.
Andrew Trick [Thu, 14 Mar 2013 22:47:01 +0000 (22:47 +0000)]
Fix r177112: Add ProcResGroup.

This is the other half of r177122 that I meant to commit at the same time.

llvm-svn: 177123

11 years agoPrepare for adding InstrSchedModel annotations to X86 instructions.
Jakob Stoklund Olesen [Thu, 14 Mar 2013 22:42:17 +0000 (22:42 +0000)]
Prepare for adding InstrSchedModel annotations to X86 instructions.

The new InstrSchedModel is easier to use than the instruction
itineraries. It will be used to model instruction latency and throughput
in modern Intel microarchitectures like Sandy Bridge.

InstrSchedModel should be able to coexist with instruction itinerary
classes, but for cleanliness we should switch the Atom processor model
to the new InstrSchedModel as well.

llvm-svn: 177122

11 years ago[analyzer] Change the way in which IDC Visitor decides to kick in and make sure it...
Anna Zaks [Thu, 14 Mar 2013 22:31:56 +0000 (22:31 +0000)]
[analyzer] Change the way in which IDC Visitor decides to kick in and make sure it attaches in the given edge case

In the test case below, the value V is not constrained to 0 in ErrorNode but it is in node N.
So we used to fail to register the Suppression visitor.

We also need to change the way we determine that the Visitor should kick in because the node N belongs to
the ExplodedGraph and might not be on the BugReporter path that the visitor sees. Instead of trying to match the node,
turn on the visitor when we see the last node in which the symbol is ‘0’.

llvm-svn: 177121

11 years agoAdd a new method which enables one to change register classes.
Reed Kotler [Thu, 14 Mar 2013 22:02:09 +0000 (22:02 +0000)]
Add a new method which enables one to change register classes.
See the Mips16ISetLowering.cpp patch to see a use of this.
For now now the extra code in Mips16ISetLowering.cpp is a nop but is
used for test purposes. Mips32 registers are setup and then removed and
then the Mips16 registers are setup.

Normally you need to add register classes and then call
computeRegisterProperties.

llvm-svn: 177120

11 years agoLog the match substring as well in the case where we match the step-avoid regexp.
Jim Ingham [Thu, 14 Mar 2013 22:00:18 +0000 (22:00 +0000)]
Log the match substring as well in the case where we match the step-avoid regexp.

llvm-svn: 177119

11 years agoAlways declare the .block_descriptor parameter, not just the local copy.
Adrian Prantl [Thu, 14 Mar 2013 21:52:59 +0000 (21:52 +0000)]
Always declare the .block_descriptor parameter, not just the local copy.
Un-breaks gdb's invoke-block behavior.

llvm-svn: 177118

11 years agoAdd some logging to track cases where “step-in” steps out due to the avoid-regexp...
Jim Ingham [Thu, 14 Mar 2013 21:44:36 +0000 (21:44 +0000)]
Add some logging to track cases where “step-in” steps out due to the avoid-regexp and the step-in target.

llvm-svn: 177117

11 years agoRecommit lldb realtime output for POSIX.
Matt Kopec [Thu, 14 Mar 2013 21:35:26 +0000 (21:35 +0000)]
Recommit lldb realtime output for POSIX.
 -Adds workaround for assertion in lldb for TestEvents.py

llvm-svn: 177116