1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

322 Commits

Author SHA1 Message Date
Chris Lattner
1c44a63eba move getDwarfExceptionSection from TAI to TLOF and rename it to
getLSDASection() to be more specific.  This makes it pretty obvious
that the ELF LSDA section is being specified wrong in PIC mode.  We're
probably getting a lot of startup-time relocations to a readonly page,
which is expensive and bad.

Someone who cares about ELF C++ should investigate this.

llvm-svn: 77847
2009-08-02 01:34:32 +00:00
Chris Lattner
06d8ca1f56 convert ctors/dtors section to be in TLOF instead of
TAI.

llvm-svn: 77842
2009-08-02 00:34:36 +00:00
Chris Lattner
05334af883 (re)introduce new simpler apis for creation sectionkinds.
llvm-svn: 77834
2009-08-01 23:57:16 +00:00
Chris Lattner
81229d1bed Remove "JumpTableDataSection" from TAI, instead, have AsmPrinter
compute it based on what it knows.  As part of this, rename getSectionForMergeableConstant
to getSectionForConstant because it works for non-mergable constants also.

The only functionality change from this is that Xcore will start dropping
its jump tables into readonly section instead of data section in -static mode.
This should be fine as the linker resolves the relocations.  If this is a
problem, let me know and we'll come up with another solution.

llvm-svn: 77833
2009-08-01 23:46:12 +00:00
Chris Lattner
82b6045b0b loweringinfo is always non-null.
llvm-svn: 77821
2009-08-01 22:48:40 +00:00
Chris Lattner
e1cc2c27b3 fix a problem Eli noticed where we would compile the attached ptrtoint
to:

.quad X

even on a 32-bit system, where X is not 64-bits.  There isn't much that
we can do here, so we just print:

.quad	((X) & 4294967295)

instead.

llvm-svn: 77818
2009-08-01 22:25:12 +00:00
Chris Lattner
79e9585304 Change SectionKind to be a property that is true of a *section*, it
should have no state that is specific to particular globals in the
section.  In this case, it means the removal of the "isWeak" and
"ExplicitSection" bits.  MCSection uses the new form of SectionKind.

To handle isWeak, I introduced a new SectionInfo class, which is
SectionKind + isWeak, and it is used by the part of the code generator
that does classification of a specific global.

The ExplicitSection disappears.  It is moved onto MCSection as a new
"IsDirective" bit.  Since the Name of a section is either a section
or directive, it makes sense to keep this bit in MCSection.  Ultimately
the creator of MCSection should canonicalize (e.g.) .text to whatever
the actual section is.

llvm-svn: 77803
2009-08-01 21:11:14 +00:00
Dan Gohman
4529d71681 Use setPreservesAll and setPreservesCFG in CodeGen passes.
llvm-svn: 77754
2009-07-31 23:37:33 +00:00
Chris Lattner
e84531b18d add some comments on how this is *supposed* to work. We don't
need the PreferredEHDataFormat hook, but I have yet-more refactoring to
do before I can zap it.

llvm-svn: 77742
2009-07-31 22:18:14 +00:00
Chris Lattner
907f114dd3 rearrange a conditional. Even if this weren't #if 0'd out, this would
have no functionality change.

llvm-svn: 77741
2009-07-31 22:03:47 +00:00
David Greene
543296ed84 Simplify operand padding by keying off tabs in the asm stream. If
padding is disabled, tabs get replaced by spaces except in the case of
the first operand, where the tab is output to line up the operands after
the mnemonics.

Add some better comments and eliminate redundant code.

Fix some testcases to not assume tabs.

llvm-svn: 77740
2009-07-31 21:57:10 +00:00
Chris Lattner
882b1208e1 PreferredEHDataFormat is always call with data and global, but this whole
thing is #if0'd out anyway.  Just simplify the code by reducing the interface.
Not deleting this is essential for Bill's continuing happiness.

llvm-svn: 77736
2009-07-31 21:39:55 +00:00
Chris Lattner
48bdeff884 move emitUsedDirectiveFor to TargetLoweringObjectFile and rename it to
indicate that it is a predicate, not an emitter.  This eliminates TAI
dependencies on Mangler and GlobalValue.

