Commit Graph

146013 Commits

Author SHA1 Message Date
Jason Molenda c1946cd8e1 Don't bother calling Reserve on the vector unless we have entries to be added.
llvm-svn: 177776
2013-03-22 23:42:09 +00:00
Sean Silva 4ee92f9de4 [docs] Document usage of SmallVectorImpl in interfaces.
llvm-svn: 177775
2013-03-22 23:41:29 +00:00
Hal Finkel 9e331c2f9c Allow the register scavenger to spill multiple registers
This patch lets the register scavenger make use of multiple spill slots in
order to guarantee that it will be able to provide multiple registers
simultaneously.

To support this, the RS's API has changed slightly: setScavengingFrameIndex /
getScavengingFrameIndex have been replaced by addScavengingFrameIndex /
isScavengingFrameIndex / getScavengingFrameIndices.

In forthcoming commits, the PowerPC backend will use this capability in order
to implement the spilling of condition registers, and some special-purpose
registers, without relying on r0 being reserved. In some cases, spilling these
registers requires two GPRs: one for addressing and one to hold the value being
transferred.

llvm-svn: 177774
2013-03-22 23:32:27 +00:00
Jason Molenda ee7593fbff Add a Reserve method to RangeVector and RangeDataVector. Have the
DWARFCallFrameInfo method which returns a RangeVector pre-size the
vector based on the number of entries it will be adding insted of
growing the vector as items are added.

llvm-svn: 177773
2013-03-22 22:43:14 +00:00
Manman Ren 0827e97700 Support in AAEvaluator to print alias queries of loads/stores with TBAA tags.
Add "evaluate-tbaa" to print alias queries of loads/stores. Alias queries
between pointers do not include TBAA tags.

Add testing case for "placement new". TBAA currently says NoAlias.

llvm-svn: 177772
2013-03-22 22:34:41 +00:00
Sebastian Pop 27c10c6b1f ScopInfo: do not call getCanonicalInductionVariable for SCEVCodegen
llvm-svn: 177771
2013-03-22 22:07:43 +00:00
John McCall 20182ac0c7 Kill every call to @clang.arc.use in the ARC contract phase.
llvm-svn: 177769
2013-03-22 21:38:36 +00:00
Bill Wendling b3b4a37138 Use RequireCompleteType() instead of isIncompleteType().
isIncompleteType() returns true or false for template types depending on whether
the type is instantiated yet. In this context, that's arbitrary. The better way
to check for a complete type is RequireCompleteType().

Thanks to Eli Friedman for noticing this!

<rdar://problem/12700799>

llvm-svn: 177768
2013-03-22 21:33:46 +00:00
Ted Kremenek 21c29e5713 Add test case for PR 12921.
llvm-svn: 177767
2013-03-22 21:30:22 +00:00
Douglas Gregor 11ef0b7778 <rdar://problem/13479539> Only rebuild the global module cache when we're allowed to.
This eliminates excessive rebuilds of the global module cache.

llvm-svn: 177766
2013-03-22 21:26:48 +00:00
Jordan Rose 25fac2f6dc Revert "[analyzer] Break cycles (optionally) when trimming an ExplodedGraph."
The algorithm used here was ridiculously slow when a potential back-edge
pointed to a node that already had a lot of successors. The previous commit
makes this feature unnecessary anyway.

This reverts r177468 / f4cf6b10f863b9bc716a09b2b2a8c497dcc6aa9b.

Conflicts:

	lib/StaticAnalyzer/Core/BugReporter.cpp

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

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

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

<rdar://problem/13474689>

llvm-svn: 177764
2013-03-22 21:15:28 +00:00
Jordan Rose 08821c84da [analyzer] Fix test to actually test what was intended.
llvm-svn: 177763
2013-03-22 21:15:26 +00:00
Jordan Rose 73aa6f2178 [analyzer] Fix ExprEngine::ViewGraph to handle C++ initializers.
Debugging aid only, no functionality change.

llvm-svn: 177762
2013-03-22 21:15:16 +00:00
Argyrios Kyrtzidis eb663daeff [PCH/Modules] De/Serialize MacroInfos separately than MacroDirectives.
-Serialize the macro directives history into its own section
-Get rid of the macro updates section
-When de/serializing an identifier from a module, associate only one macro per
 submodule that defined+exported it.

llvm-svn: 177761
2013-03-22 21:12:57 +00:00
Argyrios Kyrtzidis 4f32da1ef5 [modules] When a MacroInfo object is deserialized, allocate and store its submodule ID.
llvm-svn: 177760
2013-03-22 21:12:51 +00:00
Greg Clayton ad900f9c85 Added option parsing to the lldb_perf_clang performance test.
llvm-svn: 177759
2013-03-22 21:12:50 +00:00
Bill Wendling d96a7a6be8 Update test. There may be multiple catches, but those will be cleaned up.
llvm-svn: 177758
2013-03-22 20:36:39 +00:00
Bill Wendling 56f15bf490 Add all clauses when merging the landing pads. Duplicates will be handled later on.
llvm-svn: 177757
2013-03-22 20:31:05 +00:00
David Blaikie 61ef2be3e5 Swap the DIFile in DILexicalBlockFile out for the raw name/directory pair
This is the last change in transitioning all DIScopes to have a common prefix.

