platform/upstream/llvm.git
11 years agoUse frame-index scavenging for PPC register spilling
Hal Finkel [Thu, 14 Mar 2013 20:21:47 +0000 (20:21 +0000)]
Use frame-index scavenging for PPC register spilling

Make requiresFrameIndexScavenging return true, and create virtual registers in
the spilling code instead of using the register scavenger directly. This makes
the target-level code simpler, and importantly, delays the scavenging until
after callee-saved register processing (which will be important for later
changes).

Also cleans up trackLivenessAfterRegAlloc (makes it inline in the header with
the other related functions). This makes it clear that it always returns true.

No functionality change intended.

llvm-svn: 177107

11 years agoNot all PPC functions with a frame pointer need a RS spill slot
Hal Finkel [Thu, 14 Mar 2013 19:34:32 +0000 (19:34 +0000)]
Not all PPC functions with a frame pointer need a RS spill slot

We used to add a spill slot for the register scavenger whenever the function
has a frame pointer. This is unnecessarily conservative: We may need the spill
slot for dynamic stack allocations, and functions with dynamic stack
allocations always have a FP, but we might also have a FP for other reasons
(such as the user explicitly disabling frame-pointer elimination), and we don't
necessarily need a spill slot for those functions.

The structsinregs test needed adjustment because it disables FP elimination.

llvm-svn: 177106

11 years agoARM cost model: Increase cost of some vector selects we do terrible on
Arnold Schwaighofer [Thu, 14 Mar 2013 19:17:02 +0000 (19:17 +0000)]
ARM cost model: Increase cost of some vector selects we do terrible on

By terrible I mean we store/load from the stack.

This matters on PAQp8 in _Z5trainPsS_ii (which is inlined into Mixer::update)
where we decide to vectorize a loop with a VF of 8 resulting in a 25%
degradation on a cortex-a8.

LV: Found an estimated cost of 2 for VF 8 For instruction:   icmp slt i32
LV: Found an estimated cost of 2 for VF 8 For instruction:   select i1, i32, i32

The bug that tracks the CodeGen part is PR14868.

radar://13403975

llvm-svn: 177105

11 years ago[mips] Fix filename in comment and delete unnecessary lines of code.
Akira Hatanaka [Thu, 14 Mar 2013 19:09:52 +0000 (19:09 +0000)]
[mips] Fix filename in comment and delete unnecessary lines of code.

No functionality changes.

llvm-svn: 177104

11 years agoHexagon: Removed asserts regarding alignment and offset.
Jyotsna Verma [Thu, 14 Mar 2013 19:08:03 +0000 (19:08 +0000)]
Hexagon: Removed asserts regarding alignment and offset.
We are warning the user about the alignment, so we should not assert.

llvm-svn: 177103

11 years agoAdd missing asserts flag to test - it uses debug flags
Arnold Schwaighofer [Thu, 14 Mar 2013 19:01:58 +0000 (19:01 +0000)]
Add missing asserts flag to test - it uses debug flags

llvm-svn: 177102

11 years agoAndroid uses cacheflush(long start, long end, long flags) for MIPS.
Akira Hatanaka [Thu, 14 Mar 2013 19:01:00 +0000 (19:01 +0000)]
Android uses cacheflush(long start, long end, long flags) for MIPS.

Patch by Stephen Hines.

llvm-svn: 177101

11 years ago<rdar://problem/13228487>
Enrico Granata [Thu, 14 Mar 2013 19:00:42 +0000 (19:00 +0000)]
<rdar://problem/13228487>

A test case for the performance of some LLDB formatters
Changes and improvements to the testing infrastructure itself

llvm-svn: 177100

11 years agoUpdated link to Marshall's instructions
Marshall Clow [Thu, 14 Mar 2013 19:00:34 +0000 (19:00 +0000)]
Updated link to Marshall's instructions

llvm-svn: 177099

11 years agoLoopVectorize: Invert case when we use a vector cmp value to query select cost
Arnold Schwaighofer [Thu, 14 Mar 2013 18:54:36 +0000 (18:54 +0000)]
LoopVectorize: Invert case when we use a vector cmp value to query select cost

We generate a select with a vectorized condition argument when the condition is
NOT loop invariant. Not the other way around.

llvm-svn: 177098

11 years agoAdd back lines which were accidentally deleted in CMakeLists.txt.
Akira Hatanaka [Thu, 14 Mar 2013 18:46:46 +0000 (18:46 +0000)]
Add back lines which were accidentally deleted in CMakeLists.txt.

llvm-svn: 177096

