summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
Commit message (Collapse)AuthorAgeFilesLines
...
* Try a third time to fix MSVC build after r234290Duncan P. N. Exon Smith2015-04-071-3/+3
| | | | | | | | I have no idea what MSVC means with its error text here :(. http://lab.llvm.org:8011/builders/sanitizer-windows/builds/2310 llvm-svn: 234295
* Try again to fix MSVC build after r234290Duncan P. N. Exon Smith2015-04-071-3/+3
| | | | | | | | Still failing: http://lab.llvm.org:8011/builders/sanitizer-windows/builds/2309 llvm-svn: 234294
* Try to fix MSVC build after r234290Duncan P. N. Exon Smith2015-04-071-2/+2
| | | | | | http://lab.llvm.org:8011/builders/sanitizer-windows/builds/2308 llvm-svn: 234292
* DebugInfo: Remove DITypedArray<>, replace with typedefsDuncan P. N. Exon Smith2015-04-075-61/+47
| | | | | | | | | | | | | | | | | Replace all uses of `DITypedArray<>` with `MDTupleTypedArrayWrapper<>` and `MDTypeRefArray`. The APIs are completely different, but the provided functionality is the same: treat an `MDTuple` as if it's an array of a particular element type. To simplify this patch a bit, I've temporarily typedef'ed `DebugNodeArray` to `DIArray` and `MDTypeRefArray` to `DITypeArray`. I've also temporarily conditionalized the accessors to check for null -- eventually these should be changed to asserts and the callers should check for null themselves. There's a tiny accompanying patch to clang. llvm-svn: 234290
* DebugInfo: Remove special iterators from DIExpressionDuncan P. N. Exon Smith2015-04-074-18/+20
| | | | | | | | | | Remove special iterators from `DIExpression` in favour of same in `MDExpression`. There should be no functionality change here. Note that the APIs are slightly different: `getArg(unsigned)` counts from 0, not 1, in the `MDExpression` version of the iterator. llvm-svn: 234285
* CodeGen: Stop using DIDescriptor::is*() and auto-castingDuncan P. N. Exon Smith2015-04-067-126/+113
| | | | | | Same as r234255, but for lib/CodeGen and lib/Target. llvm-svn: 234258
* DebugInfo: Remove DIDescriptor::Verify()Duncan P. N. Exon Smith2015-04-065-11/+6
| | | | | | | | | | | | Remove `DIDescriptor::Verify()` and the `Verify()`s from subclasses. They had already been gutted, and just did an `isa<>` check. In a couple of cases I've temporarily dropped the check entirely, but subsequent commits are going to disallow conversions to the `DIDescriptor`s directly from `MDNode`, so the checks will come back in another form soon enough. llvm-svn: 234201
* [WinEH] Fill out CatchHigh in the TryBlockMapDavid Majnemer2015-04-031-2/+7
| | | | | | Now all fields in the WinEH xdata have been filled out. llvm-svn: 234067
* [WinEH] Fill out .xdata for catch objectsDavid Majnemer2015-04-031-1/+8
| | | | | | | This add support for catching an exception such that an exception object available to the catch handler will be initialized by the runtime. llvm-svn: 234062
* CodeGen: Assert that inlined-at locations agreeDuncan P. N. Exon Smith2015-04-032-0/+4
| | | | | | | | | | | | | | | | | As a follow-up to r234021, assert that a debug info intrinsic variable's `MDLocalVariable::getInlinedAt()` always matches the `MDLocation::getInlinedAt()` of its `!dbg` attachment. The goal here is to get rid of `MDLocalVariable::getInlinedAt()` entirely (PR22778), but I'll let these assertions bake for a while first. If you have an out-of-tree backend that just broke, you're probably attaching the wrong `DebugLoc` to a `DBG_VALUE` instruction. The one you want is the location that was attached to the corresponding `@llvm.dbg.declare` or `@llvm.dbg.value` call that you started with. llvm-svn: 234038
* [WinEH] Generate .xdata for catch handlersDavid Majnemer2015-03-311-4/+30
| | | | | | | | | | | | | | This lets us catch exceptions in simple cases. N.B. Things that do not work include (but are not limited to): - Throwing from within a catch handler. - Catching an object with a named catch parameter. - 'CatchHigh' is fictitious, we aren't sure of its purpose. - We aren't entirely efficient with regards to the number of EH states that we generate. - IP-to-State tables are sensitive to the order of emission. llvm-svn: 233767
* LexicalScopes: Use debug info hierarchy pervasivelyDuncan P. N. Exon Smith2015-03-301-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | Pervasively use the types provided by the debug info hierarchy rather than `MDNode` in `LexicalScopes`. I noticed (again, I guess, based on comments in the implementation?) that `DILexicalBlockFile::getScope()` returns something different from `DILexicalBlockFile::getContext()`. I created a local helper for getting the same logic from `MDLexicalBlockFile` called `getScopeOfScope()`. I still don't really understand it, but I've added some FIXMEs and I'll come back to it (I suspect the way we encode these objects isn't really ideal). Note that my previous commit r233610 accidentally changed behaviour in `findLexicalScope()` -- it transitioned from a call to `DILexicalBlockFile::getScope()` to `MDLexicalBlockFile::getScope()` (sounds right, doesn't it?) -- so I've fixed that as a drive-by. No tests failed with my error, so it looks like we're missing some coverage here... when I come back to understand the logic, I'll see if I can add some. Other than the fix to `findLexicalScope()`, no functionality change. llvm-svn: 233640
* [WinEH] Run cleanup handlers when an exception is thrownDavid Majnemer2015-03-304-15/+236
| | | | | | | | Generate tables in the .xdata section representing what actions to take when an exception is thrown. This currently fills in state for cleanups, catch handlers are still unfinished. llvm-svn: 233636
* DwarfDebug: Avoid creating new DebugLocs in the backendDuncan P. N. Exon Smith2015-03-301-5/+3
| | | | | | | Don't use `DebugLoc::getFnDebugLoc()`, which creates new `MDLocation`s, in the backend. We just want to grab the subprogram here anyway. llvm-svn: 233601
* CodeGen: Use the new DebugLoc API, NFCDuncan P. N. Exon Smith2015-03-302-16/+12
| | | | | | Update lib/CodeGen (and lib/Target) to use the new `DebugLoc` API. llvm-svn: 233582
* Remove superfluous .str() and replace std::string concatenation with Twine.Yaron Keren2015-03-272-2/+2
| | | | llvm-svn: 233392
* [AsmPrinter] Don't assert on GOT equivalent non-constant users.Ahmed Bougacha2015-03-271-1/+1
| | | | | | | We used to dyn_cast<Constant> in the recursive call, but cast<> in the initial one, and there can be non-Constant initial users. llvm-svn: 233346
* Refactor how passes get a symbol at the end of a section.Rafael Espindola2015-03-231-9/+2
| | | | | | | | | | There is now a canonical symbol at the end of a section that different passes can request. This also allows us to assert that we don't switch back to a section whose end symbol has already been printed. llvm-svn: 233026
* Re-sort includes with sort-includes.py and insert raw_ostream.h where it's used.Benjamin Kramer2015-03-232-0/+2
| | | | llvm-svn: 232998
* Purge unused includes throughout libSupport.Benjamin Kramer2015-03-231-0/+1
| | | | | | NFC. llvm-svn: 232976
* Change getISAEncoding to use the target triple to determineEric Christopher2015-03-211-2/+1
| | | | | | | | thumb-ness similar to the rest of the Module level asm printing infrastructure as debug info finalization happens after the function may be missing. llvm-svn: 232875
* AsmPrinter: Check subprogram before using itDuncan P. N. Exon Smith2015-03-201-2/+5
| | | | | | | Check return of `getDISubprogram()` before using it. A WIP patch makes `DIDescriptor` accessors more strict (and would crash on this). llvm-svn: 232838
* DwarfDebug: Check for null DebugLocsDuncan P. N. Exon Smith2015-03-201-13/+15
| | | | | | | | | | `DL` might be null, so check for that before using accessors. A WIP patch to make `DIDescriptors` more strict fails otherwise. As a bonus, I think the logic is easier to follow now (despite the extra nesting depth). llvm-svn: 232836
* At the beginning of doFinalization set the MachineFunction toEric Christopher2015-03-201-0/+5
| | | | | | | | nullptr so that users get an earlier dereferencing error and so that we can use it to conditionalize access to MachineFunction specific data. llvm-svn: 232820
* Emit the offset directly instead of creating a dummy expression.Rafael Espindola2015-03-171-26/+1
| | | | | | | | We were creating an expression of the form (S+C)-S which is just C. Patch by Frédéric Riss. I just added the testcase. llvm-svn: 232549
* Centralize the handling of unique ids for temporary labels.Rafael Espindola2015-03-176-31/+16
| | | | | | | | | | | | | | | | Before this patch code wanting to create temporary labels for a given entity (function, cu, exception range, etc) had to keep its own counter to have stable symbol names. createTempSymbol would still add a suffix to make sure a new symbol was always returned, but it kept a single counter. Because of that, if we were to use just createTempSymbol("cu_begin"), the label could change from cu_begin42 to cu_begin43 because some other code started using temporary labels. Simplify this by just keeping one counter per prefix and removing the various specialized counters. llvm-svn: 232535
* Remove the error prone GetTempSymbol API.Rafael Espindola2015-03-171-12/+0
| | | | llvm-svn: 232487
* Convert the last 4 users of GetTempSymbol to createTempSymbol.Rafael Espindola2015-03-171-2/+2
| | | | | | Despite using the same name these are unrelated. llvm-svn: 232485
* Make EmitFunctionHeader a private helper.Rafael Espindola2015-03-171-0/+2
| | | | llvm-svn: 232481
* Convert the easy cases of GetTempSymbol to createTempSymbol.Rafael Espindola2015-03-175-6/+6
| | | | | | | In these cases no code was depending on GetTempSymbol finding an existing symbol. llvm-svn: 232478
* Don't duplicate comment from the .h. NFC.Rafael Espindola2015-03-171-4/+0
| | | | llvm-svn: 232476
* Move the EH symbol to the asm printer and use it for the SJLJ case too.Rafael Espindola2015-03-176-31/+11
| | | | llvm-svn: 232475
* Remove dead code. NFC.Rafael Espindola2015-03-172-28/+0
| | | | llvm-svn: 232472
* Replace a use of GetTempSymbol with createTempSymbol.Rafael Espindola2015-03-175-12/+26
| | | | | | This is cleaner and avoids a crash in a corner case. llvm-svn: 232471
* IR: Take advantage of -verify checks for MDExpressionDuncan P. N. Exon Smith2015-03-162-2/+3
| | | | | | | | | | | | | | | | | | Now that we check `MDExpression` during `-verify` (r232299), make the `DIExpression` wrapper more strict: - remove redundant checks in `DebugInfoVerifier`, - overload `get()` to `cast_or_null<MDExpression>` (superseding `getRaw()`), - stop checking for null in any accessor, and - remove `DIExpression::Verify()` entirely in favour of `MDExpression::isValid()`. There is still some logic in this class, mostly to do with high-level iterators; I'll defer cleaning up those until the rest of the wrappers are similarly strict. llvm-svn: 232412
* [AsmPrinter] Use the per-function subtarget to emit inline asm instructions thatAkira Hatanaka2015-03-162-28/+15
| | | | | | | | | | are not at the file level. Previously, the default subtarget created from the target triple was used to emit inline asm instructions. Compilation would fail in cases where the feature bits necessary to assemble an inline asm instruction in a function weren't set. llvm-svn: 232392
* Use the cached subtarget off of the machine function.Eric Christopher2015-03-131-6/+6
| | | | llvm-svn: 232128
* [NVPTXAsmPrinter] do not print .align on function headersJingyue Wu2015-03-121-1/+2
| | | | | | | | | | | | | | | | | | | Summary: PTX does not allow .align directives on function headers. Fixes PR21551. Test Plan: test/Codegen/NVPTX/function-align.ll Reviewers: eliben, jholewinski Reviewed By: eliben, jholewinski Subscribers: llvm-commits, eliben, jpienaar, jholewinski Differential Revision: http://reviews.llvm.org/D8274 llvm-svn: 232004
* Print section start labels when first switching to the section.Rafael Espindola2015-03-112-45/+5
| | | | | | | This is less brittle and avoids polluting the start of the file with every debug section. llvm-svn: 231898
* Emit correct linkage-name attribute based on DWARF version.Paul Robinson2015-03-103-13/+15
| | | | | | | | | | There are still 4 tests that check for DW_AT_MIPS_linkage_name, because they specify DWARF 2 or 3 in the module metadata. So, I didn't create an explicit version-based test for the attribute. Differential Revision: http://reviews.llvm.org/D8227 llvm-svn: 231880
* Create symbols marking the start of a section earlier.Rafael Espindola2015-03-102-24/+22
| | | | | | | | | This lets us pass the symbol to the constructor and avoid the mutable field. This also opens the way for outputting the symbol only when needed, instead of outputting them at the start of the file. llvm-svn: 231859
* [AsmPrinter][TLOF] Reintroduce AArch64 testBruno Cardoso Lopes2015-03-101-11/+12
| | | | | | | | | | | | Follow up from r231505. Fix the non-determinism by using a MapVector and reintroduce the AArch64 testcase. Defer deleting the got candidates up to the end and remove them in a bulk, avoiding linear time removal of each element. Thanks to Renato Golin for trying it out on other platforms. llvm-svn: 231830
* Change the datatype of DwarfExpression::Emit(Un)Signed to (u)int64_tAdrian Prantl2015-03-103-10/+10
| | | | | | so it matches the one used by ByteStreamer::Emit(U|S)LEB128. llvm-svn: 231823
* Store an optional section start label in MCSection.Rafael Espindola2015-03-1012-137/+92
| | | | | | | | | | | | This makes code that uses section relative expressions (debug info) simpler and less brittle. This is still a bit awkward as the symbol is created late and has to be stored in a mutable field. I will move the symbol creation earlier in the next patch. llvm-svn: 231802
* Remove effectively dead code.Rafael Espindola2015-03-102-17/+1
| | | | | | | Switching back and forth between sections does nothing (other than producing larger .s files). llvm-svn: 231790
* Move variable into assert to fix -Asserts builds.Rafael Espindola2015-03-101-4/+2
| | | | llvm-svn: 231753
* Remove incredibly confusing isBaseAddressKnownZero.Rafael Espindola2015-03-101-3/+2
| | | | | | | | | | | | | | | When referring to a symbol in a dwarf section on ELF we should use .long foo instead of .long foo - .debug_something because ELF is unaware of the content of the sections and therefore needs relocations. This has nothing to do with optimizing a -0. llvm-svn: 231751
* Use a better name for compile unit labels.Rafael Espindola2015-03-101-2/+1
| | | | | | | | | | | | | They mark the start of a compile unit, so name them .Lcu_*. Using Section->getLabelBeginName() makes it looks like they mark the start of the section. While at it, switch to createTempSymbol to avoid collisions with labels created in inline assembly. Not sure if a "don't crash" test is worth it. With this getLabelBeginName is dead, delete it. llvm-svn: 231750
* DwarfAccelTable: remove unneeded bucket terminators.Frederic Riss2015-03-101-2/+3
| | | | | | | | | | | Last commit fixed the handling of hash collisions, but it introdcuced unneeded bucket terminators in some places. The generated table was correct, it can just be a tiny bit smaller. As the previous table was correct, the test doesn't need updating. If we really wanted to test this, I could add the section size to the dwarf dump and test for a precise value there. IMO the correctness test is sufficient. llvm-svn: 231748
* Move label creation close to emission. NFC.Rafael Espindola2015-03-104-12/+10
| | | | llvm-svn: 231744
OpenPOWER on IntegriCloud