Commit Graph

188341 Commits

Author SHA1 Message Date
Philip Reames f3108ce3e8 Extend some comments around GCModuleInfo, GCFunctionInfo, & GCStrategy
Nothing particularly interesting here, just documenting the way the code currently works before I start changing it...

llvm-svn: 223866
2014-12-10 00:30:11 +00:00
Rui Ueyama e4814d0dee Fix Darwin linker. Patch from Jean-Daniel Dupas.
llvm-svn: 223865
2014-12-10 00:24:37 +00:00
Nico Weber a33c5942a3 cmake: Make SVNVersion.inc work on Windows if svn is called svn.bat.
llvm-svn: 223864
2014-12-10 00:10:21 +00:00
Rafael Espindola 4d47f7f52b Simplify the handling of aliases in the gold plugin.
The complicated situation is when we have to keep an alias but drop a GV
that is part of the aliasee.

We used to clone the dropped GV and make the clone internal. This is wasteful
as we know the original will be dropped.

With this patch what is done instead is set the linkage of the original to
internal and replace all uses (but the one in the alias) with a new
declaration that takes the name of the old GV. This saves us from having
to copy the body.

llvm-svn: 223863
2014-12-10 00:09:35 +00:00
Ahmed Bougacha 7efbac74ec [ARM] Combine base-updating/post-incrementing vector load/stores.
We used to only combine intrinsics, and turn them into VLD1_UPD/VST1_UPD
when the base pointer is incremented after the load/store.

We can do the same thing for generic load/stores.

Note that we can only combine the first load/store+adds pair in
a sequence (as might be generated for a v16f32 load for instance),
because other combines turn the base pointer addition chain (each
computing the address of the next load, from the address of the last
load) into independent additions (common base pointer + this load's
offset).

Differential Revision: http://reviews.llvm.org/D6585

llvm-svn: 223862
2014-12-10 00:07:37 +00:00
Nico Weber d95699e9e7 cmake: Make SVNVersion.inc step depend on GetSVN.cmake.
This way, the step generating SVNVersion.inc gets rerun every time someone
changes GetSVN.cmake (which is the file that decides how the contents of
SVNVersion.inc look). This makes hacking on GetSVN.cmake a bit easier.

llvm-svn: 223861
2014-12-10 00:03:37 +00:00
Sean Callanan 0aae04175b Updated the AST importer to support importing
LinkageSpecDecls.  This is relevant when LLDB
wants to import Decls from non-C++ modules,
since many declarations are in extern "C"
blocks.

llvm-svn: 223860
2014-12-10 00:00:37 +00:00
Philip Reames de226055ca Remove the Module pointer from GCStrategy and GCMetadataPrinter
In the current implementation, GCStrategy is a part of the ownership structure for the gc metadata which describes a Module. It also contains a reference to the module in question. As a result, GCStrategy instances are essentially Module specific.

I plan to transition away from this design. Instead, a GCStrategy will be owned by the LLVMContext. It will be a lightweight policy object which contains no information about the Modules or Functions involved, but can be easily reached given a Function.

The first step in this transition is to remove the direct Module reference from GCStrategy. This also requires removing the single user of this reference, the GCMetadataPrinter hierarchy. In theory, this will allow the lifetime of the printers to be scoped to the LLVMContext as well, but in practice, I'm not actually changing that. (Yet?)

An alternate design would have been to move the direct Module reference into the GCMetadataPrinter and change the keying of the owning maps to explicitly key off both GCStrategy and Module. I'm open to doing it that way instead, but didn't see much value in preserving the per Module association for GCMetadataPrinters.

The next change in this sequence will be to start unwinding the intertwined ownership between GCStrategy, GCModuleInfo, and GCFunctionInfo.

Differential Revision: http://reviews.llvm.org/D6566

llvm-svn: 223859
2014-12-09 23:57:54 +00:00
Duncan P. N. Exon Smith 22600ff328 IR: Fix memory corruption in MDNode new/delete
There were two major problems with `MDNode` memory management.

 1. `MDNode::operator new()` called a placement array constructor for
    `MDOperand`.  What?  Each operand needs to be placed individually.

 2. `MDNode::operator delete()` failed to destruct the `MDOperand`s at
    all.

Frankly it's hard to understand how this worked locally, how this
survived an LTO bootstrap, or how it worked on most of the bots.

