summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-10-12 23:32:10 +0000
committerChad Rosier <mcrosier@apple.com>2012-10-12 23:32:10 +0000
commitaac08d2c3de03238a95752e6358c952adff8f950 (patch)
tree5a3d1454e22a1f7af3c6ad8bb478e6dca84f72b9 /clang
parentd13b41e32a4c89edf63cd12c688b9f2b40bf6e43 (diff)
downloadbcm5719-llvm-aac08d2c3de03238a95752e6358c952adff8f950.tar.gz
bcm5719-llvm-aac08d2c3de03238a95752e6358c952adff8f950.zip
[ms-inline asm] Remove a bunch of parsing code from the front-end.
llvm-svn: 165851
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Sema/SemaStmtAsm.cpp22
1 files changed, 1 insertions, 21 deletions
diff --git a/clang/lib/Sema/SemaStmtAsm.cpp b/clang/lib/Sema/SemaStmtAsm.cpp
index a3a1df62d9a..f99c9834531 100644
--- a/clang/lib/Sema/SemaStmtAsm.cpp
+++ b/clang/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,
OpenPOWER on IntegriCloud