llvm-svn: 77726
2009-07-31 20:52:39 +00:00
Chris Lattner
75b7692e66 switch off of 'Section' onto MCSection. We're not properly using
MCSection subclasses yet, but this is a step in the right direction.

llvm-svn: 77708
2009-07-31 18:48:30 +00:00
Chris Lattner
c156a00641 refactor section construction in TLOF to be through an explicit
initialize method, which can be called when an MCContext is available.

llvm-svn: 77687
2009-07-31 17:42:42 +00:00
Devang Patel
9b0dea089b Start using DebugInfoFinder.
llvm-svn: 77621
2009-07-30 18:56:46 +00:00
Bill Wendling
67495ad58d Forgot to output the base offset.
llvm-svn: 77505
2009-07-29 21:19:44 +00:00
Chris Lattner
5c3e1e0d0c pass the mangler down into the various SectionForGlobal methods.
No functionality change.

llvm-svn: 77432
2009-07-29 05:09:30 +00:00
Bill Wendling
63e2e5f961 Move comment to above method.
llvm-svn: 77412
2009-07-29 00:50:05 +00:00
Bill Wendling
067f40533e - Temporarily unbreak the build by forcing the TType "absptr", which isn't
correct. But what are you going to do? I'll fix this in the future.
- Move another large loop into its own method.

llvm-svn: 77408
2009-07-29 00:31:35 +00:00
Bill Wendling
542faaa8f1 Cleanup code to use iterators instead of ".size()".
Does any one else hate the name "const_reverse_iterator" as much as I do?

llvm-svn: 77399
2009-07-28 23:44:43 +00:00
Bill Wendling
3c423d6937 Doxygenify comments.
llvm-svn: 77394
2009-07-28 23:23:00 +00:00
Bill Wendling
4aca242899 Split out large loop into it's very own method. No intended functionality change.
llvm-svn: 77393
2009-07-28 23:22:13 +00:00
Bill Wendling
e3f9b54a39 Output the EH TType format and base offset only if there are types that we're
going to emit.

llvm-svn: 77382
2009-07-28 22:23:45 +00:00
Bill Wendling
2c464b4a80 Use the preferred EH data format for the preferred EH data format.
llvm-svn: 77373
2009-07-28 21:54:03 +00:00
Chris Lattner
55461787cc Rip all of the global variable lowering logic out of TargetAsmInfo. Since
it is highly specific to the object file that will be generated in the end,
this introduces a new TargetLoweringObjectFile interface that is implemented
for each of ELF/MachO/COFF/Alpha/PIC16 and XCore.

Though still is still a brutal and ugly refactoring, this is a major step
towards goodness.

This patch also:
1. fixes a bunch of dangling pointer problems in the PIC16 backend.
2. disables the TargetLowering copy ctor which PIC16 was accidentally using.
3. gets us closer to xcore having its own crazy target section flags and
   pic16 not having to shadow sections with its own objects.
4. fixes wierdness where ELF targets would set CStringSection but not
   CStringSection_.  Factor the code better.
5. fixes some bugs in string lowering on ELF targets.

llvm-svn: 77294
2009-07-28 03:13:23 +00:00
Chris Lattner
d519223908 hoist MCContext/MCStreamer up to AsmPrinter since we're going to start creating
MCSections soon instead of Section for all targets, and we need something to
own them.

llvm-svn: 77252
2009-07-27 21:28:04 +00:00
Chris Lattner
a2b00bdd7a Eliminate SectionFlags, just embed a SectionKind into Section
instead and drive things based off of that.

llvm-svn: 77184
2009-07-27 05:32:16 +00:00
Daniel Dunbar
4a36d5dcfd Remove Value::getName{Start,End}, the last of the old Name APIs.
llvm-svn: 77152
2009-07-26 09:48:23 +00:00
Chris Lattner
9104e8d808 remove a densemap from TargetAsmInfo that was uniquing the targetflags strings,
just use a smallstring instead.

llvm-svn: 77144
2009-07-26 07:33:58 +00:00
Chris Lattner
41570cf306 make SectionKind know whether a symbol is weak or not in addition
to its classification.

