Commit Graph

304 Commits

Author SHA1 Message Date
Bill Wendling
409914b773 Forgot to output the base offset.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77505 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 21:19:44 +00:00
Chris Lattner
e53a600f06 pass the mangler down into the various SectionForGlobal methods.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77432 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 05:09:30 +00:00
Bill Wendling
0dafca9076 Move comment to above method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77412 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 00:50:05 +00:00
Bill Wendling
ade025c65c - 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77408 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 00:31:35 +00:00
Bill Wendling
5cff487665 Cleanup code to use iterators instead of ".size()".
Does any one else hate the name "const_reverse_iterator" as much as I do?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77399 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 23:44:43 +00:00
Bill Wendling
d4609622ad Doxygenify comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77394 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 23:23:00 +00:00
Bill Wendling
5e953ddfa3 Split out large loop into it's very own method. No intended functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77393 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 23:22:13 +00:00
Bill Wendling
b0d9c3e7fd Output the EH TType format and base offset only if there are types that we're
going to emit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77382 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 22:23:45 +00:00
Bill Wendling
c5800a809f Use the preferred EH data format for the preferred EH data format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77373 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 21:54:03 +00:00
Chris Lattner
f0144127b9 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.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77294 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 03:13:23 +00:00
Chris Lattner
2b2954f00b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77252 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 21:28:04 +00:00
Chris Lattner
5fe575ff4f Eliminate SectionFlags, just embed a SectionKind into Section
instead and drive things based off of that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77184 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 05:32:16 +00:00
Daniel Dunbar
460f656475 Remove Value::getName{Start,End}, the last of the old Name APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77152 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 09:48:23 +00:00
Chris Lattner
f40761d522 remove a densemap from TargetAsmInfo that was uniquing the targetflags strings,
just use a smallstring instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77144 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 07:33:58 +00:00
Chris Lattner
4c50922f6b make SectionKind know whether a symbol is weak or not in addition
to its classification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77140 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 07:00:12 +00:00
Chris Lattner
2ceb60a677 rename Mergable -> Mergeable and Writable -> Writeable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77138 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 06:48:26 +00:00
Chris Lattner
94809c3b10 two files I missed in the last commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77137 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 06:36:20 +00:00
Chris Lattner
5c2f789952 simplify getSectionForMergableConstant to take a SectionKind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77134 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 06:26:55 +00:00
Daniel Dunbar
03d7651c36 Remove Value::{isName, getNameRef}.
Also, change MDString to use a StringRef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77098 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 23:55:21 +00:00
Chris Lattner
d0418ce890 remove a use of SectionFlagsForGlobal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76970 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 16:40:09 +00:00
Chris Lattner
837f332372 document SectionFlags::Named better and make it more easily greppable by
eliminating isNamed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76946 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 04:26:19 +00:00
David Greene
67e59834fc Put comment printing under asm-verbose.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76780 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 20:33:26 +00:00
Chris Lattner
298414ec18 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76705 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 00:28:43 +00:00
Chris Lattner
40bbebde9d make AsmPrinter::doFinalization iterate over the global variables
and call PrintGlobalVariable, allowing elimination and simplification
of various targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76604 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 18:38:57 +00:00
Chris Lattner
90f8b7073d Rename LessPrivateGlobalPrefix -> LinkerPrivateGlobalPrefix to match the
LLVM IR concept.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76590 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 17:30:51 +00:00
Bill Wendling
4cef584860 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...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76479 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-20 21:30:28 +00:00
Chris Lattner
401e10c4fb 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76399 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-20 06:14:25 +00:00
Chris Lattner
16fe990e56 remove AsmPrinter::findGlobalValue, just use Value::stripPointerCasts instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76246 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 22:00:23 +00:00
Chris Lattner
3e0f60be46 Use more terse and precise linkage checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76237 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 21:00:50 +00:00
Chris Lattner
a4ff5e48fc 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76234 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 20:53:51 +00:00
Chris Lattner
e2cf37b88c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76231 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 20:46:40 +00:00
Chris Lattner
6f37f8f9c3 fix include guard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76228 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 20:32:07 +00:00
David Greene
3ac1ab835c Emit line numbers in asm comments when available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76117 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 22:24:20 +00:00
Devang Patel
53cb17dfbc 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75875 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 01:01:22 +00:00
Chris Lattner
f1cfea2dbf remove printSuffixedName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75742 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 04:42:49 +00:00
David Greene
71847813bc Have asm printers use formatted_raw_ostream directly to avoid a
dynamic_cast<>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75670 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 20:18:05 +00:00
Chris Lattner
b8158acc23 Reapply my previous asmprinter changes now with more testing and two
additional bug fixes:

