platform/upstream/llvm.git
11 years agoR600/SI: enable all S_LOAD and S_BUFFER_LOAD opcodes
Christian Konig [Mon, 18 Mar 2013 11:33:50 +0000 (11:33 +0000)]
R600/SI: enable all S_LOAD and S_BUFFER_LOAD opcodes

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 177272

11 years agoR600/SI: fix inserting waits for all defines
Christian Konig [Mon, 18 Mar 2013 11:33:45 +0000 (11:33 +0000)]
R600/SI: fix inserting waits for all defines

Unfortunately the previous fix for inserting waits for unordered
defines wasn't sufficient, cause it's possible that even ordered
defines are only partially used (or not used at all).

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 177271

11 years ago[asan] make the __asan_get_heap_size more robust
Kostya Serebryany [Mon, 18 Mar 2013 10:52:25 +0000 (10:52 +0000)]
[asan] make the __asan_get_heap_size more robust

llvm-svn: 177270

11 years agotsan: move implementation out of h file
Dmitry Vyukov [Mon, 18 Mar 2013 10:32:21 +0000 (10:32 +0000)]
tsan: move implementation out of h file

llvm-svn: 177269

11 years agotsan: fix clang -Wall build
Dmitry Vyukov [Mon, 18 Mar 2013 10:10:15 +0000 (10:10 +0000)]
tsan: fix clang -Wall build
Clang does not like classes with virtual functions but w/o virtual dtor.
Go does not like libstdc++ (operator delete).

llvm-svn: 177267

11 years ago[TSan] re-apply r177249 lost in edits
Alexey Samsonov [Mon, 18 Mar 2013 09:45:22 +0000 (09:45 +0000)]
[TSan] re-apply r177249 lost in edits

llvm-svn: 177265

11 years ago[asan] when creating string constants, set unnamed_attr and align 1 so that equal...
Kostya Serebryany [Mon, 18 Mar 2013 09:38:39 +0000 (09:38 +0000)]
[asan] when creating string constants, set unnamed_attr and align 1 so that equal strings are merged by the linker. Observed up to 1% binary size reduction. Thanks to Anton Korobeynikov for the suggestion

llvm-svn: 177264

11 years ago[asan] Switch to allocator2 on Android.
Evgeniy Stepanov [Mon, 18 Mar 2013 09:22:58 +0000 (09:22 +0000)]
[asan] Switch to allocator2 on Android.

llvm-svn: 177263

11 years agotsan: fix memory leak
Dmitry Vyukov [Mon, 18 Mar 2013 09:09:41 +0000 (09:09 +0000)]
tsan: fix memory leak

llvm-svn: 177262

11 years agotsan: use StackDepot for thread creation stacks
Dmitry Vyukov [Mon, 18 Mar 2013 09:02:27 +0000 (09:02 +0000)]
tsan: use StackDepot for thread creation stacks

llvm-svn: 177261

11 years agotsan: fix Go build
Dmitry Vyukov [Mon, 18 Mar 2013 08:52:46 +0000 (08:52 +0000)]
tsan: fix Go build

llvm-svn: 177260

11 years agoMark internal classes as POD-like to get better behavior out of
Chandler Carruth [Mon, 18 Mar 2013 08:36:46 +0000 (08:36 +0000)]
Mark internal classes as POD-like to get better behavior out of
SmallVector and DenseMap.

This speeds up SROA by 25% on PR15412.

llvm-svn: 177259

11 years agotsan: use StackDepot in sync object to store creation stacks
Dmitry Vyukov [Mon, 18 Mar 2013 08:27:47 +0000 (08:27 +0000)]
tsan: use StackDepot in sync object to store creation stacks

llvm-svn: 177258

11 years agoTLS support for MinGW targets.
Anton Korobeynikov [Mon, 18 Mar 2013 08:12:28 +0000 (08:12 +0000)]
TLS support for MinGW targets.
MinGW is almost completely compatible to MSVC, with the exception of the _tls_array global not being available.

Patch by David Nadlinger!

llvm-svn: 177257

11 years agoWindows TLS: Section name prefix to ensure correct order
Anton Korobeynikov [Mon, 18 Mar 2013 08:10:10 +0000 (08:10 +0000)]
Windows TLS: Section name prefix to ensure correct order
The linker sorts the .tls$<xyz> sections by name, and we need
to make sure any extra sections we produce (e.g. for weak globals)
always end up between .tls$AAA and .tls$ZZZ, even if the name
starts with e.g. an underscore.

