summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-10-23 17:44:40 +0000
committerChad Rosier <mcrosier@apple.com>2012-10-23 17:44:40 +0000
commitb8097dec8fa62d7d930c7375e1373bf1fbd714bc (patch)
tree7f13ec82c1ae16f317af068afb33692532711b22 /clang/lib
parent37e755cee2c84994ffc1f06bb89cb246fe4a1171 (diff)
downloadbcm5719-llvm-b8097dec8fa62d7d930c7375e1373bf1fbd714bc.tar.gz
bcm5719-llvm-b8097dec8fa62d7d930c7375e1373bf1fbd714bc.zip
[ms-inline asm] Update for r166433.
llvm-svn: 166489
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaStmtAsm.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaStmtAsm.cpp b/clang/lib/Sema/SemaStmtAsm.cpp
index f33b87cebcc..3a5f40c74fa 100644
--- a/clang/lib/Sema/SemaStmtAsm.cpp
+++ b/clang/lib/Sema/SemaStmtAsm.cpp
@@ -513,7 +513,7 @@ StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc, SourceLocation LBraceLoc,
unsigned NumOutputs;
unsigned NumInputs;
std::string AsmStringIR;
- SmallVector<void *, 4> OpDecls;
+ SmallVector<std::pair<void *, bool>, 4> OpDecls;
SmallVector<std::string, 4> Constraints;
SmallVector<std::string, 4> Clobbers;
if (Parser->ParseMSInlineAsm(AsmLoc.getPtrEncoding(), AsmStringIR,
@@ -533,7 +533,7 @@ StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc, SourceLocation LBraceLoc,
ConstraintRefs.resize(NumExprs);
Exprs.resize(NumExprs);
for (unsigned i = 0, e = NumExprs; i != e; ++i) {
- NamedDecl *OpDecl = static_cast<NamedDecl *>(OpDecls[i]);
+ NamedDecl *OpDecl = static_cast<NamedDecl *>(OpDecls[i].first);
if (!OpDecl)
return StmtError();
@@ -542,7 +542,12 @@ StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc, SourceLocation LBraceLoc,
OpDecl);
if (OpExpr.isInvalid())
return StmtError();
-
+
+ // Need offset of variable.
+ if (OpDecls[i].second)
+ OpExpr = BuildUnaryOp(getCurScope(), AsmLoc, clang::UO_AddrOf,
+ OpExpr.take());
+
Names[i] = OpDecl->getIdentifier();
ConstraintRefs[i] = StringRef(Constraints[i]);
Exprs[i] = OpExpr.take();
OpenPOWER on IntegriCloud