Commit Graph

124794 Commits

Author SHA1 Message Date
Akira Hatanaka 769f69f9b6 Fix bug in LowerConstantPool.
llvm-svn: 153498
2012-03-27 02:55:31 +00:00
Akira Hatanaka 2a36c9f4a8 Add T9 to the list of live-in registers of the entry basic block.
llvm-svn: 153497
2012-03-27 02:46:25 +00:00
Greg Clayton 47037bc4d7 Fixed a few things in the ELF object file:
1 - sections only get a valid VM size if they have SHF_ALLOC in the section flags
2 - symbol names are marked as mangled if they start with "_Z"

Also fixed the DWARF parser to correctly use the section file size when extracting the DWARF.

llvm-svn: 153496
2012-03-27 02:40:46 +00:00
Enrico Granata c5bc412cf6 Synthetic values are now automatically enabled and active by default. SBValue is set up to always wrap a synthetic value when one is available.
A new setting enable-synthetic-value is provided on the target to disable this behavior.
There also is a new GetNonSyntheticValue() API call on SBValue to go back from synthetic to non-synthetic. There is no call to go from non-synthetic to synthetic.
The test suite has been changed accordingly.
Fallout from changes to type searching: an hack has to be played to make it possible to use maps that contain std::string due to the special name replacement operated by clang
Fixing a test case that was using libstdcpp instead of libc++ - caught as a consequence of said changes to type searching

llvm-svn: 153495
2012-03-27 02:35:13 +00:00
Akira Hatanaka fe384a2c84 Retrieve and add the offset of a symbol in applyFixup rather than retrieve and
set it in MipsMCCodeEmitter::getMachineOpValue. Assert in getMachineOpValue if
MachineOperand MO is of an unexpected type. 

llvm-svn: 153494
2012-03-27 02:33:05 +00:00
Akira Hatanaka a06bc1c6e3 Define function MipsGetSymAndOffset which returns a fixup's symbol and the
offset applied to it.

llvm-svn: 153493
2012-03-27 02:04:18 +00:00
Evan Cheng 7fede87349 Post-ra LICM should take care not to hoist an instruction that would clobber a
register that's read by the preheader terminator.

rdar://11095580

llvm-svn: 153492
2012-03-27 01:50:58 +00:00
Akira Hatanaka da72819725 Rewrite computation of Value in adjustFixupValue so that the upper 48-bits are
cleared. No functionality change.

llvm-svn: 153491
2012-03-27 01:50:08 +00:00
Richard Smith 1453e310fd Add cross-referencing comments to ParseDirectDeclarator to note that
isConstructorDeclaration also needs updating for any extension to the
grammar of a direct-declarator.

llvm-svn: 153490
2012-03-27 01:42:32 +00:00
Ted Kremenek e9a5bcf17e Change RetainCountChecker to eagerly "escape" retained objects when they are
assigned to a struct.  This is fallout from inlining results, which expose
far more patterns where people stuff CF objects into structs and pass them
around (and we can reason about it).  The problem is that we don't have
a general way to detect when values have escaped, so as an intermediate step
we need to eagerly prune out such tracking.

Fixes <rdar://problem/11104566>.

llvm-svn: 153489
2012-03-27 01:12:45 +00:00
Richard Smith efd009de1c When we see 'Class(X' or 'Class::Class(X' and we suspect that it names a
constructor, but X is not a known typename, check whether the tokens could
possibly match the syntax of a declarator before concluding that it isn't
a constructor. If it's definitely ill-formed, assume it is a constructor.

Empirical evidence suggests that this pattern is much more often a
constructor with a typoed (or not-yet-declared) type name than any of the
other possibilities, so the extra cost of the check is not expected to be
problematic.

llvm-svn: 153488
2012-03-27 00:56:56 +00:00
Lang Hames 551662bf5d During MachineCopyPropagation a register may be the source operand of multiple
copies being considered for removal. Make sure to track all of the copies,
rather than just the most recent encountered, by holding a DenseSet instead of
an unsigned in SrcMap.

No test case - couldn't reduce something with a sane size.

llvm-svn: 153487
2012-03-27 00:44:47 +00:00
Akira Hatanaka ba5100c117 Reserve hardware registers.
llvm-svn: 153486
2012-03-27 00:40:56 +00:00
Chad Rosier 58439c5a92 [driver] Put -cpp-precomp and -no-cpp-precomp under the clang_ignored_f_group.
We don't currently support these options.
rdar://11120518

