summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCParser
Commit message (Collapse)AuthorAgeFilesLines
...
* [ms-inline asm] Add the helper function, isParseringInlineAsm(). To be used ↵Chad Rosier2012-10-161-0/+1
| | | | | | in a future commit. llvm-svn: 166054
* [ms-inline asm] If we parsed a statement and the opcode is valid, then it's ↵Chad Rosier2012-10-151-5/+2
| | | | | | an instruction. llvm-svn: 165955
* [ms-inline asm] Add a few new APIs to the AsmParser class in support of MS-StyleChad Rosier2012-10-151-13/+34
| | | | | | | | | inline assembly. For the time being, these will be called directly by clang. However, in the near future I expect these to be sunk back into the MC layer and more basic APIs (e.g., getClobbers(), getConstraints(), etc.) will be called by clang. llvm-svn: 165946
* [ms-inline asm] Remove the MatchInstruction() function. Previously, this wasChad Rosier2012-10-131-5/+15
| | | | | | | | | | | the interface between the front-end and the MC layer when parsing inline assembly. Unfortunately, this is too deep into the parsing stack. Specifically, we're unable to handle target-independent assembly (i.e., assembly directives, labels, etc.). Note the MatchAndEmitInstruction() isn't the correct abstraction either. I'll be exposing target-independent hooks shortly, so this is really just a cleanup. llvm-svn: 165858
* Whitespace.Chad Rosier2012-10-091-3/+0
| | | | llvm-svn: 165540
* Add support for macro parameters/arguments delimited by spaces,Preston Gurd2012-09-193-25/+133
| | | | | | | | | | to improve compatibility with GNU as. Based on a patch by PaX Team. Fixed assertion failures on non-Darwin and added additional test cases. llvm-svn: 164248
* Support default parameters/arguments for assembler macros.Preston Gurd2012-09-191-7/+31
| | | | | | | | This patch is based on the one by PaX Team. Patch by Andy Zhang! llvm-svn: 164246
* Enhance unmatched '.endr' directive error message in assembler.Preston Gurd2012-09-191-1/+1
| | | | | | | | The directive can be matched with directives other than '.rept' Patch by Andy Zhang! llvm-svn: 164245
* Use LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.Craig Topper2012-09-151-2/+2
| | | | llvm-svn: 163970
* Fix Doxygen issues:Dmitri Gribenko2012-09-141-2/+2
| | | | | | | | | | * wrap code blocks in \code ... \endcode; * refer to parameter names in paragraphs correctly (\arg is not what most people want -- it starts a new paragraph); * use \param instead of \arg to document parameters in order to be consistent with the rest of the codebase. llvm-svn: 163902
* Assembler: Darwin variables defined via .set are no-dead-strip.Jim Grosbach2012-09-131-3/+8
| | | | | | | | For gas compatibility. rdar://12219394 llvm-svn: 163854
* Release build: guard dump functions withManman Ren2012-09-121-1/+1
| | | | | | | | "#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)" No functional change. Update r163344. llvm-svn: 163679
* Remove redundant semicolons which are null statements.Dmitri Gribenko2012-09-101-1/+1
| | | | llvm-svn: 163547
* Fix alignment of .comm and .lcomm on mingw32.Benjamin Kramer2012-09-071-2/+4
| | | | | | | | For some reason .lcomm uses byte alignment and .comm log2 alignment so we can't use the same setting for both. Fix this by reintroducing the LCOMM enum. I verified this against mingw's gcc. llvm-svn: 163420
* MC: Overhaul handling of .lcommBenjamin Kramer2012-09-071-6/+5
| | | | | | | | | | | | | - Darwin lied about not supporting .lcomm and turned it into zerofill in the asm parser. Push the zerofill-conversion down into macho-specific code. - This makes the tri-state LCOMMType enum superfluous, there are no targets without .lcomm. - Do proper error reporting when trying to use .lcomm with alignment on a target that doesn't support it. - .comm and .lcomm alignment was parsed in bytes on COFF, should be power of 2. - Fixes PR13755 (.lcomm crashes on ELF). llvm-svn: 163395
* Release build: guard dump functions with "ifndef NDEBUG"Manman Ren2012-09-061-0/+2
| | | | | | No functional change. llvm-svn: 163344
* Add virtual keywords for methods that override the base class.Craig Topper2012-08-291-8/+8
| | | | llvm-svn: 162826
* Fix macros arguments with an underscore, dot or dollar in them. This is basedRafael Espindola2012-08-211-1/+9
| | | | | | on a patch by Andy/PaX. I added the support for dot and dollar. llvm-svn: 162298
* Make the wording in of the "expected identifier" error in the .macro directiveRafael Espindola2012-08-211-2/+2
| | | | | | | consistent with the other "expected identifier" errors. Extracted from the Andy/PaX patch. I added the test. llvm-svn: 162291
* Use typedefs. Fix indentation. Extracted from the Andy/PaX patch.Rafael Espindola2012-08-211-5/+4
| | | | llvm-svn: 162283
* Remove unused variable. Extracted from the Andy/PaX patch.Rafael Espindola2012-08-211-2/+0
| | | | llvm-svn: 162282
* Fix typo. Extracted from the Andy/PaX patch.Rafael Espindola2012-08-211-1/+1
| | | | llvm-svn: 162281
* Typedefs and indentation fixes from the Andy Zhang/PAX macro argument patch.Rafael Espindola2012-08-081-26/+28
| | | | | | Committing it first as it makes the "real" patch a lot easier to read. llvm-svn: 161491
* Add `.pushsection', `.popsection', and `.previous' directives to Darwin ASM.Bill Wendling2012-08-081-2/+39
| | | | | | | | | | | | | | | | | | | | There are situations where inline ASM may want to change the section -- for instance, to create a variable in the .data section. However, it cannot do this without (potentially) restoring to the wrong section. E.g.: asm volatile (".section __DATA, __data\n\t" ".globl _fnord\n\t" "_fnord: .quad 1f\n\t" ".text\n\t" "1:" :::); This may be wrong if this is inlined into a function that has a "section" attribute. The user should use `.pushsection' and `.popsection' here instead. The addition of `.previous' is added for completeness. <rdar://problem/12048387> llvm-svn: 161477
* Keep empty assembly macro argument values in the middle of the list.Jim Grosbach2012-07-301-2/+8
| | | | | | | | | | | | | | | | | | | Empty macro arguments at the end of the list should be as-if not specified at all, but those in the middle of the list need to be kept so as not to screw up the positional numbering. E.g.: .macro foo foo_-bash___: nop .endm foo 1, 2, 3, 4 foo 1, , 3, 4 Should create two labels, "foo_1_2_3_4" and "foo_1__3_4". rdar://11948769 llvm-svn: 161002
* Fix a typo (the the => the)Sylvestre Ledru2012-07-231-1/+1
| | | | llvm-svn: 160621
* Remove tabs.Bill Wendling2012-07-191-2/+2
| | | | llvm-svn: 160475
* Enable target dependent directive parsing to hook before standard parser inAkira Hatanaka2012-07-051-3/+5
| | | | | | | | AsmParser::ParseStatement. Patch by Vladimir Medic. llvm-svn: 159768
* Implement irpc. Extracted from a patch by the PaX team. I just added the test.Rafael Espindola2012-06-161-0/+57
| | | | llvm-svn: 158604
* Factor macro argument parsing into helper methods and add support for .irp.Rafael Espindola2012-06-151-30/+115
| | | | | | | Patch extracted from a larger one by the PaX team. I added the testcases and tightened error handling a bit. llvm-svn: 158523
* Represent .rept as an anonymous macro. This removes the need for the ActiveReptRafael Espindola2012-06-031-55/+88
| | | | | | | vector. No functionality change. Extracted from a patch by the PaX Team. llvm-svn: 157909
* Add a typedef to simplify the code a bit. Not functionality change.Rafael Espindola2012-06-031-7/+9
| | | | | | Part of a patch by the PaX Team. llvm-svn: 157908
* Fix typos found by http://github.com/lyda/misspell-checkBenjamin Kramer2012-06-021-1/+1
| | | | llvm-svn: 157885
* Refactor data-in-code annotations.Jim Grosbach2012-05-181-0/+42
| | | | | | | | | | | | | | | | | | | | | | Use a dedicated MachO load command to annotate data-in-code regions. This is the same format the linker produces for final executable images, allowing consistency of representation and use of introspection tools for both object and executable files. Data-in-code regions are annotated via ".data_region"/".end_data_region" directive pairs, with an optional region type. data_region_directive := ".data_region" { region_type } region_type := "jt8" | "jt16" | "jt32" | "jta32" end_data_region_directive := ".end_data_region" The previous handling of ARM-style "$d.*" labels was broken and has been removed. Specifically, it didn't handle ARM vs. Thumb mode when marking the end of the section. rdar://11459456 llvm-svn: 157062
* Fix spacing after if.Benjamin Kramer2012-05-121-6/+5
| | | | llvm-svn: 156716
* Add support for the .rept directive. Patch by Vladmir Sorokin. I added supportRafael Espindola2012-05-121-0/+91
| | | | | | for nesting. llvm-svn: 156714
* ELF: Add support for the asm .version directive.Benjamin Kramer2012-05-121-0/+28
| | | | llvm-svn: 156712
* AsmParser: Add support for the .purgem directive.Benjamin Kramer2012-05-121-0/+23
| | | | | | Based on a patch by Team PaX. llvm-svn: 156709
* AsmParser: Give a nice error message for .code16gcc, which is currently ↵Benjamin Kramer2012-05-121-1/+1
| | | | | | | | unsupported. Patch by Team PaX! llvm-svn: 156708
* AsmParser: ignore the .extern directive.Benjamin Kramer2012-05-121-0/+4
| | | | llvm-svn: 156707
* AsmParser: Add support for .ifc and .ifnc directives.Benjamin Kramer2012-05-121-0/+54
| | | | | | Based on a patch from PaX Team. llvm-svn: 156706
* AsmParser: Add support for .ifb and .ifnb directives.Benjamin Kramer2012-05-121-0/+29
| | | | | | Based on a patch from PaX Team. llvm-svn: 156705
* MC: Unknown assembler directives are now hard errors.Jim Grosbach2012-05-011-1/+1
| | | | | | | | | | | | | | | | Previously, an unsupported/unknown assembler directive issued a warning. That's generally unsafe, and inconsistent with the behaviour of pretty much every system assembler. Now that the MC assemblers are mature enough to be the default on multiple targets, it's reasonable to issue errors for these. For target or platform directives that need to stay warnings, we should add explicit handlers for them in, e.g., ELFAsmParser.cpp, DarwinAsmParser.cpp, et. al., and issue the warning there. rdar://9246275 llvm-svn: 155926
* MC: Remove errant EatToEndOfStatement() in asm parser.Jim Grosbach2012-05-011-3/+1
| | | | | | | | | | | | The caller is already responsible for eating any additional input on the line. Putting an additional EatToEndOfStatement() in ParseStatement() causes an entire extra statement to be consumed when treating warnings as errors. For example, test/MC/macros.s will assert() because the .endmacro directive is missed as a result. rdar://11355843 llvm-svn: 155925
* MC assembly parser handling for trailing comma in macro instantiation.Jim Grosbach2012-04-161-5/+5
| | | | | | | | | A trailing comma means no argument at all (i.e., as if the comma were not present), not an empty argument to the invokee. rdar://11252521 llvm-svn: 154863
* Prune some includesCraig Topper2012-03-271-1/+0
| | | | llvm-svn: 153502
* Assembler should accept redefinitions of unused variable symbols.Jim Grosbach2012-03-201-0/+2
| | | | | | rdar://11027851 llvm-svn: 153137
* MC asm parser macro argument count was wrong when empty.Jim Grosbach2012-03-171-0/+5
| | | | | | | | evaluated to '1' when the argument list was empty (should be '0'). rdar://11057257 llvm-svn: 152967
* Convert assert(0) to llvm_unreachableCraig Topper2012-02-071-2/+1
| | | | llvm-svn: 149967
* Add assembler dialect attribute in asm parser which lets target specific asm ↵Devang Patel2012-01-311-2/+14
| | | | | | parser change dialect on the fly. llvm-svn: 149396
OpenPOWER on IntegriCloud