Commit Graph

10900 Commits

Author SHA1 Message Date
Chris Lattner c35681b298 Generalize mcasmstreamer data emission APIs to take an address space
identifier.  There is no way to work around it.

llvm-svn: 93896
2010-01-19 19:46:13 +00:00
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 0c65fd4902 add a "MCStreamer::EmitFill" method, and move the default implementation
(which just iteratively emits bytes) to MCStreamer.

llvm-svn: 93888
2010-01-19 18:45:47 +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
Jim Grosbach 04770f2aa1 For aligned load/store instructions, it's only required to know whether a
function can support dynamic stack realignment. That's a much easier question
to answer at instruction selection stage than whether the function actually
will have dynamic alignment prologue. This allows the removal of the
stack alignment heuristic pass, and improves code quality for cases where
the heuristic would result in dynamic alignment code being generated when
it was not strictly necessary.

llvm-svn: 93885
2010-01-19 18:31:11 +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 1083b5fc3f Avoid including DebugInfo.h in AsmPrinter.h
llvm-svn: 93864
2010-01-19 06:09:04 +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 b1f2934fc7 hookize the cygwin ".linkonce" directive.
llvm-svn: 93855
2010-01-19 05:08:13 +00:00
Chris Lattner dccbb28bca add a bool for whether .lcomm takes an alignment instead of basing this on "isdarwin".
llvm-svn: 93852
2010-01-19 04:48:20 +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
Chris Lattner 35474ca4c4 use BSSLocal classifier to identify 'lcomm' data instead of
duplicating the logic (differently) in lots of different targets.

llvm-svn: 93847
2010-01-19 04:21:20 +00:00
Chris Lattner b253421711 make TLOF subclassify BSS based on linkage type into private, external
and everything else (weak).

llvm-svn: 93846
2010-01-19 04:15:51 +00:00
Chris Lattner 5b585f8b1a introduce a section kind for common linkage. Use this to slightly
simplify and commonize some of the asmprinter logic for globals.

This also avoids printing the MCSection for .zerofill, which broke
the llvm-gcc build.

llvm-svn: 93843
2010-01-19 02:48:26 +00:00
Chris Lattner aa1f4fd0ed change an accessor to a predicate.
llvm-svn: 93839
2010-01-19 02:13:06 +00:00
Chris Lattner 1d371882b6 Cleanup handling of .zerofill on darwin:
1. TargetLoweringObjectFileMachO should decide if something
   goes in zerofill instead of having every target do it.
2. TargetLoweringObjectFileMachO should assign said symbols to
   the right MCSection, the asmprinters should just emit to the
   right section.
3. Since all zerofill stuff goes through mcstreamer anymore,
   MAI can have a bool "haszerofill" instead of having the textual
   directive to emit.

llvm-svn: 93838
2010-01-19 02:09:44 +00:00
Chris Lattner 17fd6dd7af remove extraneous ;
llvm-svn: 93833
2010-01-19 01:28:09 +00:00
Victor Hernandez 06828f025d Add comment that MDNode::getFunction() is not to be used by performance-critical code (currently only used by AsmWriter)
llvm-svn: 93802
2010-01-18 22:55:08 +00:00
Bill Wendling c592725fbb - Add getLSDAEncoding to the PowerPC backend.
- Greatly improve the comments to the getLSDAEncoding method.

llvm-svn: 93796
2010-01-18 22:36:35 +00:00
Sean Callanan 0b72fd5ccc Added a newline at the end of SMLoc.h
llvm-svn: 93784
2010-01-18 22:16:54 +00:00
Sean Callanan 85b27528fc Changed the comment in the file header for SMLoc
to something more accurate.

llvm-svn: 93782
2010-01-18 22:11:34 +00:00
Sean Callanan 2802d2017c Split SMLoc out in its own header so that it can
be used independently of SourceMgr.

llvm-svn: 93780
2010-01-18 22:07:51 +00:00
Victor Hernandez 870913f707 Make findDbgDeclare/findDbgGlobalDeclare local static functions; avoid Elts array
llvm-svn: 93764
2010-01-18 20:42:09 +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
Benjamin Kramer 6dea75c658 Unnamed symbol index should be >= 1. This was lost during the mangler refactoring. Fixes PR6067.
llvm-svn: 93724
2010-01-18 14:39:20 +00:00
Chris Lattner 1d8b954b43 switch x86 zerofill emission over to use MCStreamer.
llvm-svn: 93702
2010-01-18 01:21:08 +00:00
Chris Lattner 8c21ffdcc6 Change CurrentFnSym to be a non-const pointer since asmprinter mutates it
as it emits code.  Switch .globl directives to use OutStreamer instead of
doing it textually (in x86)

llvm-svn: 93700
2010-01-18 00:59:24 +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 8c2ab10bdd stop the CBE from using Mangler::appendMangledName, which is a private function, it is mangling types, which don't matter how they are done.
llvm-svn: 93692
2010-01-17 19:32:29 +00:00
Chris Lattner dfc5cbe2a1 fix uninit member, thanks to Benjamin Kramer for identifying the bug.
llvm-svn: 93691
2010-01-17 19:24:35 +00:00
Chris Lattner 83e872e1c4 Get MCSymbol out of the mangling business, and move all the logic
to Mangler.  Now MCSymbol just decides whether to slap quotes around
a symbol when printing it.

This also fixes some weirdness where two MCSymbols could be created
for the same symbol, if one needed to be mangled and got mangled to
the other one.

llvm-svn: 93690
2010-01-17 19:23:46 +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 f523bb584c fix a warning.
llvm-svn: 93663
2010-01-16 21:55:24 +00:00
Chris Lattner 1c7beb5638 this doesn't need to suck in Mangler.
llvm-svn: 93662
2010-01-16 21:35:09 +00:00
Chris Lattner 1376b02a17 reapply the mangler gutting patch.
llvm-svn: 93656
2010-01-16 21:08:46 +00:00
Rafael Espindola 9794fdfab0 Revert 93648.
Mangler::getMangledName is used from lto
Mangler::setUseQuotes is used in the AsmPrinter
Mangler::setSymbolsCanStartWithDigit is used in the AsmPrinter

llvm-svn: 93652
2010-01-16 20:27:59 +00:00
Chris Lattner 8b27547d6d Mangler::getMangledName is now dead, remove it and all the other stuff in Mangler that is now transitively dead. woo.
llvm-svn: 93648
2010-01-16 19:08:51 +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 9787fd0468 switch liblto to use the new getNameWithPrefix() method instead of getMangledName.
llvm-svn: 93643
2010-01-16 18:12:14 +00:00
Chris Lattner d3a2163069 add an inefficient version of getNameWithPrefix that returns an std::string.
llvm-svn: 93641
2010-01-16 18:06:34 +00:00
Benjamin Kramer 41cab696fc Revive dead assert.
llvm-svn: 93638
2010-01-16 16:14:55 +00:00
Tobias Grosser b478d3e0fc Fix PR6047
Nodes that had children outside of the post dominator tree (infinite loops)
where removed from the post dominator tree. This seems to be wrong. Leave them
in the tree.

llvm-svn: 93633
2010-01-16 13:38:07 +00:00
Tobias Grosser 53da3f8da8 Create Generic DOTGraphTraits Printer/Viewer
Move the DOTGraphTraits dotty printer/viewer templates, that were developed for
the dominance tree into their own header file. This will allow reuse in future
passes.

llvm-svn: 93632
2010-01-16 10:56:41 +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 a091179b5f CurrentFnName is now dead, remove it.
llvm-svn: 93612
2010-01-16 01:24:10 +00:00