aboutsummaryrefslogtreecommitdiff
path: root/include/clang/AST/Stmt.h
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-08-28 20:28:20 +0000
committerChad Rosier <mcrosier@apple.com>2012-08-28 20:28:20 +0000
commit89fb6d7eba51c7864ec544e07accd23b24057122 (patch)
treede7f2a49582fa01408145ce8a273b651393d7564 /include/clang/AST/Stmt.h
parent5abd3d2ba4c4edb5140de5d65a16e5da4076f0b1 (diff)
downloadclang-89fb6d7eba51c7864ec544e07accd23b24057122.tar.gz
[ms-inline asm] Add constraints to MSAsmStmt. We don't currently compute
the constraints, so in the interim we speculatively assume a 'r' constraint. This is expected to work for most cases on x86. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162784 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST/Stmt.h')
-rw-r--r--include/clang/AST/Stmt.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h
index 2303cb910f..042c513552 100644
--- a/include/clang/AST/Stmt.h
+++ b/include/clang/AST/Stmt.h
@@ -1677,6 +1677,7 @@ class MSAsmStmt : public AsmStmt {
unsigned NumAsmToks;
Token *AsmToks;
+ StringRef *Constraints;
StringRef *Clobbers;
public:
@@ -1684,12 +1685,12 @@ public:
bool issimple, bool isvolatile, ArrayRef<Token> asmtoks,
ArrayRef<IdentifierInfo*> inputs, ArrayRef<IdentifierInfo*> outputs,
ArrayRef<Expr*> inputexprs, ArrayRef<Expr*> outputexprs,
- StringRef asmstr, ArrayRef<StringRef> clobbers,
- SourceLocation endloc);
+ StringRef asmstr, ArrayRef<StringRef> constraints,
+ ArrayRef<StringRef> clobbers, SourceLocation endloc);
/// \brief Build an empty MS-style inline-assembly statement.
explicit MSAsmStmt(EmptyShell Empty) : AsmStmt(MSAsmStmtClass, Empty),
- NumAsmToks(0), AsmToks(0), Clobbers(0) { }
+ NumAsmToks(0), AsmToks(0), Constraints(0), Clobbers(0) { }
SourceLocation getLBraceLoc() const { return LBraceLoc; }
void setLBraceLoc(SourceLocation L) { LBraceLoc = L; }
@@ -1712,7 +1713,9 @@ public:
//===--- Output operands ---===//
- StringRef getOutputConstraint(unsigned i) const;
+ StringRef getOutputConstraint(unsigned i) const {
+ return Constraints[i];
+ }
Expr *getOutputExpr(unsigned i);
@@ -1722,7 +1725,9 @@ public:
//===--- Input operands ---===//
- StringRef getInputConstraint(unsigned i) const;
+ StringRef getInputConstraint(unsigned i) const {
+ return Constraints[i + NumOutputs];
+ }
Expr *getInputExpr(unsigned i);
void setInputExpr(unsigned i, Expr *E);