summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
Commit message (Collapse)AuthorAgeFilesLines
* Move emitInlineAsmEnd to the AsmPrinter interface.Rafael Espindola2014-01-241-3/+5
| | | | | | | | There is no inline asm in a .s file. Therefore, there should be no logic to handle it in the streamer. Inline asm only exists in bitcode files, so the logic can live in the (long misnamed) AsmPrinter class. llvm-svn: 200011
* Revert "Use DW_AT_high_pc and DW_AT_low_pc for the high and low pc for a"Eric Christopher2014-01-244-41/+14
| | | | | | | | in order to fix the cygwin/mingw bots. This reverts commit r199990. llvm-svn: 199991
* Use DW_AT_high_pc and DW_AT_low_pc for the high and low pc for aEric Christopher2014-01-244-14/+41
| | | | | | | | compile unit. Make these relocations on the platforms that need relocations and add a routine to ensure that we don't put the addresses in an offset table for split dwarf. llvm-svn: 199990
* Simplify the logic for deciding when to initialize the sections.Rafael Espindola2014-01-241-1/+1
| | | | llvm-svn: 199971
* Make the use of DW_AT_ranges in the compile unit depend also uponEric Christopher2014-01-231-5/+8
| | | | | | the existence of comdat/special sections. llvm-svn: 199954
* Avoid emitting a DWARF type attribute for an ObjC property of typeEric Christopher2014-01-231-1/+2
| | | | | | | | void. Patch by Scott Talbot. llvm-svn: 199924
* Fix inline assembly that switches between ARM and Thumb modesGreg Fitzgerald2014-01-221-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch restores the ARM mode if the user's inline assembly does not. In the object streamer, it ensures that instructions following the inline assembly are encoded correctly and that correct mapping symbols are emitted. For the asm streamer, it emits a .arm or .thumb directive. This patch does not ensure that the inline assembly contains the ADR instruction to switch modes at runtime. The problem we need to solve is code like this: int foo(int a, int b) { int r = a + b; asm volatile( ".align 2 \n" ".arm \n" "add r0,r0,r0 \n" : : "r"(r)); return r+1; } If we compile this function in thumb mode then the inline assembly will switch to arm mode. We need to make sure that we switch back to thumb mode after emitting the inline assembly or we will incorrectly encode the instructions that follow (i.e. the assembly instructions for return r+1). Based on patch by David Peixotto Change-Id: Ib57f6d2d78a22afad5de8693fba6230ff56ba48b llvm-svn: 199818
* Fix a DenseMap iterator invalidation bug causing lots of crashes whenChandler Carruth2014-01-201-31/+35
| | | | | | | | | | | | | | | | | | | type units were enabled. The crux of the issue is that the addDwarfTypeUnitType routine can end up being indirectly recursive. In this case, the reference into the dense map (TU) became invalid by the time we popped all the way back and used it to add the DIE type signature. Instead, use early return in the case where we can bypass the recursive step and creating a type unit. Then use the pointer to the new type unit to set up the DIE type signature in the case where we have to. I tried really hard to reduce a testcase for this, but it's really annoying. You have to get this to be mid-recursion when the densemap grows. Even if we got a test case for this today, it'd be very unlikely to continue exercising this pattern. llvm-svn: 199630
* Debug info (LTO): Move the creation of accessibility flags toAdrian Prantl2014-01-181-15/+16
| | | | | | | | | getOrCreateSubprogramDIE to avoid attributes being added twice when DIEs are merged. rdar://problem/15842330. llvm-svn: 199536
* Add an emitRawComment function and use it to simplify some uses of EmitRawText.Rafael Espindola2014-01-162-20/+10
| | | | llvm-svn: 199397
* Use a slightly smaller hack.Rafael Espindola2014-01-161-2/+1
| | | | llvm-svn: 199363
* WinCOFF: Transform IR expressions featuring __ImageBase into image relative ↵David Majnemer2014-01-151-0/+4
| | | | | | | | | | | | | relocations MSVC on x64 requires that we create image relative symbol references to refer to RTTI data. Seeing as how there is no way to explicitly make reference to a given relocation type in LLVM IR, pattern match expressions of the form &foo - &__ImageBase. Differential Revision: http://llvm-reviews.chandlerc.com/D2523 llvm-svn: 199312
* Make sure we emit a relocation to the debug_ranges section in theEric Christopher2014-01-152-3/+12
| | | | | | presence of CU ranges. llvm-svn: 199276
* Enable use of ranges for translation units in the presence ofEric Christopher2014-01-141-5/+7
| | | | | | | -ffunction-sections and update comments and TODOs about other places that we should enable this. llvm-svn: 199263
* Decouple dllexport/dllimport from linkageNico Rieck2014-01-141-2/+0
| | | | | | | | | | | | | | | | | | | Representing dllexport/dllimport as distinct linkage types prevents using these attributes on templates and inline functions. Instead of introducing further mixed linkage types to include linkonce and weak ODR, the old import/export linkage types are replaced with a new separate visibility-like specifier: define available_externally dllimport void @f() {} @Var = dllexport global i32 1, align 4 Linkage for dllexported globals and functions is now equal to their linkage without dllexport. Imported globals and functions must be either declarations with external linkage, or definitions with AvailableExternallyLinkage. llvm-svn: 199218
* Revert "Decouple dllexport/dllimport from linkage"Nico Rieck2014-01-141-0/+2
| | | | | | | | Revert this for now until I fix an issue in Clang with it. This reverts commit r199204. llvm-svn: 199207
* Decouple dllexport/dllimport from linkageNico Rieck2014-01-141-2/+0
| | | | | | | | | | | | | | | | | | | Representing dllexport/dllimport as distinct linkage types prevents using these attributes on templates and inline functions. Instead of introducing further mixed linkage types to include linkonce and weak ODR, the old import/export linkage types are replaced with a new separate visibility-like specifier: define available_externally dllimport void @f() {} @Var = dllexport global i32 1, align 4 Linkage for dllexported globals and functions is now equal to their linkage without dllexport. Imported globals and functions must be either declarations with external linkage, or definitions with AvailableExternallyLinkage. llvm-svn: 199204
* Make getTargetStreamer return a possibly null pointer.Rafael Espindola2014-01-141-1/+1
| | | | | | | | | This will allow it to be called from target independent parts of the main streamer that don't know if there is a registered target streamer or not. This in turn will allow targets to perform extra actions at specified points in the interface: add extra flags for some labels, extra work during finalization, etc. llvm-svn: 199174
* Handle bundled terminators in isBlockOnlyReachableByFallthrough.Jakob Stoklund Olesen2014-01-121-7/+7
| | | | | | | | | | Targets like SPARC and MIPS have delay slots and normally bundle the delay slot instruction with the corresponding terminator. Teach isBlockOnlyReachableByFallthrough to find any MBB operands on bundled terminators so SPARC doesn't need to specialize this function. llvm-svn: 199061
* Revert r198979 - accidental commit.Eric Christopher2014-01-111-5/+5
| | | | llvm-svn: 198981
* Reformat.Eric Christopher2014-01-111-5/+3
| | | | llvm-svn: 198980
* Update function name and add some helpful comments.Eric Christopher2014-01-111-3/+4
| | | | llvm-svn: 198979
* Revert "Revert r198851, "Prototype of skeleton type units for fission""David Blaikie2014-01-103-4/+27
| | | | | | | | | This reverts commit r198865 which reverts r198851. ASan identified a use-of-uninitialized of the DwarfTypeUnit::Ty variable in skeleton type units. llvm-svn: 198908
* Revert r198851, "Prototype of skeleton type units for fission"NAKAMURA Takumi2014-01-093-26/+4
| | | | | | It caused undefined behavior. DwarfTypeUnit::Ty might not be initialized properly, I guess. llvm-svn: 198865
* Prototype of skeleton type units for fissionDavid Blaikie2014-01-093-4/+26
| | | | llvm-svn: 198851
* DwarfDebug: Refactor out common skeleton construction code to be reused for ↵David Blaikie2014-01-092-17/+25
| | | | | | type unit skeletons. llvm-svn: 198846
* Reformatting for r198842David Blaikie2014-01-091-3/+2
| | | | llvm-svn: 198843
* DwarfUnit: Rename "Node" to "CUNode" and propagate it through DwarfTypeUnit ↵David Blaikie2014-01-094-22/+18
| | | | | | | | | | as well. Since we'll now also need the split dwarf file name along with the language in DwarfTypeUnits, just use the whole DICompileUnit rather than explicitly handling each field needed. llvm-svn: 198842
* Revert "DwarfUnit: Move the DICompileUnit Node to the DwarfCompileUnit only"David Blaikie2014-01-092-12/+12
| | | | | | | | This reverts commit r198830. Decided to go a different way with this... llvm-svn: 198841
* Put the functionality for printing a value to a raw_ostream as anChandler Carruth2014-01-091-4/+3
| | | | | | | | | | | | operand into the Value interface just like the core print method is. That gives a more conistent organization to the IR printing interfaces -- they are all attached to the IR objects themselves. Also, update all the users. This removes the 'Writer.h' header which contained only a single function declaration. llvm-svn: 198836
* DwarfUnit: Move the DICompileUnit Node to the DwarfCompileUnit onlyDavid Blaikie2014-01-092-12/+12
| | | | | | It's unused in DwarfTypeUnit, as is expected. llvm-svn: 198830
* Move the llvm mangler to lib/IR.Rafael Espindola2014-01-077-7/+7
| | | | | | This makes it available to tools that don't link with target (like llvm-ar). llvm-svn: 198708
* Emit arange padding with a single directive.Benjamin Kramer2014-01-071-5/+3
| | | | llvm-svn: 198700
* Move the LLVM IR asm writer header files into the IR directory, as theyChandler Carruth2014-01-071-1/+1
| | | | | | | | | | | | | | | | | are part of the core IR library in order to support dumping and other basic functionality. Rename the 'Assembly' include directory to 'AsmParser' to match the library name and the only functionality left their -- printing has been in the core IR library for quite some time. Update all of the #includes to match. All of this started because I wanted to have the layering in good shape before I started adding support for printing LLVM IR using the new pass infrastructure, and commandline support for the new pass infrastructure. llvm-svn: 198688
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-074-5/+4
| | | | | | | | | | subsequent changes are easier to review. About to fix some layering issues, and wanted to separate out the necessary churn. Also comment and sink the include of "Windows.h" in three .inc files to match the usage in Memory.inc. llvm-svn: 198685
* Make the llvm mangler depend only on DataLayout.Rafael Espindola2014-01-032-7/+14
| | | | | | | | | | | | | | Before this patch any program that wanted to know the final symbol name of a GlobalValue had to link with Target. This patch implements a compromise solution where the mangler uses DataLayout. This way, any tool that already links with Target (llc, clang) gets the exact behavior as before and new IR files can be mangled without linking with Target. With this patch the mangler is constructed with just a DataLayout and DataLayout is extended to include the information the Mangler needs. llvm-svn: 198438
* Revert "Revert "Debug Info: Type Units: Simplify type hashing using ↵David Blaikie2014-01-033-93/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | IR-provided unique names."" This reverts commit r198398, thus reapplying r198397. I had accidentally introduced an endianness issue when applying the hash to the type unit. Using support::ulittle64_t in the reinterpret_cast in addDwarfTypeUnitType fixes this issue. Original commit message: Debug Info: Type Units: Simplify type hashing using IR-provided unique names. What's good for LTO metadata size problems ought to be good for non-LTO debug info size too, so let's rely on the same uniqueness in both cases. If it's insufficient for non-LTO for whatever reason (since we now won't be uniquing CU-local types or any C types - but these are likely to not be the most significant contributors to type bloat) we should consider a frontend solution that'll help both LTO and non-LTO alike, rather than using DWARF-level DIE-hashing that only helps non-LTO debug info size. It's also much simpler this way and benefits C++ even more since we can deduplicate lexically separate definitions of the same C++ type since they have the same mangled name. llvm-svn: 198436
* Revert "Debug Info: Type Units: Simplify type hashing using IR-provided ↵David Blaikie2014-01-033-19/+93
| | | | | | | | | | | unique names." Reverting due to bot failure I won't have time to investigate until tomorrow. This reverts commit r198397. llvm-svn: 198398
* Debug Info: Type Units: Simplify type hashing using IR-provided unique names.David Blaikie2014-01-033-93/+19
| | | | | | | | | | | | | | | | What's good for LTO metadata size problems ought to be good for non-LTO debug info size too, so let's rely on the same uniqueness in both cases. If it's insufficient for non-LTO for whatever reason (since we now won't be uniquing CU-local types or any C types - but these are likely to not be the most significant contributors to type bloat) we should consider a frontend solution that'll help both LTO and non-LTO alike, rather than using DWARF-level DIE-hashing that only helps non-LTO debug info size. It's also much simpler this way and benefits C++ even more since we can deduplicate lexically separate definitions of the same C++ type since they have the same mangled name. llvm-svn: 198397
* 80-column.Eric Christopher2014-01-031-2/+4
| | | | llvm-svn: 198394
* Remove TextSectionSym as it is unused.Eric Christopher2014-01-031-4/+1
| | | | llvm-svn: 198393
* Revert "Reverting r193835 due to weirdness with Go..."David Blaikie2014-01-031-4/+8
| | | | | | | | | | The cgo problem was that it wants dwarf2 which doesn't support direct constant encoding of the location. So let's add support for dwarf2 encoding (using a location expression) of data member locations. This reverts commit r198385. llvm-svn: 198389
* Reverting r193835 due to weirdness with Go...David Blaikie2014-01-031-4/+5
| | | | | | | Apologies for the noise - we're seeing some Go failures with cgo interacting with Clang's debug info due to this change. llvm-svn: 198385
* Remove comments on CU skeleton construction, they're probablyEric Christopher2014-01-021-4/+0
| | | | | | obvious. llvm-svn: 198361
* Elaborate on comment for skeleton CU construction.Eric Christopher2014-01-021-1/+4
| | | | llvm-svn: 198358
* Revert seemingly unnecessary section sym for the data section.Eric Christopher2014-01-021-1/+0
| | | | llvm-svn: 198357
* Fix up a couple of review comments:Eric Christopher2014-01-022-9/+9
| | | | | | | | Use an if statement instead of a pair of ternary operators checking the same condition. Use a cheap method call rather than returning the local symbol. llvm-svn: 198351
* Simplify conditional.Eric Christopher2014-01-021-1/+1
| | | | llvm-svn: 198350
* Revert "Debug info: Add enumerators to the __apple_names accelerator table."Adrian Prantl2014-01-021-3/+0
| | | | | | | This reverts r197927 until the discussion on llvm-commits comes to a conclusion. llvm-svn: 198333
* Refactor and reduce code duplication for non-split dwarf strings.Eric Christopher2013-12-301-18/+9
| | | | llvm-svn: 198233
OpenPOWER on IntegriCloud