summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
* [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
* 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
* Re-commit: Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove ↵Daniel Sanders2014-02-133-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hasRawTextSupport() call Summary: AsmPrinter::EmitInlineAsm() will no longer use the EmitRawText() call for targets with mature MC support. Such targets will always parse the inline assembly (even when emitting assembly). Targets without mature MC support continue to use EmitRawText() for assembly output. The hasRawTextSupport() check in AsmPrinter::EmitInlineAsm() has been replaced with MCAsmInfo::UseIntegratedAs which when true, causes the integrated assembler to parse inline assembly (even when emitting assembly output). UseIntegratedAs is set to true for targets that consider any failure to parse valid assembly to be a bug. Target specific subclasses generally enable the integrated assembler in their constructor. The default value can be overridden with -no-integrated-as. All tests that rely on inline assembly supporting invalid assembly (for example, those that use mnemonics such as 'foo' or 'hello world') have been updated to disable the integrated assembler. Changes since review (and last commit attempt): - Fixed test failures that were missed due to configuration of local build. (fixes crash.ll and a couple others). - Fixed tests that happened to pass because the local build was on X86 (should fix 2007-12-17-InvokeAsm.ll) - mature-mc-support.ll's should no longer require all targets to be compiled. (should fix ARM and PPC buildbots) - Object output (-filetype=obj and similar) now forces the integrated assembler to be enabled regardless of default setting or -no-integrated-as. (should fix SystemZ buildbots) Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2686 llvm-svn: 201333
* Revert r201237+r201238: Demote EmitRawText call in ↵Daniel Sanders2014-02-123-18/+0
| | | | | | | | AsmPrinter::EmitInlineAsm() and remove hasRawTextSupport() call It introduced multiple test failures in the buildbots. llvm-svn: 201241
* Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove ↵Daniel Sanders2014-02-123-0/+18
| | | | | | | | | | | | | | | | | | | | | hasRawTextSupport() call Summary: AsmPrinter::EmitInlineAsm() will no longer use the EmitRawText() call for targets with mature MC support. Such targets will always parse the inline assembly (even when emitting assembly). Targets without mature MC support continue to use EmitRawText() for assembly output. The hasRawTextSupport() check in AsmPrinter::EmitInlineAsm() has been replaced with MCAsmInfo::UseIntegratedAs which when true, causes the integrated assembler to parse inline assembly (even when emitting assembly output). UseIntegratedAs is set to true for targets that consider any failure to parse valid assembly to be a bug. Target specific subclasses generally enable the integrated assembler in their constructor. The default value can be overridden with -no-integrated-as. All tests that rely on inline assembly supporting invalid assembly (for example, those that use mnemonics such as 'foo' or 'hello world') have been updated to disable the integrated assembler. Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2686 llvm-svn: 201237
* Change the begin and end methods in ObjectFile to match the style guide.Rafael Espindola2014-02-102-13/+13
| | | | llvm-svn: 201108
* MCParser: add a single token lookaheadSaleem Abdulrasool2014-02-091-0/+22
| | | | | | | Some of the more complex directive and macro handling for GAS compatibility requires lookahead. Add a single token lookahead in the MCAsmLexer. llvm-svn: 201058
* AsmParser: Simplify code with ArrayRef.Benjamin Kramer2014-02-091-32/+12
| | | | | | No functionality change. llvm-svn: 201055
* AsmParser: Parse (and ignore) nested .macro definitions.Benjamin Kramer2014-02-091-9/+20
| | | | | | | | | This enables a slightly odd feature of gas. The macro is defined when the outermost macro is instantiated. PR18599 llvm-svn: 201045
* Always create a temporary symbol to use with the cfi frame.Rafael Espindola2014-02-071-9/+3
| | | | | | | This is a small simplification and a small step in fixing pr18743 since private functions on MachO should be using a 'l' prefix. llvm-svn: 200994
* doesSectionRequireSymbols is meaningless on ELF, remove.Rafael Espindola2014-02-061-3/+0
| | | | | | | | | | | | | | | | | | | | This is a nop. doesSectionRequireSymbols is only used from isSymbolLinkerVisible. isSymbolLinkerVisible only use from ELF was in if (!Asm.isSymbolLinkerVisible(Symbol) && !Symbol.isUndefined()) return false; if (Symbol.isTemporary()) return false; If the symbol is a temporary this code returns false and it is irrelevant if we take the first if or not. If the symbol is not a temporary, Asm.isSymbolLinkerVisible returns true without ever calling doesSectionRequireSymbols. This was an horrible leftover from when support for ELF was first added. llvm-svn: 200894
OpenPOWER on IntegriCloud