Patch by David Nadlinger!

llvm-svn: 177256

11 years agotsan: fix huge stack frames
Dmitry Vyukov [Mon, 18 Mar 2013 08:09:42 +0000 (08:09 +0000)]
tsan: fix huge stack frames

llvm-svn: 177255

11 years ago[asan] while generating the description of a global variable, emit the module name...
Kostya Serebryany [Mon, 18 Mar 2013 08:05:29 +0000 (08:05 +0000)]
[asan] while generating the description of a global variable, emit the module name in a separate field, thus not duplicating this information if every description. This decreases the binary size (observed up to 3%). https://code.google.com/p/address-sanitizer/issues/detail?id=168 . This changes the asan API version. llvm-part

llvm-svn: 177254

11 years ago[asan] while generating the description of a global variable, emit the module name...
Kostya Serebryany [Mon, 18 Mar 2013 08:04:55 +0000 (08:04 +0000)]
[asan] while generating the description of a global variable, emit the module name in a separate field, thus not duplicating this information if every description. This decreases the binary size (observed up to 3%). https://code.google.com/p/address-sanitizer/issues/detail?id=168 . This changes the asan API version. compiler-rt part, llvm-part will follow

llvm-svn: 177253

11 years agoMake sure to use same EABI version for external assembler as for integrated as.
Anton Korobeynikov [Mon, 18 Mar 2013 07:59:20 +0000 (07:59 +0000)]
Make sure to use same EABI version for external assembler as for integrated as.
Patch by Andrew Turner!

llvm-svn: 177252

11 years agotsan: fix lint warnings
Dmitry Vyukov [Mon, 18 Mar 2013 07:58:20 +0000 (07:58 +0000)]
tsan: fix lint warnings

llvm-svn: 177251

11 years ago[asan] don't instrument functions with available_externally linkage. This saves a...
Kostya Serebryany [Mon, 18 Mar 2013 07:33:49 +0000 (07:33 +0000)]
[asan] don't instrument functions with available_externally linkage. This saves a bit of compile time and reduces the number of redundant global strings generated by asan (https://code.google.com/p/address-sanitizer/issues/detail?id=167)

llvm-svn: 177250

11 years ago[TSan] fix undefined variable in debug TSan build
Alexey Samsonov [Mon, 18 Mar 2013 07:33:00 +0000 (07:33 +0000)]
[TSan] fix undefined variable in debug TSan build

llvm-svn: 177249

11 years ago[TSan] Use ThreadRegistry::FindThreadContextLocked() to find thread by its stack...
Alexey Samsonov [Mon, 18 Mar 2013 07:02:08 +0000 (07:02 +0000)]
[TSan] Use ThreadRegistry::FindThreadContextLocked() to find thread by its stack/tls address.

llvm-svn: 177248

11 years ago[TSan] Makefiles: allow configurable paths to clang and FileCheck. Add -fno-rtti...
Alexey Samsonov [Mon, 18 Mar 2013 07:00:36 +0000 (07:00 +0000)]
[TSan] Makefiles: allow configurable paths to clang and FileCheck. Add -fno-rtti flag.

llvm-svn: 177247

11 years ago[Sanitizer] Get rid of global mutexes in StopTheWorld implementation
Alexey Samsonov [Mon, 18 Mar 2013 06:27:13 +0000 (06:27 +0000)]
[Sanitizer] Get rid of global mutexes in StopTheWorld implementation

llvm-svn: 177246

11 years ago[Sanitizer] Rely on template argument deduction in sanitizer_allocator_test
Alexey Samsonov [Mon, 18 Mar 2013 06:07:44 +0000 (06:07 +0000)]
[Sanitizer] Rely on template argument deduction in sanitizer_allocator_test

llvm-svn: 177245

11 years agoExtract a method.
Jakob Stoklund Olesen [Mon, 18 Mar 2013 04:08:07 +0000 (04:08 +0000)]
Extract a method.

This computes the type of an instruction operand or result based on the
records in the instruction's ins and outs lists.

llvm-svn: 177244

11 years agoPost process ADC/SBB and use a shorter encoding if they use a sign extended immediate.
Craig Topper [Mon, 18 Mar 2013 03:34:55 +0000 (03:34 +0000)]
Post process ADC/SBB and use a shorter encoding if they use a sign extended immediate.

