summaryrefslogtreecommitdiff
path: root/include/llvm/MC/MCParser
Commit message (Collapse)AuthorAge
* Support C99 hexadecimal floating-point literals in assemblyTim Northover2013-08-14
| | | | | | | | It's useful to be able to write down floating-point numbers without having to worry about what they'll be rounded to (as C99 discovered), this extends that ability to the MC assembly parsers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188370 91177308-0d34-0410-b5e6-96231b3b80d8
* Whitespace.Jim Grosbach2013-06-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183086 91177308-0d34-0410-b5e6-96231b3b80d8
* Add ArrayRef constructor from None, and do the cleanups that this ↵Dmitri Gribenko2013-05-05
| | | | | | | | | constructor enables Patch by Robert Wilhelm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181138 91177308-0d34-0410-b5e6-96231b3b80d8
* In MC asm parsing, account for the possibility of whitespace withinJohn McCall2013-05-03
| | | | | | | | | | | | | | the "identifier" parsed by the frontend callback by skipping forward until we've consumed a token that ends at the point dictated by the callback. In addition, inform the callback when it's parsing an unevaluated operand (e.g. mov eax, LENGTH A::x) as opposed to an evaluated one (e.g. mov eax, [A::x]). This commit depends on a clang commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180978 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add the OpDecl to the InlineAsmIdentifierInfo struct and in turnChad Rosier2013-04-22
| | | | | | | the MCParsedAsmOperand. Part of rdar://13663589 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180054 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Remove the identifier parsing logic from the AsmParser. This isChad Rosier2013-04-22
| | | | | | | | now taken care of by the frontend, which allows us to parse arbitrary C/C++ variables. Part of rdar://13663589 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180037 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Refactor/clean up the SemaLookup interface. No functionalChad Rosier2013-04-22
| | | | | | | change indended. Part of rdar://13663589 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180028 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r179115, but use parsePrimaryExpression a little more judiciously.Chad Rosier2013-04-10
| | | | | | | | | | | | | | | | | Test cases that regressed due to r179115, plus a few more, were added in r179182. Original commit message below: [ms-inline asm] Use parsePrimaryExpr in lieu of parseExpression if we need to parse an identifier. Otherwise, parseExpression may parse multiple tokens, which makes it impossible to properly compute an immediate displacement. An example of such a case is the source operand (i.e., [Symbol + ImmDisp]) in the below example: __asm mov eax, [Symbol + ImmDisp] Part of rdar://13611297 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179187 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r179115 as it looks to have killed the ASan tests.Chad Rosier2013-04-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179120 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Use parsePrimaryExpr in lieu of parseExpression if we need toChad Rosier2013-04-09
| | | | | | | | | | | | | | | parse an identifier. Otherwise, parseExpression may parse multiple tokens, which makes it impossible to properly compute an immediate displacement. An example of such a case is the source operand (i.e., [Symbol + ImmDisp]) in the below example: __asm mov eax, [Symbol + ImmDisp] The existing test cases exercise this patch. rdar://13611297 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179115 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Maintain a StringRef to reference a symbol in a parsed operand,Chad Rosier2013-04-09
| | | | | | | | | | | | | rather than deriving the StringRef from the Start and End SMLocs. Using the Start and End SMLocs works fine for operands such as [Symbol], but not for operands such as [Symbol + ImmDisp]. All existing test cases that reference a variable exercise this patch. rdar://13602265 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179109 91177308-0d34-0410-b5e6-96231b3b80d8
* Dead code.Chad Rosier2013-03-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177450 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Move the size directive asm rewrite into the target specificChad Rosier2013-03-19
| | | | | | | logic as a QOI cleanup. rdar://13445327 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177413 91177308-0d34-0410-b5e6-96231b3b80d8
* MCParser: Update method names per coding guidelines.Jim Grosbach2013-02-20
| | | | | | | | | | | | | | | | | | | s/AddDirectiveHandler/addDirectiveHandler/ s/ParseMSInlineAsm/parseMSInlineAsm/ s/ParseIdentifier/parseIdentifier/ s/ParseStringToEndOfStatement/parseStringToEndOfStatement/ s/ParseEscapedString/parseEscapedString/ s/EatToEndOfStatement/eatToEndOfStatement/ s/ParseExpression/parseExpression/ s/ParseParenExpression/parseParenExpression/ s/ParseAbsoluteExpression/parseAbsoluteExpression/ s/CheckForValidSection/checkForValidSection/ http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175675 91177308-0d34-0410-b5e6-96231b3b80d8
* Grammar.Eric Christopher2013-02-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175493 91177308-0d34-0410-b5e6-96231b3b80d8
* [MC] Expose ParseEscapedString to target AsmParser implementations.Daniel Dunbar2013-01-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172777 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add support for the 'SIZE' and 'LENGTH' operators.Chad Rosier2013-01-17
| | | | | | | Part of rdar://12576868 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172743 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up some unnecessary headers and forward declarationsEli Bendersky2013-01-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172638 91177308-0d34-0410-b5e6-96231b3b80d8
* Now that GenericAsmParser was folded into AsmParser, some methods and types canEli Bendersky2013-01-16
| | | | | | | | return into the safe harbor of AsmParser's private areas. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172637 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the ExtensionDirectiveHandler type in other places where it makes sense.Eli Bendersky2013-01-16
| | | | | | | | | Since we already have this type it's a shame to keep dragging a pair of object and method around explicitly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172584 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly encapsulate additional methods and data from AsmParser.Eli Bendersky2013-01-14
| | | | | | | | | | | This finally allows AsmParser to no longer list GenericAsmParser as a friend. All member vars directly accessed by GenericAsmParser have been properly encapsulated and exposed through the MCAsmParser interface. This reduces the coupling between AsmParser and GenericAsmParser. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172490 91177308-0d34-0410-b5e6-96231b3b80d8
* Move CheckForValidSection to the MCAsmParser interface.Eli Bendersky2013-01-14
| | | | | | | | | | | | | | Now that it behaves itself in terms of streamer independence (r172450), this method can be moved to MCAsmParser to be available to all extensions, overriding, etc. -- -This line, and those below, will be ignored-- M lib/MC/MCParser/AsmParser.cpp M include/llvm/MC/MCParser/MCAsmParser.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172451 91177308-0d34-0410-b5e6-96231b3b80d8
* Move ParseMacroArgument to the MCAsmParser interfance.Eli Bendersky2013-01-14
| | | | | | | | | | | | | | Since it's used by extensions. One further step to fully decoupling GenericAsmParser from an intimate knowledge of the internals of AsmParser, pointing it to the MCASmParser interface instead (like all other parser extensions do). Since this change moves the MacroArgument type to the interface header, it's renamed to be a bit more descriptive in a general context. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172449 91177308-0d34-0410-b5e6-96231b3b80d8
* Encapsulate the MacroEnabled flag in AsmParser behind accessor methods.Eli Bendersky2013-01-14
| | | | | | | | | | The methods are also exposed via the MCAsmParser interface, which allows more than one client to control them. Previously, GenericAsmParser was playing with a member var in AsmParser directly (by virtue of being its friend). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172440 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add support for calling functions from inline assembly.Chad Rosier2013-01-10
| | | | | | Part of rdar://12991541 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172121 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix include guards so they exactly match file names.Jakub Staszak2013-01-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172025 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove MCTargetAsmLexer and its derived classes now that edis,Roman Divacky2012-12-20
| | | | | | | its only user, is gone. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170699 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort the #include lines for the include/... tree with the script.Chandler Carruth2012-12-03
| | | | | | | | | | AKA: Recompile *ALL* the source code! This one went much better. No manual edits here. I spot-checked for silliness and grep-checked for really broken edits and everything seemed good. It all still compiles. Yell if you see something that looks goofy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169133 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add support for the TYPE operator.Chad Rosier2012-10-26
| | | | | | | Part of rdar://12576868 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166790 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Perform field lookups with the dot operator.Chad Rosier2012-10-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166724 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add an implementation of the offset operator. This is a followChad Rosier2012-10-23
| | | | | | | on patch to r166433. rdar://12470317 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166488 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline-asm] Implement _emit directive (which is roughly equivalent to ↵Eli Friedman2012-10-22
| | | | | | | | | | .byte). <rdar://problem/12470345>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166451 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add the isOffsetOf() function.Chad Rosier2012-10-22
| | | | | | | Part of rdar://12470317 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166436 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Have the TargetParser callback to Sema to determine the size ofChad Rosier2012-10-19
| | | | | | | | | a memory operand. Retain this information and then add the sizing directives to the IR. This allows the backend to do proper instruction selection. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166316 91177308-0d34-0410-b5e6-96231b3b80d8
* Pacify -Wnon-virtual-dtor.Nick Lewycky2012-10-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166270 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add a size argument to the LookupInlineAsmIdentifier() callback,Chad Rosier2012-10-18
| | | | | | | | which will be used by the asm matcher in the near future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166222 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Have the LookupInlineAsmIdentifier() callback function return aChad Rosier2012-10-18
| | | | | | | | *NamedDecl. In turn, build the expressions after we're finished parsing the asm. This avoids a crasher if the lookup fails. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166212 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Move most of the AsmParsing logic in clang back into the MCChad Rosier2012-10-18
| | | | | | | | | layer. Add the ParseMSInlineAsm() function, which is the new interface to clang. Also expose the new MCAsmParserSemaCallback interface, which is used by the back-end to do name lookup in Sema. Finally, remove the now defunct APIs introduced in r165946. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166183 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add the helper function, isParseringInlineAsm(). To be used ↵Chad Rosier2012-10-16
| | | | | | in a future commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166054 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add a few new APIs to the AsmParser class in support of MS-StyleChad Rosier2012-10-15
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165946 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Remove the MatchInstruction() function. Previously, this wasChad Rosier2012-10-13
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165858 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add a few data members and member functions to theChad Rosier2012-10-12
| | | | | | | MCParsedAsmOperand class in support of ms-style inline assembly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165830 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 165057, per Jim's request. This requires further discussion.Chad Rosier2012-10-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165069 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add basic support for wildcard MCParsedAsmOperands. This typeChad Rosier2012-10-02
| | | | | | | | | | | | | | of operand is specific to MS-style inline assembly and should not be generated when parsing normal assembly. The purpose of the wildcard operands are to allow the AsmParser to match multiple instructions (i.e., MCInsts) to a given ms-style asm statement. For the time being the matcher just returns the first match. This patch only implements wildcard matches for memory operands. Support for register wildcards will be added in the near future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165057 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Expose the getReg() function in the base class.Chad Rosier2012-10-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164969 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for macro parameters/arguments delimited by spaces,Preston Gurd2012-09-19
| | | | | | | | | | | | to improve compatibility with GNU as. Based on a patch by PaX Team. Fixed assertion failures on non-Darwin and added additional test cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164248 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Doxygen issues:Dmitri Gribenko2012-09-14
| | | | | | | | | | | * 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163902 91177308-0d34-0410-b5e6-96231b3b80d8
* Add documentation.Chad Rosier2012-09-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163658 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a few virtual functions to the abstract MCParsedAsmOperand class.Chad Rosier2012-09-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163655 91177308-0d34-0410-b5e6-96231b3b80d8
* Make use of the LLVM_DELETED_FUNCTION macro.Craig Topper2012-08-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162828 91177308-0d34-0410-b5e6-96231b3b80d8