summaryrefslogtreecommitdiff
path: root/lib/Target/TargetLoweringObjectFile.cpp
Commit message (Collapse)AuthorAge
...
* Make error statement more personal.Bill Wendling2010-02-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96410 91177308-0d34-0410-b5e6-96231b3b80d8
* Move TLOF implementations to libCodegen to resolve layering violation.Anton Korobeynikov2010-02-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96288 91177308-0d34-0410-b5e6-96231b3b80d8
* Add suffix for stubs, so we won't have name clashes with private symbols.Anton Korobeynikov2010-02-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96286 91177308-0d34-0410-b5e6-96231b3b80d8
* Preliminary patch to improve dwarf EH generation - Hooks to return ↵Anton Korobeynikov2010-02-15
| | | | | | Personality / FDE / LSDA / TType encoding depending on target / options (e.g. code model / relocation model) - MCIzation of Dwarf EH printer to use encoding information - Stub generation for ELF target (needed for indirect references) - Some other small changes here and there git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96285 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify some uses of str(n)cmp with StringRef.Benjamin Kramer2010-01-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94189 91177308-0d34-0410-b5e6-96231b3b80d8
* stop using the .lcomm pseudoop on darwin, instead, directly use theChris Lattner2010-01-19
| | | | | | | | .zerofill directive. Streamerize its generation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93868 91177308-0d34-0410-b5e6-96231b3b80d8
* make TLOF subclassify BSS based on linkage type into private, externalChris Lattner2010-01-19
| | | | | | | and everything else (weak). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93846 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a significant difference between llvm and gcc on ELF systems:Chris Lattner2010-01-19
| | | | | | | | | GCC would put weak zero initialized mutable data in the .bss section, we would put it into a crasy '.gnu.linkonce.b.test,"aw",@nobits' section. Fixing this will allow simplifications next up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93844 91177308-0d34-0410-b5e6-96231b3b80d8
* introduce a section kind for common linkage. Use this to slightlyChris Lattner2010-01-19
| | | | | | | | | | simplify and commonize some of the asmprinter logic for globals. This also avoids printing the MCSection for .zerofill, which broke the llvm-gcc build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93843 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup handling of .zerofill on darwin:Chris Lattner2010-01-19
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93838 91177308-0d34-0410-b5e6-96231b3b80d8
* Get MCSymbol out of the mangling business, and move all the logicChris Lattner2010-01-17
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93690 91177308-0d34-0410-b5e6-96231b3b80d8
* move the mangler into libtarget from vmcore.Chris Lattner2010-01-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93664 91177308-0d34-0410-b5e6-96231b3b80d8
* fix build failure.Chris Lattner2010-01-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93628 91177308-0d34-0410-b5e6-96231b3b80d8
* remove a couple of actively incorrect uses of getMangledName.Chris Lattner2010-01-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93627 91177308-0d34-0410-b5e6-96231b3b80d8
* fix ELF section mangling stuff for weak symbols to not useChris Lattner2010-01-13
| | | | | | | obsolete Mangler interfaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93356 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the GV version of getNameWithPrefix in TargetLoweringObjectFileCOFF::Chris Lattner2010-01-13
| | | | | | | SelectSectionForGlobal, unbreaking weak globals with no-name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93336 91177308-0d34-0410-b5e6-96231b3b80d8
* add a fixme, ELF MCSection isn't quite right and weak unnamed globals are brokenChris Lattner2010-01-13
| | | | | | | on linux (even though they are pointless, they shouldn't ICE). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93308 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate some uses of Mangler::makeNameProper.Chris Lattner2010-01-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93305 91177308-0d34-0410-b5e6-96231b3b80d8
* change Mangler::makeNameProper to return its result in a SmallVectorChris Lattner2010-01-13
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93298 91177308-0d34-0410-b5e6-96231b3b80d8
* We need to put any kind of data with a relocation into aEric Christopher2010-01-07
| | | | | | | not-readonly segment on darwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92933 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting the EH table patches.Bill Wendling2009-11-19
| | | | | | | | | | | | | | | $ svn merge -c -89279 https://llvm.org/svn/llvm-project/llvm/trunk --- Reverse-merging r89279 into '.': U lib/CodeGen/AsmPrinter/DwarfException.cpp U lib/Target/TargetLoweringObjectFile.cpp $ svn merge -c -89270 https://llvm.org/svn/llvm-project/llvm/trunk --- Reverse-merging r89270 into '.': G lib/CodeGen/AsmPrinter/DwarfException.cpp G lib/Target/TargetLoweringObjectFile.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89379 91177308-0d34-0410-b5e6-96231b3b80d8
* The "ReadOnlyWithRel" enum seems to apply more to what Darwin does with the EHBill Wendling2009-11-19
| | | | | | | exception table than DataRel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89279 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt #2:Bill Wendling2009-11-18
| | | | | | | | Place the EH table in the __TEXT section on MachO. It saves space. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89270 91177308-0d34-0410-b5e6-96231b3b80d8
* add some missing #includesChris Lattner2009-11-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86367 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass StringRef by value.Daniel Dunbar2009-11-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86251 91177308-0d34-0410-b5e6-96231b3b80d8
* --- Reverse-merging r82282 into '.':Bill Wendling2009-09-20
| | | | | | | | | | | | | | | U lib/CodeGen/AsmPrinter/DwarfException.cpp U lib/CodeGen/AsmPrinter/DwarfException.h --- Reverse-merging r82274 into '.': U lib/Target/TargetLoweringObjectFile.cpp G lib/CodeGen/AsmPrinter/DwarfException.cpp These revisions were breaking everything. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82396 91177308-0d34-0410-b5e6-96231b3b80d8
* Still one more thing wrong here...Bill Wendling2009-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82356 91177308-0d34-0410-b5e6-96231b3b80d8
* Here's fun! It turns out that these filter functions can be internal. If they'reBill Wendling2009-09-20
| | | | | | | | | internal, they shouldn't use the indirect pointer stuff. In the case of throw_rethrow_test, it was marked as 'internal' and calculated its own offset to its contents. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82354 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r82274. It's causing failures in the CINT2006 benchmarks.Bill Wendling2009-09-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82336 91177308-0d34-0410-b5e6-96231b3b80d8
* It's inefficient to have place the exception tables (which contain the LSDA)Bill Wendling2009-09-18
| | | | | | | | | | into the __DATA section. At launch time, dyld has to update most of the section to fix up the type info pointers. It's better to place it into the __TEXT section and use pc-rel indirect pointer encodings. Similar to the personality routine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82274 91177308-0d34-0410-b5e6-96231b3b80d8
* pass machinemoduleinfo down into getSymbolForDwarfGlobalReference, Chris Lattner2009-09-17
| | | | | | | currently unused. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82157 91177308-0d34-0410-b5e6-96231b3b80d8
* Big change #1 for personality function references:Chris Lattner2009-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | Eliminate the PersonalityPrefix/Suffix & NeedsIndirectEncoding fields from MAI: they aren't part of the asm syntax, they are related to the structure of the object file. To replace their functionality, add a new TLOF::getSymbolForDwarfGlobalReference method which asks targets to decide how to reference a global from EH in a pc-relative way. The default implementation just returns the symbol. The default darwin implementation references the symbol through an indirect $non_lazy_ptr stub. The bizarro x86-64 darwin specialization handles the weird "foo@GOTPCREL+4" hack. DwarfException.cpp now uses this to emit the reference to the symbol in the right way, and this also eliminates another horrible hack from DwarfException.cpp: - if (strcmp(MAI->getPersonalitySuffix(), "+4@GOTPCREL")) - O << "-" << MAI->getPCSymbol(); git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81991 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide proper section flags for various BSS flavoursAnton Korobeynikov2009-09-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81322 91177308-0d34-0410-b5e6-96231b3b80d8
* Whitespace cleanupAnton Korobeynikov2009-09-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81321 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify.Daniel Dunbar2009-08-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80176 91177308-0d34-0410-b5e6-96231b3b80d8
* fix COFF targets (mingw/cygwin) to provide ehframe and LSDA sectionsChris Lattner2009-08-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79346 91177308-0d34-0410-b5e6-96231b3b80d8
* Text sections should have 'exec' flag set. This seems to unbreak libstdc++ ↵Anton Korobeynikov2009-08-18
| | | | | | | | on linux. Patch by Dmitry Gorbachev! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79334 91177308-0d34-0410-b5e6-96231b3b80d8
* Clear the uniquing table when initializing TLOF to avoid a crash when the ↵Benjamin Kramer2009-08-17
| | | | | | TLOF is reinitialized with a different MCContext. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79253 91177308-0d34-0410-b5e6-96231b3b80d8
* Update getSectionForConstant() to to allow mergable sections to be nulled outRichard Osborne2009-08-17
| | | | | | | if not supported by the ELF subtarget. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79249 91177308-0d34-0410-b5e6-96231b3b80d8
* the .eh_frame sections we generate need to be writable (whichChris Lattner2009-08-15
| | | | | | | | is why they are datarel). This should fix PR4724, and is fallout from r78890. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79111 91177308-0d34-0410-b5e6-96231b3b80d8
* If ELF subtargets don't want to support 4/8/16-byte mergable sections, allow Chris Lattner2009-08-15
| | | | | | | them to null out the default section pointers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79078 91177308-0d34-0410-b5e6-96231b3b80d8
* Make these matching rules more strict so that they don'tDan Gohman2009-08-14
| | | | | | | accidentally match unrelated things. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78966 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove HasCrazyBSS and add a flag in TAI to indicate that '.section' Bruno Cardoso Lopes2009-08-13
| | | | | | | must be emitted for PowerPC-Linux '.bss' section git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78958 91177308-0d34-0410-b5e6-96231b3b80d8
* Change MCSectionELF to represent a section semantically instead ofBruno Cardoso Lopes2009-08-13
| | | | | | | | syntactically as a string, very similiar to what Chris did with MachO. The parsing support and validation is not introduced yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78890 91177308-0d34-0410-b5e6-96231b3b80d8
* sink uniquing of sections out of MCContext into the ELF and PECOFF TLOF ↵Chris Lattner2009-08-13
| | | | | | | | | implementations. MCContext no longer maintains a string -> section map. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78874 91177308-0d34-0410-b5e6-96231b3b80d8
* add some comments: MCContext owns the MCSections, but it bump pointer allocatesChris Lattner2009-08-13
| | | | | | | them, so it doesn't have to explicitly free them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78870 91177308-0d34-0410-b5e6-96231b3b80d8
* reject invalid code like:Chris Lattner2009-08-13
| | | | | | | | | | int x __attribute__((section("_foo, _bar"))) = 4; int y __attribute__((section("_foo, _bar, 4byte_literals"))) = 1; git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78867 91177308-0d34-0410-b5e6-96231b3b80d8
* implement support for uniquing MachO sections.Chris Lattner2009-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78866 91177308-0d34-0410-b5e6-96231b3b80d8
* reduce #includageChris Lattner2009-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78860 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy #includes.Dan Gohman2009-08-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78677 91177308-0d34-0410-b5e6-96231b3b80d8