llvm-svn: 223858
2014-12-09 23:56:39 +00:00
David Majnemer 4cea5b4954 Forgot to add test for r223856
llvm-svn: 223857
2014-12-09 23:51:14 +00:00
David Majnemer aa5d70764f AsmParser: Verifier that the contents of a hex integer are hex
llvm-svn: 223856
2014-12-09 23:50:38 +00:00
Sean Callanan 8759649013 Modified the Objective-C lexer and parser (only
in debugger mode) to accept @import declarations
and pass them to the debugger.  

In the preprocessor, accept import declarations
if the debugger is enabled, but don't actually
load the module, just pass the import path on to 
the preprocessor callbacks.

In the Objective-C parser, if it sees an import
declaration in statement context (usual for LLDB),
ignore it and return a NullStmt.

llvm-svn: 223855
2014-12-09 23:47:56 +00:00
David Blaikie d73f3c6b73 DebugInfo: Correct location of aggregate assignment
llvm-svn: 223854
2014-12-09 23:33:26 +00:00
Kaelyn Takata 22324f378a Rename static functiom "map" to be more descriptive and to avoid
potential confusion with the std::map type.

llvm-svn: 223853
2014-12-09 23:32:46 +00:00
David Majnemer b511603281 AST: Don't assume two zero sized objects live at different addresses
Zero sized objects may overlap with each other or any other object.

This fixes PR21786.

llvm-svn: 223852
2014-12-09 23:32:34 +00:00
Greg Clayton a97c4d2154 Handle thumb IT instructions correctly all the time.
The issue with Thumb IT (if/then) instructions is the IT instruction preceeds up to four instructions that are made conditional. If a breakpoint is placed on one of the conditional instructions, the instruction either needs to match the thumb opcode size (2 or 4 bytes) or a BKPT instruction needs to be used as these are always unconditional (even in a IT instruction). If BKPT instructions are used, then we might end up stopping on an instruction that won't get executed. So if we do stop at a BKPT instruction, we need to continue if the condition is not true.

When using the BKPT isntructions are easy in that you don't need to detect the size of the breakpoint that needs to be used when setting a breakpoint even in a thumb IT instruction. The bad part is you will now always stop at the opcode location and let LLDB determine if it should auto-continue. If the BKPT instruction is used, the BKPT that is used for ARM code should be something that also triggers the BKPT instruction in Thumb in case you set a breakpoint in the middle of code and the code is actually Thumb code. A value of 0xE120BE70 will work since the lower 16 bits being 0xBE70 happens to be a Thumb BKPT instruction. 

The alternative is to use trap or illegal instructions that the kernel will translate into breakpoint hits. On Mac this was 0xE7FFDEFE for ARM and 0xDEFE for Thumb. The darwin kernel currently doesn't recognize any 32 bit Thumb instruction as a instruction that will get turned into a breakpoint exception (EXC_BREAKPOINT), so we had to use the BKPT instruction on Mac. The linux kernel recognizes a 16 and a 32 bit instruction as valid thumb breakpoint opcodes. The benefit of using 16 or 32 bit instructions is you don't stop on opcodes in a IT block when the condition doesn't match. 

To further complicate things, single stepping on ARM is often implemented by modifying the BCR/BVR registers and setting the processor to stop when the PC is not equal to the current value. This means single stepping is another way the ARM target can stop on instructions that won't get executed.

This patch does the following:
1 - Fix the internal debugserver for Apple to use the BKPT instruction for ARM and Thumb
2 - Fix LLDB to catch when we stop in the middle of a Thumb IT instruction and continue if we stop at an instruction that won't execute
3 - Fixes this in a way that will work for any target on any platform as long as it is ARM/Thumb
4 - Adds a patch for ignoring conditions that don't match when in ARM mode (see below)

This patch also provides the code that implements the same thing for ARM instructions, though it is disabled for now. The ARM patch will check the condition of the instruction in ARM mode and continue if the condition isn't true (and therefore the instruction would not be executed). Again, this is not enable, but the code for it has been added.

<rdar://problem/19145455> 

llvm-svn: 223851
2014-12-09 23:31:02 +00:00
Nico Weber 238462627e clang-format: Add a test for PR19603 which seems fixed (maybe by r221338?).
llvm-svn: 223850
2014-12-09 23:22:35 +00:00
Duncan P. N. Exon Smith d167eac023 IR: Metadata: Detect an RAUW recursion
Speculatively handle a recursion in
`GenericMDNode::handleChangedOperand()`.  I'm hoping this fixes the
failing hexagon bot [1].

[1]: http://lab.llvm.org:8011/builders/llvm-hexagon-elf/builds/13434

