summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
* DebugInfo: Use MC line table file entry uniquing for non-asm input as well.David Blaikie2014-03-172-12/+29
| | | | | | | | | | | | | 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
* MC: change runtime check to an assertionSaleem Abdulrasool2014-03-171-1/+2
| | | | | | | | It is unclear how it would be possible to get M to be NULL in normal scenarios. Change this to an assert rather than a runtime check as per dblakie's suggestion. llvm-svn: 204060
* ARM IAS: support .thumb_setSaleem Abdulrasool2014-03-171-2/+8
| | | | | | | | | | | | | | This performs the equivalent of a .set directive in that it creates a symbol which is an alias for another symbol or value which may possibly be yet undefined. This directive also has the added property in that it marks the aliased symbol as being a thumb function entry point, in the same way that the .thumb_func directive does. The current implementation fails one test due to an unrelated issue. Functions within .thumb sections are not marked as thumb_func. The result is that the aliasee function is not valued correctly. llvm-svn: 204059
* [C++11] Introduce ObjectFile::symbols() to use range-based loops.Alexey Samsonov2014-03-172-16/+17
| | | | | | | | | | | | Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3081 llvm-svn: 204031
* Consider the base pointer for setting the symbol type.Rafael Espindola2014-03-171-2/+3
| | | | | | | | | | | | | | This is really a consistency fix. Since given a = b we propagate the information, we should propagate it too given a = b + (1 - 1) Fixes pr19145. llvm-svn: 204028
* DebugInfo: Improve reuse of file table entries in asm debug infoDavid Blaikie2014-03-175-24/+34
| | | | | | | | | | | | | | | | | 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
* MC: don't create a backtrace for diagnostics.Jim Grosbach2014-03-141-1/+1
| | | | | | | | | | | For better or worse, this is currently the normal error reporting path when dealing with backend errors from inline assembly. It's not just internal compiler issues that come through here, so we shouldn't be creating a backtrace on this path. rdar://16329947 llvm-svn: 203979
* MCContext: Remove redundant assignmentDavid Blaikie2014-03-141-2/+0
| | | | | | | The member variable is not initialized in the ctor so it's already empty. No need to empty it again. llvm-svn: 203963
* Correctly handle an ELF symbol defined with "a = b + expr".Rafael Espindola2014-03-142-37/+66
| | | | | | | | | We were marking the symbol as absolute instead of computing b's offset + the expression value. This fixes pr19126. llvm-svn: 203962
* [C++11] Introduce SectionRef::relocations() to use range-based loopsAlexey Samsonov2014-03-141-7/+5
| | | | | | | | | | | | Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3077 llvm-svn: 203927
* MCDwarf: Rename MCDwarfFileTable to MCDwarfLineTableDavid Blaikie2014-03-133-9/+10
| | | | | | | This type now represents all the data for the DWARF line table: directory names, file names, and the line table proper. llvm-svn: 203858
* MCDwarf: Extract the DWARF line table header handling into its own typeDavid Blaikie2014-03-131-3/+13
| | | | llvm-svn: 203856
* MCDwarf: Sink file/directory creation down into MCDwarfFileTable form MCContextDavid Blaikie2014-03-132-50/+50
| | | | llvm-svn: 203836
* MCDwarf: Oh, and move the directory string over to std::string as wellDavid Blaikie2014-03-132-8/+4
| | | | | | (see r203831 for similar stuff) llvm-svn: 203833
* MCDwarf: Simplify MCDwarfFile to just use std::string instead of cunning use ↵David Blaikie2014-03-133-24/+18
| | | | | | | | | | | | | of MCContext's allocator. There aren't /that/ many files, and we are already using various maps and other standard containers that don't use MCContext's allocator to store these values, so this doesn't seem to be critical and simplifies the design (I'll be moving construction out of MCContext shortly so it'd be annoying to have to pass the allocator around to allocate these things... and we'll have non-MCContext users (debug_line.dwo) shortly) llvm-svn: 203831
* MCDwarf: Simply MCDwarfFile since it really is just a StringRef and unsigned.David Blaikie2014-03-133-15/+7
| | | | llvm-svn: 203827
* Use printable names to implement directional labels.Rafael Espindola2014-03-132-14/+21
| | | | | | | | | | | | | | This changes the implementation of local directional labels to use a dedicated map. With that it can then just use CreateTempSymbol, which is what the rest of MC uses. CreateTempSymbol doesn't do a great job at making sure the names are unique (or being efficient when the names are not needed), but that should probably be fixed in a followup patch. This fixes pr18928. llvm-svn: 203826
* Remove stale commentDavid Blaikie2014-03-131-4/+0
| | | | llvm-svn: 203823
* MCDwarf: Refactor line table handling into a single data structureDavid Blaikie2014-03-133-31/+25
| | | | | | | | | | | | | | | | | This replaces several "compile unit ID -> thing" mappings in favor of one mapping from CUID to the whole line table structure (files, directories, and lines). This is another step along the way to refactoring out reusable components of line table handling for use when generating debug_line.dwo for fission type units. Also, might be a good basis to fold some of this handling down into MCStreamers to avoid the special case of "One line table when doing asm printing, line table per CU otherwise" by building it into the different MCStreamer implementations. llvm-svn: 203821
* [C++11] Introduce ObjectFile::sections().Alexey Samsonov2014-03-132-33/+38
| | | | | | | | | | | | | | | | | | Summary: This adds ObjectFile::section_iterator_range, that allows to write range-based for-loops running over all sections of a given file. Several files from lib/ are converted to the new interface. Similar fixes should be applied to a variety of llvm-* tools. Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3069 llvm-svn: 203799
* MC: fix silly typoSaleem Abdulrasool2014-03-131-1/+1
| | | | llvm-svn: 203763
* MC: fix possible NULL pointer dereferenceSaleem Abdulrasool2014-03-131-1/+1
| | | | | | Avoid NULL pointer scenario found via clang's static analyzer. llvm-svn: 203745
* MCDwarf: Remove unused parameterDavid Blaikie2014-03-121-5/+4
| | | | llvm-svn: 203727
* MCDwarf: Invert the Section+CU->LineEntries mapping so the CU is the primary ↵David Blaikie2014-03-122-46/+14
| | | | | | | | | | | | | | | | | | | | | | | | dimension This makes the mapping consistent with other CU->X mappings in the MCContext, helping pave the way to refactor all these values into a single data structure per CU and thus a single map. I haven't renamed the data structure as that would make the patch churn even higher (the MCLineSection name no longer makes sense, as this structure now contains lines for multiple sections covered by a single CU, rather than lines for a single section in multiple CUs) and further refactorings will follow that may remove this type entirely. For convenience, I also gave the MCLineSection value semantics so we didn't have to do the lazy construction, manual delete, etc. (& for those playing at home, refactoring the line printing into a single data structure will eventually alow that data structure to be reused to own the debug_line.dwo line table used for type unit file name resolution) llvm-svn: 203726
* Correct typo ("a entry" -> "an entry")David Blaikie2014-03-121-1/+1
| | | | llvm-svn: 203678
* Try harder to evaluate expressions when printing assembly.Rafael Espindola2014-03-123-7/+7
| | | | | | | | | When printing assembly we don't have a Layout object, but we can still try to fold some constants. Testcase by Ulrich Weigand. llvm-svn: 203677
* Simplify a really complicated check for Arch == X86_64.Rafael Espindola2014-03-112-3/+3
| | | | | | | | | | | | The function hasReliableSymbolDifference had exactly one use in the MachO writer. It is also only true for X86_64. In fact, the comments refers to "Darwin x86_64" and everything else, so this makes the code match the comment. If this is to be abstracted again, it should be a property of TargetObjectWriter, like useAggressiveSymbolFolding. llvm-svn: 203605
* MC: Appease the buildbotsDavid Majnemer2014-03-101-2/+2
| | | | | | This is fallout from r203429. llvm-svn: 203430
* MC: Cleanup MCSectionMachO::ParseSectionSpecifierDavid Majnemer2014-03-101-77/+43
| | | | | | | | | Split by comma once instead of multiple times. Moving this upfront makes the rest of the code considerably simpler. No functional change. llvm-svn: 203429
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-085-36/+36
| | | | | | class. llvm-svn: 203342
* 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-086-256/+251
| | | | | | class. llvm-svn: 203340
* MC: Use MachO::SectionType for MCSectionMachO::getType's return typeDavid Majnemer2014-03-072-2/+2
| | | | | | | | | This is a straightfoward replacement, it makes debugging a little easier. This has no functional impact. llvm-svn: 203264
* Change MCDisassembler::setSymbolizer to take unique_ptr by value.Ahmed Charles2014-03-072-3/+3
| | | | | | | This changes the interface to be more explicit that ownership is being transferred. llvm-svn: 203223
* MC: Remove superfluous section attribute flag definitionsDavid Majnemer2014-03-074-108/+108
| | | | | | | | | | | | | | | | | | | Summary: llvm/MC/MCSectionMachO.h and llvm/Support/MachO.h both had the same definitions for the section flags. Instead, grab the definitions out of support. No functionality change. Reviewers: grosbach, Bigcheese, rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2998 llvm-svn: 203211
* Reapply "MC: simplify object file selection for Windows"Saleem Abdulrasool2014-03-061-3/+2
| | | | | | | | That was overly aggressive in assuming that we could always assume COFF. Some of the tests assume that they will get ELF rather than COFF even on Windows where the default is COFF. llvm-svn: 203176
* Remove unreachable 'return true' always dominated by 'return Error' or ↵Ted Kremenek2014-03-061-3/+2
| | | | | | 'return false'. llvm-svn: 203171
* Support: split object format out of environmentSaleem Abdulrasool2014-03-061-2/+2
| | | | | | | | | | | This is a preliminary setup change to support a renaming of Windows target triples. Split the object file format information out of the environment into a separate entity. Unfortunately, file format was previously treated as an environment with an unknown OS. This is most obvious in the ARM subtarget where the handling for macho on an arbitrary platform switches to AAPCS rather than APCS (as per Apple's needs). llvm-svn: 203160
* MC: simplify object file selection for WindowsSaleem Abdulrasool2014-03-061-4/+3
| | | | | | | | Windows always uses COFF unless Windows ELF is in use. Rather than checking if Windows, MinGW, or Cygwin is being targeted, just check if the target OS is windows and that it is not an ELF environment. llvm-svn: 203159
* MS asm: The initial dot in struct access is optionalReid Kleckner2014-03-061-0/+4
| | | | | | | | Fixes PR18994. Tests, once again, in that other repository. =P llvm-svn: 203146
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-0610-60/+45
| | | | | | | | | | 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-054-9/+4
| | | | | | | | | | | | | | | | | 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
* [C++11] Add overloads for externally used OwningPtr functions.Ahmed Charles2014-03-051-0/+12
| | | | | | | | This will allow external callers of these functions to switch over time rather than forcing a breaking change all a once. These particular functions were determined by building clang/lld/lldb. llvm-svn: 202959
* [C++11] Replace OwningPtr::take() with OwningPtr::release().Ahmed Charles2014-03-053-3/+3
| | | | llvm-svn: 202957
* [C++11] Replace llvm::next and llvm::prior with std::next and std::prev.Benjamin Kramer2014-03-021-1/+1
| | | | | | Remove the old functions. llvm-svn: 202636
* Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper2014-03-022-5/+4
| | | | llvm-svn: 202621
* Add support for parsing sun-style section flags in ELFAsmParser.Venkatraman Govindaraju2014-03-011-6/+43
| | | | llvm-svn: 202573
* Remove MCPureStreamer.Rafael Espindola2014-02-272-229/+0
| | | | | | | We moved MCJIT to use native object formats a long time ago and R600 now uses ELF, so it was dead. llvm-svn: 202408
* Reuse constants for COFF string table entry offsetsNico Rieck2014-02-251-7/+9
| | | | llvm-svn: 202130
* Replace the F_Binary flag with a F_Text one.Rafael Espindola2014-02-241-1/+2
| | | | | | | | | After this I will set the default back to F_None. The advantage is that before this patch forgetting to set F_Binary would corrupt a file on windows. Forgetting to set F_Text produces one that cannot be read in notepad, which is a better failure mode :-) llvm-svn: 202052
OpenPOWER on IntegriCloud