summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCParser
Commit message (Collapse)AuthorAgeFilesLines
...
* raw_ostream: Forward declare OpenFlags and include FileSystem.h only where ↵Benjamin Kramer2014-04-292-0/+2
| | | | | | necessary. llvm-svn: 207593
* [C++] Use 'nullptr'.Craig Topper2014-04-247-33/+33
| | | | llvm-svn: 207083
* Integrated assbemler, macros: added 'vararg' argument qualifier support.Stepan Dyatkovskiy2014-04-231-8/+32
| | | | | | Note, currently we have no 'vararg' support for darwin macros. llvm-svn: 206951
* Fix the assembler to print a better relocatable expression errorKevin Enderby2014-04-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostic that includes location information. Currently if one has this assembly: .quad (0x1234 + (4 * SOME_VALUE)) where SOME_VALUE is undefined ones gets the less than useful error message with no location information: % clang -c x.s clang -cc1as: fatal error: error in backend: expected relocatable expression With this fix one now gets a more useful error message with location information: % clang -c x.s x.s:5:8: error: expected relocatable expression .quad (0x1234 + (4 * SOME_VALUE)) ^ To do this I plumbed the SMLoc through the MCObjectStreamer EmitValue() and EmitValueImpl() interfaces so it could be used when creating the MCFixup. rdar://12391022 llvm-svn: 206906
* DebugInfo: Emit relocation to debug_line section when emitting asm for asmDavid Blaikie2014-04-011-5/+9
| | | | | | | | | | | | | | I don't think this is reachable by any frontend (why would you transform asm to asm+debug info?) but it helps tidy up some of this code, avoid the weird special case of "emit the first CU, store the label, then emit the rest" in MCDwarfLineTable::Emit by instead having the DWARF-for-assembly case use the same codepath as DwarfDebug.cpp, by registering the label of the debug_line section, thus causing it to be emitted. (with a special case in asm output to just emit the label since asm output uses the .loc directives, etc, rather than the debug_loc directly) llvm-svn: 205286
* Map ELf flags back to more specific section kinds.Rafael Espindola2014-03-281-2/+28
| | | | | | With that, convert another llc -filetype=obj test. llvm-svn: 205031
* Remove some dead assignements found by scan-buildArnaud A. de Grandmaison2014-03-211-6/+4
| | | | llvm-svn: 204526
* MCParser: add an assertionSaleem Abdulrasool2014-03-211-1/+3
| | | | | | | Add an assertion that the section is not NULL. Potential NULL pointer dereference identified by clang static analyzer. llvm-svn: 204429
* Tidy up. Update per naming conventions.Jim Grosbach2014-03-181-197/+197
| | | | | | No functional change. llvm-svn: 204192
* Darwin: Add assembler directives to create version-min load commands.Jim Grosbach2014-03-181-0/+48
| | | | | | | | | | | | Allow object files to be tagged with a version-min load command for iOS or MacOSX. Teach macho-dump to understand the version-min load commands for testcases. rdar://11337778 llvm-svn: 204190
* 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
* DebugInfo: Improve reuse of file table entries in asm debug infoDavid Blaikie2014-03-171-11/+7
| | | | | | | | | | | | | | | | | 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
* MCDwarf: Simplify MCDwarfFile to just use std::string instead of cunning use ↵David Blaikie2014-03-131-4/+4
| | | | | | | | | | | | | 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-131-1/+1
| | | | llvm-svn: 203827
* Use printable names to implement directional labels.Rafael Espindola2014-03-131-1/+1
| | | | | | | | | | | | | | 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
* 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
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-084-32/+32
| | | | | | class. llvm-svn: 203342
* MC: Use MachO::SectionType for MCSectionMachO::getType's return typeDavid Majnemer2014-03-071-1/+1
| | | | | | | | | This is a straightfoward replacement, it makes debugging a little easier. This has no functional impact. llvm-svn: 203264
* MC: Remove superfluous section attribute flag definitionsDavid Majnemer2014-03-071-44/+44
| | | | | | | | | | | | | | | | | | | 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
* Remove unreachable 'return true' always dominated by 'return Error' or ↵Ted Kremenek2014-03-061-3/+2
| | | | | | 'return false'. llvm-svn: 203171
* 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
* Add support for parsing sun-style section flags in ELFAsmParser.Venkatraman Govindaraju2014-03-011-6/+43
| | | | llvm-svn: 202573
* 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
* 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
* 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
* Use the default values.Rafael Espindola2014-02-041-1/+1
| | | | llvm-svn: 200781
* Fix PR18345: ldr= pseudo instruction produces incorrect code when using in ↵David Peixotto2014-02-041-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | inline assembly This patch fixes the ldr-pseudo implementation to work when used in inline assembly. The fix is to move arm assembler constant pools from the ARMAsmParser class to the ARMTargetStreamer class. Previously we kept the assembler generated constant pools in the ARMAsmParser object. This does not work for inline assembly because a new parser object is created for each blob of inline assembly. This patch moves the constant pools to the ARMTargetStreamer class so that the constant pool will remain alive for the entire code generation process. An ARMTargetStreamer class is now required for the arm backend. There was no existing implementation for MachO, only Asm and ELF. Instead of creating an empty MachO subclass, we decided to make the ARMTargetStreamer a non-abstract class and provide default (llvm_unreachable) implementations for the non constant-pool related methods. Differential Revision: http://llvm-reviews.chandlerc.com/D2638 llvm-svn: 200777
* MC: Fix .octa output for APInts with BitWidth > 128David Woodhouse2014-02-011-1/+2
| | | | llvm-svn: 200615
* MC: Add support for .octaDavid Woodhouse2014-02-011-2/+55
| | | | | | | | | | This is a minimal implementation which accepts only constants rather than full expressions, but that should be perfectly sufficient for all known users for now. Patch from PaX Team <pageexec@freemail.hu> llvm-svn: 200614
* MC: Add AsmLexer::BigNum token for integers greater than 64 bitsDavid Woodhouse2014-02-012-17/+19
| | | | | | | | | | | | | | | | | | | | This will be needed for .octa support, but we don't want to just use the existing AsmLexer::Integer for it and then have to litter all its users with explicit checks for the size, and make them use the new get APIntVal() method. So let the lexer produce an AsmLexer::Integer as before for numbers which are small enough — which appears to cover what was previously a nasty special case handling of numbers which don't fit in int64_t but *do* fit in uint64_t. Where the number is too large even for that, produce an AsmLexer::BigNum instead. We do nothing with these except complain about them for now, but that will be changed shortly... Based on a patch from PaX Team <pageexec@freemail.hu> llvm-svn: 200613
* MC: Improve the .fill directive's compatibility with GASDavid Majnemer2014-02-011-4/+28
| | | | | | | | | Per the GAS documentation, .fill should permit pattern widths that aren't a power of two. While I was in the neighborhood, I added some sanity checking. This change was motivated by a use of this construct in the Linux Kernel. llvm-svn: 200606
* MC: Better management of macro argumentsDavid Majnemer2014-01-291-55/+22
| | | | | | | | | | | | The linux kernel makes uses of a GAS `feature' which substitutes nothing for macro arguments which aren't specified. Proper support for these kind of macro arguments necessitated a cleanup of differences between `GAS' and `Darwin' dialect macro processing. Differential Revision: http://llvm-reviews.chandlerc.com/D2634 llvm-svn: 200409
* MC: Clean up error paths in AsmParser::parseMacroArgumentDavid Majnemer2014-01-291-10/+20
| | | | | | | | | Use an RAII object Instead of inserting a call to AsmLexer::setSkipSpace(true) in all error paths. No functional change. llvm-svn: 200358
* MC: Add support for .cfi_startproc simpleDavid Majnemer2014-01-271-2/+7
| | | | | | | | | | | | | This commit allows LLVM MC to process .cfi_startproc directives when they are followed by an additional `simple' identifier. This signals to elide the emission of target specific CFI instructions that would normally occur initially. This fixes PR16587. Differential Revision: http://llvm-reviews.chandlerc.com/D2624 llvm-svn: 200227
* AsmParser: improve diagnostics for invalid variantsSaleem Abdulrasool2014-01-261-1/+2
| | | | | | | | | An emitted diagnostic for an invalid relocation variant would place the caret on the token following the relocation variant indicator or at the end of the line if there was no following token. This change corrects the placement of the caret to point to the token. llvm-svn: 200159
* Fix known typosAlp Toker2014-01-241-4/+4
| | | | | | | Sweep the codebase for common typos. Includes some changes to visible function names that were misspelt. llvm-svn: 200018
OpenPOWER on IntegriCloud