1. The bug that everyone hit was a problem in the asmprinter where it
   would remove $stub but keep the L prefix on a name when emitting the
   indirect symbol.  This is easy to fix by keeping the name of the stub
   and the name of the symbol in a StringMap instead of just keeping a
   StringSet and trying to reconstruct it late.

2. There was a problem printing the personality function.  The current
   logic to print out the personality function from the DWARF information
   is a bit of a cesspool right now that duplicates a bunch of other 
   logic in the asm printer.  The short version of it is that it depends
   on emitting both the L and _ prefix for symbols (at least on darwin)
   and until I can untangle it, it is best to switch the mangler back to
   emitting both prefixes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75646 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 18:17:16 +00:00
Torok Edwin
c23197a26f llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75640 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 16:55:14 +00:00
Daniel Dunbar
1f316e321a Revert r7561{9,8,7,6}, which depend on r75610.
--- Reverse-merging r75619 into '.':
U    lib/Target/DarwinTargetAsmInfo.cpp
U    lib/CodeGen/AsmPrinter/AsmPrinter.cpp
--- Reverse-merging r75618 into '.':
U    lib/CodeGen/ELFWriter.cpp
U    lib/CodeGen/MachOCodeEmitter.cpp
U    lib/CodeGen/MachOWriter.cpp
--- Reverse-merging r75617 into '.':
U    lib/Target/CBackend/CBackend.cpp
--- Reverse-merging r75616 into '.':
U    tools/bugpoint/Miscompilation.cpp
U    tools/lto/LTOCodeGenerator.cpp
U    tools/lto/LTOModule.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75638 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 16:25:11 +00:00
Chris Lattner
5dc72d2c9f rename getValueName -> getMangledName. These two files have very
dubious looking things that I need to investigate in more detail.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75619 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 06:21:12 +00:00
Chris Lattner
1cda87c3a0 Change the internal interface to makeNameProper to take a bool that
indicates whether the label is private or not, instead of taking
prefix stuff.  One effect of this is that symbols will be generated
with *just* the private prefix, instead of both the private prefix
*and* the user-label-prefix, but this doesn't matter as long as it
is consistent.  For example we'll now get "Lfoo" instead of "L_foo".
These are just assembler temporary labels anyway, so they never even
make it into the .o file.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75607 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 04:50:12 +00:00
Devang Patel
1a8d2d2d4f Do not use Mangler to remove '1' from linkage name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75574 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 00:55:28 +00:00
Devang Patel
d84b41615e Use assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75540 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 22:46:19 +00:00
Devang Patel
87370b8301 Use AsmPrinter's Mangler to remove leading '1' from linkage names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75515 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 21:48:26 +00:00
Devang Patel
43da8fbe52 revert rev. 75503 for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75507 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 21:26:33 +00:00
Devang Patel
7597a6252b Use Mangler to remove leading '1' from linkage names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75503 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 21:19:56 +00:00
David Greene
014700c1a8 Add infrastructure to allow post instruction printing action triggers.
We'll eventually use this to print comments in asm files and do other
fun things.

This adds interfaces to the AsmPrinter and changes TableGen to invoke
the postInstructionAction when appropriate.  It also add parameters to
TargetAsmInfo to control comment layout.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75490 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 20:25:48 +00:00
Torok Edwin
c25e7581b9 assert(0) -> LLVM_UNREACHABLE.
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75379 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-11 20:10:48 +00:00
Torok Edwin
7d696d8040 Convert more assert(0)+abort() -> LLVM_UNREACHABLE,
and abort()/exit() -> llvm_report_error().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75363 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-11 13:10:19 +00:00
Devang Patel
261cc194d7 Accidently dropped this while removing dead code in previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74953 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 21:55:14 +00:00