llvm-svn: 223849
2014-12-09 23:04:59 +00:00
Eric Fiselier f60e441080 Update information on where to find buildbots. Remove dead buildbot links.
llvm-svn: 223848
2014-12-09 22:53:21 +00:00
Michael Zolotukhin 4def395646 Remove redundant variable.
Tested by adding assert(LoopVectorPreHeader == VecPreheader) on LLVM
test suite and SPECs.

llvm-svn: 223847
2014-12-09 22:45:07 +00:00
Fariborz Jahanian df833a4918 Objective-C SDK modernizer. Modernize to use
property-dot-syntax when receiver is 'super'. 
rdar://19140267

llvm-svn: 223846
2014-12-09 22:36:47 +00:00
Colin LeMahieu b32bf14c2a [Hexagon] [NFC] Cleaning up unused classes.
llvm-svn: 223845
2014-12-09 22:33:26 +00:00
Zachary Turner 543afa18b3 Fix compilation failures resulting from the llvm Metadata refactor.
Patch by Duncan P. N. Exon Smith

llvm-svn: 223844
2014-12-09 22:29:47 +00:00
Jason Molenda ce19fe3f38 Add a new 'eRegisterInLiveRegisterContext' RegisterLocation to track
a register value that is live in the stack frame 0 register context.

Fixes a problem where retrieving a register value on stack frame #n
would involved O(n!) stack frame checks.  This could be very slow on
a deep stack when retrieving register values that had not been
modified/saved by any of the stack frames.  Not common, but annoying
when it was hit.

<rdar://problem/19010211> 

llvm-svn: 223843
2014-12-09 22:28:10 +00:00
David Blaikie 00de22f963 DebugInfo: Correct location of initialization of auto __complex
llvm-svn: 223842
2014-12-09 22:15:02 +00:00
Ahmed Bougacha 9d2d7c1b00 [ARM] Make testcase more explicit. NFC.
llvm-svn: 223841
2014-12-09 22:08:57 +00:00
Justin Bogner 55248db0c9 profile: Add low level versions of profile buffer functions
On Darwin, compiler_rt uses magic linker symbols to find the profile
counters in the __DATA segment.  This is a reasonable method for
normal, hosted, userspace programs.  However programs with custom
memory layouts, such as the kernel, will need to tell compiler_rt
explicitly where to find these sections.

Patch by Lawrence D'Anna. Thanks!

llvm-svn: 223840
2014-12-09 22:07:25 +00:00
David Blaikie 7f138811cd DebugInfo: Correct the location of initializations of auto.
llvm-svn: 223839
2014-12-09 22:04:13 +00:00
Tobias Grosser bd8f3c1f61 Unbreak after LLVM's metadata split in r223802
llvm-svn: 223838
2014-12-09 22:02:16 +00:00
Enrico Granata 986fa5f4eb Extend ValueObject::GetExpressionPath() to do something reasonable for synthetic children
Because of the way they are created, synthetic children cannot (in general) have a sane expression path

A solution to this would be letting the parent front-end generate expression paths for its children
Doing so requires a significant amount of refactoring, and might not always lead to better results (esp. w.r.t. C++ templates)

This commit takes a simpler approach:
- if a synthetic child is of pointer type and it's a target pointer, then emit *((T)value)
- if a synthetic child is a non-pointer, but its location is in the target, then emit *((T*)loadAddr)
- if a synthetic child has a value, emit ((T)value)
- else, don't emit anything

Fixes rdar://18442386

llvm-svn: 223836
2014-12-09 21:41:16 +00:00
David Blaikie 93e9cf8aa4 DebugInfo: Correct location for compound complex assignment
llvm-svn: 223835
2014-12-09 21:32:00 +00:00
Ahmed Bougacha b31fba1613 [ARM] Factor out base-updating VLD/VST combiner function. NFC.
Move the combiner-state check into another function, add a few
small comments, and use a more general type in a cast<>.

In preparation for a future patch.

llvm-svn: 223834
2014-12-09 21:30:00 +00:00
Ahmed Bougacha 2316746e40 [ARM] Move the store combiner function down. NFC.
And flip its final condition.
In preparation for a future patch.

llvm-svn: 223833
2014-12-09 21:26:53 +00:00
Ahmed Bougacha be0b227679 [ARM] Also support v2f64 vld1/vst1.
It was missing from the VLD1/VST1 handling logic, even though the
corresponding instructions exist (same form as v2i64).

In preparation for a future patch.