llvm-svn: 177756
2013-03-22 20:18:46 +00:00
Howard Hinnant 7c5b88b134 Test cleanup with respect to use of deprecated tmpnam function. Also Windows port for these tests to use _tempnam. The bulk of this patch was donated anonymously. I've tested it on OS X and accept responsibility for it. If I've broken anyone's platform by switching from tmpnam to mktemp for the generation of temporary file names, just let me know. Should be easy to fix in test/support/platform_support.h
llvm-svn: 177755
2013-03-22 20:05:40 +00:00
David Blaikie 7c8dbc12bb reorder the fields in DILexicalBlockFile to match the common prefix for DIScopes
llvm-svn: 177754
2013-03-22 19:13:22 +00:00
Reid Kleckner 407e8b642b [ms-cxxabi] Implement member data pointers for non-dynamic classes
Summary:
For non-dynamic classes (no virtual bases), member data pointers are
simple offsets from the base of the record.  Dynamic classes use an
aggregate for member data pointers and are therefore currently
unsupported.

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

Reviewers: rjmccall

CC: timurrrr, cfe-commits

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

llvm-svn: 177753
2013-03-22 19:02:54 +00:00
Galina Kistanova 36ffafc388 Reverted r176374. In some cases the lit.site.cfg file does not get generated in tools/clang/tools/extra.
llvm-svn: 177751
2013-03-22 18:54:14 +00:00
Douglas Gregor 603cd869f7 <rdar://problem/13479539> Simplify ModuleManager/GlobalModuleIndex interaction to eliminate a pile of extraneous stats().
The refactoring in r177367 introduced a serious performance bug where
the "lazy" resolution of module file names in the global module index
to actual module file entries in the module manager would perform
repeated negative stats(). The new interaction requires the module
manager to inform the global module index when a module file has been
loaded, eliminating the extraneous stat()s and a bunch of bookkeeping
on both sides.

llvm-svn: 177750
2013-03-22 18:50:14 +00:00
Bill Wendling a397c017bb Don't use the removed API.
llvm-svn: 177749
2013-03-22 18:49:53 +00:00
Bill Wendling 3b3e50503c Revert r177675. This is language-specific and shouldn't be in the API.
llvm-svn: 177748
2013-03-22 18:46:32 +00:00
Jyotsna Verma fdc660bf2e Hexagon: Add and enable memops setbit, clrbit, &,|,+,- for byte, short, and word.
llvm-svn: 177747
2013-03-22 18:41:34 +00:00
Timur Iskhodzhanov fb74020cea Revert 177745 as it was incorrect
llvm-svn: 177746
2013-03-22 18:16:57 +00:00
Timur Iskhodzhanov e117eef77f Band-aid fix for the Windows build caused by r177710. Long-term, atomic_compare_exchange_strong should be a template on Windows too...
llvm-svn: 177745
2013-03-22 18:05:28 +00:00
Fariborz Jahanian 1fcf4921af documentation parsing. Provide code completion comment
for self.GetterName where GetterName is the getter method 
for a property with name different from the property name 
(declared via a property getter attribute) // rdar://12791315

llvm-svn: 177744
2013-03-22 17:55:27 +00:00
Fariborz Jahanian c56ae1b677 These tests fail on our Window64 machine.
Feel free to revert them (or let me know and I will revert)
if they shouldn't be.

llvm-svn: 177743
2013-03-22 17:42:39 +00:00
David Blaikie 30ce0788e7 Refactor out the DIFile parameter to DILexicalBlock to refer to the raw file/directory pair
llvm-svn: 177742
2013-03-22 17:33:20 +00:00
Dmitry Vyukov 9af68719ed tsan: return 0 on malloc() failure instead of crashing
llvm-svn: 177741
2013-03-22 17:06:22 +00:00
Daniel Jasper dd9276e464 Better fix for r177725.
It turns out that

-foo;

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

llvm-svn: 177740
2013-03-22 16:55:40 +00:00
Daniel Jasper bc0fa39d69 Align comments to surrounding unformatted comments.
Before:
int a; // not formatted
// formatting this line only

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

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

llvm-svn: 177739
2013-03-22 16:25:51 +00:00
Reid Kleckner 9cffbc1873 [cxxabi] Get ptrdiff_t from the CodeGenModule instead of caching it
As the comment says, it's a little silly to cache it in the ABI code.

