Commit Graph

1942 Commits

Author SHA1 Message Date
David Blaikie
c8b93557da DebugInfo: Emit definitions for types with no members.
The absence of members was a poor/incorrect proxy for "is definition".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187607 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-01 20:30:22 +00:00
Carlo Kok
5b25082ddb Bugfix for making the DWARF debug strings and labels to code emitted as secrel32 instead of long opcodes (only for coff). This makes them debuggable with GDB.
fixes Bug 16249 - LLVM generates broken debug info on Windows 

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187597 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-01 18:38:14 +00:00
Eric Christopher
86aa03d5f9 Fix a truly egregious thinko in anonymous namespace check,
update testcase to make sure we generate debug info for walrus
by adding a non-trivial constructor and verify that we don't
emit an ODR signature for the type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187393 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-29 23:53:08 +00:00
Eric Christopher
944aa2b784 Make sure we don't emit an ODR hash for types with no name and make
sure the comments for each testcase are a bit easier to distinguish.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187392 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-29 23:53:05 +00:00
Eric Christopher
be48204a7b Elaborate a bit on the type unit and ODR conditional code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187385 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-29 22:24:32 +00:00
Benjamin Kramer
1faea8f086 DwarfDebug: MD5 is always little endian, bswap on big endian platforms.
This makes LLVM emit the same signature regardless of host and target endianess.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187304 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-27 14:14:43 +00:00
Chandler Carruth
05497cc965 Fix a memory leak in the debug emission by simply not allocating memory.
There doesn't appear to be any reason to put this variable on the heap.
I'm suspicious of the LexicalScope above that we stuff in a map and then
delete afterward, but I'm just trying to get the valgrind bot clean.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187301 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-27 11:09:58 +00:00
Eric Christopher
0be31910e0 Remove addLetterToHash, no functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187245 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-26 21:07:18 +00:00
Eric Christopher
3dee575b8d Add preliminary support for hashing DIEs and breaking them into
type units.

Initially this support is used in the computation of an ODR checker
for C++. For now we're attaching it to the DIE, but in the future
it will be attached to the type unit.

This also starts breaking out types into the separation for type
units, but without actually splitting the DIEs.

In preparation for hashing the DIEs this adds a DIEString type
that contains a StringRef with the string contained at the label.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187213 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-26 17:02:41 +00:00
Eric Christopher
6e61e0ba08 Reformat options.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186994 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-23 22:16:41 +00:00
Eric Christopher
fa73995188 Formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186851 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-22 18:26:15 +00:00
Manman Ren
c8cfaa1625 Add getModuleFlag(StringRef Key) to query a module flag given Key.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186470 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-16 23:21:16 +00:00
Craig Topper
4172a8abba Add 'const' qualifiers to static const char* variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186371 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-16 01:17:10 +00:00
Eric Christopher
4d138ba043 Clarify comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186297 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-14 22:23:54 +00:00
Eric Christopher
010dbfdf93 Collapse temporary variable into call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186295 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-14 21:46:51 +00:00
Hal Finkel
6cf88c9850 Initialize AsmPrinter::MF in the constructor
MF is normally initialized in AsmPrinter::SetupMachineFunction, but if the file
contains only globals (no functions), then we need this to be initialized
because, when encountering an error, lowerConstant() references it.

This should fix the non-deterministic failures of
test/CodeGen/X86/nonconst-static-iv.ll, etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186068 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-11 06:41:14 +00:00
Eric Christopher
61c91d5d7c Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185984 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-09 23:48:45 +00:00
Adrian Prantl
b2754919ca Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185971 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-09 21:44:06 +00:00
Adrian Prantl
3517640443 Reapply an improved version of r180816/180817.
Change the informal convention of DBG_VALUE machine instructions so that
we can express a register-indirect address with an offset of 0.
The old convention was that a DBG_VALUE is a register-indirect value if
the offset (operand 1) is nonzero. The new convention is that a DBG_VALUE
is register-indirect if the first operand is a register and the second
operand is an immediate. For plain register values the combination reg,
reg is used. MachineInstrBuilder::BuildMI knows how to build the new
DBG_VALUES.