llvm-svn: 153485
2012-03-26 23:36:04 +00:00
Evan Cheng a2b48d985b ARM has a peephole optimization which looks for a def / use pair. The def
produces a 32-bit immediate which is consumed by the use. It tries to 
fold the immediate by breaking it into two parts and fold them into the
immmediate fields of two uses. e.g
       movw    r2, #40885
       movt    r3, #46540
       add     r0, r0, r3
=>
       add.w   r0, r0, #3019898880
       add.w   r0, r0, #30146560
;
However, this transformation is incorrect if the user produces a flag. e.g.
       movw    r2, #40885
       movt    r3, #46540
       adds    r0, r0, r3
=>
       add.w   r0, r0, #3019898880
       adds.w  r0, r0, #30146560
Note the adds.w may not set the carry flag even if the original sequence
would.

rdar://11116189

llvm-svn: 153484
2012-03-26 23:31:00 +00:00
Lang Hames 95e021faf5 Add a debug option to dump PBQP graphs during register allocation.
llvm-svn: 153483
2012-03-26 23:07:23 +00:00
Greg Clayton 84db9105d2 <rdar://problem/11113279>
Fixed type lookups to "do the right thing". Prior to this fix, looking up a type using "foo::bar" would result in a type list that contains all types that had "bar" as a basename unless the symbol file was able to match fully qualified names (which our DWARF parser does not). 

This fix will allow type matches to be made based on the basename and then have the types that don't match filtered out. Types by name can be fully qualified, or partially qualified with the new "bool exact_match" parameter to the Module::FindTypes() method.

This fixes some issue that we discovered with dynamic type resolution as well as improves the overall type lookups in LLDB.

llvm-svn: 153482
2012-03-26 23:03:23 +00:00
Chad Rosier 98e5d863ad [driver] Testcase for r153469, r153470, and r153478.
llvm-svn: 153481
2012-03-26 22:43:28 +00:00
Andrew Trick 7004e4b95e SCEV fix: Handle loop invariant loads.
Fixes PR11882: NULL dereference in ComputeLoadConstantCompareExitLimit.

llvm-svn: 153480
2012-03-26 22:33:59 +00:00
Bill Wendling 12a98c9f07 Add 'undef's to make SWIG happier. Patch by Baozeng Ding.
llvm-svn: 153479
2012-03-26 22:15:12 +00:00
Chad Rosier 4fab82cda6 [driver] Fix unused argument warnings.
1. Don't short-circuit conditional statements that are checking flags.
Otherwise, the driver emits warnings about unused arguments.

2. -mkernel and -fapple-kext imply no exceptions, so claim exception related
 arguments now to avoid warnings about unused arguments.

rdar://11120518

llvm-svn: 153478
2012-03-26 22:04:46 +00:00
Johnny Chen 41b77265e3 If creation of watchpoint failed on the device, make sure the list maintained by the target reflects that by cleaning it up.
llvm-svn: 153477
2012-03-26 22:00:10 +00:00
Eric Christopher 56079c1e72 Add InitializeNativeTargetDisassembler function.
Patch by Ojab.

llvm-svn: 153476
2012-03-26 21:56:56 +00:00
Andrew Trick f62744bb0d Unit test for PR11950: LSR crash.
llvm-svn: 153472
2012-03-26 21:45:37 +00:00
Eric Christopher 0925c62c74 Use the file in the inlined die rather than the compile unit for
backtrace locations.

Testcase forthcoming, but I wanted to get some testing here.

Should fix:

PR12323
PR12314
rdar://11091100

llvm-svn: 153471
2012-03-26 21:38:38 +00:00
Chad Rosier d9d80e0844 [driver] -mkernel implies -fno-common, so claim the arg to avoid an unused
argument warning.
Part of rdar://11120518

llvm-svn: 153470
2012-03-26 21:35:40 +00:00
Chad Rosier f27e1c40dd [driver] -mkernel implies -fno-builtin, so claim the arg to avoid an unused
argument warning.
Part of rdar://11120518

llvm-svn: 153469
2012-03-26 21:29:17 +00:00
Nadav Rotem a8f3562e8f 153465 was incorrect. In this code we wanted to check that the pointer operand is of pointer type (and not vector type).
llvm-svn: 153468
2012-03-26 21:00:53 +00:00
Sean Callanan 91e1080bcb <rdar://problem/11022964>
Patched LLVM to handle generic i386 relocations.
This avoids some sudden termination problems on
i386 where the JIT would exit() out reporting
"Invalid CPU type!"

