Commit Graph

131925 Commits

Author SHA1 Message Date
Chad Rosier b32f3d5230 [ms-inline asm] Use a set container to remove redundant clobbers.
llvm-svn: 161991
2012-08-15 21:55:19 +00:00
Bill Wendling 4d5150d978 Remove dead flag.
llvm-svn: 161990
2012-08-15 21:18:10 +00:00
Bill Wendling 2c8685e327 Rework test so that it reproduces the error without the horrible flag.
llvm-svn: 161989
2012-08-15 21:10:18 +00:00
Chad Rosier 712faa2708 [ms-inline asm] Address a FIXME by computing the number of asm statements when
building the AsmString.

llvm-svn: 161988
2012-08-15 21:08:52 +00:00
Jordan Rose e9753b0640 [analyzer] Even if we are not inlining a virtual call, still invalidate!
Fixes a mistake introduced in r161916.

llvm-svn: 161987
2012-08-15 21:05:15 +00:00
Chad Rosier aa7c1cb5f8 [ms-inline asm] MSVC parses multiple __asm statements on a single line as one
statement.  For example,

  if (x)
    __asm out dx, ax  __asm out dx, ax

results in a single inline asm statement (i.e., both "out dx, ax" statements are
predicated on if(x)).

llvm-svn: 161986
2012-08-15 21:03:27 +00:00
Bill Wendling d63f1f5a9c Remove invalid test. This test requires that dead basic blocks be kept
around. That's not how we do things. Besides, the commit message tells us that
it is covered by the GCC test suite.

------------------------------------------------------------------------
r127497 | zwarich | 2011-03-11 13:51:56 -0800 (Fri, 11 Mar 2011) | 3 lines

Fix the GCC test suite issue exposed by r127477, which was caused by stack
protector insertion not working correctly with unreachable code. Since that
revision was rolled out, this test doesn't actual fail before this fix.
------------------------------------------------------------------------

llvm-svn: 161985
2012-08-15 20:54:09 +00:00
Sean Callanan 219fc0f386 Fixed a problem in the JIT memory allocator where
allocations of executable memory would not be padded
to account for the size of the allocation header.
This resulted in undersized allocations, meaning that
when the allocation was written to later the next
allocation's header would be corrupted.

llvm-svn: 161984
2012-08-15 20:53:52 +00:00
Jakob Stoklund Olesen 3697143a0b Add a CoveringSubRegIndices field to SubRegIndex records.
This can be used to tell TableGen to use a specific SubRegIndex instead
of synthesizing one when discovering all sub-registers.

llvm-svn: 161982
2012-08-15 20:15:48 +00:00
Jordan Rose 5fc5da0578 [analyzer] Correctly devirtualize virtual method calls in constructors.
This is the other half of C++11 [class.cdtor]p4 (the destructor side
was added in r161915). This also fixes an issue with post-call checks
where the 'this' value was already being cleaned out of the state, thus
being omitted from a reconstructed CXXConstructorCall.

llvm-svn: 161981
2012-08-15 20:07:17 +00:00
Matt Beaumont-Gay 22be8d5ab8 Allow 'static' and type qualifiers in K&R parameter type lists.
llvm-svn: 161980
2012-08-15 19:53:19 +00:00
Michael J. Spencer 135611f7fc Properly test the LLVM_USE_RVALUE_REFERENCES macro.
llvm-svn: 161979
2012-08-15 19:21:42 +00:00
Michael J. Spencer 1d2d12deb1 Properly test the LLVM_USE_RVALUE_REFERENCES macro.
llvm-svn: 161978
2012-08-15 19:16:27 +00:00
Chad Rosier ecf77b56dd [ms-inline asm] Don't emit newlines as these are ignored by the AsmParser
anyways.  Also, simplify some conditional logic.

llvm-svn: 161977
2012-08-15 19:12:42 +00:00
Michael J. Spencer ef2284fbad [PathV2] Add mapped_file_region. Implementation for Windows and POSIX.
llvm-svn: 161976
2012-08-15 19:05:47 +00:00
Michael J. Spencer 19cd5f2580 Add LLVM_DELETED_FUNCTION compatibility macro.
This should replace uses of:

class A {
  A(const &A); // DO NOT IMPLEMENT
public:
  ...
};

