Devang Patel
32bdaef3fe
Refactoring. Push DILocation processing in to DwarfDebug from AsmPrinter.
...
llvm-svn: 99772
2010-03-28 18:57:09 +00:00
Chris Lattner
8fce3dddfa
reapply r98656 unmodified, which exposed the asmprinter not
...
handling constant unions.
llvm-svn: 98680
2010-03-16 21:25:55 +00:00
Daniel Dunbar
3a374da973
Revert r98656, its breaking all over the place.
...
llvm-svn: 98662
2010-03-16 19:35:34 +00:00
Chris Lattner
9ae99e0df5
improve support for uniontype and ConstantUnion, patch by Tim Northover!
...
llvm-svn: 98656
2010-03-16 19:15:03 +00:00
Chris Lattner
db035a0af2
Fix the third (and last known) case of code update problems due
...
to LLVM IR changes with addr label weirdness. In the testcase, we
generate references to the two bb's when codegen'ing the first
function:
_test1: ## @test1
leaq Ltmp0(%rip), %rax
..
leaq Ltmp1(%rip), %rax
Then continue to codegen the second function where the blocks
get merged. We're now smart enough to emit both labels, producing
this code:
_test_fun: ## @test_fun
## BB#0: ## %entry
Ltmp1: ## Block address taken
Ltmp0:
## BB#1: ## %ret
movl $-1, %eax
ret
Rejoice.
llvm-svn: 98595
2010-03-16 00:29:39 +00:00
Chris Lattner
561334a81f
Implement support for the case when a reference to a addr-of-bb
...
label is generated, but then the block is deleted. Since the
value is undefined, we just emit the label right after the entry
label of the function. It might matter that the label is in the
same section as the function was afterall.
llvm-svn: 98579
2010-03-15 20:39:00 +00:00
Devang Patel
a3e9c9ca7b
Emit dwarf variable info communicated by code generator through DBG_VALUE machine instructions.
...
This is a work in progress.
llvm-svn: 98556
2010-03-15 18:33:46 +00:00
Chris Lattner
f18c0e6b4b
remove dead method.
...
llvm-svn: 98526
2010-03-15 00:00:42 +00:00
Chris Lattner
9efbbcbe45
fix AsmPrinter::GetBlockAddressSymbol to always return a unique
...
label instead of trying to form one based on the BB name (which
causes collisions if the name is empty). This fixes PR6608
llvm-svn: 98495
2010-03-14 17:53:23 +00:00
Chris Lattner
c26f44fb07
change the DBG_LABEL MachineInstr to always be created
...
with an MCSymbol instead of an immediate.
llvm-svn: 98481
2010-03-14 07:56:48 +00:00
Chris Lattner
1065f49ad9
switch GC_LABEL to use an MCSymbol operand instead of a label ID operand.
...
llvm-svn: 98474
2010-03-14 07:27:07 +00:00
Chris Lattner
ee2fbbc978
change the LabelSDNode to be EHLabelSDNode and make it hold
...
an MCSymbol. Make the EH_LABEL MachineInstr hold its label
with an MCSymbol instead of ID. Fix a bug in MMI.cpp which
would return labels named "Label4" instead of "label4".
llvm-svn: 98463
2010-03-14 02:33:54 +00:00
Chris Lattner
29bdac4928
eliminate the now-unneeded context argument of MBB::getSymbol()
...
llvm-svn: 98451
2010-03-13 21:04:28 +00:00
Chris Lattner
e468f88b26
rearrange MCContext ownership. Before LLVMTargetMachine created it
...
and passing off ownership to AsmPrinter. Now MachineModuleInfo
creates it and owns it by value. This allows us to use MCSymbols
more consistently throughout the rest of the code generator, and
simplifies a bit of code. This also allows MachineFunction to
keep an MCContext reference handy, and cleans up the TargetRegistry
interfaces for AsmPrinters.
llvm-svn: 98450
2010-03-13 20:55:24 +00:00
Chris Lattner
5ea039ad5c
remove gone method, grr symlinks.
...
llvm-svn: 98392
2010-03-12 21:30:49 +00:00
Chris Lattner
9e4cafe6f1
inline the now-trivial implementation of GetGlobalValueSymbol into
...
some of its callers.
llvm-svn: 98388
2010-03-12 21:09:07 +00:00
Chris Lattner
c7b46f9d9c
give Mangler access to TargetData.
...
llvm-svn: 98378
2010-03-12 20:47:28 +00:00
Chris Lattner
be3242b523
finally give Mangler a getSymbol method, which returns an MCSymbol
...
for a global instead of messing around with string buffers.
llvm-svn: 98366
2010-03-12 18:55:20 +00:00
Chris Lattner
2eff505fba
make the mangler take an MCContext instead of an MAI.
...
No functionality change.
llvm-svn: 98363
2010-03-12 18:44:54 +00:00
Richard Osborne
6d3e92dfee
Add a new jump table encoding to indicate jump tables entries
...
are inside the function by the target at the point of use.
llvm-svn: 98255
2010-03-11 14:58:16 +00:00
Chris Lattner
ac2361a9b0
set the temporary bit on MCSymbols correctly.
...
llvm-svn: 98124
2010-03-10 02:25:11 +00:00
Chris Lattner
ba35a67062
reapply r98035:
...
Now that setStartLabel takes an MCSymbol, we can de-ID'ize
beginScope and RecordSourceLine.
llvm-svn: 98047
2010-03-09 04:54:43 +00:00
Eric Christopher
66194fbf86
Speculatively revert r98035. It appears to have caused a set of buildbot
...
failures.
llvm-svn: 98039
2010-03-09 02:36:31 +00:00
Chris Lattner
06c5e9060c
Now that setStartLabel takes an MCSymbol, we can de-ID'ize
...
beginScope and RecordSourceLine.
llvm-svn: 98035
2010-03-09 02:08:02 +00:00
Chris Lattner
9e57c676dd
mcstreamerize AsmPrinter::printLabel.
...
llvm-svn: 98025
2010-03-09 01:02:30 +00:00
Chris Lattner
b14490d912
add a EmitSymbolValue convenience method to MCStreamer.
...
llvm-svn: 98017
2010-03-09 00:39:24 +00:00
Chris Lattner
9889c1eb9e
move .set generation out of DwarfPrinter into AsmPrinter and
...
MCize it.
llvm-svn: 98010
2010-03-08 23:58:37 +00:00
Devang Patel
3b548aa8e2
Avoid using DIDescriptor.isNull().
...
This is a first step towards eliminating checks in Descriptor constructors.
llvm-svn: 97975
2010-03-08 20:52:55 +00:00
Devang Patel
bc97f6b757
Revert r97947.
...
llvm-svn: 97963
2010-03-08 19:20:38 +00:00
Devang Patel
fe28599f6f
Avoid using DIDescriptor.isNull().
...
This is a first step towards eliminating unncessary constructor checks in light weight DIDescriptor wrappers.
llvm-svn: 97947
2010-03-08 18:25:48 +00:00
Chris Lattner
e4f249bc06
use OutStreamer.EmitCodeAlignment for alignment in the text
...
segment.
llvm-svn: 96967
2010-02-23 18:46:22 +00:00
Chris Lattner
1fa9c2cce4
move isOnlyReachableByFallthrough out of MachineBasicBlock into AsmPrinter,
...
and add a sparc implementation that knows about delay slots. Patch by
Nathan Keynes!
llvm-svn: 96492
2010-02-17 18:52:56 +00:00
Dan Gohman
4a618827de
Fix "the the" and similar typos.
...
llvm-svn: 95781
2010-02-10 16:03:48 +00:00
Chris Lattner
ea26fa9971
fix a layering violation: VirtRegRewriter.cpp shouldn't use AsmPrinter.h.
...
llvm-svn: 95748
2010-02-10 01:23:18 +00:00
Chris Lattner
74e6852510
Move verbose asm instruction comments to using MCStreamer.
...
The major win of this is that the code is simpler and they
print on the same line as the instruction again:
movl %eax, 96(%esp) ## 4-byte Spill
movl 96(%esp), %eax ## 4-byte Reload
cmpl 92(%esp), %eax ## 4-byte Folded Reload
jl LBB7_86
llvm-svn: 95738
2010-02-10 00:47:53 +00:00
Chris Lattner
ff68a42121
print all the newlines at the end of instructions with
...
OutStreamer.AddBlankLine instead of textually.
llvm-svn: 95734
2010-02-10 00:36:00 +00:00
Chris Lattner
b06015aa69
move target-independent opcodes out of TargetInstrInfo
...
into TargetOpcodes.h. #include the new TargetOpcodes.h
into MachineInstr. Add new inline accessors (like isPHI())
to MachineInstr, and start using them throughout the
codebase.
llvm-svn: 95687
2010-02-09 19:54:29 +00:00
Dan Gohman
227077d1be
Implement AsmPrinter support for several more operators which have
...
direct MCExpr equivalents. Don't use MCExpr::Shr because it isn't
consistent between targets.
llvm-svn: 95620
2010-02-09 00:02:37 +00:00
Chris Lattner
ebc970e4eb
now that @GOTOFF is no longer represented as a suffix on a
...
MCSymbol, we can remove the 'suffix' argument of
GetBlockAddressSymbol. Do so.
llvm-svn: 95601
2010-02-08 23:10:08 +00:00
Dan Gohman
e51b57bee0
ConstantFoldConstantExpression can theoretically return the original
...
expression; don't go into an infinite loop if it does.
llvm-svn: 95591
2010-02-08 22:19:11 +00:00
Dan Gohman
4268d6a7c3
When CodeGen'ing unoptimized code, there may be unfolded constant expressions
...
in global initializers. Instead of aborting, attempt to fold them on the
spot. If folding succeeds, emit the folded expression instead.
This fixes PR6255.
llvm-svn: 95583
2010-02-08 22:02:38 +00:00
Bill Wendling
6510dc8dc3
An empty global constant (one of size 0) may have a section immediately
...
following it. However, the EmitGlobalConstant method wasn't emitting a body for
the constant. The assembler doesn't like that. Before, we were generating this:
.zerofill __DATA, __common, __cmd, 1, 3
This fix puts us back to that semantic.
llvm-svn: 95336
2010-02-05 00:17:02 +00:00
Chris Lattner
0b78cc2af5
don't emit \n's at the start of X86AsmPrinter::runOnMachineFunction,
...
.o files don't like that.
llvm-svn: 95187
2010-02-03 01:49:49 +00:00
Chris Lattner
f1866ab682
privatize a bunch of methods and move \n printing into them.
...
llvm-svn: 95186
2010-02-03 01:46:05 +00:00
Chris Lattner
996ec840d0
rejigger the world so that EmitInstruction prints the \n at
...
the end of the instruction instead of expecting the caller to
do it. This currently causes the asm-verbose instruction
comments to be on the next line.
llvm-svn: 95178
2010-02-03 01:09:55 +00:00
Chris Lattner
41ad1905c9
sink handling of target-independent machine instrs (other
...
than DEBUG_VALUE :( ) into the target indep AsmPrinter.cpp
file. This allows elimination of the
NO_ASM_WRITER_BOILERPLATE hack among other things.
llvm-svn: 95177
2010-02-03 01:00:52 +00:00
Chris Lattner
b0d44c3807
refactor code so that LLVMTargetMachine creates the asmstreamer and
...
mccontext instead of having AsmPrinter do it. This allows other
types of MCStreamer's to be passed in.
llvm-svn: 95155
2010-02-02 23:37:42 +00:00
Chris Lattner
32445d300f
move handling of asm-verbose out of AsmPrinter.cpp into LLVMTargetMachine.cpp with the rest of the command line options.
...
llvm-svn: 95152
2010-02-02 22:54:51 +00:00
Chris Lattner
c968f4475e
add target hooks for emitting random gunk before and after the function body.
...
llvm-svn: 94732
2010-01-28 01:58:58 +00:00
Chris Lattner
73de5fbfc3
Give AsmPrinter the most common expected implementation of
...
runOnMachineFunction, and switch PPC to use EmitFunctionBody.
The two ppc asmprinters now don't heave to define
runOnMachineFunction.
llvm-svn: 94722
2010-01-28 01:28:58 +00:00