llvm-svn: 153467
2012-03-26 20:52:07 +00:00
Sean Callanan a375943d82 Made RuntimeDyldMachO support vanilla i386
relocations.  The algorithm is the same as
that for x86_64.  Scattered relocations, a
feature present in i386 but not on x86_64,
are not yet supported.

llvm-svn: 153466
2012-03-26 20:45:52 +00:00
Nadav Rotem e63e59cc44 PR12357: The pointer was used before it was checked.
llvm-svn: 153465
2012-03-26 20:39:18 +00:00
Richard Smith 6da64f39d4 Forward-declared enumerations are now complete, except for an interaction
between unscoped enumerations and class template member specializations,
whose behavior is currently under discussion in CWG (and for which there
is a preference to not implement the currently-standardized wording).

llvm-svn: 153464
2012-03-26 20:31:41 +00:00
Andrew Trick 14779cc49e LSR ivchain bug fix: corner case with ConstantExpr.
Fixes PR11950.

llvm-svn: 153463
2012-03-26 20:28:37 +00:00
Andrew Trick 356a896394 comment typo
llvm-svn: 153462
2012-03-26 20:28:35 +00:00
Richard Smith 169f219001 Add a special-case diagnostic for one of the more obnoxious special cases of
unscoped enumeration members: an enumerator name which is visible in the
out-of-class definition of a member of a templated class might not actually
exist in the instantiation of that class, if the enumeration is also lexically
defined outside the class definition and is explicitly specialized.

Depending on the result of a CWG discussion, we may have a different resolution
for a class of problems in this area, but this fixes the immediate issue of a
crash-on-invalid / accepts-invalid (depending on +Asserts). Thanks to Johannes
Schaub for digging into the standard wording to find how this case is currently
specified to behave.

llvm-svn: 153461
2012-03-26 20:28:16 +00:00
Daniel Dunbar eec0abefb6 [tests] Fix test failure in release mode.
llvm-svn: 153460
2012-03-26 20:18:16 +00:00
Benjamin Kramer a4988caa26 Simplify code, no functionality change.
llvm-svn: 153459
2012-03-26 20:12:15 +00:00
Chris Lattner b1e2e1e091 eliminate an unneeded branch, part of PR12357
llvm-svn: 153458
2012-03-26 19:13:57 +00:00
Chris Lattner 9e4e335281 fix a failure path to print the right thing, part of PR12357
llvm-svn: 153457
2012-03-26 19:11:51 +00:00
Eric Christopher 2b40fdf3ae Tidy.
llvm-svn: 153456
2012-03-26 19:09:40 +00:00
Eric Christopher f16bee8682 Tidy.
llvm-svn: 153455
2012-03-26 19:09:38 +00:00
Daniel Dunbar 94d34ca2d9 Revert r153443 "objective-c modern translator: extern "C" exported", it fails in testing.
llvm-svn: 153454
2012-03-26 18:48:59 +00:00
Anna Zaks a651c4099d [analyzer] Malloc: Allow a pointer to escape through OSAtomicEnqueue.
llvm-svn: 153453
2012-03-26 18:18:39 +00:00
Chad Rosier 08e57e5ccf Revert r153423 as this is causing failures on our internal nightly testers.
Original commit message:
Use the new range metadata in computeMaskedBits and add a new optimization to
instruction simplify that lets us remove an and when loading a boolean value.

llvm-svn: 153452
2012-03-26 18:07:14 +00:00
Andrew Trick e51feea79c LSR cleanup: potential bug caught by PVS-Studio.
Thanks Andrey.

llvm-svn: 153451
2012-03-26 18:03:16 +00:00
Daniel Dunbar 9a05c8b479 docs/lit: Add some notes on the lit test run output format.
llvm-svn: 153450
2012-03-26 18:01:14 +00:00
Akira Hatanaka efe96a682d Test case for r153348.
llvm-svn: 153449
2012-03-26 17:37:20 +00:00
Kostya Serebryany 6f8a776041 [tsan] treat vtable pointer updates in a special way (requires tbaa); fix a bug (forgot to return true after instrumenting); make sure the tsan tests are run
llvm-svn: 153448
2012-03-26 17:35:03 +00:00
Kostya Serebryany 141e46faf0 add tbaa metadata to vtable pointer loads/stores
llvm-svn: 153447
2012-03-26 17:03:51 +00:00
Benjamin Kramer db534a4eb9 Move CodeCompletionBuilder's chunk adding methods out of line.
This makes sense because chunk's ctor is also out of line and simplifies considerably
when inlined with a constant parameter. Shrinks clang on i386-linux-Release+Asserts by 65k.

llvm-svn: 153446
2012-03-26 16:57:36 +00:00