aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaStmtAsm.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-10-12 21:37:00 +0000
committerChad Rosier <mcrosier@apple.com>2012-10-12 21:37:00 +0000
commitfba3fb9a14f2d729639e0fdb834e3eeb40a8a12a (patch)
tree61c2ff467f540818dea0c4dc624434600f01e3a6 /lib/Sema/SemaStmtAsm.cpp
parentc8b2a863bda198c4be02056929143fed54e68e68 (diff)
[ms-inline asm] Remove a bunch of parsing code from the front-end, which will be
reimplemented in the AsmParser where it belongs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165825 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaStmtAsm.cpp')
-rw-r--r--lib/Sema/SemaStmtAsm.cpp33
1 files changed, 0 insertions, 33 deletions
diff --git a/lib/Sema/SemaStmtAsm.cpp b/lib/Sema/SemaStmtAsm.cpp
index c29a8b17c2..ded1c3f780 100644
--- a/lib/Sema/SemaStmtAsm.cpp
+++ b/lib/Sema/SemaStmtAsm.cpp
@@ -320,17 +320,6 @@ StmtResult Sema::ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple,
return Owned(NS);
}
-// isMSAsmKeyword - Return true if this is an MS-style inline asm keyword. These
-// require special handling.
-static bool isMSAsmKeyword(StringRef Name) {
- bool Ret = llvm::StringSwitch<bool>(Name)
- .Cases("EVEN", "ALIGN", true) // Alignment directives.
- .Cases("LENGTH", "SIZE", "TYPE", true) // Type and variable sizes.
- .Case("_emit", true) // _emit Pseudoinstruction.
- .Default(false);
- return Ret;
-}
-
// getSpelling - Get the spelling of the AsmTok token.
static StringRef getSpelling(Sema &SemaRef, Token AsmTok) {
StringRef Asm;
@@ -342,28 +331,9 @@ static StringRef getSpelling(Sema &SemaRef, Token AsmTok) {
return Asm;
}
-// Determine if we should bail on this MSAsm instruction.
-static bool bailOnMSAsm(std::vector<StringRef> Piece) {
- for (unsigned i = 0, e = Piece.size(); i != e; ++i)
- if (isMSAsmKeyword(Piece[i]))
- return true;
- return false;
-}
-
-// Determine if we should bail on this MSAsm block.
-static bool bailOnMSAsm(std::vector<std::vector<StringRef> > Pieces) {
- for (unsigned i = 0, e = Pieces.size(); i != e; ++i)
- if (bailOnMSAsm(Pieces[i]))
- return true;
- return false;
-}
-
// Determine if this is a simple MSAsm instruction.
static bool isSimpleMSAsm(std::vector<StringRef> &Pieces,
const TargetInfo &TI) {
- if (isMSAsmKeyword(Pieces[0]))
- return false;
-
for (unsigned i = 1, e = Pieces.size(); i != e; ++i) {
if (!TI.isValidGCCRegisterName(Pieces[i]))
return false;
@@ -479,9 +449,6 @@ StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc, SourceLocation LBraceLoc,
bool IsSimple = isSimpleMSAsm(Pieces, Context.getTargetInfo());
- // AsmParser doesn't fully support these asm statements.
- if (bailOnMSAsm(Pieces)) { DEF_SIMPLE_MSASM(EmptyAsmStr); return Owned(NS); }
-
// Get the target specific parser.
std::string Error;
const std::string &TT = Context.getTargetInfo().getTriple().getTriple();