11 years ago[mips] Define function MipsSEDAGToDAGISel::selectAddESubE.
Akira Hatanaka [Thu, 14 Mar 2013 18:39:25 +0000 (18:39 +0000)]
[mips] Define function MipsSEDAGToDAGISel::selectAddESubE.

No intended functionality changes.

llvm-svn: 177095

11 years agoAdd a comment about overlapping PPC frame offsets
Hal Finkel [Thu, 14 Mar 2013 18:38:31 +0000 (18:38 +0000)]
Add a comment about overlapping PPC frame offsets

I don't think that it is otherwise clear how the overlapping offsets
are processed into distinct spill slots. Comment that this is done
in processFunctionBeforeFrameFinalized.

llvm-svn: 177094

11 years agoSome forward-looking and optimistic documentation.
Howard Hinnant [Thu, 14 Mar 2013 18:37:48 +0000 (18:37 +0000)]
Some forward-looking and optimistic documentation.

llvm-svn: 177093

11 years ago[mips] Rename functions and variables to start with proper case.
Akira Hatanaka [Thu, 14 Mar 2013 18:33:23 +0000 (18:33 +0000)]
[mips] Rename functions and variables to start with proper case.

llvm-svn: 177092

11 years ago<rdar://problem/13421412>
Greg Clayton [Thu, 14 Mar 2013 18:31:44 +0000 (18:31 +0000)]
<rdar://problem/13421412>

Many "byte size" members and variables were using a mixture of uint32_t and size_t. Switching over to using uint64_t everywhere.

llvm-svn: 177091

11 years agoAdd header file MipsISelDAGToDAG.h.
Akira Hatanaka [Thu, 14 Mar 2013 18:28:19 +0000 (18:28 +0000)]
Add header file MipsISelDAGToDAG.h.

llvm-svn: 177090

11 years ago[mips] Define two subclasses of MipsDAGToDAGISel. Mips16DAGToDAGISel is for
Akira Hatanaka [Thu, 14 Mar 2013 18:27:31 +0000 (18:27 +0000)]
[mips] Define two subclasses of MipsDAGToDAGISel. Mips16DAGToDAGISel is for
mips16 and MipsSEDAGToDAGISel is for mips32/64.

No functionality changes.

llvm-svn: 177089

11 years agoPerform factorization as a last resort of unsafe fadd/fsub simplification.
Shuxin Yang [Thu, 14 Mar 2013 18:08:26 +0000 (18:08 +0000)]
Perform factorization as a last resort of unsafe fadd/fsub simplification.

Rules include:
  1)1 x*y +/- x*z => x*(y +/- z)
    (the order of operands dosen't matter)

  2) y/x +/- z/x => (y +/- z)/x

 The transformation is disabled if the new add/sub expr "y +/- z" is a
denormal/naz/inifinity.

rdar://12911472

llvm-svn: 177088

11 years agoTest that we emit a DW_AT_location for self captured by a block.
Adrian Prantl [Thu, 14 Mar 2013 17:54:13 +0000 (17:54 +0000)]
Test that we emit a DW_AT_location for self captured by a block.
This is the backend part of a CFE test with the same name.

llvm-svn: 177087

11 years agoAllocate stack storage for .block_descriptor and captured self at -O0.
Adrian Prantl [Thu, 14 Mar 2013 17:53:33 +0000 (17:53 +0000)]
Allocate stack storage for .block_descriptor and captured self at -O0.
This way the register allocator will not optimize away the debug info
for captured variables.

Fixes rdar://problem/12767564

llvm-svn: 177086

11 years agoFixed a problem where we didn't return TypedefNameDecls
Sean Callanan [Thu, 14 Mar 2013 17:21:53 +0000 (17:21 +0000)]
Fixed a problem where we didn't return TypedefNameDecls
when clang asked for them by name.

llvm-svn: 177085

11 years ago[analyzer] Fix scan-build's -stats mode.
Jordan Rose [Thu, 14 Mar 2013 17:18:30 +0000 (17:18 +0000)]
[analyzer] Fix scan-build's -stats mode.

We were failing to match the output line, which led to us collecting no
stats at all, which led to a divide-by-zero error.

Fixes PR15510.

llvm-svn: 177084

11 years agoAdding a new code owners file for clang-tools-extra.
Edwin Vane [Thu, 14 Mar 2013 16:56:31 +0000 (16:56 +0000)]
Adding a new code owners file for clang-tools-extra.

Populated file with known existing owners.

llvm-svn: 177083

11 years ago<rdar://problem/13413693>
Greg Clayton [Thu, 14 Mar 2013 16:47:56 +0000 (16:47 +0000)]
<rdar://problem/13413693>

Fixed a crasher in the new DWARF in .o files line table linking function where "back()" could end up being called on an empty std::vector.

