Chris Lattner
fefcb1531c
refactor code to be static functions instead of methods on AsmPrinter.
...
This fixes some bugs handling address spaces.
llvm-svn: 93891
2010-01-19 19:10:44 +00:00
Chris Lattner
ed89f60f5e
mcstreamerize AsmPrinter::EmitZeros, at least when emitting to the
...
default address space.
llvm-svn: 93890
2010-01-19 18:58:52 +00:00
Chris Lattner
9c31b0c695
remove MAI::ZeroDirectiveSuffix, which is only used by MASM,
...
which we don't support anymore.
llvm-svn: 93886
2010-01-19 18:37:01 +00:00
Chris Lattner
3024e9813e
mcstreamer'ize the rest of EmitGlobalVariable that is used on
...
darwin. The next big piece to get global variables streamerized
is EmitGlobalConstant.
llvm-svn: 93870
2010-01-19 06:41:24 +00:00
Chris Lattner
cd2915e467
stop using the .lcomm pseudoop on darwin, instead, directly use the
...
.zerofill directive. Streamerize its generation.
llvm-svn: 93868
2010-01-19 06:25:51 +00:00
Devang Patel
018b29b039
MDNodes are not expected to disappear or replaced by another MDNode, so there is no need to pay the cost of WeakVH and ValueMaps.
...
llvm-svn: 93865
2010-01-19 06:19:05 +00:00
Devang Patel
1083b5fc3f
Avoid including DebugInfo.h in AsmPrinter.h
...
llvm-svn: 93864
2010-01-19 06:09:04 +00:00
Chris Lattner
95b98959b0
mc'ize some stuff, don't comment out .lcomm directive in -fverbose-asm mode.
...
llvm-svn: 93860
2010-01-19 06:01:04 +00:00
Chris Lattner
282466abf7
factor this code better.
...
llvm-svn: 93859
2010-01-19 05:51:42 +00:00
Chris Lattner
c7a062d187
Now that we have everything nicely factored (e.g. asmprinter is not
...
doing global variable classification anymore) and hookized, sink almost
all target targets global variable emission code into AsmPrinter and out
of each target.
Some notes:
1. PIC16 does completely custom and crazy stuff, so it is not changed.
2. XCore has some custom handling for extra directives. I'll look at it next.
3. This switches linux/ppc to use .globl instead of .global. If .globl is
actually wrong, let me know and I'll fix it.
4. This makes linux/ppc get a lot of random cases right which were obviously
wrong before, it is probably now a bit healthier.
5. Blackfin will probably start getting .comm and other things that it didn't
before. If this is undesirable, it should explicitly opt out of these
things by clearing the relevant fields of MCAsmInfo.
This leads to a nice diffstat:
14 files changed, 127 insertions(+), 830 deletions(-)
llvm-svn: 93858
2010-01-19 05:38:33 +00:00
Chris Lattner
6a160517a0
hoist handling of external globals and special globals up to common code.
...
This makes a similar code dead in all the other targets, I'll clean it up
in a bit.
This also moves handling of lcomm up before acquisition of a section,
since lcomm never needs a section.
llvm-svn: 93851
2010-01-19 04:39:15 +00:00
Chris Lattner
e9d28b19cf
move production of .reference directives for static ctor/dtor list on
...
darwin into common code.
llvm-svn: 93849
2010-01-19 04:34:02 +00:00
Devang Patel
fe189e65d7
Revert accident check-in from r93165.
...
llvm-svn: 93832
2010-01-19 01:26:02 +00:00
Bill Wendling
a73e471c62
- Add a comment to the callback indicating that it's *extremely* not a good
...
idea, but unfortunately necessary.
- Default to using 4-bytes for the LSDA pointer encoding to agree with the
encoded value in the CIE.
llvm-svn: 93753
2010-01-18 19:36:27 +00:00
Chris Lattner
c8f7717808
remove the MAI argument to MCExpr::print and switch overthing to use << when printing them.
...
llvm-svn: 93699
2010-01-18 00:37:40 +00:00
Chris Lattner
8b5d55ed06
now that MCSymbol::print doesn't use it's MAI argument, we can
...
remove it and change all the code that prints MCSymbols to use
<< instead, which is much simpler and cleaner.
llvm-svn: 93695
2010-01-17 21:43:43 +00:00
Chris Lattner
b4ffc894e6
now that mangler is in libtarget, it can use MCAsmInfo instead of clients
...
having to pass various fields from it in. Simplify.
llvm-svn: 93686
2010-01-17 18:22:35 +00:00
Benjamin Kramer
4d128a2387
Switch some functions to take Twines, eliminate uses of StringExtras.h.
...
llvm-svn: 93680
2010-01-17 07:46:39 +00:00
Chris Lattner
f62e3ee8c5
move the mangler into libtarget from vmcore.
...
llvm-svn: 93664
2010-01-16 21:57:06 +00:00
Chris Lattner
d3b1808876
unbreak the build.
...
llvm-svn: 93654
2010-01-16 20:53:11 +00:00
Chris Lattner
06d45f6e75
Change DIEObjectLabel to take an MCSymbol instead of std::string.
...
llvm-svn: 93647
2010-01-16 18:50:28 +00:00
Chris Lattner
555ceabe64
rename GetPrivateGlobalValueSymbolStub -> GetSymbolWithGlobalValueBase,
...
and add an explicit ForcePrivate argument.
Switch FunctionEHFrameInfo to be MCSymbol based instead of string based.
llvm-svn: 93646
2010-01-16 18:37:32 +00:00
Chris Lattner
8a1f23af11
eliminate uses of getMangledName from AsmPrinter.cpp, last up is
...
dwarf emission which is going to be more invasive.
llvm-svn: 93645
2010-01-16 18:17:26 +00:00
Devang Patel
814b7e7488
No need to use WeakVH here.
...
llvm-svn: 93631
2010-01-16 06:17:40 +00:00
Devang Patel
c0e17df3ce
Replace DebugLocTuple with DILocation.
...
llvm-svn: 93630
2010-01-16 06:09:35 +00:00
Bill Wendling
bf5cfa1a41
Retrying r91337:
...
The CIE says that the LSDA point in the FDE section is an "sdata4". That's fine,
but we need it to actually be 4-bytes in the FDE for some platforms. Allow
individual platforms to decide for themselves.
llvm-svn: 93616
2010-01-16 01:40:55 +00:00
Chris Lattner
a689edd067
fix inverted conditional
...
llvm-svn: 93614
2010-01-16 01:37:14 +00:00
Chris Lattner
a091179b5f
CurrentFnName is now dead, remove it.
...
llvm-svn: 93612
2010-01-16 01:24:10 +00:00
Chris Lattner
fedff0f67d
remove the string form of printVisibility.
...
llvm-svn: 93609
2010-01-16 01:17:26 +00:00
Chris Lattner
ae9b9eed18
supplement CurrentFnName with CurrentFnSym, which will eventually
...
replace it. Upgrade Alpha, Blackfin, and part of CellSPU to not
use mangler anymore. CellSPU needs more invasive surgery.
llvm-svn: 93589
2010-01-15 23:55:16 +00:00
Chris Lattner
7fec180909
add a version of AsmPrinter::printVisibility that takes an MCSymbol.
...
llvm-svn: 93587
2010-01-15 23:38:51 +00:00
Chris Lattner
0dca0a9650
add another helper
...
llvm-svn: 93577
2010-01-15 23:25:11 +00:00
Chris Lattner
91687f6e28
add a AsmPrinter::GetGlobalValueSymbol and GetExternalSymbolSymbol
...
helper method, use it to simplify some code.
llvm-svn: 93575
2010-01-15 23:18:17 +00:00
Devang Patel
0633820599
Add FIXME.
...
llvm-svn: 93562
2010-01-15 22:08:16 +00:00
Devang Patel
89880c8224
Do not use AT_specification die for static variables. It confuses gdb.
...
llvm-svn: 93494
2010-01-15 01:12:22 +00:00
Devang Patel
2108ee075f
Do not emit multiple AT_container_type attributes.
...
We need to find a better way to emit this info.
llvm-svn: 93481
2010-01-15 00:26:31 +00:00
Dale Johannesen
b297cdd937
Fix a comment.
...
llvm-svn: 93463
2010-01-14 21:50:17 +00:00
Chris Lattner
25d8ed3773
remove uses of deprecated functions, this generates slightly
...
different BlockAddress labels, but nothing semantically important.
Add a FIXME that BlockAddress codegen is broken if the LLVM BB has
an empty name (e.g. strip was run).
llvm-svn: 93303
2010-01-13 07:30:49 +00:00
Chris Lattner
2b630fe822
use the new form of getNameWithPrefix, not makeNameProper.
...
Among other things, this would do very weird things if the
basic block name had (e.g.) a space in it on darwin:
makeNameProper would add quotes, then the mcsymbol would
escape the quotes.
llvm-svn: 93302
2010-01-13 07:16:53 +00:00
Chris Lattner
209aecad0c
change Mangler::makeNameProper to return its result in a SmallVector
...
instead of returning it in an std::string. Based on this change:
1. Change TargetLoweringObjectFileCOFF::getCOFFSection to take a StringRef
2. Change a bunch of targets to call makeNameProper with a smallstring,
making several of them *much* more efficient.
3. Rewrite Mangler::makeNameProper to not build names and then prepend
prefixes, not use temporary std::strings, and to avoid other crimes.
llvm-svn: 93298
2010-01-13 06:38:18 +00:00
Chris Lattner
8e26d19cb3
fix assert in AsmPrinter::EmitGlobalConstantLargeInt to match reality.
...
llvm-svn: 93293
2010-01-13 04:39:46 +00:00
Chris Lattner
4581a4f03a
reduce nesting and code duplication in AsmPrinter::EmitGlobalConstantLargeInt.
...
llvm-svn: 93292
2010-01-13 04:38:16 +00:00
Chris Lattner
a32ba6d056
reduce indentation and add a fast-path to EmitGlobalConstant for 8-byte
...
integers on 64-bit systems.
llvm-svn: 93291
2010-01-13 04:34:19 +00:00
Chris Lattner
7e0c164b5e
reduce indentation and use early exits in AsmPrinter::EmitConstantValueOnly
...
llvm-svn: 93290
2010-01-13 04:29:19 +00:00
Devang Patel
8992323bb9
s/NextValueNo/NextMDValueNo while processing metadata.
...
llvm-svn: 93165
2010-01-11 18:52:33 +00:00
Benjamin Kramer
2b45998b7b
Kill dead store.
...
llvm-svn: 92920
2010-01-07 17:50:57 +00:00
Devang Patel
d146e2e3df
If a scope has only one instruction then first instruction is also the last instruction.
...
llvm-svn: 92736
2010-01-05 16:59:17 +00:00
Devang Patel
43ef34d2a5
Use StringRef.startswith().
...
llvm-svn: 92671
2010-01-05 01:46:14 +00:00
Devang Patel
e6433faba6
Fix debug_inlined section entries for routines whose names are changed through __asm() extension.
...
llvm-svn: 92533
2010-01-04 23:04:36 +00:00
Devang Patel
530a075f17
Fix begin and end markers for nested scopes.
...
llvm-svn: 92505
2010-01-04 20:44:00 +00:00