rdar://problem/13658587

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185966 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-09 20:28:37 +00:00
Eric Christopher
cced212851 Update comment to avoid mentioning DbgValues which is an instance
variable later in the class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185866 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08 21:16:18 +00:00
Manman Ren
d03d2b243a Debug Info: clean up usage of Verify.
No functionality change. It should suffice to check the type of a debug info
metadata, instead of calling Verify.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185847 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08 18:33:29 +00:00
David Blaikie
66f464ee26 DebugInfo: Correct comment & re-format a nearby loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185844 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08 17:51:28 +00:00
David Blaikie
5ce4091a68 DebugInfo: Simplify Address Pool index handling.
Since the pool indexes are necessarily sequential and contiguous, just
insert things in the right place rather than having to sort the sequence
after the fact.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185842 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08 17:33:10 +00:00
Kai Nacke
113d32cea8 Revert: Emit personality function and Dwarf EH data for Win64 SEH.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185788 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08 04:43:23 +00:00
Kai Nacke
28bb04453d Emit personality function and Dwarf EH data for Win64 SEH.
Obviously the personality function should be emitted as language handler
instead of the hard coded _GCC_specific_handler. The language specific
data must be placed after the unwind information therefore it must not
be emitted into a separate section.

Reviewed by Charles Davis and Nico Rieck.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185761 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-06 17:17:31 +00:00
Benjamin Kramer
b6566aee30 Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185689 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-05 10:20:57 +00:00
Nico Rieck
25746ddd66 Initialize object file info before output streamer
r179494 switched to using the object file info to retrieve the default text
section for some MC streamers. It is possible that initializing an MC
streamer can request sections before the object file info is initialized
when the AutoInitSections flag is set on the streamer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185670 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-04 21:37:26 +00:00
Eric Christopher
7c2f3e8944 Hoist all of the Entry.getLoc() calls int a single variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185589 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 22:40:21 +00:00
Eric Christopher
0d0782ae93 Make DotDebugLocEntry a class, reorder the members along with comments
for them and update all uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185588 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 22:40:18 +00:00
Eric Christopher
4e976457eb Elaborate on comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185586 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 21:37:03 +00:00
Eric Christopher
3a1812d1fe Add names to the header file since they help in documenting the API
(and for consistency).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185585 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 21:23:59 +00:00
Eric Christopher
08ebdc73de Move typedefs inside the class that they belong to.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185573 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 20:36:36 +00:00
Eric Christopher
52f5a65f84 Remove unused field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185523 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 08:26:07 +00:00
Eric Christopher
6af85aec4a Constify a few functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185520 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 08:13:55 +00:00
Craig Topper
01eb99af2f Introduce some typedefs for DenseMaps containing SmallVectors so the vector size doesn't have to repeated when creating iterators for the DenseMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185508 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 04:40:27 +00:00
Craig Topper
9f43ac6cd3 Use SmallVectorImpl& instead of SmallVector& to avoid needlessly respecifying the small vector size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185505 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 04:24:43 +00:00
Craig Topper
2d785dbace Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid specifying the vector size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185504 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 04:17:25 +00:00
Eric Christopher
e717713547 Avoid doing a lot of computation when we have multiple ranges and
avoid adding information for the debug_inlined section when it isn't
going to be emitted anyhow.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185500 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 02:23:53 +00:00
Eric Christopher
f53d643bd9 Move iterator to where it's used and update comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185498 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 01:57:28 +00:00
Eric Christopher
c9c17a8e4f Move instance variable before experimental section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185497 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 01:57:26 +00:00
Eric Christopher
aa30a0cf9b Fix typo to make grep for DW_AT_comp_dir work without case-insensitive
grep.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185496 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 01:57:23 +00:00
Eric Christopher
015343eb7c Remove unnecessary forward declare.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185495 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 01:57:20 +00:00
Eric Christopher
da965defb8 Add a helpful comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185492 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 01:22:29 +00:00
Eric Christopher
e4721495b6 addConstantValue, addConstantFPValue never returned anything but
true, so remove the return value and propagate accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185490 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 01:08:30 +00:00
Manman Ren
0e6783feed Debug Info: use module flag to set up Dwarf version.
Correctly handles ref_addr depending on the Dwarf version. Emit Dwarf with
version from module flag.

TODO: turn on/off features depending on the Dwarf version.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185484 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-02 23:40:10 +00:00
Eric Christopher
d3b98530c5 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185480 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-02 21:36:07 +00:00
Ulrich Weigand
716a94f0c9 [DebugInfo] Allow getDebugThreadLocalSymbol to return MCExpr
This allows getDebugThreadLocalSymbol to return a generic MCExpr
instead of just a MCSymbolRefExpr.

This is in preparation for supporting debug info for TLS variables
on PowerPC, where we need to describe the variable location using
a more complex expression than just MCSymbolRefExpr.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185460 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-02 18:47:09 +00:00
Ulrich Weigand
18dbe5029f [DebugInfo] Hold generic MCExpr in AddrPool
This changes the AddrPool infrastructure to enable it to hold
generic MCExpr expressions, not just MCSymbolRefExpr.

