summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
* Remove the UseCFI option from createAsmStreamer.Rafael Espindola2014-05-071-5/+4
| | | | | | We were already always passing true, this just removes the option. llvm-svn: 208205
* Allow using normal .eh_frame based unwinding on ARM. Use the sameJoerg Sonnenberger2014-05-071-0/+4
| | | | | | encodings as x86. Use this exception model for NetBSD. llvm-svn: 208166
* Use a range based for loop for the SubtargetFeatures print function.Eric Christopher2014-05-061-2/+2
| | | | llvm-svn: 208132
* Fix odd formatting that snuck into last patch.Eric Christopher2014-05-061-3/+3
| | | | llvm-svn: 208130
* ArrayRef-ize the Feature and Processor tables for SubtargetFeatures.Eric Christopher2014-05-062-71/+52
| | | | | | | | This removes arguments passed everywhere and allows the use of standard iteration over lists. Should be no functional change. llvm-svn: 208127
* Have the SubtargetFeature help routine just not return a number andEric Christopher2014-05-061-6/+4
| | | | | | | | fall back to the normal path without a cpu. While doing this fix llc to just exit when we don't have a module to process instead of asserting. llvm-svn: 208102
* Revert "Walk back commits for unused function parameters - they're still being"Eric Christopher2014-05-061-19/+5
| | | | | | this reapplies 208012 and 208002. llvm-svn: 208037
* Walk back commits for unused function parameters - they're still beingEric Christopher2014-05-051-5/+19
| | | | | | used via dragonegg for now. llvm-svn: 208016
* Remove a now unnecessary function since all calls have one versionEric Christopher2014-05-051-17/+4
| | | | | | and inline it into its caller. llvm-svn: 208012
* Remove a call to std::exit in a library. Make "Help" returnEric Christopher2014-05-051-5/+7
| | | | | | a 0 as a default answer. llvm-svn: 208009
* Remove unused argument from AddFeature.Eric Christopher2014-05-051-3/+2
| | | | llvm-svn: 208002
* Fix pr19645.Rafael Espindola2014-05-035-47/+40
| | | | | | | | | | | | | | | | The fix itself is fairly simple: move getAccessVariant to MCValue so that we replace the old weak expression evaluation with the far more general EvaluateAsRelocatable. This then requires that EvaluateAsRelocatable stop when it finds a non trivial reference kind. And that in turn requires the ELF writer to look harder for weak references. Last but not least, this found a case where we were being bug by bug compatible with gas and accepting an invalid input. I reported pr19647 to track it. llvm-svn: 207920
* MC: place .file records into the correct sectionSaleem Abdulrasool2014-05-021-0/+1
| | | | | | | | | .file records are supposed to have a section identifier of 65534 (IMAGE_SCN_DEBUG) rather than 0. This is spelt out clearly within the PE/COFF specification. Fix this minor oversight with the implementation for support for .file records. llvm-svn: 207851
* Fix uninitialized variable introduced in r207739.David Blaikie2014-05-011-1/+1
| | | | | | | | | | This was initialized by llvm-mc (calling setDwarfVersion) but other clients (such as clang, llc, etc) aren't necessarily initializing this so we were getting garbage DWARF version values in the output. Initialize it to a reasonable default (the same default used in llvm-mc, though this is higher than it was (2) previously). llvm-svn: 207788
* Don't propagate StorageClass and ComplexType to aliases.Rafael Espindola2014-05-011-2/+1
| | | | | | | | | This matches gas' behaviour on COFF. I think that this yak is now sufficiently shaved for aliases with offset to work. llvm-svn: 207786
* Compute the correct section for zed = foo + 1 in COFF.Rafael Espindola2014-05-011-10/+9
| | | | | | | | | This fixes pr19147. There are a few more related issues to fix, but the testcase in the bug now passes. llvm-svn: 207763
* Move getBaseSymbol somewhere the COFF writer can use.Rafael Espindola2014-05-012-26/+25
| | | | | | I will use it there in a second. llvm-svn: 207761
* Make getBaseSymbol non recursive.Rafael Espindola2014-05-011-3/+5
| | | | llvm-svn: 207759
* Record the DWARF version in MCContextOliver Stannard2014-05-011-2/+2
| | | | | | | Record the DWARF version in MCContext, and use it when emitting the dwarf version into the debug info. llvm-svn: 207739
* Start fixing pr19147.Rafael Espindola2014-05-011-10/+13
| | | | | | | This makes the coff writer compute the correct symbol value for the test in pr19147. The section is still incorrect, that will be fixed in a followup patch. llvm-svn: 207728
* Add missing breaks.Joerg Sonnenberger2014-04-301-0/+3
| | | | llvm-svn: 207723
* Switch over getArch()'s result.Joerg Sonnenberger2014-04-301-15/+28
| | | | llvm-svn: 207721
* Provide a version of getSymbolOffset that returns false on error.Rafael Espindola2014-04-302-38/+49
| | | | | | | This simplifies ELFObjectWriter::SymbolValue a bit more. This new version will also be used in the COFF writer to fix pr19147. llvm-svn: 207711
* Simplify ELFObjectWriter::SymbolValue.Rafael Espindola2014-04-301-22/+14
| | | | | | It now defers all offset computation to getSymbolOffset. llvm-svn: 207674
* ELFObjectWriter: deduplicate suffices in strtabHans Wennborg2014-04-301-86/+32
| | | | | | | | | | | | | | | We already do this for shstrtab, so might as well do it for strtab. This extracts the string table building code into a separate class. The idea is to use it for other object formats too. I mostly wanted to do this for the general principle, but it does save a little bit on object file size. I tried this on a clang bootstrap and saved 0.54% on the sum of object file sizes (1.14 MB out of 212 MB for a release build). Differential Revision: http://reviews.llvm.org/D3533 llvm-svn: 207670
* Grammar fix.Rafael Espindola2014-04-301-1/+1
| | | | | | Thanks to Saleem Abdulrasool for noticing it. llvm-svn: 207643
* [ARM64] Ensure arm64_be is dealt with when emitting debug info.James Molloy2014-04-301-1/+2
| | | | | | | This is a partial port of r204816 (cpirker "Elf support for MC-JIT runtime dynamic linker") from AArch64 to ARM64. llvm-svn: 207625
* Simplify getSymbolOffset.Rafael Espindola2014-04-301-26/+28
| | | | | | | We can now use EvaluateAsValue to make it non recursive and remove some code duplication. llvm-svn: 207604
* Another missing include for MSVC.Benjamin Kramer2014-04-291-1/+1
| | | | llvm-svn: 207596
* raw_ostream: Forward declare OpenFlags and include FileSystem.h only where ↵Benjamin Kramer2014-04-293-0/+3
| | | | | | necessary. llvm-svn: 207593
* Parse and create GOT_PREL relocations.Joerg Sonnenberger2014-04-291-0/+2
| | | | llvm-svn: 207526
* Centralize the handling of the thumb bit.Rafael Espindola2014-04-294-12/+37
| | | | | | | | | | | | | This patch centralizes the handling of the thumb bit around MCStreamer::isThumbFunc and makes isThumbFunc handle aliases. This fixes a corner case, but the main advantage is having just one way to check if a MCSymbol is thumb or not. This should still be refactored to be ARM only, but at least now it is just one predicate that has to be refactored instead of 3 (isThumbFunc, ELF_Other_ThumbFunc, and SF_ThumbFunc). llvm-svn: 207522
* Add an option for evaluating past symbols.Rafael Espindola2014-04-282-19/+28
| | | | | | | | | | | | | When evaluating an assembly expression for a relocation, we want to stop at MCSymbols that are in the symbol table, even if they are variables. This is needed since the semantics may require that the relocation use them. That is not the case when computing the value of a symbol in the symbol table. There are no relocations in this case and we have to keep going until we hit a section or find out that the expression doesn't have an assembly time value. llvm-svn: 207445
* Simplify ELFObjectWriter::ExecutePostLayoutBinding.Rafael Espindola2014-04-281-3/+6
| | | | | | | No functionality change. This removes the last use of AliasedSymbol in ELFObjectWriter.cpp. llvm-svn: 207424
* Simplify isLocal().Rafael Espindola2014-04-281-11/+6
| | | | | | No functionality change. llvm-svn: 207421
* Don't include an invalid symbol in the symbol table.Rafael Espindola2014-04-281-8/+10
| | | | | | | | | | | | The symbol table itself has no relocations, so it is not possible to represent things like a = undefined + 1 With the patch we just omit these variables. That matches the behaviour of the gnu assembler. llvm-svn: 207419
* Produce an error instead of a crash in an expr we cannot represent.Rafael Espindola2014-04-281-1/+6
| | | | llvm-svn: 207414
* MC: range-loopifySaleem Abdulrasool2014-04-281-62/+49
| | | | | | Use C++11 range-based loops rather than explicit constructors. NFC. llvm-svn: 207393
* Make getOrCreateSymbolData non virtual.Rafael Espindola2014-04-273-13/+0
| | | | llvm-svn: 207367
* Avoid using MCSymbolData on the asm streamer.Rafael Espindola2014-04-271-14/+0
| | | | | | | | Only the object streamers need to track if a symbol should be marked thumb or not. This ports the ELF case. The COFF case is not ported since it is currently not working for some other reason (I will report a bug). llvm-svn: 207366
* MC: restore behaviour of defaulting to ELFSaleem Abdulrasool2014-04-271-4/+3
| | | | | | | This restores the previous behaviour of just assuming that if you dont specify a valid triple that you really meant the default triple with an ELF object file. llvm-svn: 207349
* Add WoA object file emission supportSaleem Abdulrasool2014-04-272-2/+42
| | | | | | | | | | | | | | | | | | | | | | Introduce support for WoA PE/COFF object file emission from LLVM. Add the new target specific PE/COFF Streamer (ARMWinCOFFStreamer) that handles the ARM specific behaviour of PE/COFF object emission. ARM exception information is not yet emitted and is a TODO item. The ARM specific object writer (ARMWinCOFFObjectWriter) handles the ARM specific relocation handling in conjunction with the WinCOFFObjectWriter in the MC layer. The MC layer needs to be updated to deal with the relocation adjustments. Branch relocations are adjusted by 4 bytes (unlikely their ELF counterparts). Minor tweaks to switch multiple conditional checks into equivalent switch statements. The ObjectFileInfo is updated to relax the object file setup for Windows COFF. Move the architecture checks into an assertion. Windows COFF is currently only supported on x86, x86_64, and ARM (thumb). Rather than defaulting to ELF, we will refuse to generate an object file. This is better though as you do not get an (arbitrary) object file which is different from the request. llvm-svn: 207345
* MC: create X86WinCOFFStreamer for target specific behaviourSaleem Abdulrasool2014-04-271-15/+1
| | | | | | | | | | This introduces a target specific streamer, X86WinCOFFStreamer, which handles the target specific behaviour (e.g. WinEH). This is mostly to ensure that differences between ARM and X86 remain disjoint and do not accidentally cross boundaries. This is the final staging change for enabling object emission for Windows on ARM. llvm-svn: 207344
* MC: rename WinCOFFStreamer and move declaration out-of-lineSaleem Abdulrasool2014-04-271-90/+57
| | | | | | | | | This is in preparation for promoting WinCOFFStreamer to a base class which will be shared by the X86 and ARM specific target COFF streamers. Also add a new getOrCreateSymbolData interface (like MCELFStreamer) for the ARM COFF Streamer. This makes the COFFStreamer more similar to the ELFStreamer. llvm-svn: 207343
* MC: style tweaks to WinCOFFStreamerSaleem Abdulrasool2014-04-271-65/+57
| | | | | | | Stylistic changes to prepare for splitting up the COFFStreamer into target specific streamers. Tweak some assertion messages. No functional change. llvm-svn: 207342
* Fix quadratic performance during debug compression due to sections x symbols ↵David Blaikie2014-04-251-12/+21
| | | | | | | | | | | | | | | | iteration. When fixing the symbols in each compressed section we were iterating over all symbols for each compressed section. In extreme cases this could snowball severely (5min uncompressed -> 35min compressed) due to iterating over all symbols for each compressed section (large numbers of compressed sections can be generated by DWARF type units). To address this, build a map of the symbols in each section ahead of time, and access that map if a section is being compressed. This brings compile time for the aforementioned example down to ~6 minutes. llvm-svn: 207167
* Spread some const around for non-mutating uses of MCSymbolData.David Blaikie2014-04-243-5/+5
| | | | | | | | I discovered this const-hole while attempting to coalesnce the Symbol and SymbolMap data structures. There's some pending issues with that, but I figured this change was easy to flush early. llvm-svn: 207124
* Fix memory leak of MCSymbolData in MCAsmStreamer.David Blaikie2014-04-241-8/+10
| | | | | | | | | Leak identified by LSan and reported by Kostya Serebryany. Let's get a bit experimental here... in theory our minimum compiler versions support unordered_map. llvm-svn: 207118
* [C++] Use 'nullptr'.Craig Topper2014-04-249-45/+45
| | | | llvm-svn: 207083
* MC: honour IMAGE_SCN_CNT_INITIALIZED_DATASaleem Abdulrasool2014-04-231-1/+2
| | | | | | | Emit the flag to indicate to the assembler that a section contains data if there is pre-populated data present. llvm-svn: 207028
OpenPOWER on IntegriCloud