llvm-svn: 161975
2012-08-15 18:54:36 +00:00
Daniel Jasper faaffe373e Add ASTMatcher for matching extern "C" function declarations.
llvm-svn: 161974
2012-08-15 18:52:19 +00:00
Chad Rosier ba072d6b2c Fix a typo in VariadicFunction.h that leads to invalid code in macro expansion.
Patch by Andy Gibbs <andyg1001@hotmail.co.uk>

llvm-svn: 161973
2012-08-15 18:48:14 +00:00
Fariborz Jahanian 05f4e7181a Patch to warn about __private_extern__ on tentative definitions
as it does something unexpected (but gcc compatible).
Suggest use of __attribute__((visibility("hidden")))
on declaration instead. // rdar://7703982

llvm-svn: 161972
2012-08-15 18:42:26 +00:00
John Criswell edc84507c7 Fix for PR#13606: http://llvm.org/bugs/show_bug.cgi?id=13606
Changed the alignment of an LValue to be 64 bits so that we can handle
alignment values up to half of a 64-bit address space.

llvm-svn: 161971
2012-08-15 18:40:30 +00:00
Owen Anderson 352dfff447 Fix another roundToIntegral bug where very large values could become infinity. Problem and solution identified by Steve Canon.
llvm-svn: 161969
2012-08-15 18:28:45 +00:00
Chad Rosier 73e325de55 [ms-inline asm] Add support for clobbers in CodeGen.
This is a reapplication of r161914 now that the scoping issue has been resolved
in r161966.

llvm-svn: 161967
2012-08-15 18:12:36 +00:00
Chad Rosier ad34aef449 [ms-inline asm] Capturing loop-scoped (std::string)Reg with a StringRef is bad.
llvm-svn: 161966
2012-08-15 18:09:18 +00:00
Jakob Stoklund Olesen 70a0bbcad2 Make synthesized sub-register indexes available in the target namespace.
TableGen sometimes synthesizes missing sub-register indexes. Emit these
indexes as enumerators in the target namespace along with the
user-defined ones.

Also take this opportunity to stop creating new Record objects for
synthetic indexes.

llvm-svn: 161964
2012-08-15 18:00:55 +00:00
Michael Han 1fb908f745 Fix base type of ASTDeclNodeLister.
llvm-svn: 161963
2012-08-15 17:56:58 +00:00
Evan Cheng eec6bc6270 Use vld1/vst1 to load/store f64 if alignment is < 4 and the target allows unaligned access. rdar://12091029
llvm-svn: 161962
2012-08-15 17:44:53 +00:00
Jordan Rose 9910720851 [analyzer] Don't try to devirtualize if the class is incomplete.
A similar issue to the previous commit, introduced by r161915.

llvm-svn: 161961
2012-08-15 17:33:37 +00:00
Jordan Rose 31c3fa9c24 [analyzer] Only adjust the type of 'this' when we devirtualize a method call.
With reinterpret_cast, we can get completely unrelated types in a region
hierarchy together; this was resulting in CXXBaseObjectRegions being layered
directly on an (untyped) SymbolicRegion, whose symbol was from a completely
different type hierarchy. This was what was causing the internal buildbot to
fail.

Reverts r161911, which merely masked the problem.

llvm-svn: 161960
2012-08-15 17:33:34 +00:00
Dmitry Vyukov 1c0b3c6b84 tsan: store sync objects in memory block headers + delete them when the block is freed
llvm-svn: 161959
2012-08-15 17:27:20 +00:00
Chad Rosier b6f46c1af9 [ms-inline asm] Add the left brace source location and improve the pretty
printer.  Patch by Enea Zaffanella <zaffanella@cs.unipr.it>.

llvm-svn: 161958
2012-08-15 16:53:30 +00:00
Dmitry Vyukov 9f1509fe44 tsan: provide function that imitates write to a region but does not detect races
llvm-svn: 161957
2012-08-15 16:52:19 +00:00
Owen Anderson be7e297b6d Fix typo in comment.
llvm-svn: 161956
2012-08-15 16:42:53 +00:00
Jakob Stoklund Olesen 2ec0c41e01 Add missing Rfalse operand to the predicated pseudo-instructions.
When predicating this instruction:

  Rd = ADD Rn, Rm

We need an extra operand to represent the value given to Rd when the
predicate is false:

  Rd = ADDCC Rfalse, Rn, Rm, pred