llvm-svn: 177243

11 years agoRefactor some duplicated code into helper functions.
Craig Topper [Mon, 18 Mar 2013 02:53:34 +0000 (02:53 +0000)]
Refactor some duplicated code into helper functions.

llvm-svn: 177242

11 years agoFix the build broken in r177239
David Blaikie [Sun, 17 Mar 2013 21:32:54 +0000 (21:32 +0000)]
Fix the build broken in r177239

Seems some accidental C++11 crept in there. Reported by the C++98 buildbots.

llvm-svn: 177241

11 years agoReduced dont-infinite-loop-during-block-escape-analysis.ll with bugpoint and moved...
Michael Gottesman [Sun, 17 Mar 2013 21:31:12 +0000 (21:31 +0000)]
Reduced dont-infinite-loop-during-block-escape-analysis.ll with bugpoint and moved it to retain-block-escape-analysis.ll.

*NOTE* I verified that the original bug behind
dont-infinite-loop-during-block-escape-analysis.ll occurs when using opt on
retain-block-escape-analysis.ll.

llvm-svn: 177240

11 years agoSplit out filename & directory from DIFile to start generalizing over DIScopes
David Blaikie [Sun, 17 Mar 2013 21:13:55 +0000 (21:13 +0000)]
Split out filename & directory from DIFile to start generalizing over DIScopes

This is the first step to making all DIScopes have a common metadata prefix (so
that things (using directives, for example) that can appear in any scope can be
added to that common prefix). DIFile is itself a DIScope so the common prefix
of all DIScopes cannot be a DIFile - instead it's the raw filename/directory
name pair.

llvm-svn: 177239

11 years agoGeneralize debug info test to be resilient to changes in metadata node numbering
David Blaikie [Sun, 17 Mar 2013 21:08:22 +0000 (21:08 +0000)]
Generalize debug info test to be resilient to changes in metadata node numbering

llvm-svn: 177238

11 years agoGeneralize a few debug info test cases
David Blaikie [Sun, 17 Mar 2013 20:29:22 +0000 (20:29 +0000)]
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.

llvm-svn: 177237

11 years agoImprove DIFile debug info annotation by letting it fallback to DIScope
David Blaikie [Sun, 17 Mar 2013 20:28:12 +0000 (20:28 +0000)]
Improve DIFile debug info annotation by letting it fallback to DIScope

llvm-svn: 177236

11 years agoUse ArrayRef<MVT::SimpleValueType> when possible.
Jakob Stoklund Olesen [Sun, 17 Mar 2013 17:26:09 +0000 (17:26 +0000)]
Use ArrayRef<MVT::SimpleValueType> when possible.

Not passing vector references around makes it possible to use
SmallVector in most places.

llvm-svn: 177235

11 years agoTo avoid symbol clash, undefine PPC here. PPC may be predefined on some hosts.
Sylvestre Ledru [Sun, 17 Mar 2013 12:40:42 +0000 (12:40 +0000)]
To avoid symbol clash, undefine PPC here. PPC may be predefined on some hosts.

llvm-svn: 177234

11 years agoBuild LLVMgold.so on FreeBSD using cmake.
Rafael Espindola [Sun, 17 Mar 2013 12:01:05 +0000 (12:01 +0000)]
Build LLVMgold.so on FreeBSD using cmake.
Patch by Stephen Checkoway.

llvm-svn: 177233

11 years agoThe promised test case for r175939.
Michael Gottesman [Sun, 17 Mar 2013 08:42:58 +0000 (08:42 +0000)]
The promised test case for r175939.

This test makes sure that the ObjCARC escape analysis looks at the uses of
instructions which copy the block pointer value by checking all four cases where
that can occur.

llvm-svn: 177232

11 years agoImprove PPC VR (Altivec) register spilling
Hal Finkel [Sun, 17 Mar 2013 04:43:44 +0000 (04:43 +0000)]
Improve PPC VR (Altivec) register spilling

This change cleans up two issues with Altivec register spilling:

  1. The spilling code was inefficient (using two instructions, and add and a
     load, when just one would do)

  2. The code assumed that r0 would always be available (true for now, but this
     will change)

The new code handles VR spilling just like GPR spills but forced into r+r mode.
As a result, when any VR spills are present, we must now always allocate the
register-scavenger spill slot.