llvm-svn: 77140
2009-07-26 07:00:12 +00:00
Chris Lattner
61e4445f5a rename Mergable -> Mergeable and Writable -> Writeable
llvm-svn: 77138
2009-07-26 06:48:26 +00:00
Chris Lattner
950bd8ba10 two files I missed in the last commit.
llvm-svn: 77137
2009-07-26 06:36:20 +00:00
Chris Lattner
1f709a74f6 simplify getSectionForMergableConstant to take a SectionKind.
llvm-svn: 77134
2009-07-26 06:26:55 +00:00
Daniel Dunbar
038a7f0d35 Remove Value::{isName, getNameRef}.
Also, change MDString to use a StringRef.

llvm-svn: 77098
2009-07-25 23:55:21 +00:00
Chris Lattner
1ae0ab672a remove a use of SectionFlagsForGlobal.
llvm-svn: 76970
2009-07-24 16:40:09 +00:00
Chris Lattner
a82421ce2f document SectionFlags::Named better and make it more easily greppable by
eliminating isNamed.

llvm-svn: 76946
2009-07-24 04:26:19 +00:00
David Greene
76d89c51ce Put comment printing under asm-verbose.
llvm-svn: 76780
2009-07-22 20:33:26 +00:00
Chris Lattner
e2bd5bc939 remove the SelectSectionForMachineConst hook, replacing it with
a new getSectionForMergableConstant hook.  This removes one dependence
of TAI on Type, and provides the hook with enough info to make the 
right decision based on whether the global has relocations etc.

llvm-svn: 76705
2009-07-22 00:28:43 +00:00
Chris Lattner
3d4ab7a231 make AsmPrinter::doFinalization iterate over the global variables
and call PrintGlobalVariable, allowing elimination and simplification
of various targets.

llvm-svn: 76604
2009-07-21 18:38:57 +00:00
Chris Lattner
0f65fbf095 Rename LessPrivateGlobalPrefix -> LinkerPrivateGlobalPrefix to match the
LLVM IR concept.

llvm-svn: 76590
2009-07-21 17:30:51 +00:00
Bill Wendling
16a69eeaeb Pass in the unfortunately named "LessPrivatePrefix" for the
"LinkerPrivatePrefix". It seems to have been used in only one place before I
started this "linker_private" business. I'm thinking that a rename is in
order...

llvm-svn: 76479
2009-07-20 21:30:28 +00:00
Chris Lattner
eac40b1473 implement a new magic global "llvm.compiler.used" which is like llvm.used, but
doesn't cause ".no_dead_strip" to be emitted on darwin.

llvm-svn: 76399
2009-07-20 06:14:25 +00:00
Chris Lattner
7cf9653432 remove AsmPrinter::findGlobalValue, just use Value::stripPointerCasts instead.
llvm-svn: 76246
2009-07-17 22:00:23 +00:00
Chris Lattner
e824b863e5 Use more terse and precise linkage checks.
llvm-svn: 76237
2009-07-17 21:00:50 +00:00
Chris Lattner
b6cede976e these two pieces of code are the same because we always
emit the EHFrame label next to the section_eh_frame and
eh_frame_common labels.

llvm-svn: 76234
2009-07-17 20:53:51 +00:00
Chris Lattner
ffe0c407be Untangle a snarl that I discovered when updating the mangler,
starting in getCurrentFunctionEHName.  Among other problems,
we would try to privative a "foo.eh" label, but end up emitting
the label as _Lfoo.eh instead of L_foo.eh on darwin.  This is really
bad, and the linker has always tolerated these labels existing.
For now, just emit them as _foo.eh.

This patch also fixes problems with ".eh" labels on unnamed
functions and eliminates two strangely defined TargetAsmInfo
hooks.

llvm-svn: 76231
2009-07-17 20:46:40 +00:00
Chris Lattner
1cb7dceb60 fix include guard.
llvm-svn: 76228
2009-07-17 20:32:07 +00:00
David Greene
a2c98dd402 Emit line numbers in asm comments when available.
llvm-svn: 76117
2009-07-16 22:24:20 +00:00
Devang Patel
58a041b634 Skip special LLVM prefix '1' while emitting linknage name.
This prefix is used by LLVM to inform the asm printer to not emit usual global symbol prefix before the symbol name.

llvm-svn: 75875
2009-07-16 01:01:22 +00:00