This is in preparation for supporting debug info for TLS variables
on PowerPC, where we need to describe the variable location using
a more complex expression than just MCSymbolRefExpr.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185459 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-02 18:46:46 +00:00
Ulrich Weigand
1f8aacd6af [DebugInfo] Introduce DIEExpr variant of DIEValue to hold MCExpr values
This partially reverts r185202 and restores DIELabel to hold plain
MCSymbol references.  Instead, we add a new subclass DIEExpr of
DIEValue that can hold generic MCExpr references.

This is in preparation for supporting debug info for TLS variables
on PowerPC, where we need to describe the variable location using
a more complex expression than just MCSymbolRefExpr.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185458 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-02 18:46:26 +00:00
Rafael Espindola
a3863ea2da Remove address spaces from MC.
This is dead code since PIC16 was removed in 2010. The result was an odd mix,
where some parts would carefully pass it along and others would assert it was
zero (most of the object streamer for example).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185436 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-02 15:49:13 +00:00
David Blaikie
8fed05ec1b PR14728: DebugInfo: TLS variables with -gsplit-dwarf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185398 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-01 23:55:52 +00:00
David Blaikie
59eaa38746 DebugInfo: PR14728: TLS support
Based on GCC's output for TLS variables (OP_constNu, x@dtpoff,
OP_lo_user), this implements debug info support for TLS in ELF. Verified
that this output is correct/sufficient on Linux (using gold - if you're
using binutils-ld, you'll need something with the fix for
http://sourceware.org/bugzilla/show_bug.cgi?id=15685 in it).

Support on non-ELF is sort of "arbitrary" at the moment - if Apple folks
want to discuss (or just go ahead & implement) how this should work in
MachO, etc, I'm open.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185203 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-28 20:05:11 +00:00
David Blaikie
95e72c90e4 DebugInfo: Pass MCSymbolRefExprs for labels instead of MCSymbols
This is a precursor to adding debug info support for TLS which requires
non-default relocations applied to TLS symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185202 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-28 20:05:04 +00:00
David Blaikie
1ca79907ef DebugInfo: Revise r185189 to avoid subtle 'unsigned += bool'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185190 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-28 18:55:13 +00:00
David Blaikie
1c736322a2 DebugInfo: Simplify the AddressPool representation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185189 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-28 18:47:19 +00:00
David Blaikie
321d83ba9e DebugInfo: constify the AddressPool MCSymbol pointers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185188 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-28 18:47:14 +00:00
Manman Ren
2560e242c8 Remove unused code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184866 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-25 18:49:55 +00:00
Eric Christopher
fdfc81f142 80-column and tab character fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184792 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-24 23:20:02 +00:00
Eric Christopher
afbe0e266c Formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184788 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-24 21:34:55 +00:00
Eric Christopher
f61dbc1575 Use const references instead of pointers to references that are
never modified. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184781 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-24 21:07:27 +00:00
David Blaikie
fe2e66a6da DebugInfo: PR14404: Avoid truncating 64 bit values into 32 bits for ULEB128/SLEB128 generation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184669 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-23 18:31:11 +00:00
David Blaikie
e88939cfeb DebugInfo: Support (using GNU extensions) for template template parameters and parameter packs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184643 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-22 18:59:11 +00:00
David Blaikie
4532c280f5 DebugInfo: don't use location lists when the location covers the whole function anyway
Fix up three tests - one that was relying on abbreviation number,
another relying on a location list in this case (& testing raw asm,
changed that to use dwarfdump on the debug_info now that that's where
the location is), and another which was added in r184368 - exposing a
bug in that fix that is exposed when we emit the location inline rather
than through a location list. Fix that bug while I'm here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184387 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-20 00:25:24 +00:00
David Blaikie
0159ae4295 DebugInfo: PR14763/r183329 correct the location of indirect parameters
We had been papering over a problem with location info for non-trivial
types passed by value by emitting their type as references (this caused
the debugger to interpret the location information correctly, but broke
the type of the function). r183329 corrected the type information but
lead to the debugger interpreting the pointer parameter as the value -
the debug info describing the location needed an extra dereference.

Use a new flag in DIVariable to add the extra indirection (either by
promoting an existing DW_OP_reg (parameter passed in a register) to
DW_OP_breg + 0 or by adding DW_OP_deref to an existing DW_OP_breg + n
(parameter passed on the stack).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184368 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-19 21:55:13 +00:00
David Blaikie
0187e7a9ba DebugInfo: remove target-specific Frame Index handling for DBG_VALUE MachineInstrs
Frame index handling is now target-agnostic, so delete the target hooks
for creation & asm printing of target-specific addressing in DBG_VALUEs
and any related functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184067 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-16 20:34:27 +00:00
David Blaikie
6d9dbd5526 Debug Info: Simplify Frame Index handling in DBG_VALUE Machine Instructions
Rather than using the full power of target-specific addressing modes in
DBG_VALUEs with Frame Indicies, simply use Frame Index + Offset. This
reduces the complexity of debug info handling down to two
representations of values (reg+offset and frame index+offset) rather
than three or four.

Ideally we could ensure that frame indicies had been eliminated by the
time we reached an assembly or dwarf generation, but I haven't spent the
time to figure out where the FIs are leaking through into that & whether
there's a good place to convert them. Some FI+offset=>reg+offset
conversion is done (see PrologEpilogInserter, for example) which is
necessary for some SelectionDAG assumptions about registers, I believe,
but it might be possible to make this a more thorough conversion &
ensure there are no remaining FIs no matter how instruction selection
is performed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184066 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-16 20:34:15 +00:00
David Blaikie
f14b44c71b DebugInfo: print DBG_VALUE MachineInstrs with [] for deref and drop the offset when it's zero
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184045 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-15 15:52:58 +00:00
David Blaikie
702ff96ff3 Debug Info: Don't print the display name and colon prefix for DEBUG_VALUE comments if the display name is empty
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184026 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-15 00:33:47 +00:00
Eric Christopher
1d1862958c Formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183807 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-11 23:41:38 +00:00
Eric Christopher
f0aefa858c Remove a few fixmes, the only work we're doing is getting the string
to return and this is done all over.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183704 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-10 22:24:10 +00:00
Eric Christopher
0fbaa37873 Fix up comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183703 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-10 22:24:07 +00:00
Eric Christopher
175a7809c8 Remove unused function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183698 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-10 21:59:28 +00:00
Eric Christopher
d32d7a541a IndentCount is only used within NDEBUG code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183695 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-10 20:58:53 +00:00
Quentin Colombet
fcca6c690c Teach AsmPrinter how to print odd constants.
Fix an assertion when the compiler encounters big constants whose bit width is
not a multiple of 64-bits.
Although clang would never generate something like this, the backend should be
able to handle any legal IR.

<rdar://problem/13363576>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183544 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 18:36:03 +00:00
David Blaikie
babfebb4e8 Fix break in r183446 - helps to increment the iterator in a loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183454 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-06 22:28:26 +00:00
David Blaikie
b20fdff6fe Debug Info: simplify parameter ordering preservation
Seems we emit the parameter ordering number (spuriously named 'arg
number') in the debug info, so there's no need to search through the
variable list to figure out the parameter ordering. This implementation
does 'always' do the work, even in non-optimized debug info (the
previous implementation checked the existence of the 'variables' list on
the subprogram which is only present in optimized builds).

No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183446 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-06 21:04:51 +00:00
David Blaikie
032d62487c PR15662: Optimized debug info produces out of order function parameters
When a function is inlined we lazily construct the variables
representing the function's parameters. After that, we add any remaining
unused parameters.

If the function doesn't use all the parameters, or uses them out of
order, then the DWARF would produce them in that order, producing a
parameter order that doesn't match the source.

This fix causes us to always keep the arg variables at the start of the
variable list & in the original order from the source.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183297 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-05 05:39:59 +00:00
Benjamin Kramer
7c2b4be2a7 Move getRealLinkageName to a common place and remove all the duplicates of it.
Also simplify code a bit while there. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183076 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-01 17:51:14 +00:00
Eric Christopher
813419ed5a Const-ify some printing and dumping code for DIEValues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183057 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-31 22:50:40 +00:00
Eric Christopher
d2df98f3aa Rename variable to be more descriptive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182903 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-30 00:43:35 +00:00
Eric Christopher
5592ba4775 Formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182902 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-30 00:43:32 +00:00
Bill Wendling
cc5a882c96 Don't reach into the middle of TargetMachine and cache one of its ivars.
Not only does this break encapsulation, it's gross.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182876 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-29 20:37:19 +00:00
Manman Ren
742671bf8e LTO+Debug Info: revert r182791.
Since the testing case uses ref_addr, which requires version 3+ to work,
we will solve the dwarf version issue first.

This patch also causes failures in one of the bots. I will update the patch
accordingly in my next attempt.

rdar://13926659


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182867 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-29 17:16:59 +00:00
Manman Ren
9174fd77e5 LTO+Debug Info: correctly emit inlined_subroutine when the inlined callee is
from a different CU.

We used to print out an error message and fail to generate inlined_subroutine.

If we use ref_addr in the generated DWARF, the DWARF version should be 3 or
above.
rdar://13926659


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182791 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-28 19:01:58 +00:00
David Blaikie
3d33184d9d Solidify the assumption that a DW_TAG_subprogram's type is a DW_TAG_subroutine_type
There were bits & pieces of code lying around that may've given the
impression that debug info metadata supported the possibility that a
subprogram's type could be specified by a non-subroutine type describing
the return type of a void function. This support was incomplete &
unnecessary. Asserts & API have been changed to make the desired usage
more clear.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182532 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-22 23:22:18 +00:00
Manman Ren
01cb18ea08 Dwarf: use a single line table to generate assembly when .loc is used.
This is to fix PR15408 where an undefined symbol Lline_table_start1 is used.
Since we do not generate the debug_line section when .loc is used,
Lline_table_start1 is not emitted and we can't refer to it when calculating
at_stmt_list for a compile unit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182344 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-21 00:57:22 +00:00
David Blaikie
7b72cc7782 PR14606: Debug Info for namespace aliases/DW_TAG_imported_module
This resolves the last of the PR14606 failures in the GDB 7.5 test
suite by implementing an optional name field for
DW_TAG_imported_modules/DIImportedEntities and using that to implement
C++ namespace aliases (eg: "namespace X = Y;").

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182328 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20 22:50:35 +00:00
Eric Christopher
4d7f2ce938 Make getCompileUnit non-const and return the current DIE if it
happens to be a compile unit. Noticed on inspection and tested
via calling on a newly created compile unit. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181835 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-14 21:33:10 +00:00
David Blaikie
17a692e7f1 Assert that DIEEntries are constructed with non-null DIEs
This just brings a crash a little further forward from DWARF emission to
DIE construction to make errors easier to diagnose.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181748 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-14 00:35:19 +00:00
Rafael Espindola
4a971705bc Remove the MachineMove class.
It was just a less powerful and more confusing version of
MCCFIInstruction. A side effect is that, since MCCFIInstruction uses
dwarf register numbers, calls to getDwarfRegNum are pushed out, which
should allow further simplifications.

I left the MachineModuleInfo::addFrameMove interface unchanged since
this patch was already fairly big.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181680 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-13 01:16:13 +00:00
Benjamin Kramer
03406c4f15 StringRefize some debug accel table bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181663 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-11 18:24:28 +00:00
Rafael Espindola
d84ccfaf50 Change getFrameMoves to return a const reference.
To add a frame now there is a dedicated addFrameMove which also takes
care of constructing the move itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181657 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-11 02:38:11 +00:00
Rafael Espindola
baf81af759 Remove more dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181656 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-11 02:24:41 +00:00
David Blaikie
4de9d72883 PR14492: Debug Info: Support for values of non-integer non-type template parameters.
This is only tested for global variables at the moment (& includes tests
for the unnamed parameter case, since apparently this entire function
was completely untested previously)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181632 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-10 21:52:07 +00:00
Eric Christopher
c496875f0c Revert "Make sure debug info contains linkage names (DW_AT_MIPS_linkage_name)"
temporarily while investigating gdb.cp/templates.exp.

This reverts commit r181471.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181496 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-09 00:42:33 +00:00
Eric Christopher
cc55d4528c Make sure debug info contains linkage names (DW_AT_MIPS_linkage_name)
for constructors and destructors since the original declaration given
by the AT_specification both won't and can't.

Patch by Yacine Belkadi, I've cleaned up the testcases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181471 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 21:23:22 +00:00
David Blaikie
aa76a93cd3 Debug Info: Support DW_TAG_imported_declaration
This provides basic functionality for imported declarations. For
subprograms and types some amount of lazy construction is supported (so
the definition of a function can proceed the using declaration), but it
still doesn't handle declared-but-not-defined functions (since we don't
generally emit function declarations).

Variable support is really rudimentary at the moment - simply looking up
the existing definition with no support for out of order (declaration,
imported_module, then definition).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181392 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 06:01:41 +00:00
David Blaikie
d1221e377d Finish renaming constructImportedModuleDIE to constructImportedEntityDIE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181391 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 06:01:38 +00:00
Eric Christopher
9c57ad2381 Pass the MDNode in and do the insertion at compile unit creation time
instead of relying upon an extra call to finish initializing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181383 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 00:58:51 +00:00
Eric Christopher
1db3d0820f Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181378 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 00:11:10 +00:00