platform/upstream/llvm.git
11 years agoMuch more cleanup on the performance testing infrastructure:
Greg Clayton [Fri, 22 Mar 2013 02:31:35 +0000 (02:31 +0000)]
Much more cleanup on the performance testing infrastructure:
- Added new abtract Results class to keep CoreFoundation out of the tests. There are many subclasses for different settings:
    Results::Result::Dictionary
    Results::Result::Array
    Results::Result::Unsigned
    Results::Result::Double
    Results::Result::String
- Gauge<T> can now write themselves out via a templatized write to results function:
    template <class T>
    Results::ResultSP GetResult (const char *description, T value);

- There are four specializations of this so far:
    template <>
    Results::ResultSP GetResult (const char *description, double value);

    template <>
    Results::ResultSP GetResult (const char *description, uint64_t value);

    template <>
    Results::ResultSP GetResult (const char *description, std::string value);

    template <>
    Results::ResultSP GetResult (const char *description, MemoryStats value);
- Don't emit the virtual memory reading from the task info call as it really doesn't mean much as it includes way too much (shared cache + other stuff we don't have control over)
- Fixed other test cases to build correctly and use the new classes

llvm-svn: 177696

11 years agoRevert r177543: Add timing of the IR parsing code with a new
Chandler Carruth [Fri, 22 Mar 2013 02:20:34 +0000 (02:20 +0000)]
Revert r177543: Add timing of the IR parsing code with a new
-time-ir-parsing flag

This breaks the layering of the Support library. We can't add an
implementation side to IRReader because it refers directly to entities
only accessible as part of the IR, AsmParser, and BitcodeReader
libraries. It can only be used in a context where all of those libraries
will be available.

We'll need to find some other way to get this functionality, and
hopefully solve the long-standing layering problem of IRReader.h...

llvm-svn: 177695

11 years agoFix buffer read overflow in money_get::do_get(). Found by UBSan
Marshall Clow [Fri, 22 Mar 2013 02:14:40 +0000 (02:14 +0000)]
Fix buffer read overflow in money_get::do_get(). Found by UBSan

llvm-svn: 177694

11 years agoFix undefined behavior in syntax_option_type::operator~ and match_flag_type::operator...
Marshall Clow [Fri, 22 Mar 2013 02:13:55 +0000 (02:13 +0000)]
Fix undefined behavior in syntax_option_type::operator~ and match_flag_type::operator./a.out  Found by UBSan

llvm-svn: 177693

11 years agoFix a crash-on-valid where a block capture copy expression was
John McCall [Fri, 22 Mar 2013 02:10:40 +0000 (02:10 +0000)]
Fix a crash-on-valid where a block capture copy expression was
picking up cleanups from earlier in the statement.  Also fix a
crash-on-invalid where a reference to an invalid decl from an
enclosing scope was causing an expression to fail to build, but
only *after* a cleanup was registered from that statement,
causing an assertion downstream.

The crash-on-valid is rdar://13459289.

llvm-svn: 177692

11 years agoChange the AppleObjCTrampolineHandler to always run all threads when resolving the...
Jim Ingham [Fri, 22 Mar 2013 01:28:17 +0000 (01:28 +0000)]
Change the AppleObjCTrampolineHandler to always run all threads when resolving the target of an ObjC method call.
Add a StopOthers method to AppleThreadPlanStepThroughObjCTrampoline, don't rely on the setting in the ThreadPlanToCallFunction, since that
gets pushed too late to determine which threads will continue.

<rdar://problem/13447638>

llvm-svn: 177691

11 years agoubsan: Pass floating-point arguments to the runtime by value if they fit the
Richard Smith [Fri, 22 Mar 2013 00:47:07 +0000 (00:47 +0000)]
ubsan: Pass floating-point arguments to the runtime by value if they fit the
value argument. If not, be sure we don't accidentally use a dynamic alloca.

llvm-svn: 177690

11 years agoubsan: Pass floating-point arguments to the runtime by value if they fit the
Richard Smith [Fri, 22 Mar 2013 00:47:05 +0000 (00:47 +0000)]
ubsan: Pass floating-point arguments to the runtime by value if they fit the
value argument.

llvm-svn: 177689

11 years agoDon't try to read the eh_frame section out of a dSYM.
Jason Molenda [Fri, 22 Mar 2013 00:38:45 +0000 (00:38 +0000)]
Don't try to read the eh_frame section out of a dSYM.
It won't have one and it isn't needed.

llvm-svn: 177688

11 years agoFix the invalid opcode for Mips branch instructions in the assembler
Jack Carter [Fri, 22 Mar 2013 00:29:10 +0000 (00:29 +0000)]
Fix the invalid opcode for Mips branch instructions in the assembler

For mips a branch an 18-bit signed offset (the 16-bit
offset field shifted left 2 bits) is added to the
address of the instruction following the branch
(not the branch itself), in the branch delay slot,
to form a PC-relative effective target address.

Previously, the code generator did not perform the
shift of the immediate branch offset which resulted
in wrong instruction opcode. This patch fixes the issue.

Contributor: Vladimir Medic
llvm-svn: 177687

11 years ago<rdar://problem/13479214> Make Clang's <stddef.h> robust against system headers defin...
Douglas Gregor [Fri, 22 Mar 2013 00:10:49 +0000 (00:10 +0000)]
<rdar://problem/13479214> Make Clang's <stddef.h> robust against system headers defining size_t/ptrdiff_t/wchar_t.

Clang's <stddef.h> provides definitions for the C standard library
types size_t, ptrdiff_t, and wchar_t. However, the system's C standard
library headers tend to provide the same typedefs, and the two
generally avoid each other using the macros
_SIZE_T/_PTRDIFF_T/_WCHAR_T. With modules, however, we need to see
*all* of the places where these types are defined, so provide the
typedefs (ignoring the macros) when modules are enabled.

llvm-svn: 177686

11 years agoThis patch that enables the Mips assembler to use symbols for offset for instructions
Jack Carter [Fri, 22 Mar 2013 00:05:30 +0000 (00:05 +0000)]
This patch that enables the Mips assembler to use symbols for offset for instructions

This patch uses the generated instruction info tables to
identify memory/load store instructions.
After successful matching and based on the operand type
and size, it generates additional instructions to the output.

Contributor: Vladimir Medic
llvm-svn: 177685

11 years agoDon't forget to link in the C++-specific parts of the ubsan runtime when using the...
Richard Smith [Fri, 22 Mar 2013 00:01:44 +0000 (00:01 +0000)]
Don't forget to link in the C++-specific parts of the ubsan runtime when using the Makefile build system on Darwin.

llvm-svn: 177684

11 years agoRemove the G8RC_NOX0_and_GPRC_NOR0 PPC register class
Hal Finkel [Thu, 21 Mar 2013 23:45:03 +0000 (23:45 +0000)]
Remove the G8RC_NOX0_and_GPRC_NOR0 PPC register class

As Jakob pointed out in his review of r177423, having a shared ZERO
register between the 32- and 64-bit register classes causes this
odd G8RC_NOX0_and_GPRC_NOR0 class to be created. As recommended,
this adds a ZERO8 register which differentiates the 32- and 64-bit
zeros.

No functionality change intended.

llvm-svn: 177683

11 years agoAdd TableGen ctags(1) emitter and helper script.
Sean Silva [Thu, 21 Mar 2013 23:40:38 +0000 (23:40 +0000)]
Add TableGen ctags(1) emitter and helper script.

To use this in conjunction with exuberant ctags to generate a single
combined tags file, run tblgen first and then
  $ ctags --append [...]

Since some identifiers have corresponding definitions in C++ code,
it can be useful (if using vim) to also use cscope, and
  :set cscopetagorder=1
so that
  :tag X
will preferentially select the tablegen symbol, while
  :cscope find g X
will always find the C++ symbol.

Patch by Kevin Schoedel!

(a couple small formatting changes courtesy of clang-format)

llvm-svn: 177682

11 years agoAlways forward 'resume' instructions to the outter landing pad.
Bill Wendling [Thu, 21 Mar 2013 23:30:12 +0000 (23:30 +0000)]
Always forward 'resume' instructions to the outter landing pad.

How did this ever work?

Basically, if you have a function that's inlined into the caller, it may not
have any 'call' instructions, but any 'resume' instructions it may have should
still be forwarded to the outer (caller's) landing pad. This requires that all
of the 'landingpad' instructions in the callee have their clauses merged with
the caller's outer 'landingpad' instruction (hence the bit of ugly code in the
`forwardResume' method).

Testcase in a follow commit to the test-suite repository.

<rdar://problem/13360379> & PR15555

llvm-svn: 177680

11 years agoFix a register-class comparison bug in PPCCTRLoops
Hal Finkel [Thu, 21 Mar 2013 23:23:34 +0000 (23:23 +0000)]
Fix a register-class comparison bug in PPCCTRLoops

Thanks to Jakob for isolating the underlying problem from the
test case in r177423. The original commit had introduced
asymmetric copy operations, but these turned out to be a work-around
to the real problem (the use of == instead of hasSubClassEq in PPCCTRLoops).

llvm-svn: 177679

11 years ago[analyzer] scan-build: emit errors on stderr, and exit(1) instead of exit(0).
Jordan Rose [Thu, 21 Mar 2013 23:14:26 +0000 (23:14 +0000)]
[analyzer] scan-build: emit errors on stderr, and exit(1) instead of exit(0).

PR14963

llvm-svn: 177678

11 years agoRefactor the filename/directory information in DISubprogram to refer directly to...
David Blaikie [Thu, 21 Mar 2013 23:08:34 +0000 (23:08 +0000)]
Refactor the filename/directory information in DISubprogram to refer directly to the pair rather than the DIFile.

llvm-svn: 177677

11 years agoUpdate debug info test case for more incoming DIBuilder changes
David Blaikie [Thu, 21 Mar 2013 23:07:47 +0000 (23:07 +0000)]
Update debug info test case for more incoming DIBuilder changes

Switching the DIFile field in DISubprogram to refer to the raw
filename/directory pair instead of a DIFile.

llvm-svn: 177676

11 years agoAdd a query to tell if a landing pad has a catch-all.
Bill Wendling [Thu, 21 Mar 2013 23:01:03 +0000 (23:01 +0000)]
Add a query to tell if a landing pad has a catch-all.

llvm-svn: 177675

11 years agoMove the DIFile in DISubprogram to the beginning to be a common prefix along with...
David Blaikie [Thu, 21 Mar 2013 22:29:36 +0000 (22:29 +0000)]
Move the DIFile in DISubprogram to the beginning to be a common prefix along with other DIScopes

llvm-svn: 177674

11 years agoUpdate debug info test case for an incoming change to DIBuilder in LLVM
David Blaikie [Thu, 21 Mar 2013 22:28:46 +0000 (22:28 +0000)]
Update debug info test case for an incoming change to DIBuilder in LLVM

(this will produce some transient test failure/skew)

llvm-svn: 177673

11 years agoModified the way we report fields of records.
Sean Callanan [Thu, 21 Mar 2013 22:15:41 +0000 (22:15 +0000)]
Modified the way we report fields of records.
Clang requires them to have complete types, but
we were previously only completing them if they
were of tag or Objective-C object types.

I have implemented a method on the ASTImporter
whose job is to complete a type.  It handles not
only the cases mentioned above, but also array
and atomic types.

<rdar://problem/13446777>

llvm-svn: 177672

11 years ago<rdar://problem/13477190> Give the Clang module cache directory some structure, so...
Douglas Gregor [Thu, 21 Mar 2013 21:48:48 +0000 (21:48 +0000)]
<rdar://problem/13477190> Give the Clang module cache directory some structure, so it's easier to find.

We now put the Clang module cache in
<system-temp-directory>/org.llvm.clang/ModuleCache. Perhaps some day
there will be other caches under <system-temp-directory>/org.llvm.clang>.

llvm-svn: 177671

11 years agoIf we stopped but no threads had a reason for stopping, we should tell the user about...
Jim Ingham [Thu, 21 Mar 2013 21:46:56 +0000 (21:46 +0000)]
If we stopped but no threads had a reason for stopping, we should tell the user about it rather than continuing.

<rdar://problem/13273125> Astris thread status replies for single-core device confuse lldb; lldb resumes execution on attaching

llvm-svn: 177670

11 years ago<rdar://problem/13477190> On Darwin, use DARWIN_USER_TEMP_DIR or DARWIN_USER_CACHE_DI...
Douglas Gregor [Thu, 21 Mar 2013 21:46:10 +0000 (21:46 +0000)]
<rdar://problem/13477190> On Darwin, use DARWIN_USER_TEMP_DIR or DARWIN_USER_CACHE_DIR for the system temporary directory.

The DARWIN_USER_TEMP_DIR and DARWIN_USER_CACHE_DIR configuration
settings are more idiomatic for Darwin than the TMPDIR environment
variable.

llvm-svn: 177669

11 years agoRemove some commented out code.
Jim Ingham [Thu, 21 Mar 2013 21:44:20 +0000 (21:44 +0000)]
Remove some commented out code.

llvm-svn: 177668

11 years agoThis patch enables the Mips .set directive to define aliases
Jack Carter [Thu, 21 Mar 2013 21:44:16 +0000 (21:44 +0000)]
This patch enables the Mips .set directive to define aliases

The .set directive in the Mips the assembler can be
used to set the value of a symbol to an expression.
This changes the symbol's value and type to conform
to the expression's.

Syntax: .set symbol, expression

This patch implements the parsing of the above syntax
and enables the parser to use defined symbols when
parsing operands.

Contributor: Vladimir Medic
llvm-svn: 177667

11 years agoImplement builtin_{setjmp/longjmp} on PPC
Hal Finkel [Thu, 21 Mar 2013 21:37:52 +0000 (21:37 +0000)]
Implement builtin_{setjmp/longjmp} on PPC

This implements SJLJ lowering on PPC, making the Clang functions
__builtin_{setjmp/longjmp} functional on PPC platforms. The implementation
strategy is similar to that on X86, with the exception that a branch-and-link
variant is used to get the right jump address. Credit goes to Bill Schmidt for
suggesting the use of the unconditional bcl form (instead of the regular bl
instruction) to limit return-address-cache pollution.

Benchmarking the speed at -O3 of:

static jmp_buf env_sigill;

void foo() {
                __builtin_longjmp(env_sigill,1);
}

main() {
...

        for (int i = 0; i < c; ++i) {
                if (__builtin_setjmp(env_sigill)) {
                        goto done;
                } else {
                        foo();
                }

done:;
        }

...
}

vs. the same code using the libc setjmp/longjmp functions on a P7 shows that
this builtin implementation is ~4x faster with Altivec enabled and ~7.25x
faster with Altivec disabled. This comparison is somewhat unfair because the
libc version must also save/restore the VSX registers which we don't yet
support.

llvm-svn: 177666

11 years agoFix indentation
David Blaikie [Thu, 21 Mar 2013 21:35:15 +0000 (21:35 +0000)]
Fix indentation

llvm-svn: 177665

11 years agoFix Darwin NEON FP and increase coverage
Renato Golin [Thu, 21 Mar 2013 21:30:49 +0000 (21:30 +0000)]
Fix Darwin NEON FP and increase coverage

llvm-svn: 177664

11 years agoSelect correct -std flag for CMake for different versions of gcc.
Matt Kopec [Thu, 21 Mar 2013 20:52:53 +0000 (20:52 +0000)]
Select correct -std flag for CMake for different versions of gcc.

llvm-svn: 177663

11 years agoObjective-C: Tighten the rules when warning
Fariborz Jahanian [Thu, 21 Mar 2013 20:50:53 +0000 (20:50 +0000)]
Objective-C: Tighten the rules when warning
is issused for on overriding 'readwrite'
property which is not auto-synthesized.
Buttom line is that if hueristics determine
that there will be a user implemented setter,
no warning will be issued. // rdar://13388503

llvm-svn: 177662

11 years agoRemove unused field in DISubprogram
David Blaikie [Thu, 21 Mar 2013 20:28:52 +0000 (20:28 +0000)]
Remove unused field in DISubprogram

llvm-svn: 177661

11 years agoGeneralize debug info tests to be forward compatible with future DISubprogram changes
David Blaikie [Thu, 21 Mar 2013 20:20:15 +0000 (20:20 +0000)]
Generalize debug info tests to be forward compatible with future DISubprogram changes

llvm-svn: 177659

11 years agoThis ugly regex is required because on Windows, the paths come out as \\ delimited...
Aaron Ballman [Thu, 21 Mar 2013 20:12:19 +0000 (20:12 +0000)]
This ugly regex is required because on Windows, the paths come out as \\ delimited instead of / delimited.  Fixes a test breakage since r176894.

llvm-svn: 177658

11 years agoRemove unused variable.
Benjamin Kramer [Thu, 21 Mar 2013 19:47:38 +0000 (19:47 +0000)]
Remove unused variable.

llvm-svn: 177657

11 years agoAvoid warnings from compilers that think you can drop off the end of a fully covered...
Benjamin Kramer [Thu, 21 Mar 2013 19:45:46 +0000 (19:45 +0000)]
Avoid warnings from compilers that think you can drop off the end of a fully covered switch.

llvm-svn: 177656

11 years agoDelayed template parsing is not supported by the AST serialization system yet, so...
Aaron Ballman [Thu, 21 Mar 2013 19:38:59 +0000 (19:38 +0000)]
Delayed template parsing is not supported by the AST serialization system yet, so turning it off.  This fixes a test breakage caused by r177336.

llvm-svn: 177655

11 years agoAdd support for spilling VRSAVE on PPC
Hal Finkel [Thu, 21 Mar 2013 19:03:21 +0000 (19:03 +0000)]
Add support for spilling VRSAVE on PPC

Although there is only one Altivec VRSAVE register, it is a member of
a register class, and we need the ability to spill it. Because this
register is normally callee-preserved and handled by special code this
has never before been necessary. However, this capability will be required by
a forthcoming commit adding SjLj support.

llvm-svn: 177654

11 years agoCorrect PPC FRAMEADDR lowering using a pseudo-register
Hal Finkel [Thu, 21 Mar 2013 19:03:19 +0000 (19:03 +0000)]
Correct PPC FRAMEADDR lowering using a pseudo-register

The old code used to lower FRAMEADDR tried to replicate the logic in the real
frame-lowering code that determines whether or not the frame pointer (r31) will
be used. When it seemed as through the frame pointer would not be used, the
stack pointer (r1) was used instead. Unfortunately, because the stack size is
not yet known, this does not work. Instead, this change introduces new
always-reserved pseudo-registers (FP and FP8) that are replaced during prologue
insertion with the real frame-pointer register (either r1 or r31).

It is important that this intrinsic always return a valid frame address because
it is used by Clang to store the frame address as part of code generation for
__builtin_setjmp.

llvm-svn: 177653

11 years agoAvoid NEON SP-FP unless unsafe-math or Darwin
Renato Golin [Thu, 21 Mar 2013 18:47:47 +0000 (18:47 +0000)]
Avoid NEON SP-FP unless unsafe-math or Darwin

NEON is not IEEE 754 compliant, so we should avoid lowering single-precision
floating point operations with NEON unless unsafe-math is turned on. The
equivalent VFP instructions are IEEE 754 compliant, but in some cores they're
much slower, so some archs/OSs might still request it to be on by default,
such as Swift and Darwin.

llvm-svn: 177651

11 years agoUpdate some EH tests that were violating the new EH model.
Bill Wendling [Thu, 21 Mar 2013 18:30:10 +0000 (18:30 +0000)]
Update some EH tests that were violating the new EH model.

The landingpad instruction needs to be the first non-PHI instruction in the
unwind destination block.

llvm-svn: 177650

11 years ago[analyzer] Print return values from debug.DumpCalls checker.
Jordan Rose [Thu, 21 Mar 2013 18:16:59 +0000 (18:16 +0000)]
[analyzer] Print return values from debug.DumpCalls checker.

Debug utility only, no functionality change.

llvm-svn: 177649

11 years agotsan: better reporting of thread leaks
Dmitry Vyukov [Thu, 21 Mar 2013 16:55:17 +0000 (16:55 +0000)]
tsan: better reporting of thread leaks
1. do not report running threads as leaks
2. aggregate leaked threads by creation stack

llvm-svn: 177647

11 years agoThe outline of the stepping perf test case, doesn't do anything yet.
Jim Ingham [Thu, 21 Mar 2013 16:48:24 +0000 (16:48 +0000)]
The outline of the stepping perf test case, doesn't do anything yet.

llvm-svn: 177646

11 years agoAdd failing test case
Tobias Grosser [Thu, 21 Mar 2013 16:14:55 +0000 (16:14 +0000)]
Add failing test case

llvm-svn: 177645

11 years agoDo not canonicalize indvars with scev based codegen
Tobias Grosser [Thu, 21 Mar 2013 16:14:53 +0000 (16:14 +0000)]
Do not canonicalize indvars with scev based codegen

Scev code generation can now handle scops with non canonical induction
variables. Hence there is no need to introduce canonical ones any more.

llvm-svn: 177644

11 years agoRemove last uses of canoncial induction variable when scev code generating
Tobias Grosser [Thu, 21 Mar 2013 16:14:50 +0000 (16:14 +0000)]
Remove last uses of canoncial induction variable when scev code generating

We now detect scops without a canonical induction variable and can generate a
polyhedral representation for them. There was no modification necessary to
code generate these scops.

llvm-svn: 177643

11 years agoTempScop: Make assert more descriptive
Tobias Grosser [Thu, 21 Mar 2013 16:14:45 +0000 (16:14 +0000)]
TempScop: Make assert more descriptive

llvm-svn: 177642

11 years agotsan: better reporting for races on vptr
Dmitry Vyukov [Thu, 21 Mar 2013 15:37:39 +0000 (15:37 +0000)]
tsan: better reporting for races on vptr
explicitly say "ctor/dtor vs virtual call"

llvm-svn: 177640

11 years agotsan: add flag to control symbolizer flush frequency
Dmitry Vyukov [Thu, 21 Mar 2013 13:01:50 +0000 (13:01 +0000)]
tsan: add flag to control symbolizer flush frequency

llvm-svn: 177638

11 years agotsan: intercept abort() to fflush() libc streams
Dmitry Vyukov [Thu, 21 Mar 2013 12:50:43 +0000 (12:50 +0000)]
tsan: intercept abort() to fflush() libc streams

llvm-svn: 177637

11 years agotsan: remove bogus CHECK
Dmitry Vyukov [Thu, 21 Mar 2013 12:44:44 +0000 (12:44 +0000)]
tsan: remove bogus CHECK
Asynchronous signal (e.g. SIGABRT) can be received with any value of in_rtl.

llvm-svn: 177636

11 years agoBetter block comment formatting.
Alexander Kornienko [Thu, 21 Mar 2013 12:28:10 +0000 (12:28 +0000)]
Better block comment formatting.

Summary:
1. When splitting one-line block comment, use indentation and *s.
2. Remove trailing whitespace from all lines of a comment, not only the ones being splitted.
3. Add backslashes for all lines if a comment is used insed a preprocessor directive.

Reviewers: djasper

Reviewed By: djasper

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

llvm-svn: 177635

11 years ago[ASan] Switch ASan to generic ThreadRegistry from sanitizer_common. Delete ASan-speci...
Alexey Samsonov [Thu, 21 Mar 2013 11:23:41 +0000 (11:23 +0000)]
[ASan] Switch ASan to generic ThreadRegistry from sanitizer_common. Delete ASan-specific AsanThreadRegistry.

llvm-svn: 177634

11 years ago[ASan] Let the users to invoke `clang -fsanitize=address` to link binaries targeting...
Alexander Potapenko [Thu, 21 Mar 2013 10:49:06 +0000 (10:49 +0000)]
[ASan] Let the users to invoke `clang -fsanitize=address` to link binaries targeting the iOS simulator.

llvm-svn: 177633

11 years agoHoist the definition of getTypeSizeInBits to be inlinable and in the
Chandler Carruth [Thu, 21 Mar 2013 09:52:22 +0000 (09:52 +0000)]
Hoist the definition of getTypeSizeInBits to be inlinable and in the
header.

This method is called in the hot path for *many* passes, SROA is what
caught my interest. A common pattern is that which branch of the switch
should be taken is known in the callsite and so it is a very good
candidate for inlining and simplification. Moving it into the header
allows the optimizer to fold a lot of boring, repeatitive code in
callers of this routine.

I'm seeing pretty significant speedups in parts of SROA and I suspect
other passes will see similar speedups if they end up working with type
sizes frequently. I've not seen any significant growth of the binaries
as a consequence, but let me know if you see anything suspicious here.

llvm-svn: 177632

11 years ago[SROA] Prefix names using a custom IRBuilder inserter.
Chandler Carruth [Thu, 21 Mar 2013 09:52:18 +0000 (09:52 +0000)]
[SROA] Prefix names using a custom IRBuilder inserter.

The key part of this is ensuring that name prefixes remain in a Twine
form until we get to a point where we can nuke them under NDEBUG. This
is tricky using the old APIs as they played fast and loose with Twine,
which is prone to serious error. The inserter is much cleaner as it is
actually in the call stack leading to the setName call, and so has
a good opportunity to prepend the prefix.

This matters more than you might imagine because most runs over an
alloca find a single partition, and rewrite 3 or 4 instructions
referring to it. As a consequence doing this lazily and exclusively with
Twine allows the optimizer to delete more of it and shaves another 2% to
3% off of the release build's SROA run time for PR15412. I also think
the APIs are cleaner, and the use of Twine is more reliable, so
I consider it a win-win despite the churn required to reach this state.

llvm-svn: 177631

11 years ago[msan] Add an option to disable poisoning of shadow for undef values.
Evgeniy Stepanov [Thu, 21 Mar 2013 09:38:26 +0000 (09:38 +0000)]
[msan] Add an option to disable poisoning of shadow for undef values.

llvm-svn: 177630

11 years agotsan: flush symbolizer cache if not symbolized for more than 5 seconds
Dmitry Vyukov [Thu, 21 Mar 2013 07:02:36 +0000 (07:02 +0000)]
tsan: flush symbolizer cache if not symbolized for more than 5 seconds

llvm-svn: 177629

11 years agotsan: add a comment about magic numbers
Dmitry Vyukov [Thu, 21 Mar 2013 06:28:04 +0000 (06:28 +0000)]
tsan: add a comment about magic numbers

llvm-svn: 177628

11 years agotsan: use a single background thread for memory profiler and memory flush (and later...
Dmitry Vyukov [Thu, 21 Mar 2013 06:24:31 +0000 (06:24 +0000)]
tsan: use a single background thread for memory profiler and memory flush (and later for symbolizer flush)

llvm-svn: 177627

11 years agoFix a typo.
Bob Wilson [Thu, 21 Mar 2013 06:09:09 +0000 (06:09 +0000)]
Fix a typo.

llvm-svn: 177626

11 years agoAdd correct file headers to all source files.
Greg Clayton [Thu, 21 Mar 2013 03:39:51 +0000 (03:39 +0000)]
Add correct file headers to all source files.

llvm-svn: 177625

11 years agoAdd a new method GetFunctionAddressAndSizeVector to DWARFCallFrameInfo.
Jason Molenda [Thu, 21 Mar 2013 03:36:01 +0000 (03:36 +0000)]
Add a new method GetFunctionAddressAndSizeVector to DWARFCallFrameInfo.
This returns a vector of <file address, size> entries for all of
the functions in the module that have an eh_frame FDE.

Update ObjectFileMachO to use the eh_frame FDE function addresses if
the LC_FUNCTION_STARTS section is missing, to fill in the start
addresses of any symbols that have been stripped from the binary.

Generally speaking, lldb works best if it knows the actual start
address of every function in a module - it's especially important
for unwinding, where lldb inspects the instructions in the prologue
of the function.  In a stripped binary, it is deprived of this
information and it reduces the quality of our unwinds and saved
register retrieval.

Other ObjectFile users may want to use the function addresses from
DWARFCallFrameInfo to fill in any stripped symbols like ObjectFileMachO
does already.
<rdar://problem/13365659>

llvm-svn: 177624

11 years agoModify code to adhere to LLDB coding conventions.
Greg Clayton [Thu, 21 Mar 2013 03:32:24 +0000 (03:32 +0000)]
Modify code to adhere to LLDB coding conventions.

llvm-svn: 177623

11 years agosimplify-libcalls: Removed unused variable
Meador Inge [Thu, 21 Mar 2013 02:44:07 +0000 (02:44 +0000)]
simplify-libcalls: Removed unused variable

The 'Modified' variable should have been removed from SimplifyLibCalls
in r177619, but was missed.  This commit removes it.

llvm-svn: 177622

11 years ago<rdar://problem/13037793> Allow the names of modules to differ from the name of their...
Douglas Gregor [Thu, 21 Mar 2013 01:08:50 +0000 (01:08 +0000)]
<rdar://problem/13037793> Allow the names of modules to differ from the name of their subdirectory in the include path.

llvm-svn: 177621

11 years agoFix missing std::. Not sure how this compiles for anyone else.
Matt Arsenault [Thu, 21 Mar 2013 00:57:21 +0000 (00:57 +0000)]
Fix missing std::. Not sure how this compiles for anyone else.

llvm-svn: 177620

11 years agoMove library call prototype attribute inference to functionattrs
Meador Inge [Thu, 21 Mar 2013 00:55:59 +0000 (00:55 +0000)]
Move library call prototype attribute inference to functionattrs

The simplify-libcalls pass implemented a doInitialization hook to infer
function prototype attributes for well-known functions.  Given that the
simplify-libcalls pass is going away *and* that the functionattrs pass
is already in place to deduce function attributes, I am moving this logic
to the functionattrs pass.  This approach was discussed during patch
review:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121126/157465.html.

llvm-svn: 177619

11 years agoPer discussion on cxx-abi-dev, switch from comparing type_info objects to
Richard Smith [Thu, 21 Mar 2013 00:42:03 +0000 (00:42 +0000)]
Per discussion on cxx-abi-dev, switch from comparing type_info objects to
comparing type_info names, since the latter have better uniqueness guarantees
in practice.

llvm-svn: 177618

11 years agoAdded a lldb-perf test case that will be used to time various aspects of debugging...
Greg Clayton [Thu, 21 Mar 2013 00:30:04 +0000 (00:30 +0000)]
Added a lldb-perf test case that will be used to time various aspects of debugging clang with LLDB.

This test case will measure memory usage and expression timings in frame zero and at higher frames.

llvm-svn: 177617

11 years agoFixed the ValidOffsetForDataOfSize() to use simpler logic. Fixed DataExtractor::Bytes...
Greg Clayton [Thu, 21 Mar 2013 00:29:45 +0000 (00:29 +0000)]
Fixed the ValidOffsetForDataOfSize() to use simpler logic. Fixed DataExtractor::BytesLeft() to return the correct value.

llvm-svn: 177616

11 years agoSimplify the logic for DNBDataRef::ValidOffsetForDataOfSize() and DNBDataRef::ValidOf...
Greg Clayton [Thu, 21 Mar 2013 00:24:59 +0000 (00:24 +0000)]
Simplify the logic for DNBDataRef::ValidOffsetForDataOfSize() and DNBDataRef::ValidOffset() functions.

llvm-svn: 177615

11 years agoRemoving unused DISubprogram::getFile
David Blaikie [Thu, 21 Mar 2013 00:10:31 +0000 (00:10 +0000)]
Removing unused DISubprogram::getFile

llvm-svn: 177614

11 years agoFurther weaken block conversion rules to permit blocks with
John McCall [Thu, 21 Mar 2013 00:10:07 +0000 (00:10 +0000)]
Further weaken block conversion rules to permit blocks with
enum return type to be converted to blocks with any integer type
of the same size.

rdar://13463504

llvm-svn: 177613

11 years agoAdd more testing cases for tbaa.struct
Manman Ren [Thu, 21 Mar 2013 00:09:50 +0000 (00:09 +0000)]
Add more testing cases for tbaa.struct

Testing cases for structs of structs and unions of structs.

llvm-svn: 177612

11 years agoAdd a WriteMicrocoded for ancient microcoded instructions.
Jakob Stoklund Olesen [Thu, 21 Mar 2013 00:07:17 +0000 (00:07 +0000)]
Add a WriteMicrocoded for ancient microcoded instructions.

llvm-svn: 177611

11 years agoDebug info: refactor the first field of DICompileUnit to be a raw file/directory...
David Blaikie [Wed, 20 Mar 2013 23:58:12 +0000 (23:58 +0000)]
Debug info: refactor the first field of DICompileUnit to be a raw file/directory pair

This removes the DICompileUnit special case from DIScope.

llvm-svn: 177610

11 years agoDebug info - generalize namespace test to not depend on a DW_TAG_file_type entry
David Blaikie [Wed, 20 Mar 2013 23:57:15 +0000 (23:57 +0000)]
Debug info - generalize namespace test to not depend on a DW_TAG_file_type entry

This isn't necessary & with the next change to LLVM the DW_TAG_file_type entry
won't be emitted at all - only the raw filename/directory pair, so match on
that directly instead.

llvm-svn: 177609

11 years agoUse pre-inc, pre-dec when possible.
Jakub Staszak [Wed, 20 Mar 2013 23:56:19 +0000 (23:56 +0000)]
Use pre-inc, pre-dec when possible.
They are generally faster (at least not slower) than post-inc, post-dec.

llvm-svn: 177608

11 years agoRemove 'else' after 'return'.
Jakub Staszak [Wed, 20 Mar 2013 23:53:45 +0000 (23:53 +0000)]
Remove 'else' after 'return'.

llvm-svn: 177607

11 years agoSplit ubsan runtime into three pieces (compiler-rt part):
Richard Smith [Wed, 20 Mar 2013 23:49:17 +0000 (23:49 +0000)]
Split ubsan runtime into three pieces (compiler-rt part):
 * libclang_rt-san-* is sanitizer_common, and is linked in only if no other
   sanitizer runtime is present.
 * libclang_rt-ubsan-* is the piece of the runtime which doesn't depend on
   a C++ ABI library, and is always linked in.
 * libclang_rt-ubsan_cxx-* is the piece of the runtime which depends on a
   C++ ABI library, and is only linked in when linking a C++ binary.

The Darwin ubsan runtime is unchanged.

For more details, see Clang change r177605.

llvm-svn: 177606

11 years agoSplit ubsan runtime into three pieces (clang part):
Richard Smith [Wed, 20 Mar 2013 23:49:07 +0000 (23:49 +0000)]
Split ubsan runtime into three pieces (clang part):
 * libclang_rt-san-* is sanitizer_common, and is linked in only if no other
   sanitizer runtime is present.
 * libclang_rt-ubsan-* is the piece of the runtime which doesn't depend on
   a C++ ABI library, and is always linked in.
 * libclang_rt-ubsan_cxx-* is the piece of the runtime which depends on a
   C++ ABI library, and is only linked in when linking a C++ binary.

This change also switches us to using -whole-archive for the ubsan runtime
(which is made possible by the above split), and switches us to only linking
the sanitizer runtime into the main binary and not into DSOs (which is made
possible by using -whole-archive).

The motivation for this is to only link a single copy of sanitizer_common
into any binary. This is becoming important now because we want to share
more state between multiple sanitizers in the same process (for instance,
we want a single shared output mutex).

The Darwin ubsan runtime is unchanged; because we use a DSO there, we don't
need this complexity.

llvm-svn: 177605

11 years ago[ELF][Hexagon][test] check .got.plt order
Shankar Easwaran [Wed, 20 Mar 2013 23:39:43 +0000 (23:39 +0000)]
[ELF][Hexagon][test] check .got.plt order

llvm-svn: 177604

11 years ago[X86_64][test] check that interp section is not emitted when building dynamic libraries
Shankar Easwaran [Wed, 20 Mar 2013 23:34:36 +0000 (23:34 +0000)]
[X86_64][test] check that interp section is not emitted when building dynamic libraries

llvm-svn: 177603

11 years ago[lit] Avoid CRLFs in bash scripts on Windows
Reid Kleckner [Wed, 20 Mar 2013 23:32:14 +0000 (23:32 +0000)]
[lit] Avoid CRLFs in bash scripts on Windows

Native Windows Python will do line ending translation by default, which
we don't want in bash scripts.  If we're not native Windows Python, then
'b' is ignored.

llvm-svn: 177602

11 years agoAdd declaration for linux.
Bill Wendling [Wed, 20 Mar 2013 23:21:08 +0000 (23:21 +0000)]
Add declaration for linux.

llvm-svn: 177601

11 years agoMake variable name more explicit and eliminate redundant lookup in SDNodeOrdering
Justin Holewinski [Wed, 20 Mar 2013 23:10:59 +0000 (23:10 +0000)]
Make variable name more explicit and eliminate redundant lookup in SDNodeOrdering

llvm-svn: 177600

11 years agoModel prefetches and barriers as loads.
Jakob Stoklund Olesen [Wed, 20 Mar 2013 23:09:53 +0000 (23:09 +0000)]
Model prefetches and barriers as loads.

It's not yet clear if these instructions need a more careful model.

llvm-svn: 177599

11 years agoAdd a catch-all WriteSystem SchedWrite type.
Jakob Stoklund Olesen [Wed, 20 Mar 2013 23:09:50 +0000 (23:09 +0000)]
Add a catch-all WriteSystem SchedWrite type.

This is used for all the expensive system instructions.

llvm-svn: 177598

11 years agoMaking a manual mode of operation for measurements, where you can manually call start...
Enrico Granata [Wed, 20 Mar 2013 23:01:28 +0000 (23:01 +0000)]
Making a manual mode of operation for measurements, where you can manually call start() and stop() instead of using the function-call syntax
This is especially useful to take measurements that span multiple test steps, or where you need to have different operations fall under the same measurement

An example of use is in the formatters perf test case

llvm-svn: 177597

11 years agoWhen computing the demanded bits of Load SDNodes, make sure that we are looking at...
Nadav Rotem [Wed, 20 Mar 2013 22:53:44 +0000 (22:53 +0000)]
When computing the demanded bits of Load SDNodes, make sure that we are looking at the loaded-value operand and not the ptr result (in case of pre-inc loads).
rdar://13348420

llvm-svn: 177596

11 years agoDebug Info: Swap the 2nd and 3rd parameters to DICompileUnit to match the common...
David Blaikie [Wed, 20 Mar 2013 22:52:54 +0000 (22:52 +0000)]
Debug Info: Swap the 2nd and 3rd parameters to DICompileUnit to match the common DIScope prefix

llvm-svn: 177595

11 years agoMaking the test step count a member variable so that it can be accessed easily
Enrico Granata [Wed, 20 Mar 2013 22:42:34 +0000 (22:42 +0000)]
Making the test step count a member variable so that it can be accessed easily

llvm-svn: 177594

11 years agoCodePrepare: Do not require canonical induction variables for scev based mode
Tobias Grosser [Wed, 20 Mar 2013 22:41:53 +0000 (22:41 +0000)]
CodePrepare: Do not require canonical induction variables for scev based mode

llvm-svn: 177593

11 years agoAnnotate the remaining SSE MOV instructions.
Jakob Stoklund Olesen [Wed, 20 Mar 2013 22:37:16 +0000 (22:37 +0000)]
Annotate the remaining SSE MOV instructions.

llvm-svn: 177592

11 years agoAnnotate SSE horizontal and integer instructions.
Jakob Stoklund Olesen [Wed, 20 Mar 2013 22:37:13 +0000 (22:37 +0000)]
Annotate SSE horizontal and integer instructions.

llvm-svn: 177591