aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaStmtAsm.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-08-24 00:07:09 +0000
committerChad Rosier <mcrosier@apple.com>2012-08-24 00:07:09 +0000
commit633abb0ea01d37ab9c8e4ce1ee9e48894a12dfca (patch)
tree2abbddcfc5221de0fab55c2a4cd2ddf1e020d313 /lib/Sema/SemaStmtAsm.cpp
parent5a90193ad825656d4a03099cd5e9c928d1782b5e (diff)
[ms-inline asm] Add the basic APIs for Exprs to the MSAsmStmt AST. Next we need
generate the Input/Output expressions using Sema::ActOnIdExpression(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162509 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaStmtAsm.cpp')
-rw-r--r--lib/Sema/SemaStmtAsm.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/Sema/SemaStmtAsm.cpp b/lib/Sema/SemaStmtAsm.cpp
index 38bc254438..039aa1eaaf 100644
--- a/lib/Sema/SemaStmtAsm.cpp
+++ b/lib/Sema/SemaStmtAsm.cpp
@@ -458,7 +458,8 @@ static std::string buildMSAsmString(Sema &SemaRef, ArrayRef<Token> AsmToks,
MSAsmStmt *NS = \
new (Context) MSAsmStmt(Context, AsmLoc, LBraceLoc, /*IsSimple*/ true, \
/*IsVolatile*/ true, AsmToks, Inputs, Outputs, \
- AsmString, Clobbers, EndLoc);
+ InputExprs, OutputExprs, AsmString, Clobbers, \
+ EndLoc);
StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc,
SourceLocation LBraceLoc,
@@ -470,6 +471,8 @@ StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc,
std::set<std::string> ClobberRegs;
SmallVector<IdentifierInfo*, 4> Inputs;
SmallVector<IdentifierInfo*, 4> Outputs;
+ SmallVector<Expr*, 4> InputExprs;
+ SmallVector<Expr*, 4> OutputExprs;
// Empty asm statements don't need to instantiate the AsmParser, etc.
if (AsmToks.empty()) {
@@ -593,8 +596,16 @@ StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc,
IdentifierInfo *II = getIdentifierInfo(Name, AsmToks,
AsmTokRanges[StrIdx].first,
AsmTokRanges[StrIdx].second);
- if (II)
- isDef ? Outputs.push_back(II) : Inputs.push_back(II);
+ if (II) {
+ // FIXME: Compute the InputExpr/OutputExpr using ActOnIdExpression().
+ if (isDef) {
+ Outputs.push_back(II);
+ OutputExprs.push_back(0);
+ } else {
+ Inputs.push_back(II);
+ InputExprs.push_back(0);
+ }
+ }
}
}
}
@@ -606,6 +617,7 @@ StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc,
MSAsmStmt *NS =
new (Context) MSAsmStmt(Context, AsmLoc, LBraceLoc, IsSimple,
/*IsVolatile*/ true, AsmToks, Inputs, Outputs,
- AsmString, Clobbers, EndLoc);
+ InputExprs, OutputExprs, AsmString, Clobbers,
+ EndLoc);
return Owned(NS);
}