llvm-svn: 223832
2014-12-09 21:25:00 +00:00
Sean Callanan 1f1aacac96 Removed an unnecessary variaable.
llvm-svn: 223831
2014-12-09 21:20:03 +00:00
Sean Callanan 7375f3e30e Fixed ValueObject::UpdateValueIfNeeded to keep
track of the checksum of the object so we can
track if it is modified.  This fixes a testcase
(test/expression_command/issue_11588) on OS X.

Patch by Enrico Granata.

llvm-svn: 223830
2014-12-09 21:18:59 +00:00
Duncan P. N. Exon Smith 21909e35cb IR: Metadata/Value split: RAUW in a deterministic order
RAUW in a deterministic order to try to recover the hexagon bot [1],
whose tests started failing once my GCC fixes were in for r223802.

Otherwise, I'm not sure why tests would fail there and not here.

[1]: http://lab.llvm.org:8011/builders/llvm-hexagon-elf/builds/13426

llvm-svn: 223829
2014-12-09 21:12:56 +00:00
David Blaikie 8ec8dfecd1 DebugInfo: Accurate location information for complex assignment
llvm-svn: 223828
2014-12-09 21:10:43 +00:00
Rafael Espindola 0bfe828f7a Return ErrorOr<std::unique_ptr<Archive>> form getAsArchive.
This is the same return type of Archive::create.

llvm-svn: 223827
2014-12-09 21:05:36 +00:00
Jason Molenda 28737d8db9 Change AddressSanitzierRuntime to print its info message via
the Debugger's output stream instead of logging to the module.

http://reviews.llvm.org/D6577

llvm-svn: 223826
2014-12-09 20:52:26 +00:00
David Blaikie 538deffd2d DebugInfo: Emit the correct location for initialization of a complex variable
Especially useful for sanitizer reports.

llvm-svn: 223825
2014-12-09 20:52:24 +00:00
Hans Wennborg e242e8b064 Try fixing MSVC build after r223802
LLVM_EXPLICIT is only supported by recent version of MSVC, and it seems
the not-so-recent versions get confused about the operator bool() when
tryint to resolve operator== calls.

This removed the operator bool()'s since they don't seem to be used
anyway.

llvm-svn: 223824
2014-12-09 20:39:15 +00:00
Colin LeMahieu b030c254c0 [Hexagon] Fixing broken tests.
llvm-svn: 223823
2014-12-09 20:36:53 +00:00
Rafael Espindola 5dec7eaae2 Rename createIRObjectFile to just create.
It is a static method of IRObjectFile, so having to use
IRObjectFile::createIRObjectFile was redundant.

llvm-svn: 223822
2014-12-09 20:36:13 +00:00
Colin LeMahieu 4af437fee5 [Hexagon] Updating rr/ri 32/64 transfer encodings and adding tests.
llvm-svn: 223821
2014-12-09 20:23:30 +00:00
Duncan P. N. Exon Smith 0580a42096 Fix an MSVC failure from r223802
llvm-svn: 223820
2014-12-09 20:01:40 +00:00
Enrico Granata e29df230cd This patch does a few things:
- adds a new flag to mark ValueObjects as "synthetic children generated"
- vends new Create functions as part of the SyntheticChildrenFrontEnd that set the flag automatically
- moves synthetic child providers over to using these new functions

No visible feature change, but preparatory work for feature change

llvm-svn: 223819
2014-12-09 19:51:20 +00:00
Juergen Ributzka c6f314b8ed [FastISel][AArch64] Fix a missing nullptr check in 'computeAddress'.
The load/store value type is currently not available when lowering the memcpy
intrinsic. Add the missing nullptr check to support this in 'computeAddress'.

Fixes rdar://problem/19178947.

llvm-svn: 223818
2014-12-09 19:44:38 +00:00
Will Newton b907542235 ELF: Add AArch64 test case missing from previous commit
llvm-svn: 223817
2014-12-09 19:31:09 +00:00
Zachary Turner 80c2c60f36 XFAIL all of TestInferiorAssert.py tests on Windows.
Getting this working correctly is a significant amount of work.
Assertions on Windows show up as error code 0xC0000409, which is
STATUS_STACK_BUFFER_OVERRUN.  In order to accurately determine
that this is not just any stack buffer overrun, but one triggered
by a call to abort, we would need to analyze the call stack.  This
in turn requires better symbol support for Windows executables,
and work on LLDB to make stack frames better on Windows.

For now, these are XFAIL'ed and tracked in http://llvm.org/pr21793.

llvm-svn: 223816
2014-12-09 19:28:00 +00:00