llvm-svn: 177082

11 years agoImplements memoization for ancestor matching.
Manuel Klimek [Thu, 14 Mar 2013 16:33:21 +0000 (16:33 +0000)]
Implements memoization for ancestor matching.

This yields a log(#ast_nodes) worst-case improvement with matchers like
stmt(unless(hasAncestor(...))).

Also made the order of visitation for ancestor matches BFS, as the most
common use cases (for example finding the closest enclosing function
definition) rely on that.

llvm-svn: 177081

11 years agoMulti-line comment alignment
Alexander Kornienko [Thu, 14 Mar 2013 16:10:54 +0000 (16:10 +0000)]
Multi-line comment alignment

Summary:
Aligns continuation lines of multi-line comments to the base
indentation level +1:
class A {
  /*
   * test
   */
  void f() {}
};

The first revision is work in progress. The implementation is not yet complete.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D541

llvm-svn: 177080

11 years ago[lld] remove trailing whitespace
Shankar Easwaran [Thu, 14 Mar 2013 16:09:49 +0000 (16:09 +0000)]
[lld] remove trailing whitespace

llvm-svn: 177079

11 years agoR600: Factorize code handling Const Read Port limitation
Vincent Lejeune [Thu, 14 Mar 2013 15:50:45 +0000 (15:50 +0000)]
R600: Factorize code handling Const Read Port limitation

llvm-svn: 177078

11 years ago[Sanitizer] Fix compiler warnings and style issues in sanitizer_common tests. Use...
Alexey Samsonov [Thu, 14 Mar 2013 15:15:35 +0000 (15:15 +0000)]
[Sanitizer] Fix compiler warnings and style issues in sanitizer_common tests. Use -Werror=sign-compare when building them.

llvm-svn: 177077

11 years agoBackout POSIX realtime lldb output. TestEvents.py is causing lldb to assert.
Matt Kopec [Thu, 14 Mar 2013 14:22:40 +0000 (14:22 +0000)]
Backout POSIX realtime lldb output. TestEvents.py is causing lldb to assert.

llvm-svn: 177076

11 years agoSlightly improve formatting of longer pipe statements.
Daniel Jasper [Thu, 14 Mar 2013 14:00:17 +0000 (14:00 +0000)]
Slightly improve formatting of longer pipe statements.

The stronger binding of a string ending in :/= does not really make
sense if it is the only character.

Before:
llvm::outs() << aaaaaaaaaaaaaaaaaaaaaaaa
             << "=" << bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;

After:
llvm::outs() << aaaaaaaaaaaaaaaaaaaaaaaa << "="
             << bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;

llvm-svn: 177075

11 years ago[Sanitizer] Add generic ThreadRegistry class for sanitizer runtimes. This class holds...
Alexey Samsonov [Thu, 14 Mar 2013 13:54:30 +0000 (13:54 +0000)]
[Sanitizer] Add generic ThreadRegistry class for sanitizer runtimes. This class holds basic thread bookkeeping logic and allows specific sanitizer runtimes to create thread contexts and mark threads as created/running/joined etc. The class is based on the way we currently store thread contexts in TSan.

llvm-svn: 177074

11 years agoBasic support for formatting asm() statments.
Daniel Jasper [Thu, 14 Mar 2013 13:45:21 +0000 (13:45 +0000)]
Basic support for formatting asm() statments.

llvm-svn: 177073

11 years ago[Sanitizer] Add default constructor for BlockingMutex
Alexey Samsonov [Thu, 14 Mar 2013 13:30:56 +0000 (13:30 +0000)]
[Sanitizer] Add default constructor for BlockingMutex

llvm-svn: 177072

11 years ago[sanitizer] No dirent64 on Android.
Evgeniy Stepanov [Thu, 14 Mar 2013 13:24:03 +0000 (13:24 +0000)]
[sanitizer] No dirent64 on Android.

llvm-svn: 177071

11 years ago[Sanitizer] Build sanitizer_common with -fno-rtti
Alexey Samsonov [Thu, 14 Mar 2013 13:16:35 +0000 (13:16 +0000)]
[Sanitizer] Build sanitizer_common with -fno-rtti

llvm-svn: 177070

11 years ago[asan] remove one redundant malloc stress test, unify the usage of ASAN_LOW_MEMORY...
Kostya Serebryany [Thu, 14 Mar 2013 13:16:09 +0000 (13:16 +0000)]
[asan] remove one redundant malloc stress test, unify the usage of ASAN_LOW_MEMORY macro in tests, slightly reduce test memory usage (all to make 32-bit runs consume less RAM)

llvm-svn: 177069

11 years ago[libsanitizer] fixed a bug in ThreadLister tests where we forgot to terminate one...
Alexander Potapenko [Thu, 14 Mar 2013 13:15:14 +0000 (13:15 +0000)]
[libsanitizer] fixed a bug in ThreadLister tests where we forgot to terminate one thread

Patch by Sergey Matveev (earthdok@google.com)

llvm-svn: 177068

11 years ago[msan] Add changes missing from r177065.
Evgeniy Stepanov [Thu, 14 Mar 2013 13:13:49 +0000 (13:13 +0000)]
[msan] Add changes missing from r177065.

llvm-svn: 177067

11 years agoDocumentation: improve formatting
Dmitri Gribenko [Thu, 14 Mar 2013 12:53:46 +0000 (12:53 +0000)]
Documentation: improve formatting

llvm-svn: 177066

11 years ago[msan] Intercept readdir64.
Evgeniy Stepanov [Thu, 14 Mar 2013 12:49:23 +0000 (12:49 +0000)]
[msan] Intercept readdir64.

llvm-svn: 177065

11 years ago[ASan] remove -fsanitize=init-order from lit tests as now it's implied by -fsanitize...
Alexey Samsonov [Thu, 14 Mar 2013 12:43:03 +0000 (12:43 +0000)]
[ASan] remove -fsanitize=init-order from lit tests as now it's implied by -fsanitize=address

llvm-svn: 177064

11 years ago[ASan] emit instrumentation for initialization order checking by default
Alexey Samsonov [Thu, 14 Mar 2013 12:38:58 +0000 (12:38 +0000)]
[ASan] emit instrumentation for initialization order checking by default

llvm-svn: 177063

11 years ago[ASan] Update docs for -fsanitize=init-order option
Alexey Samsonov [Thu, 14 Mar 2013 12:26:21 +0000 (12:26 +0000)]
[ASan] Update docs for -fsanitize=init-order option

llvm-svn: 177062

11 years ago[ASan] Make -fsanitize=address imply -fsanitize=init-order (if the latter is not...
Alexey Samsonov [Thu, 14 Mar 2013 12:13:27 +0000 (12:13 +0000)]
[ASan] Make -fsanitize=address imply -fsanitize=init-order (if the latter is not explicitly disabled).

llvm-svn: 177061

11 years ago[libsanitizer] Fixed incorrect handling of pre-existing threads in ThreadLister test.
Alexander Potapenko [Thu, 14 Mar 2013 12:06:54 +0000 (12:06 +0000)]
[libsanitizer] Fixed incorrect handling of pre-existing threads in ThreadLister test.
Also, extended the test to check that ThreadLister::Reset() works as intended.

Patch by Sergey Matveev (earthdok@google.com)

llvm-svn: 177060

11 years ago[msan] Fix a typo in test.
Evgeniy Stepanov [Thu, 14 Mar 2013 11:58:13 +0000 (11:58 +0000)]
[msan] Fix a typo in test.

llvm-svn: 177059

11 years ago[ASan] turn off checking initialization order in ASan runtime by default. Instead...
Alexey Samsonov [Thu, 14 Mar 2013 11:49:40 +0000 (11:49 +0000)]
[ASan] turn off checking initialization order in ASan runtime by default. Instead, it should be turned on by default in the compiler

llvm-svn: 177058

11 years ago[msan] Options for switching between fast and cfi unwinders in run time.
Evgeniy Stepanov [Thu, 14 Mar 2013 11:47:03 +0000 (11:47 +0000)]
[msan] Options for switching between fast and cfi unwinders in run time.

Does not change default behavior.

llvm-svn: 177057

11 years ago[sanitizer] Intercept frexp and friends.
Evgeniy Stepanov [Thu, 14 Mar 2013 11:34:39 +0000 (11:34 +0000)]
[sanitizer] Intercept frexp and friends.

llvm-svn: 177056

11 years agoPR14972: SROA vs. GVN exposed a really bad bug in SROA.
Chandler Carruth [Thu, 14 Mar 2013 11:32:24 +0000 (11:32 +0000)]
PR14972: SROA vs. GVN exposed a really bad bug in SROA.

The fundamental problem is that SROA didn't allow for overly wide loads
where the bits past the end of the alloca were masked away and the load
was sufficiently aligned to ensure there is no risk of page fault, or
other trapping behavior. With such widened loads, SROA would delete the
load entirely rather than clamping it to the size of the alloca in order
to allow mem2reg to fire. This was exposed by a test case that neatly
arranged for GVN to run first, widening certain loads, followed by an
inline step, and then SROA which miscompiles the code. However, I see no
reason why this hasn't been plaguing us in other contexts. It seems
deeply broken.

Diagnosing all of the above took all of 10 minutes of debugging. The
really annoying aspect is that fixing this completely breaks the pass.
;] There was an implicit reliance on the fact that no loads or stores
extended past the alloca once we decided to rewrite them in the final
stage of SROA. This was used to encode information about whether the
loads and stores had been split across multiple partitions of the
original alloca. That required threading explicit tracking of whether
a *use* of a partition is split across multiple partitions.

Once that was done, another problem arose: we allowed splitting of
integer loads and stores iff they were loads and stores to the entire
alloca. This is a really arbitrary limitation, and splitting at least
some integer loads and stores is crucial to maximize promotion
opportunities. My first attempt was to start removing the restriction
entirely, but currently that does Very Bad Things by causing *many*
common alloca patterns to be fully decomposed into i8 operations and
lots of or-ing together to produce larger integers on demand. The code
bloat is terrifying. That is still the right end-goal, but substantial
work must be done to either merge partitions or ensure that small i8
values are eagerly merged in some other pass. Sadly, figuring all this
out took essentially all the time and effort here.

So the end result is that we allow splitting only when the load or store
at least covers the alloca. That ensures widened loads and stores don't
hurt SROA, and that we don't rampantly decompose operations more than we
have previously.

All of this was already fairly well tested, and so I've just updated the
tests to cover the wide load behavior. I can add a test that crafts the
pass ordering magic which caused the original PR, but that seems really
brittle and to provide little benefit. The fundamental problem is that
widened loads should Just Work.

llvm-svn: 177055

11 years ago[Sanitizer] fix compilation for Windows
Alexey Samsonov [Thu, 14 Mar 2013 11:29:06 +0000 (11:29 +0000)]
[Sanitizer] fix compilation for Windows

llvm-svn: 177054

11 years agoFix an unused variable warning from Clang by sinking a dyn_cast into an
Chandler Carruth [Thu, 14 Mar 2013 11:17:20 +0000 (11:17 +0000)]
Fix an unused variable warning from Clang by sinking a dyn_cast into an
isa and a cast inside the assert. The efficiency concern isn't really
important here. The code should likely be cleaned up a bit more,
especially getting a message into the assert.

Please review Rafael.

llvm-svn: 177053

11 years ago[msan] Intercept __strdup, strndup, __strndup.
Evgeniy Stepanov [Thu, 14 Mar 2013 11:10:36 +0000 (11:10 +0000)]
[msan] Intercept __strdup, strndup, __strndup.

llvm-svn: 177052

11 years ago[Sanitizer] Write a slightly better implementation of GetEnv() function on Windows
Alexey Samsonov [Thu, 14 Mar 2013 11:10:23 +0000 (11:10 +0000)]
[Sanitizer] Write a slightly better implementation of GetEnv() function on Windows

llvm-svn: 177051

11 years agoFix dereference formatting in for-loops.
Daniel Jasper [Thu, 14 Mar 2013 10:50:25 +0000 (10:50 +0000)]
Fix dereference formatting in for-loops.

Before: for (char **a = b; * a; ++a) {}
After:  for (char **a = b; *a; ++a) {}
llvm-svn: 177037

11 years ago[ASan] make ASan assume ASAN_OPTIONS=symbolize=1 if ASAN_EXTERNAL_SYMBOLIZER is defined
Alexey Samsonov [Thu, 14 Mar 2013 10:07:40 +0000 (10:07 +0000)]
[ASan] make ASan assume ASAN_OPTIONS=symbolize=1 if ASAN_EXTERNAL_SYMBOLIZER is defined

llvm-svn: 177036

11 years agoAdd support for the 'endian' attribute for OpenCL.
Joey Gouly [Thu, 14 Mar 2013 09:54:43 +0000 (09:54 +0000)]
Add support for the 'endian' attribute for OpenCL.

llvm-svn: 177035

11 years agoImprove formatting of trailing annotations.
Daniel Jasper [Thu, 14 Mar 2013 09:50:46 +0000 (09:50 +0000)]
Improve formatting of trailing annotations.

Before:
bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa __attribute__((
    unused));

After:
bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    __attribute__((unused));

llvm-svn: 177034

11 years agoAdd two of the float related ARM-specific entries for e_flags needed for
Joerg Sonnenberger [Thu, 14 Mar 2013 08:01:36 +0000 (08:01 +0000)]
Add two of the float related ARM-specific entries for e_flags needed for
linkers to interact with GNU ld.

llvm-svn: 177016

11 years agoFix the name of a variable to match its declaration. Fixes build failure from r177014.
Craig Topper [Thu, 14 Mar 2013 07:47:43 +0000 (07:47 +0000)]
Fix the name of a variable to match its declaration. Fixes build failure from r177014.

llvm-svn: 177015

11 years agoFix a bug in the calculation of the VEX.B bit for FMA4 rr with the VEX.W bit set...
Craig Topper [Thu, 14 Mar 2013 07:40:52 +0000 (07:40 +0000)]
Fix a bug in the calculation of the VEX.B bit for FMA4 rr with the VEX.W bit set. The VEX.B was being calculated from the wrong operand. Fixes at least some portion of PR14185.

llvm-svn: 177014

11 years ago[TSan] Add missing header inclusion
Alexey Samsonov [Thu, 14 Mar 2013 07:13:00 +0000 (07:13 +0000)]
[TSan] Add missing header inclusion

llvm-svn: 177013

11 years ago[TSan] Use __sanitizer_pthread_attr_t in TSan
Alexey Samsonov [Thu, 14 Mar 2013 07:10:52 +0000 (07:10 +0000)]
[TSan] Use __sanitizer_pthread_attr_t in TSan

llvm-svn: 177012

11 years agoTeach X86 MC instruction lowering that VMOVAPSrr and other VEX-encoded register to...
Craig Topper [Thu, 14 Mar 2013 07:09:57 +0000 (07:09 +0000)]
Teach X86 MC instruction lowering that VMOVAPSrr and other VEX-encoded register to register moves should be switched from using the MRMSrcReg form to the MRMDestReg form if the source register is a 64-bit extended register and the destination register is not. This allows the instruction to be encoded using the 2-byte VEX form instead of the 3-byte VEX form. The GNU assembler has similar behavior.

llvm-svn: 177011

11 years agoFix PR15309
Michael Liao [Thu, 14 Mar 2013 06:57:42 +0000 (06:57 +0000)]
Fix PR15309

- Fix the typo on type checking

llvm-svn: 177010

11 years agotest commit: remove blank line.
Jiong Wang [Thu, 14 Mar 2013 05:43:59 +0000 (05:43 +0000)]
test commit: remove blank line.

llvm-svn: 177009

11 years agoRemove a change to the debug info in this test, that I made while testing
Nick Lewycky [Thu, 14 Mar 2013 05:28:10 +0000 (05:28 +0000)]
Remove a change to the debug info in this test, that I made while testing
something else and forgot to remove.

llvm-svn: 177007

11 years agoTry using %S to find the emitted .gcno file.
Nick Lewycky [Thu, 14 Mar 2013 05:23:30 +0000 (05:23 +0000)]
Try using %S to find the emitted .gcno file.

llvm-svn: 177006

11 years agoRemove accidentally committed debug line.
Nick Lewycky [Thu, 14 Mar 2013 05:19:12 +0000 (05:19 +0000)]
Remove accidentally committed debug line.

llvm-svn: 177005

11 years agoUpdate GCOVProfiling pass creation for API change in r177002. No functionality change.
Nick Lewycky [Thu, 14 Mar 2013 05:14:01 +0000 (05:14 +0000)]
Update GCOVProfiling pass creation for API change in r177002. No functionality change.

llvm-svn: 177004

11 years agoFlag that friend function definitions are "late parsed" so that
John McCall [Thu, 14 Mar 2013 05:13:41 +0000 (05:13 +0000)]
Flag that friend function definitions are "late parsed" so that
template instantiation will still consider them to be definitions
if we instantiate the containing class before we get around
to parsing the friend.

This seems like a legitimate use of "late template parsed" to me,
but I'd appreciate it if someone responsible for the MS feature
would look over this.

This file already appears to access AST nodes directly, which
is arguably not kosher in the parser, but the performance of this
path matters enough that perpetuating the sin is justifiable.
Probably we ought to reconsider this policy for very simple
manipulations like this.

The reason this entire thing is necessary is that
function template instantiation plays some very gross games
in order to not associate an instantiated function template
with the class it came from unless it's a definition, and
the reason *that's* necessary is that the AST currently
cannot represent the instantiation history of individual
function template declarations, but instead tracks it in
common for the entire function template.  That probably
prevents us from correctly reporting ill-formed calls to
ambiguously instantiated friend function templates.

rdar://12350696

llvm-svn: 177003

11 years agoRefactor GCOV's six constructor arguments into a struct with a getter that
Nick Lewycky [Thu, 14 Mar 2013 05:13:26 +0000 (05:13 +0000)]
Refactor GCOV's six constructor arguments into a struct with a getter that
constructs default arguments. It can now take default arguments from
cl::opt'ions. Add a new -default-gcov-version=... option, and actually test it!

Sink the reverse-order of the version into GCOVProfiling, hiding it from our
users.

llvm-svn: 177002

11 years ago[modules] Don't write the UnusedFileScopedDecls vector to the module file.
Argyrios Kyrtzidis [Thu, 14 Mar 2013 04:45:00 +0000 (04:45 +0000)]
[modules] Don't write the UnusedFileScopedDecls vector to the module file.

llvm-svn: 177001

11 years ago[modules] Check for delegating constructor cycles when building a module and don...
Argyrios Kyrtzidis [Thu, 14 Mar 2013 04:44:56 +0000 (04:44 +0000)]
[modules] Check for delegating constructor cycles when building a module and don't write them out to the module file.

llvm-svn: 177000

11 years agoAvoid computing the linkage too early. Don't invalidate it.
Rafael Espindola [Thu, 14 Mar 2013 03:07:35 +0000 (03:07 +0000)]
Avoid computing the linkage too early. Don't invalidate it.

Before this patch we would compute the linkage lazily and cache it. When the
AST was modified in ways that could change the value, we would invalidate the
cache.

That was fairly brittle, since any code could ask for the a linkage before
the correct value was available.

We should change the API to one where the linkage is computed explicitly and
trying to get it when it is not available asserts.

This patch is a first step in that direction. We still compute the linkage
lazily, but instead of invalidating a cache, we assert that the AST
modifications didn't change the result.

llvm-svn: 176999

11 years agoAdded future directions comment and a couple of fixme's.
John Thompson [Thu, 14 Mar 2013 01:41:29 +0000 (01:41 +0000)]
Added future directions comment and a couple of fixme's.

llvm-svn: 176998

11 years agoFix typo in comment.
Nick Lewycky [Thu, 14 Mar 2013 01:26:17 +0000 (01:26 +0000)]
Fix typo in comment.

llvm-svn: 176997

11 years ago[Support][Test] Missed this in the API change.
Michael J. Spencer [Thu, 14 Mar 2013 00:33:37 +0000 (00:33 +0000)]
[Support][Test] Missed this in the API change.

llvm-svn: 176996

11 years ago[Support] Fix lifetime of file descriptors when using MemoryBuffer.
Michael J. Spencer [Thu, 14 Mar 2013 00:20:10 +0000 (00:20 +0000)]
[Support] Fix lifetime of file descriptors when using MemoryBuffer.

Clients of MemoryBuffer::getOpenFile expect it not to take ownership of the file
descriptor passed in. So don't.

llvm-svn: 176995

11 years agoNo functionality change. Rename emitGCNO() to the more sensible
Nick Lewycky [Wed, 13 Mar 2013 22:55:42 +0000 (22:55 +0000)]
No functionality change. Rename emitGCNO() to the more sensible
emitProfileNotes(), similar to emitProfileArcs(). Also update its comment.

Also add a comment on Version[4] (there will be another comment in clang later),
and compress lines that exceeded 80 columns.

llvm-svn: 176994

11 years agoSimplify file/directory name handling in DILexicalBlock
David Blaikie [Wed, 13 Mar 2013 22:52:59 +0000 (22:52 +0000)]
Simplify file/directory name handling in DILexicalBlock

llvm-svn: 176993

11 years ago<rdar://problem/13415471>
Han Ming Ong [Wed, 13 Mar 2013 22:51:04 +0000 (22:51 +0000)]
<rdar://problem/13415471>

Don't get dirty page size if we are not going to send it back

llvm-svn: 176992

11 years agoReally fix the MIPS test.
Bill Wendling [Wed, 13 Mar 2013 22:44:19 +0000 (22:44 +0000)]
Really fix the MIPS test.

llvm-svn: 176991

11 years agoRemove an extra operand to a DIFile metadata entry
David Blaikie [Wed, 13 Mar 2013 22:33:09 +0000 (22:33 +0000)]
Remove an extra operand to a DIFile metadata entry

(extra cleanup/fallout from r176983 - not sure why I didn't catch this locally)

llvm-svn: 176988

11 years agoAttempt to fix test.
Bill Wendling [Wed, 13 Mar 2013 22:29:26 +0000 (22:29 +0000)]
Attempt to fix test.

llvm-svn: 176987

11 years agoReset some of the target options which affect code generation.
Bill Wendling [Wed, 13 Mar 2013 22:26:59 +0000 (22:26 +0000)]
Reset some of the target options which affect code generation.

This doesn't reset all of the target options within the TargetOptions
object. This is because some of those are ABI-specific and must be determined if
it's okay to change those on the fly.

llvm-svn: 176986

11 years agoHave these attriubtes set to 'true' or 'false'.
Bill Wendling [Wed, 13 Mar 2013 22:24:33 +0000 (22:24 +0000)]
Have these attriubtes set to 'true' or 'false'.

The back-end cannot differentiate between functions that are from a .ll file and
those generated from the front-end. We cannot then take the non-precense of
these attributes as a "false" value. Have the front-end explicitly set the value
to 'true' or 'false' depending upon what is actually set.

llvm-svn: 176985

11 years agoSimplify directory name handling in DILexicalBlockFile.
David Blaikie [Wed, 13 Mar 2013 22:23:51 +0000 (22:23 +0000)]
Simplify directory name handling in DILexicalBlockFile.

llvm-svn: 176984

11 years agoRemove the unused 4th operand for DIFile debug info metadata
David Blaikie [Wed, 13 Mar 2013 22:05:21 +0000 (22:05 +0000)]
Remove the unused 4th operand for DIFile debug info metadata

llvm-svn: 176983

11 years agoAdd braces to crashed test summary (needed for buildbots to detect crashes)
Daniel Malea [Wed, 13 Mar 2013 21:50:49 +0000 (21:50 +0000)]
Add braces to crashed test summary (needed for buildbots to detect crashes)

llvm-svn: 176980

11 years agoRemove extra whitespace
Daniel Malea [Wed, 13 Mar 2013 21:18:54 +0000 (21:18 +0000)]
Remove extra whitespace

llvm-svn: 176978

11 years agoMake LTO codegen use a PassManager, rather than a FunctionPassManager, for the
Lang Hames [Wed, 13 Mar 2013 21:18:46 +0000 (21:18 +0000)]
Make LTO codegen use a PassManager, rather than a FunctionPassManager, for the
codegen passes. This brings it in to line with clang and llc's codegen setup,
and tidies up the code.

If I understand correctly, adding ModulePasses to a FunctionPassManager is
bogus. It only seems to explode if an added ModulePass depends on a
FunctionPass though, which might be why this code has survived so long.

Fixes <rdar://problem/13386816>.

llvm-svn: 176977

11 years ago[Modules] Don't eagerly load and associate all the module header files.
Argyrios Kyrtzidis [Wed, 13 Mar 2013 21:13:51 +0000 (21:13 +0000)]
[Modules] Don't eagerly load and associate all the module header files.

In a module-enabled Cocoa PCH file, we spend a lot of time stat'ing the headers
in order to associate the FileEntries with their modules and support implicit
module import.

Use a more lazy scheme by enhancing HeaderInfoTable to store extra info about
the module that a header belongs to, and associate it with its module only when
there is a request for loading the header info for a particular file.

Part of rdar://13391765

llvm-svn: 176976

11 years ago[Modules] Resolve top-headers of modules lazily.
Argyrios Kyrtzidis [Wed, 13 Mar 2013 21:13:43 +0000 (21:13 +0000)]
[Modules] Resolve top-headers of modules lazily.

This allows resolving top-header filenames of modules to FileEntries when
we need them, not eagerly.

Note that that this breaks ABI for libclang functions
clang_Module_getTopLevelHeader / clang_Module_getNumTopLevelHeaders
but this is fine because they are experimental and not widely used yet.

llvm-svn: 176975

11 years agoPrepend "FAIL:" string to tests that crash so that buildbots pick them up.
Daniel Malea [Wed, 13 Mar 2013 21:08:02 +0000 (21:08 +0000)]
Prepend "FAIL:" string to tests that crash so that buildbots pick them up.

llvm-svn: 176974

11 years agoSimplify CMake rules in HandleLLVMOptions module.
Alexey Samsonov [Wed, 13 Mar 2013 20:50:23 +0000 (20:50 +0000)]
Simplify CMake rules in HandleLLVMOptions module.

Summary: No functionality change.

Reviewers: Bigcheese

Reviewed By: Bigcheese

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D535

llvm-svn: 176973

11 years agoMinor LLDB test improvements
Daniel Malea [Wed, 13 Mar 2013 20:50:05 +0000 (20:50 +0000)]
Minor LLDB test improvements
- fix TestCPPBool (was failing with some versions of GCC due to num_breakpoint_locations)
- speed up tests by skipping git/svn revision parsing by the test harness when running in lit-compatible (parsable) mode

This should resolve the failures reported by http://lab.llvm.org:8011/builders/lldb-x86_64-linux

llvm-svn: 176972

11 years agoCause the mips16/nomips16 attribute to be passed to LLVM from Clang
Reed Kotler [Wed, 13 Mar 2013 20:40:30 +0000 (20:40 +0000)]
Cause the mips16/nomips16 attribute to be passed to LLVM from Clang
in the LLVM assembly language output.

llvm-svn: 176971