diff options
author | Chad Rosier <mcrosier@apple.com> | 2012-10-12 23:32:10 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2012-10-12 23:32:10 +0000 |
commit | de31b28eb7d982ed6802986c2ea94b4e955c5366 (patch) | |
tree | 5b940f00d8ffbb4438478f33c4f2e859bb8aa577 /lib/Sema | |
parent | 6505a29cfd629e1a4820282b4cf3871efc1e696f (diff) |
[ms-inline asm] Remove a bunch of parsing code from the front-end.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165851 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/SemaStmtAsm.cpp | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/lib/Sema/SemaStmtAsm.cpp b/lib/Sema/SemaStmtAsm.cpp index a3a1df62d9..f99c983453 100644 --- a/lib/Sema/SemaStmtAsm.cpp +++ b/lib/Sema/SemaStmtAsm.cpp @@ -331,25 +331,6 @@ static StringRef getSpelling(Sema &SemaRef, Token AsmTok) { return Asm; } -// Determine if this is a simple MSAsm instruction. -static bool isSimpleMSAsm(std::vector<StringRef> &Pieces, - const TargetInfo &TI) { - for (unsigned i = 1, e = Pieces.size(); i != e; ++i) { - if (!TI.isValidGCCRegisterName(Pieces[i])) - return false; - } - return true; -} - -// Determine if this is a simple MSAsm block. -static bool isSimpleMSAsm(std::vector<std::vector<StringRef> > Pieces, - const TargetInfo &TI) { - for (unsigned i = 0, e = Pieces.size(); i != e; ++i) - if (!isSimpleMSAsm(Pieces[i], TI)) - return false; - return true; -} - // Break the AsmString into pieces (i.e., mnemonic and operands). static void buildMSAsmPieces(StringRef Asm, std::vector<StringRef> &Pieces) { std::pair<StringRef,StringRef> Split = Asm.split(' '); @@ -447,8 +428,6 @@ StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc, SourceLocation LBraceLoc, std::vector<std::vector<StringRef> > Pieces(AsmStrings.size()); buildMSAsmPieces(AsmStrings, Pieces); - bool IsSimple = isSimpleMSAsm(Pieces, Context.getTargetInfo()); - // Get the target specific parser. std::string Error; const std::string &TT = Context.getTargetInfo().getTriple().getTriple(); @@ -640,6 +619,7 @@ StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc, SourceLocation LBraceLoc, } } + bool IsSimple = Inputs.size() != 0 || Outputs.size() != 0; MSAsmStmt *NS = new (Context) MSAsmStmt(Context, AsmLoc, LBraceLoc, IsSimple, /*IsVolatile*/ true, AsmToks, Inputs, Outputs, |