summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCAsmStreamer.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Patch by Ray Donnelly.Yaron Keren2014-04-181-4/+11
| | | | | | Emit WIN64 SEH registers by name instead of just number. llvm-svn: 206565
* [C++11] More 'nullptr' conversion or in some cases just using a boolean ↵Craig Topper2014-04-131-9/+9
| | | | | | check instead of comparing to nullptr. llvm-svn: 206129
* DebugInfo: Avoid creating unnecessary/empty line tables and remove the ↵David Blaikie2014-04-011-2/+8
| | | | | | | | | | | | special case of '0' in DwarfCompileUnit::initStmtList by just always using a label difference This moves one case of raw text checking down into the MCStreamer interfaces in the form of a virtual function, even if we ultimately end up consolidating on the one-or-many line tables issue one day, this is nicer in the interim. This just generally streamlines a bunch of use cases into a common code path. llvm-svn: 205287
* DebugInfo: Emit relocation to debug_line section when emitting asm for asmDavid Blaikie2014-04-011-1/+14
| | | | | | | | | | | | | | I don't think this is reachable by any frontend (why would you transform asm to asm+debug info?) but it helps tidy up some of this code, avoid the weird special case of "emit the first CU, store the label, then emit the rest" in MCDwarfLineTable::Emit by instead having the DWARF-for-assembly case use the same codepath as DwarfDebug.cpp, by registering the label of the debug_line section, thus causing it to be emitted. (with a special case in asm output to just emit the label since asm output uses the .loc directives, etc, rather than the debug_loc directly) llvm-svn: 205286
* MachO: Add linker-optimisation hint framework to MC.Tim Northover2014-03-291-0/+22
| | | | | | | | Another part of the ARM64 backend (so tests will be following soon). This is currently used by the linker to relax adrp/ldr pairs into nops where possible, though could well be more broadly applicable. llvm-svn: 205084
* remove a bunch of unused private methodsNuno Lopes2014-03-231-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | found with a smarter version of -Wunused-member-function that I'm playwing with. Appologies in advance if I removed someone's WIP code. include/llvm/CodeGen/MachineSSAUpdater.h | 1 include/llvm/IR/DebugInfo.h | 3 lib/CodeGen/MachineSSAUpdater.cpp | 10 -- lib/CodeGen/PostRASchedulerList.cpp | 1 lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 10 -- lib/IR/DebugInfo.cpp | 12 -- lib/MC/MCAsmStreamer.cpp | 2 lib/Support/YAMLParser.cpp | 39 --------- lib/TableGen/TGParser.cpp | 16 --- lib/TableGen/TGParser.h | 1 lib/Target/AArch64/AArch64TargetTransformInfo.cpp | 9 -- lib/Target/ARM/ARMCodeEmitter.cpp | 12 -- lib/Target/ARM/ARMFastISel.cpp | 84 -------------------- lib/Target/Mips/MipsCodeEmitter.cpp | 11 -- lib/Target/Mips/MipsConstantIslandPass.cpp | 12 -- lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp | 21 ----- lib/Target/NVPTX/NVPTXISelDAGToDAG.h | 2 lib/Target/PowerPC/PPCFastISel.cpp | 1 lib/Transforms/Instrumentation/AddressSanitizer.cpp | 2 lib/Transforms/Instrumentation/BoundsChecking.cpp | 2 lib/Transforms/Instrumentation/MemorySanitizer.cpp | 1 lib/Transforms/Scalar/LoopIdiomRecognize.cpp | 8 - lib/Transforms/Scalar/SCCP.cpp | 1 utils/TableGen/CodeEmitterGen.cpp | 2 24 files changed, 2 insertions(+), 261 deletions(-) llvm-svn: 204560
* ARM IAS: properly handle function entries in .thumbSaleem Abdulrasool2014-03-221-0/+13
| | | | | | | | | | | | | | | | | | | | When a label is parsed, check if there is type information available for the label. If so, check if the symbol is a function. If the symbol is a function and we are in thumb mode and no explicit thumb_func has been emitted, adjust the symbol data to indicate that the function definition is a thumb function. The application of this inferencing is improved value handling in the object file (the required thumb bit is set on symbols which are thumb functions). It also helps improve compatibility with binutils. The one complication that arises from this handling is the MCAsmStreamer. The default implementation of getOrCreateSymbolData in MCStreamer does not support tracking the symbol data. In order to support the semantics of thumb functions, track symbol data in assembly streamer. Although O(n) in number of labels in the TU, this is already done in various other streamers and as such the memory overhead is not a practical concern in this scenario. llvm-svn: 204544
* Mark alias symbols as microMIPS if necessary. Differential Revision: ↵Zoran Jovanovic2014-03-201-2/+1
| | | | | | http://llvm-reviews.chandlerc.com/D3080 llvm-svn: 204323
* Darwin: Add assembler directives to create version-min load commands.Jim Grosbach2014-03-181-0/+14
| | | | | | | | | | | | Allow object files to be tagged with a version-min load command for iOS or MacOSX. Teach macho-dump to understand the version-min load commands for testcases. rdar://11337778 llvm-svn: 204190
* DebugInfo: Use MC line table file entry uniquing for non-asm input as well.David Blaikie2014-03-171-9/+20
| | | | | | | | | | | | | See r204027 for the precursor to this that applied to asm debug info. This required some non-obvious API changes to handle the case of asm output (we never go asm->asm so this didn't come up in r204027): the modification of the file/directory name by MCDwarfLineTableHeader needed to be reflected in the MCAsmStreamer caller so it could print the appropriate .file directive, so those StringRef parameters are now non-const ref (in/out) parameters rather than just const. llvm-svn: 204069
* DebugInfo: Improve reuse of file table entries in asm debug infoDavid Blaikie2014-03-171-4/+7
| | | | | | | | | | | | | | | | | The previous deduping strategy was woefully inadequate - it only considered the most recent file used and avoided emitting a duplicate in that case - never considering the a/b/a scenario. It was also lacking when it came to directory paths as the previous filename would never match the current if the filename had been split into file and directory components. This change builds caching functionality into the line table at the lowest level in an optional form (a file number of 0 indicates that one should be chosen and returned) and will eventually be reused by the normal source level debugging DWARF emission. llvm-svn: 204027
* De-virtualize a method since it doesn't override anything (yay 'override' ↵Craig Topper2014-03-081-1/+1
| | | | | | keyword) and its class is in an anonymous namespace. llvm-svn: 203341
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-081-124/+122
| | | | | | class. llvm-svn: 203340
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-4/+3
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* Always print the implicit .text at the start of an asm file.Rafael Espindola2014-03-051-5/+0
| | | | | | | | | | | | | | | | | Before llvm-mc would print it, but llc was assuming that it would produce another section changing directive before one was needed. That assumption is false with inline asm. Fixes PR19049. Another option would be to always create the section, but in the asm printer avoid printing sections changes during initialization. That would work, but * We do use the fact that llvm-mc prints it in testing. The tests can be changed if needed. * A quick poll on IRC suggest that most developers prefer the implicit .text to be printed. llvm-svn: 203001
* Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper2014-03-021-1/+1
| | | | llvm-svn: 202621
* Fix generation of 'isa' and 'discriminator' keywords.Diego Novillo2014-02-131-2/+2
| | | | | | | | | | | | | | | | | Summary: There should be a space before each of these two keywords to avoid generating invalid assembly files. NOTE: I could not find an obvious maintainers in CODE_OWNERS.TXT, but this seems related to debug info. Reviewers: echristo CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2791 llvm-svn: 201359
* Remove support for not using .loc directives.Rafael Espindola2014-02-051-28/+17
| | | | | | Clang itself was not using this. The only way to access it was via llc. llvm-svn: 200862
* Every target uses .align. Simplify.Rafael Espindola2014-02-041-6/+13
| | | | llvm-svn: 200782
* MC: Improve the .fill directive's compatibility with GASDavid Majnemer2014-02-011-10/+29
| | | | | | | | | Per the GAS documentation, .fill should permit pattern widths that aren't a power of two. While I was in the neighborhood, I added some sanity checking. This change was motivated by a use of this construct in the Linux Kernel. llvm-svn: 200606
* Explictly pass MCSubtargetInfo to MCCodeEmitter::EncodeInstruction()David Woodhouse2014-01-281-4/+5
| | | | llvm-svn: 200348
* Change MCStreamer EmitInstruction interface to take subtarget infoDavid Woodhouse2014-01-281-2/+2
| | | | llvm-svn: 200345
* MC: Add support for .cfi_startproc simpleDavid Majnemer2014-01-271-0/+2
| | | | | | | | | | | | | This commit allows LLVM MC to process .cfi_startproc directives when they are followed by an additional `simple' identifier. This signals to elide the emission of target specific CFI instructions that would normally occur initially. This fixes PR16587. Differential Revision: http://llvm-reviews.chandlerc.com/D2624 llvm-svn: 200227
* Construct the MCStreamer before constructing the MCTargetStreamer.Rafael Espindola2014-01-261-6/+5
| | | | | | | | | | This has a few advantages: * Only targets that use a MCTargetStreamer have to worry about it. * There is never a MCTargetStreamer without a MCStreamer, so we can use a reference. * A MCTargetStreamer can talk to the MCStreamer in its constructor. llvm-svn: 200129
* Simplify the logic for deciding when to initialize the sections.Rafael Espindola2014-01-241-0/+5
| | | | llvm-svn: 199971
* Most streamers' InitSections just create a text section. Make that the defaultRafael Espindola2014-01-241-4/+0
| | | | llvm-svn: 199969
* InitToTextSection is redundant with InitSections. Remove it.Rafael Espindola2014-01-231-4/+0
| | | | llvm-svn: 199955
* Add an emitRawComment function and use it to simplify some uses of EmitRawText.Rafael Espindola2014-01-161-0/+9
| | | | llvm-svn: 199397
* [COFF] Add support for the .secidx directiveTimur Iskhodzhanov2013-12-201-1/+7
| | | | | | Reviewed at http://llvm-reviews.chandlerc.com/D2445 llvm-svn: 197826
* MCStreamer: Reimplement the virtual EmitRawText as a protected member, ↵David Blaikie2013-10-241-2/+2
| | | | | | | | | | EmitRawTextImpl, to avoid string literal ambiguities Also improve the implementation of EmitRawText(Twine) so it doesn't bother using the SmallString buffer if the Twine is a simple StringRef anyway. llvm-svn: 193378
* Move .ident handling to MCStreamer.Rafael Espindola2013-10-161-0/+8
| | | | | | | | No functionality change, but exposes the API so that codegen can use it too. Patch by Katya Romanova. llvm-svn: 192757
* Add a MCTargetStreamer interface.Rafael Espindola2013-10-081-123/+16
| | | | | | | | | | | | | This patch fixes an old FIXME by creating a MCTargetStreamer interface and moving the target specific functions for ARM, Mips and PPC to it. The ARM streamer is still declared in a common place because it is used from lib/CodeGen/ARMException.cpp, but the Mips and PPC are completely hidden in the corresponding Target directories. I will send an email to llvmdev with instructions on how to use this. llvm-svn: 192181
* Remove some really nasty uses of hasRawTextSupport.Rafael Espindola2013-10-051-7/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When MC was first added, targets could use hasRawTextSupport to keep features working before they were added to the MC interface. The design goal of MC is to provide an uniform api for printing assembly and object files. Short of relaxations and other corner cases, a object file is just another representation of the assembly. It was never the intention that targets would keep doing things like if (hasRawTextSupport()) Set flags in one way. else Set flags in another way. When they do that they create two code paths and the object file is no longer just another representation of the assembly. This also then requires testing with llc -filetype=obj, which is extremelly brittle. This patch removes some of these hacks by replacing them with smaller ones. The ARM flag setting is trivial, so I just moved it to the constructor. For Mips, the patch adds two temporary hack directives that allow the assembly to represent the same things as the object file was already able to. The hope is that the mips developers will replace the hack directives with the same ones that gas uses and drop the -print-hack-directives flag. I will also try to implement a target streamer interface, so that we can move this out of the common code. In summary, for any new work, two rules of the thumb are * Don't use "llc -filetype=obj" in tests. * Don't add calls to hasRawTextSupport. llvm-svn: 192035
* Implements parsing and emitting of .cfi_window_save in MC.Venkatraman Govindaraju2013-09-261-0/+11
| | | | llvm-svn: 191431
* Fixed debug_aranges handling for common symbols.Richard Mitton2013-09-231-4/+4
| | | | | | | | | | The size of common symbols is now tracked correctly, so they can be listed in the arange section without needing knowledge of other following symbols. .comm (and .lcomm) do not indicate to the system assembler any particular section to use, so we have to treat them as having no section. Test case update to account for this. llvm-svn: 191210
* Added support for generate DWARF .debug_aranges sections automatically.Richard Mitton2013-09-191-0/+11
| | | | llvm-svn: 191052
* Remove extraneous space, the asm printing infrastructure adds a spaceEric Christopher2013-09-191-1/+0
| | | | | | in normally. llvm-svn: 191026
* Call generateCompactUnwindEncodings() right before we need to output the ↵Bill Wendling2013-09-091-1/+2
| | | | | | | | | | | | | frame information. There are more than one paths to where the frame information is emitted. Place the call to generateCompactUnwindEncodings() into the method which outputs the frame information, thus ensuring that the encoding is there for every path. This involved threading the MCAsmBackend object through to this method. <rdar://problem/13623355> llvm-svn: 190335
* [CodeGen] prevent abnormal on invalid attributesSaleem Abdulrasool2013-08-091-5/+8
| | | | | | | | | | | Currently, when an invalid attribute is encountered on processing a .s file, clang will abort due to llvm_unreachable. Invalid user input should not cause an abnormal termination of the compiler. Change the interface to return a boolean to indicate the failure as a first step towards improving hanlding of malformed user input to clang. Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org> llvm-svn: 188047
* Remove address spaces from MC.Rafael Espindola2013-07-021-33/+26
| | | | | | | | This is dead code since PIC16 was removed in 2010. The result was an odd mix, where some parts would carefully pass it along and others would assert it was zero (most of the object streamer for example). llvm-svn: 185436
* Use pointers to the MCAsmInfo and MCRegInfo.Bill Wendling2013-06-181-48/+46
| | | | | | | | | Someone may want to do something crazy, like replace these objects if they change or something. No functionality change intended. llvm-svn: 184175
* Move PathV2.h to Path.hRafael Espindola2013-06-111-1/+1
| | | | | | | Most clients have already been moved from Path V1 to V2. The ones using V1 now include PathV1.h explicitly. llvm-svn: 183801
* Add support for subsections to the ELF assembler. Fixes PR8717.Peter Collingbourne2013-04-171-6/+11
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D598 llvm-svn: 179725
* Use object file specific section type for initial text sectionNico Rieck2013-04-141-6/+1
| | | | llvm-svn: 179494
* Debug Info: store the files and directories for each compile unit.Manman Ren2013-03-071-5/+8
| | | | | | | | | | | | | | We now emit a line table for each compile unit. To reduce the prologue size of each line table, the files and directories used by each compile unit are stored in std::map<unsigned, std::vector< > > instead of std::vector< >. The prologue for a lto'ed image can be as big as 93K. Duplicating 93K for each compile unit causes a huge increase of debug info. With this patch, each prologue will only emit the files required by the compile unit. rdar://problem/13342023 llvm-svn: 176605
* Fix another typo in the classof definitions that doesn't (currently)Chandler Carruth2013-02-011-1/+1
| | | | | | have any effect. Spotted by Eli in review, thanks!!! llvm-svn: 174121
* Give the MCStreamer class hierarchy LLVM RTTI facilities for use withChandler Carruth2013-01-311-1/+5
| | | | | | | | | | | | | | | | isa<> and dyn_cast<>. In several places, code is already hacking around the absence of this, and there seem to be several interfaces that might be lifted and/or devirtualized using this. This change was based on a discussion with Jim Grosbach about how best to handle testing for specific MCStreamer subclasses. He said that this was the correct end state, and everything else was too hacky so I decided to just make it so. No functionality should be changed here, this is just threading the kind through all the constructors and setting up the classof overloads. llvm-svn: 174113
* [MC/Mach-O] Implement integrated assembler support for linker options.Daniel Dunbar2013-01-181-0/+1
| | | | | | - Also, fixup syntax errors in LangRef and missing newline in the MCAsmStreamer. llvm-svn: 172837
* [MC/Mach-O] Add AsmParser support for .linker_option directive.Daniel Dunbar2013-01-181-0/+10
| | | | llvm-svn: 172778
* Expose an InitToTextSection through MCStreamer.Eli Bendersky2013-01-141-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The aim of this patch is to fix the following piece of code in the platform-independent AsmParser: void AsmParser::CheckForValidSection() { if (!ParsingInlineAsm && !getStreamer().getCurrentSection()) { TokError("expected section directive before assembly directive"); Out.SwitchSection(Ctx.getMachOSection( "__TEXT", "__text", MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS, 0, SectionKind::getText())); } } This was added for the "-n" option of llvm-mc. The proposed fix adds another virtual method to MCStreamer, called InitToTextSection. Conceptually, it's similar to the existing InitSections which initializes all common sections and switches to text. The new method is implemented by each platform streamer in a way that it sees fit. So AsmParser can now do this: void AsmParser::CheckForValidSection() { if (!ParsingInlineAsm && !getStreamer().getCurrentSection()) { TokError("expected section directive before assembly directive"); Out.InitToTextSection(); } } Which is much more reasonable. llvm-svn: 172450
OpenPOWER on IntegriCloud