The Rd and Rfalse operands are different registers while in SSA form.
Rfalse is tied to Rd to make sure they get the same register during
register allocation.

Previously, Rd and Rn were tied, but that is not required.

Compare to MOVCC:

  Rd = MOVCC Rfalse, Rtrue, pred

llvm-svn: 161955
2012-08-15 16:17:24 +00:00
Alexander Potapenko cfb2a6b074 Remove the extra semicolon reported by the buildbot.
llvm-svn: 161954
2012-08-15 15:59:18 +00:00
Dmitry Vyukov 954fc8c3e4 tsan: switch to new allocator
llvm-svn: 161953
2012-08-15 15:35:15 +00:00
Alexander Potapenko f6344ffe39 Introduce asan_intercepted_functions.h which contains the declarations wrapped functions and their wrappers.
Those declarations are going to be shared between asan_interceptors.cc and the dynamic runtime library on Mac OS.

llvm-svn: 161952
2012-08-15 15:24:48 +00:00
Alexey Samsonov 5b2c6ea38f [ASan] lit tests: use nm instead of llvm-nm, until llvm-nm becomes usable on Mac. Port output test change in r161948 to lit
llvm-svn: 161951
2012-08-15 14:33:30 +00:00
Dmitry Vyukov 4b5ec3145a tsan: add some more tests for memory allocator
llvm-svn: 161950
2012-08-15 14:25:33 +00:00
Dmitry Vyukov c693689bb1 tsan: fix several integer overflows
llvm-svn: 161949
2012-08-15 14:25:08 +00:00
Alexander Potapenko 6c1de8faa7 Check for filenames and numbers to detect possible problems with asan_symbolize.py on -fPIE binaries.
llvm-svn: 161948
2012-08-15 14:00:09 +00:00
Alexander Potapenko 1800362758 Pass offset of the frame address within the binary to addr2line instead of the absolute address.
Fixes the problem with -PIE binaries.

llvm-svn: 161947
2012-08-15 13:58:24 +00:00
Alexander Potapenko 07ea07c3ca Patch the frame address regardless of the frame number.
llvm-svn: 161946
2012-08-15 13:23:03 +00:00
Alexander Potapenko 20f9fcc285 Move the prototype of __CFInitialize to asan_mac.h so that asan_malloc_mac.cc may use it in the dynamic library mode.
llvm-svn: 161945
2012-08-15 12:23:36 +00:00
Bill Wendling e1c54262f4 Set the branch probability of branching to the 'normal' destination of an invoke
instruction to something absurdly high, while setting the probability of
branching to the 'unwind' destination to the bare minimum. This should set cause
the normal destination's invoke blocks to be moved closer to the invoke.

PR13612

llvm-svn: 161944
2012-08-15 12:22:35 +00:00
Alexander Potapenko 9a168a7405 Use SANITIZER_INTERFACE_ATTRIBUTE instead of __attribute__((visibility("default")))
Export CheckFailed, asan_malloc, asan_free, asan_memalign, AsanStackTrace::CompressStack, AsanStackTrace::UncompressStack from the dynamic runtime library.

llvm-svn: 161943
2012-08-15 11:57:52 +00:00
Alexander Potapenko 55df945db2 Make __asan::asan_{malloc,free,memalign} globally visible, so that the dynamic version of the runtime will export them.
llvm-svn: 161942
2012-08-15 11:32:15 +00:00
Alexey Samsonov 9fe914b099 [ASan] Port (the last one) tricky interface_test to lit, and a *huge* chunks of boilerplate to run tests for 32/64 bits and all optimization levels. Alas, lit doesn't support for loops in RUN-lines...
llvm-svn: 161941
2012-08-15 11:26:57 +00:00
Benjamin Kramer 26b568d9d5 Fix a const violation in the generated disassembler.
llvm-svn: 161940
2012-08-15 10:26:44 +00:00
Alexander Potapenko 81a1ec8ea6 Do not attempt to intercept mlock and friends on Windows.
llvm-svn: 161939
2012-08-15 09:46:45 +00:00
Alexander Potapenko 785f8bc4ec Use the common interception machinery for mlock/munlock/mlockall/munlockall.
llvm-svn: 161938
2012-08-15 09:22:57 +00:00