llvm-svn: 177738
2013-03-22 16:13:10 +00:00
Eli Bendersky 6f6cbdbb8c fix small doc typo
llvm-svn: 177737
2013-03-22 16:09:06 +00:00
Michel Danzer 3de8ae38e6 R600: Fix up test/CodeGen/R600/llvm.pow.ll for r177730
llvm-svn: 177736
2013-03-22 15:24:16 +00:00
Ulrich Weigand f62e83f415 Remove ABI-duplicated call instruction patterns.
We currently have a duplicated set of call instruction patterns depending
on the ABI to be followed (Darwin vs. Linux).  This is a bit odd; while the
different ABIs will result in different instruction sequences, the actual
instructions themselves ought to be independent of the ABI.  And in fact it
turns out that the only nontrivial difference between the two sets of
patterns is that in the PPC64 Linux ABI, the instruction used for indirect
calls is marked to take X11 as extra input register (which is indeed used
only with that ABI to hold an incoming environment pointer for nested
functions).  However, this does not need to be hard-coded at the .td
pattern level; instead, the C++ code expanding calls can simply add that
use, just like it adds uses for argument registers anyway.

No change in generated code expected.

llvm-svn: 177735
2013-03-22 15:24:13 +00:00
Ulrich Weigand 1df06d8b58 Rename memrr ptrreg and offreg components.
Currently, the sub-operand of a memrr address that corresponds to what
hardware considers the base register is called "offreg", while the
sub-operand that corresponds to the offset is called "ptrreg".

To avoid confusion, this patch simply swaps the named of those two
sub-operands and updates all uses.  No functional change is intended.

llvm-svn: 177734
2013-03-22 14:59:13 +00:00
Ulrich Weigand e90b022468 Fix swapped BasePtr and Offset in pre-inc memory addresses.
PPCTargetLowering::getPreIndexedAddressParts currently provides
the base part of a memory address in the offset result, and the
offset part in the base result.  That swap is then undone again
when an MI instruction is generated (in PPCDAGToDAGISel::Select
for loads, and using .md Pat patterns for stores).

This patch reverts this double swap, to make common code and
back-end be in sync as to which part of the address is base
and which is offset.

To avoid performance regressions in certain cases, target code
now checks whether the choice of base register would be rejected
for pre-inc accesses by common code, and attempts to swap base
and offset again in such cases.  (Overall, this means that now
pre-ice accesses are generated *more* frequently than before.)

llvm-svn: 177733
2013-03-22 14:58:48 +00:00
Ulrich Weigand d1b99d350c Tighten iaddroff ComplexPattern.
The iaddroff ComplexPattern is supposed to recognize displacement
expressions that have been processed by a SelectAddressRegImm,
which means it needs to accept TargetConstant and TargetGlobalAddress
nodes.  Currently, it erroneously also accepts some other nodes,
in particular Constant and PPCISD::Lo.

While this problem is currently latent, it would cause wrong-code
bugs with a follow-on patch I'm about to commit, so this patch
tightens the ComplexPattern.  The equivalent change is made in
PPCDAGToDAGISel::Select, where pre-inc load patterns are handled
(as opposed to store patterns, the loads are handled in C++ code
without making use of the .td ComplexPattern).

llvm-svn: 177732
2013-03-22 14:58:17 +00:00
Ulrich Weigand e448badbb1 Remove the xaddroff ComplexPattern.
The xaddroff pattern is currently (mistakenly) used to recognize
the *base* register in pre-inc store patterns.  This patch replaces
those uses by ptr_rc_nor0 (as is elsewhere done to match the base
register of an address), and removes the now unused ComplexPattern.

llvm-svn: 177731
2013-03-22 14:57:48 +00:00
Michel Danzer a2e28156b4 R600: Use legacy (0 * anything = 0) MUL instructions for pow intrinsics
Fixes wrong lighting in some corner cases with r600g and radeonsi, e.g.
manifested by failure of two piglit/glean tests and intermittent black
patches in many apps.

Tested on SI and RS880.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62012 [radeonsi]
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58150 [r600g]

NOTE: This is a candidate for the Mesa stable branch.

Reviewed-by: Christian König <christian.koenig@amd.com>
llvm-svn: 177730
2013-03-22 14:09:10 +00:00
Daniel Jasper 4172375713 Update docs after moving clang-format from clang-tools-extra to cfe.
llvm-svn: 177729
2013-03-22 12:44:20 +00:00
Evgeniy Stepanov ecbf64648f [msan] Handle dlopen() failure in dlopen interceptor.
llvm-svn: 177728
2013-03-22 11:59:49 +00:00
Daniel Jasper be0d173099 Add clang-format to the corresponding Makefile.
llvm-svn: 177727
2013-03-22 11:43:51 +00:00
Dmitry Vyukov 3bd5ffb62b tsan: test that tsan explicitly says "race on vptr".
Requires llvm r177717.

llvm-svn: 177726
2013-03-22 10:54:39 +00:00
Daniel Jasper 399d1ee5a0 More precisely recognize ObjC method declarations.
Otherwise, +/- and the beginning of constants can be recognized
incorrectly.

Before:  #define A - 1
After:   #define A -1
llvm-svn: 177725
2013-03-22 10:44:43 +00:00