Commit Graph

131934 Commits

Author SHA1 Message Date
Johnny Chen a7e1d39309 Update build instructions. Patch from "Kopec, Matt" <matt.kopec@intel.com>!
llvm-svn: 162001
2012-08-16 00:08:21 +00:00
Chad Rosier 7dbef3e035 [ms-inline asm] Add inputs and outputs to AST. No functional change.
llvm-svn: 162000
2012-08-16 00:06:53 +00:00
Jordan Rose 6ee44e1f03 [analyzer] Look through all casts when trying to track constraints.
Previously, we were losing path notes (in both text and plist form)
because the interesting DeclRefExpr was buried in a cast.

llvm-svn: 161999
2012-08-16 00:03:33 +00:00
Richard Smith 48c15319f7 Devirtualize calls on glvalues produced by class member access expressions.
Based on a patch by Yin Ma!

llvm-svn: 161998
2012-08-15 22:59:28 +00:00
DeLesley Hutchins 19c722d61d Thread safety analysis: prevent a compiler error in cases where a
late-parsed attribute is attached to an invalid declaration.

llvm-svn: 161997
2012-08-15 22:41:04 +00:00
Victor Oliveira 18023e4b20 bug in experimental targets
llvm-svn: 161995
2012-08-15 22:35:36 +00:00
Jakob Stoklund Olesen 6cb96120f1 Fold predicable instructions into MOVCC / t2MOVCC.
The ARM select instructions are just predicated moves. If the select is
the only use of an operand, the instruction defining the operand can be
predicated instead, saving one instruction and decreasing register
pressure.

This implementation can turn AND/ORR/EOR instructions into their
corresponding ANDCC/ORRCC/EORCC variants. Ideally, we should be able to
predicate any instruction, but we don't yet support predicated
instructions in SSA form.

llvm-svn: 161994
2012-08-15 22:16:39 +00:00
Johnny Chen eb46f78b08 rdar://problem/12096295
Add an lldb command line option to specify a core file: --core/-c.
For consistency, change the "target create" command to also use --core.

llvm-svn: 161993
2012-08-15 22:10:42 +00:00
Jordan Rose 83e4049d39 [analyzer] If we call a C++ method on an object, assume it's non-null.
This is analogous to our handling of pointer dereferences: if we
dereference a pointer that may or may not be null, we assume it's non-null
from then on.

While some implementations of C++ (including ours) allow you to call a
non-virtual method through a null pointer of object type, it is technically
disallowed by the C++ standard, and should not prune out any real paths in
practice.

  [class.mfct.non-static]p1: A non-static member function may be called
    for an object of its class type, or for an object of a class derived
    from its class type...
  (a null pointer value does not refer to an object)

We can also make the same assumption about function pointers.

llvm-svn: 161992
2012-08-15 21:56:23 +00:00
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