llvm-svn: 177231

11 years agoRemove FIXMEs in PPC test cases related to unaligned loads/stores
Hal Finkel [Sat, 16 Mar 2013 23:02:31 +0000 (23:02 +0000)]
Remove FIXMEs in PPC test cases related to unaligned loads/stores

As pointed out by Bill in response to r177160, these two FIXMEs
can also be removed.

llvm-svn: 177229

11 years agoRemove PPC avoidWriteAfterWrite callback
Hal Finkel [Sat, 16 Mar 2013 22:50:51 +0000 (22:50 +0000)]
Remove PPC avoidWriteAfterWrite callback

As a follow-up to r158719, remove PPCRegisterInfo::avoidWriteAfterWrite.
Jakob pointed out in response to r158719 that this callback is currently unused
and so this has no effect (and the speedups that I thought that I had observed
as a result of implementing this function must have been noise).

llvm-svn: 177228

11 years agoChange the default latency for implicit defs.
Andrew Trick [Sat, 16 Mar 2013 18:58:57 +0000 (18:58 +0000)]
Change the default latency for implicit defs.

Implicit defs are not currently positional and not modeled by the
per-operand machine model. Unfortunately, we treat defs that are part
of the architectural instruction description, like flags, the same as
other implicit defs. Really, they should have a fixed MachineInstr
layout and probably shouldn't be "implicit" at all.

For now, we'll change the default latency to be the max operand
latency. That will give flag setting operands full latency for x86
folded loads. Other kinds of "fake" implicit defs don't occur prior to
regalloc anyway, and we would like them to go away postRegAlloc as
well.

llvm-svn: 177227

11 years agoMachine model. Allow mixed itinerary classes and SchedRW lists.
Andrew Trick [Sat, 16 Mar 2013 18:58:55 +0000 (18:58 +0000)]
Machine model. Allow mixed itinerary classes and SchedRW lists.

We always supported a mixture of the old itinerary model and new
per-operand model, but it required a level of indirection to map
itinerary classes to SchedRW lists. This was done for ARM A9.

Now we want to define x86 SchedRW lists, with the goal of removing its
itinerary classes, but still support the itineraries in the mean
time. When I original developed the model, Atom did not have
itineraries, so there was no reason to expect this requirement.

llvm-svn: 177226

11 years agoWhen built with cmake, only call the string functions when the previous commands...
Sylvestre Ledru [Sat, 16 Mar 2013 17:01:13 +0000 (17:01 +0000)]
When built with cmake, only call the string functions when the previous commands (utils/GetSourceVersion & utils/GetRepositoryPath successed). Otherwise, they fail when not launched from a repository

llvm-svn: 177225

11 years ago[docs] Discuss a potential bug to be aware of.
Sean Silva [Sat, 16 Mar 2013 16:58:20 +0000 (16:58 +0000)]
[docs] Discuss a potential bug to be aware of.

llvm-svn: 177224

11 years agoTest case for graceful handling of long file names on Windows. Patch thanks to Paul...
Aaron Ballman [Sat, 16 Mar 2013 15:00:51 +0000 (15:00 +0000)]
Test case for graceful handling of long file names on Windows.  Patch thanks to Paul Robinson!

llvm-svn: 177223

11 years agorevert r177211 due to its potential issues
Manman Ren [Sat, 16 Mar 2013 04:47:38 +0000 (04:47 +0000)]
revert r177211 due to its potential issues

llvm-svn: 177222

11 years agoAdd X86 code emitter support AVX encoded MRMDestReg instructions.
Craig Topper [Sat, 16 Mar 2013 03:44:31 +0000 (03:44 +0000)]
Add X86 code emitter support AVX encoded MRMDestReg instructions.

Previously we weren't skipping the VVVV encoded register. Based on patch by Michael Liao.

llvm-svn: 177221

11 years ago[analyzer] Model trivial copy/move assignment operators with a bind as well.
Jordan Rose [Sat, 16 Mar 2013 02:14:06 +0000 (02:14 +0000)]
[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>

llvm-svn: 177220

11 years agoC++ formatters for NSTimeZone and for CFBitVector
Enrico Granata [Sat, 16 Mar 2013 01:50:07 +0000 (01:50 +0000)]
C++ formatters for NSTimeZone and for CFBitVector

llvm-svn: 177219

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