summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* Asm Parser: support .error directiveSaleem Abdulrasool2014-02-231-10/+34
| | | | | | | | The .error directive is similar to .err in that it will halt assembly if it is evaluated for assembly. However, it permits a user supplied message to be rendered. llvm-svn: 201999
* AsmParser: support .ifeqs directiveSaleem Abdulrasool2014-02-231-2/+44
| | | | | | | The .ifeqs directive assembles the following code if the quoted string parameters are equal. The strings must be quoted using double quotes. llvm-svn: 201998
* MCAsmParser: support .ifneSaleem Abdulrasool2014-02-231-3/+7
| | | | | | | The .ifne directive assembles the following section of code if the argument expression is non-zero. Effectively, it is equivalent to if. llvm-svn: 201986
* MCAsmParser: handle space properly for .ifc/.ifncSaleem Abdulrasool2014-02-231-1/+2
| | | | | | | | If the strings are not quoted, the first string stops at the first comma, and the second string stops at the end of the line. Strings which contain whitespace should be quoted. Unquoted space is to be discarded. llvm-svn: 201985
* MCAsmParser: add support for .err directiveSaleem Abdulrasool2014-02-231-0/+16
| | | | | | | The .err directive produces an error whenever it is assembled. This can be useful for preventing assembly when an unexpected condition occurs. llvm-svn: 201984
* MC: Support COFF string tables larger than 10MBNico Rieck2014-02-221-1/+27
| | | | | | | | Offsets past the range of single-slash encoding are encoded as base64, padded to 6 characters, and prefixed with two slashes. This encoding is undocumented but used by MSVC. llvm-svn: 201940
* Move get[S|U]LEB128Size() to LEB128.h.Logan Chien2014-02-222-26/+1
| | | | | | | | | | This commit moves getSLEB128Size() and getULEB128Size() from MCAsmInfo to LEB128.h and removes some copy-and-paste code. Besides, this commit also adds some unit tests for the LEB128 functions. llvm-svn: 201937
* Remove dead declarationSylvestre Ledru2014-02-211-1/+0
| | | | llvm-svn: 201863
* AsmParser: Disable Darwin-style macro argument expansion on non-darwin targets.Benjamin Kramer2014-02-201-3/+3
| | | | | | There is code in the wild that relies on $0 not being expanded. llvm-svn: 201784
* MCAsmParser: support required parametersSaleem Abdulrasool2014-02-191-12/+59
| | | | | | | | | | | This enhances the macro parser to parse and handle parameter qualifications, which is needed to support required formal parameters in macro definitions. A required parameter may not be defaulted (though providing a default value is accepted with a warning). This improves GAS compatibility. Partially addresses PR9248. llvm-svn: 201630
* MCAsmParser: change representation of MCAsmMacroParameterSaleem Abdulrasool2014-02-191-18/+22
| | | | | | | | | | Rather than using std::pair, create a structure to represent the type. This is a preliminary refactoring to enable required parameter handling. Additional state is needed to indicate required parameters. This has a minor side effect of improving readability by providing more accurate names compared to first and second. llvm-svn: 201629
* Add support for assigning to . in AsmParser.Anders Waldenborg2014-02-171-8/+6
| | | | | | | | | This is implemented by handling assignments to the '.' pseudo symbol as ".org" directives. Differential Revision: http://llvm-reviews.chandlerc.com/D2625 llvm-svn: 201530
* MCAsmParser: better handling for named argumentsSaleem Abdulrasool2014-02-171-15/+56
| | | | | | | | | | | | | | | | | | | Until this point only macro definition with named parameters were parsed but the names were ignored. This adds support for using that information for named parameter instantiation. In order to support the full semantics of the keyword arguments, the arguments are no longer lazily initialised since the keyword arguments can be specified out of order and partially if they are defaulted. Prepopulate the arguments with the default value for any defaulted parameters, and then parse the specified arguments. This simplies some of the handling of the arguments in the inner loop since empty arguments simply increment the parameter index and move on. Note that keyword and positional arguments cannot be mixed. llvm-svn: 201499
* MCAsmParser: relax declaration parsingSaleem Abdulrasool2014-02-161-1/+4
| | | | | | | | The Linux kernel defines empty macros for compatibility with ARM UAL syntax. The comma after the name is optional, and if present can be safely lexed. This improves compatibility with the GNU assembler. llvm-svn: 201474
* DebugInfo: Don't include the name of the CU file in the line table file list ↵David Blaikie2014-02-141-1/+2
| | | | | | | | | | | | | | | | | | | | when it's unneeded Recommitting r201380 (reverted in r201389) Recommitting r201351 and r201355 (reverted in r201351 and r201355) We weren't emitting the an empty (header only) line table when the line table was empty - this made the DWARF invalid (the compile unit would point to the zero-size debug_lines section where there should've been an empty line table but there was nothing at all). Fix that, and as a consequence this works around/addresses PR18809. Also, we emit a non-empty line table to workaround a darwin linker bug, so XFAILing on darwin too. Also, mark the test as 'REQUIRES: object-emission' because it does. llvm-svn: 201429
* Support DWARF discriminators in object streamer.Diego Novillo2014-02-141-0/+10
| | | | | | | | | | | | | | | Summary: This adds support for emitting DWARF path discriminator values in the object streamer. It also changes the DWARF dumper to show discriminator values in the line table output. Reviewers: echristo CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2794 llvm-svn: 201427
* Revert "DebugInfo: Don't include the name of the CU file in the line table ↵Eric Christopher2014-02-141-2/+1
| | | | | | | | file list when it's unneeded" This reverts commit r201380 for now while we investigate. llvm-svn: 201389
* DebugInfo: Don't include the name of the CU file in the line table file list ↵David Blaikie2014-02-141-1/+2
| | | | | | | | | | | | | | when it's unneeded Recommitting r201351 and r201355 (reverted in r201351 and r201355) We weren't emitting the an empty (header only) line table when the line table was empty - this made the DWARF invalid (the compile unit would point to the zero-size debug_lines section where there should've been an empty line table but there was nothing at all). Fix that, and as a consequence this works around/addresses PR18809. llvm-svn: 201380
* Use __literal16. It has been supported by the linker since 2005.Rafael Espindola2014-02-131-10/+4
| | | | llvm-svn: 201365
OpenPOWER on IntegriCloud