Commit Graph

145344 Commits

Author SHA1 Message Date
Matt Kopec 85cc3b3dbf Backout POSIX realtime lldb output. TestEvents.py is causing lldb to assert.
llvm-svn: 177076
2013-03-14 14:22:40 +00:00
Daniel Jasper f38a0ace2d 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
2013-03-14 14:00:17 +00:00
Alexey Samsonov 1cb684381a [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
2013-03-14 13:54:30 +00:00
Daniel Jasper 40aacf4872 Basic support for formatting asm() statments.
llvm-svn: 177073
2013-03-14 13:45:21 +00:00
Alexey Samsonov a097f7b1e3 [Sanitizer] Add default constructor for BlockingMutex
llvm-svn: 177072
2013-03-14 13:30:56 +00:00
Evgeniy Stepanov 8d487b4407 [sanitizer] No dirent64 on Android.
llvm-svn: 177071
2013-03-14 13:24:03 +00:00
Alexey Samsonov 3d09fdbf21 [Sanitizer] Build sanitizer_common with -fno-rtti
llvm-svn: 177070
2013-03-14 13:16:35 +00:00
Kostya Serebryany d332d42372 [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
2013-03-14 13:16:09 +00:00
Alexander Potapenko 34e1171768 [libsanitizer] fixed a bug in ThreadLister tests where we forgot to terminate one thread
Patch by Sergey Matveev (earthdok@google.com)

llvm-svn: 177068
2013-03-14 13:15:14 +00:00
Evgeniy Stepanov 740e6ebe71 [msan] Add changes missing from r177065.
llvm-svn: 177067
2013-03-14 13:13:49 +00:00
Dmitri Gribenko 4e72a40604 Documentation: improve formatting
llvm-svn: 177066
2013-03-14 12:53:46 +00:00
Evgeniy Stepanov c6bce93591 [msan] Intercept readdir64.
llvm-svn: 177065
2013-03-14 12:49:23 +00:00
Alexey Samsonov 1dc928e1b1 [ASan] remove -fsanitize=init-order from lit tests as now it's implied by -fsanitize=address
llvm-svn: 177064
2013-03-14 12:43:03 +00:00
Alexey Samsonov 819eddc3ce [ASan] emit instrumentation for initialization order checking by default
llvm-svn: 177063
2013-03-14 12:38:58 +00:00
Alexey Samsonov f29d81f234 [ASan] Update docs for -fsanitize=init-order option
llvm-svn: 177062
2013-03-14 12:26:21 +00:00
Alexey Samsonov 881d150cc7 [ASan] Make -fsanitize=address imply -fsanitize=init-order (if the latter is not explicitly disabled).
llvm-svn: 177061
2013-03-14 12:13:27 +00:00
Alexander Potapenko ac3bbb3ef3 [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
2013-03-14 12:06:54 +00:00
Evgeniy Stepanov 4062a396c7 [msan] Fix a typo in test.
llvm-svn: 177059
2013-03-14 11:58:13 +00:00
Alexey Samsonov 963be1ddd8 [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
2013-03-14 11:49:40 +00:00
Evgeniy Stepanov fe0199ea54 [msan] Options for switching between fast and cfi unwinders in run time.
Does not change default behavior.

llvm-svn: 177057
2013-03-14 11:47:03 +00:00
Evgeniy Stepanov 231894a902 [sanitizer] Intercept frexp and friends.
llvm-svn: 177056
2013-03-14 11:34:39 +00:00
Chandler Carruth a1c54bbe34 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
2013-03-14 11:32:24 +00:00
Alexey Samsonov 7d2385419a [Sanitizer] fix compilation for Windows
llvm-svn: 177054
2013-03-14 11:29:06 +00:00
Chandler Carruth 5aa9d793c5 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
2013-03-14 11:17:20 +00:00
Evgeniy Stepanov ead6cf7c72 [msan] Intercept __strdup, strndup, __strndup.
llvm-svn: 177052
2013-03-14 11:10:36 +00:00
Alexey Samsonov 83e7622df6 [Sanitizer] Write a slightly better implementation of GetEnv() function on Windows
llvm-svn: 177051
2013-03-14 11:10:23 +00:00
Daniel Jasper ae9076457e Fix dereference formatting in for-loops.
Before: for (char **a = b; * a; ++a) {}
After:  for (char **a = b; *a; ++a) {}
llvm-svn: 177037
2013-03-14 10:50:25 +00:00
Alexey Samsonov 140cd84155 [ASan] make ASan assume ASAN_OPTIONS=symbolize=1 if ASAN_EXTERNAL_SYMBOLIZER is defined
llvm-svn: 177036
2013-03-14 10:07:40 +00:00
Joey Gouly 0608ae89a2 Add support for the 'endian' attribute for OpenCL.
llvm-svn: 177035
2013-03-14 09:54:43 +00:00
Daniel Jasper bf4755bb28 Improve formatting of trailing annotations.
Before:
bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa __attribute__((
    unused));

After:
bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    __attribute__((unused));

llvm-svn: 177034
2013-03-14 09:50:46 +00:00
Joerg Sonnenberger 7118befdb5 Add two of the float related ARM-specific entries for e_flags needed for
linkers to interact with GNU ld.

llvm-svn: 177016
2013-03-14 08:01:36 +00:00
Craig Topper ba82429826 Fix the name of a variable to match its declaration. Fixes build failure from r177014.
llvm-svn: 177015
2013-03-14 07:47:43 +00:00
Craig Topper 872999737d 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
2013-03-14 07:40:52 +00:00
Alexey Samsonov 41a560b8cd [TSan] Add missing header inclusion
llvm-svn: 177013
2013-03-14 07:13:00 +00:00
Alexey Samsonov 109ddd0fe4 [TSan] Use __sanitizer_pthread_attr_t in TSan
llvm-svn: 177012
2013-03-14 07:10:52 +00:00
Craig Topper a66d81d521 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
2013-03-14 07:09:57 +00:00
Michael Liao 20d287044c Fix PR15309
- Fix the typo on type checking

llvm-svn: 177010
2013-03-14 06:57:42 +00:00
Jiong Wang 5bbb96d7df test commit: remove blank line.
llvm-svn: 177009
2013-03-14 05:43:59 +00:00
Nick Lewycky 3d28d4dee7 Remove a change to the debug info in this test, that I made while testing
something else and forgot to remove.

llvm-svn: 177007
2013-03-14 05:28:10 +00:00
Nick Lewycky d11060d971 Try using %S to find the emitted .gcno file.
llvm-svn: 177006
2013-03-14 05:23:30 +00:00
Nick Lewycky 307a1d03b5 Remove accidentally committed debug line.
llvm-svn: 177005
2013-03-14 05:19:12 +00:00
Nick Lewycky c8bf8249ce Update GCOVProfiling pass creation for API change in r177002. No functionality change.
llvm-svn: 177004
2013-03-14 05:14:01 +00:00
John McCall e68672fed2 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
2013-03-14 05:13:41 +00:00
Nick Lewycky fdfed3e9c9 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
2013-03-14 05:13:26 +00:00
Argyrios Kyrtzidis 59852367b4 [modules] Don't write the UnusedFileScopedDecls vector to the module file.
llvm-svn: 177001
2013-03-14 04:45:00 +00:00
Argyrios Kyrtzidis ffb3558beb [modules] Check for delegating constructor cycles when building a module and don't write them out to the module file.
llvm-svn: 177000
2013-03-14 04:44:56 +00:00
Rafael Espindola 0e0d00976f 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
2013-03-14 03:07:35 +00:00
John Thompson ce601e21d0 Added future directions comment and a couple of fixme's.
llvm-svn: 176998
2013-03-14 01:41:29 +00:00
Nick Lewycky 5862c6dbfc Fix typo in comment.
llvm-svn: 176997
2013-03-14 01:26:17 +00:00
Michael J. Spencer 01ac34e4c3 [Support][Test] Missed this in the API change.
llvm-svn: 176996
2013-03-14 00:33:37 +00:00