summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCParser/AsmParser.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove yet another method of creating begin and end symbol for sections.Rafael Espindola2015-05-211-4/+4
| | | | | | I missed this one when first unifying how we handle begin and end symbols. llvm-svn: 237912
* MC: Clean up method names in MCContext.Jim Grosbach2015-05-181-13/+13
| | | | | | | The naming was a mish-mash of old and new style. Update to be consistent with the new. NFC. llvm-svn: 237594
* [MC] Split MCBinaryExpr::Shr into LShr and AShr.Ahmed Bougacha2015-04-281-1/+1
| | | | | | | | Defaulting to AShr without consulting the target MCAsmInfo isn't OK. Add a flag to fix that. Keep it off for now: target migrations will follow in separate commits. llvm-svn: 235951
* [MC] Move getBinOpPrecedence into AsmParser. NFC.Ahmed Bougacha2015-04-281-2/+5
| | | | | | In preparation for a future patch. llvm-svn: 235950
* [MC] [IAS] Add support for the \@ .macro pseudo-variable.Toma Tabacu2015-04-271-29/+53
| | | | | | | | | | | | | | | | | | Summary: When used, it is substituted with the number of .macro instantiations we've done up to that point in time. So if this is the 1st time we've instantiated a .macro (any .macro, regardless of name), \@ will instantiate to 0, if it's the 2nd .macro instantiation, it will instantiate to 1 etc. It can only be used inside a .macro definition, an .irp definition or an .irpc definition (those last 2 uses are undocumented). Reviewers: echristo, rafael Reviewed By: rafael Subscribers: dsanders, llvm-commits Differential Revision: http://reviews.llvm.org/D9197 llvm-svn: 235862
* [mips] [IAS] Implement the .asciiz directive.Toma Tabacu2015-04-211-0/+4
| | | | | | | | | | | | | | | | Summary: This directive is exactly the same as .asciz, except it's only used by MIPS. It is used to store null terminated strings in object files. Reviewers: rafael, dsanders, echristo Reviewed By: dsanders, echristo Subscribers: echristo, llvm-commits Differential Revision: http://reviews.llvm.org/D7530 llvm-svn: 235382
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-111-1/+1
| | | | | | | | | | | | | | The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' \ -j=32 -fix -format http://reviews.llvm.org/D8925 llvm-svn: 234679
* Remove more superfluous .str() and replace std::string concatenation with Twine.Yaron Keren2015-03-301-1/+1
| | | | | | Following r233392, http://llvm.org/viewvc/llvm-project?rev=233392&view=rev. llvm-svn: 233555
* Add support for .ifnes psuedo-op.Sid Manning2015-03-181-10/+22
| | | | llvm-svn: 232636
* Fix uses of reserved identifiers starting with an underscore followed by an ↵David Blaikie2015-03-161-5/+5
| | | | | | | | | uppercase letter This covers essentially all of llvm's headers and libs. One or two weird cases I wasn't sure were worth/appropriate to fix. llvm-svn: 232394
* Simplify expressions involving boolean constants with clang-tidyDavid Blaikie2015-03-091-1/+1
| | | | | | | | Patch by Richard (legalize at xmission dot com). Differential Revision: http://reviews.llvm.org/D8154 llvm-svn: 231617
* MC: Allow multiple comma-separated expressions on the .uleb128 directive.Benjamin Kramer2015-02-191-9/+15
| | | | | | | For compatiblity with GNU as. Binutils documents this as '.uleb128 expressions'. Subtle, isn't it? llvm-svn: 229911
* Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for ↵Aaron Ballman2015-02-151-2/+2
| | | | | | requiring the macro. NFC; LLVM edition. llvm-svn: 229340
* Replace size method call of containers to empty method where appropriateAlexander Kornienko2015-01-151-1/+1
| | | | | | | | | | | | | | | | This patch was generated by a clang tidy checker that is being open sourced. The documentation of that checker is the following: /// The emptiness of a container should be checked using the empty method /// instead of the size method. It is not guaranteed that size is a /// constant-time function, and it is generally more efficient and also shows /// clearer intent to use empty. Furthermore some containers may implement the /// empty method but not implement the size method. Using empty whenever /// possible makes it easier to switch to another container in the future. Patch by Gábor Horváth! llvm-svn: 226161
* MC: Label definitions are permitted after .set directivesDavid Majnemer2014-12-241-0/+5
| | | | | | | | | .set directives may be overridden by other .set directives as well as label definitions. This fixes PR22019. llvm-svn: 224811
* IAS: correct debug line info for asm macrosSaleem Abdulrasool2014-12-241-4/+8
| | | | | | | | | | | | | | | | | Correct the line information generation for preprocessed assembly. Although we tracked the source information for the macro instantiation, we failed to account for the fact that we were instantiating a macro, which is populated into a new buffer and that the line information would be relative to the definition rather than the actual instantiation location. This could cause the line number associated with the statement to be very high due to wrapping of the difference calculated for the preprocessor line information emitted into the stream. Properly calculate the line for the macro instantiation, referencing the line where the macro is actually used as GCC/gas do. The test case uses x86, though the same problem exists on any other target using the LLVM IAS. llvm-svn: 224810
* Allow target to specify prefix for labelsMatt Arsenault2014-12-041-1/+1
| | | | | | | | Use the MCAsmInfo instead of the DataLayout, and allow specifying a custom prefix for labels specifically. HSAIL requires that labels begin with @, but global symbols with &. llvm-svn: 223323
* Revert r221150, as it broke sanitizer testsOliver Stannard2014-11-031-9/+2
| | | | llvm-svn: 221151
* Emit .eh_frame with relocations to functions, rather than sectionsOliver Stannard2014-11-031-2/+9
| | | | | | | | | | | | | | | | | | | | | | | When LLVM emits DWARF call frame information, it currently creates a local, section-relative symbol in the code section, which is pointed to by a relocation on the .eh_frame section. However, for C++ we emit some functions in section groups, and the SysV ABI has some rules to make it easier to remove these sections (http://www.sco.com/developers/gabi/latest/ch4.sheader.html#section_group_rules): A symbol table entry with STB_LOCAL binding that is defined relative to one of a group's sections, and that is contained in a symbol table section that is not part of the group, must be discarded if the group members are discarded. References to this symbol table entry from outside the group are not allowed. This means that we need to use the function symbol for the relocation, not a temporary symbol. There was a comment in the code claiming that the local symbol was used to avoid creating a relocation, but a relocation must be created anyway as the code and CFI are in different sections. llvm-svn: 221150
* Simplify handling of --noexecstack by using getNonexecutableStackSection.Rafael Espindola2014-10-151-2/+2
| | | | llvm-svn: 219799
* MCParser: Modernize memory handling.Benjamin Kramer2014-10-031-37/+22
| | | | | | NFC. llvm-svn: 218998
* ms-inline-asm: Add a sema callback for looking up label namesEhsan Akhgari2014-09-221-6/+18
| | | | | | | | | | | | | | | The implementation of the callback in clang's Sema will return an internal name for labels. Test Plan: Will be tested in clang. Reviewers: rnk Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D4587 llvm-svn: 218229
* Fix left shifts by too large exponents in MCParserAlexey Samsonov2014-09-021-7/+8
| | | | | | | | (which happened only on error recovery path). This bug was reported by UBSan. llvm-svn: 216915
* Return a std::unique_ptr when creating a new MemoryBuffer.Rafael Espindola2014-08-271-4/+4
| | | | llvm-svn: 216583
* Remove unused argument.Rafael Espindola2014-08-271-9/+6
| | | | llvm-svn: 216580
* Convert MC command line option for fatal assembler warnings into aJoerg Sonnenberger2014-08-261-5/+1
| | | | | | proper flag. llvm-svn: 216471
* Explicitly pass ownership of the MemoryBuffer to AddNewSourceBuffer using ↵David Blaikie2014-08-211-6/+6
| | | | | | std::unique_ptr llvm-svn: 216223
* Don't allow MCStreamer::EmitIntValue to output 0-byte integers.Alexey Samsonov2014-08-201-1/+2
| | | | | | | | It makes no sense and can hide bugs. In particular, it lead to left shift by 64 bits, which is an undefined behavior, properly reported by UBSan. llvm-svn: 216134
* TableGen: allow use of uint64_t for available features mask.Tim Northover2014-08-181-1/+1
| | | | | | | | | | ARM in particular is getting dangerously close to exceeding 32 bits worth of possible subtarget features. When this happens, various parts of MC start to fail inexplicably as masks get truncated to "unsigned". Mostly just refactoring at present, and there's probably no way to test. llvm-svn: 215887
* Remove unused member variable.Rafael Espindola2014-08-171-10/+7
| | | | llvm-svn: 215860
* Enable Darwin vararg parameters support in assembler macros.Kevin Enderby2014-08-041-1/+1
| | | | | | | | | Duplicate the vararg tests for linux and add a tests which mixed vararg arguments with darwin positional parameters. Patch by: Janne Grunau <j@jannau.net> llvm-svn: 214799
* Let the integrated assembler understand .exitm, PR20426.Nico Weber2014-07-241-8/+40
| | | | llvm-svn: 213876
* Remove unused field MacroInstantiation::TheMacro. No behavior change.Nico Weber2014-07-241-11/+6
| | | | llvm-svn: 213874
* Let the integrated assembler understand .warning, PR20428.Nico Weber2014-07-241-1/+33
| | | | llvm-svn: 213873
* ms inline asm: Don't add x86 segment registers to the clobber list.Nico Weber2014-07-171-1/+2
| | | | | | | Clang tries to check the clobber list but doesn't list segment registers in its x86 register list. This fixes PR20343. llvm-svn: 213303
* This only needs a StringRef.Rafael Espindola2014-07-061-5/+6
| | | | llvm-svn: 212401
* SourceMgr: make valid buffer IDs start from oneAlp Toker2014-07-061-26/+26
| | | | | | | | | | Use 0 for the invalid buffer instead of -1/~0 and switch to unsigned representation to enable more idiomatic usage. Also introduce a trivial SourceMgr::getMainFileID() instead of hard-coding 0/1 to identify the main file. llvm-svn: 212398
* Revert "Introduce a string_ostream string builder facilty"Alp Toker2014-06-261-2/+4
| | | | | | Temporarily back out commits r211749, r211752 and r211754. llvm-svn: 211814
* Introduce a string_ostream string builder faciltyAlp Toker2014-06-261-4/+2
| | | | | | | | | | | | | | | | | | | | string_ostream is a safe and efficient string builder that combines opaque stack storage with a built-in ostream interface. small_string_ostream<bytes> additionally permits an explicit stack storage size other than the default 128 bytes to be provided. Beyond that, storage is transferred to the heap. This convenient class can be used in most places an std::string+raw_string_ostream pair or SmallString<>+raw_svector_ostream pair would previously have been used, in order to guarantee consistent access without byte truncation. The patch also converts much of LLVM to use the new facility. These changes include several probable bug fixes for truncated output, a programming error that's no longer possible with the new interface. llvm-svn: 211749
* MC: Cleanup parseMSInlineAsmDavid Majnemer2014-06-231-16/+13
| | | | | | | | | Utilize range based for-loops to simplify some code. Use insert() instead of a loop for simplicity/efficiency. No functionality change. llvm-svn: 211486
* Emit DWARF info for all code section in an assembly fileOliver Stannard2014-06-191-8/+9
| | | | | | | | Currently, when using llvm as an assembler, DWARF debug information is only generated for the .text section. This patch modifies this so that DWARF info is emitted for all executable sections. llvm-svn: 211273
* MS asm: Properly handle quoted symbol namesDavid Majnemer2014-06-191-1/+13
| | | | | | | | | | | | | We would get confused by '@' characters in symbol names, we would mistake the text following them for the variant kind. When an identifier a string, the variant kind will never show up inside of it. Instead, check to see if there is a variant following the string. This fixes PR19965. llvm-svn: 211249
* MCAsmParser: full support for gas' '.if{cond} expression' directivesSaleem Abdulrasool2014-06-181-8/+41
| | | | | | Patch by Janne Grunau! llvm-svn: 211218
* AsmMatchers: Use unique_ptr to manage ownership of MCParsedAsmOperandDavid Blaikie2014-06-081-19/+12
| | | | | | | | | | | | I saw at least a memory leak or two from inspection (on probably untested error paths) and r206991, which was the original inspiration for this change. I ran this idea by Jim Grosbach a few weeks ago & he was OK with it. Since it's a basically mechanical patch that seemed sufficient - usual post-commit review, revert, etc, as needed. llvm-svn: 210427
* MC: initialise MCAsmParser variableSaleem Abdulrasool2014-05-221-2/+2
| | | | | | | Properly initialise HadError to false during construction. Detected as use-of-uninitialised variable by MSan! llvm-svn: 209393
* MC: loosen an overzealous assertionSaleem Abdulrasool2014-05-211-1/+2
| | | | | | | | Permit active macro expansions when terminating the assembler if there were errors during the expansion. This would only trigger on invalid input when built with assertions. llvm-svn: 209309
* raw_ostream: Forward declare OpenFlags and include FileSystem.h only where ↵Benjamin Kramer2014-04-291-0/+1
| | | | | | necessary. llvm-svn: 207593
* [C++] Use 'nullptr'.Craig Topper2014-04-241-16/+16
| | | | 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
OpenPOWER on IntegriCloud