bool IsVolatile;
unsigned NumAsmToks;
+ unsigned NumInputs;
+ unsigned NumOutputs;
unsigned NumClobbers;
Token *AsmToks;
+ IdentifierInfo **Names;
Stmt **Exprs;
StringRef *Clobbers;
public:
MSAsmStmt(ASTContext &C, SourceLocation asmloc, SourceLocation lbraceloc,
bool issimple, bool isvolatile, ArrayRef<Token> asmtoks,
+ ArrayRef<IdentifierInfo*> inputs, ArrayRef<IdentifierInfo*> outputs,
StringRef asmstr, ArrayRef<StringRef> clobbers,
SourceLocation endloc);
std::copy(clobbers, clobbers + NumClobbers, Clobbers);
}
-MSAsmStmt::MSAsmStmt(ASTContext &C,
- SourceLocation asmloc, SourceLocation lbraceloc,
- bool issimple, bool isvolatile, ArrayRef<Token> asmtoks,
- StringRef asmstr, ArrayRef<StringRef> clobbers,
- SourceLocation endloc)
+MSAsmStmt::MSAsmStmt(ASTContext &C, SourceLocation asmloc,
+ SourceLocation lbraceloc, bool issimple, bool isvolatile,
+ ArrayRef<Token> asmtoks, ArrayRef<IdentifierInfo*> inputs,
+ ArrayRef<IdentifierInfo*> outputs, StringRef asmstr,
+ ArrayRef<StringRef> clobbers, SourceLocation endloc)
: Stmt(MSAsmStmtClass), AsmLoc(asmloc), LBraceLoc(lbraceloc), EndLoc(endloc),
AsmStr(asmstr.str()), IsSimple(issimple), IsVolatile(isvolatile),
- NumAsmToks(asmtoks.size()), NumClobbers(clobbers.size()) {
+ NumAsmToks(asmtoks.size()), NumInputs(inputs.size()),
+ NumOutputs(outputs.size()), NumClobbers(clobbers.size()) {
+
+ unsigned NumExprs = NumOutputs + NumInputs;
+
+ Names = new (C) IdentifierInfo*[NumExprs];
+ for (unsigned i = 0, e = NumOutputs; i != e; ++i)
+ Names[i] = outputs[i];
+ for (unsigned i = NumOutputs, e = NumExprs; i != e; ++i)
+ Names[i] = inputs[i];
AsmToks = new (C) Token[NumAsmToks];
for (unsigned i = 0, e = NumAsmToks; i != e; ++i)
Diag(AsmLoc, diag::warn_unsupported_msasm);
SmallVector<StringRef,4> Clobbers;
std::set<std::string> ClobberRegs;
+ SmallVector<IdentifierInfo*, 4> Inputs;
+ SmallVector<IdentifierInfo*, 4> Outputs;
// Empty asm statements don't need to instantiate the AsmParser, etc.
if (AsmToks.empty()) {
StringRef AsmString;
MSAsmStmt *NS =
- new (Context) MSAsmStmt(Context, AsmLoc, LBraceLoc,
- /* IsSimple */ true, /* IsVolatile */ true,
- AsmToks, AsmString, Clobbers, EndLoc);
+ new (Context) MSAsmStmt(Context, AsmLoc, LBraceLoc, /*IsSimple*/ true,
+ /*IsVolatile*/ true, AsmToks, Inputs, Outputs,
+ AsmString, Clobbers, EndLoc);
return Owned(NS);
}
// patchMSAsmStrings doesn't correctly patch non-simple asm statements.
if (!IsSimple) {
MSAsmStmt *NS =
- new (Context) MSAsmStmt(Context, AsmLoc, LBraceLoc,
- /* IsSimple */ true, /* IsVolatile */ true,
- AsmToks, AsmString, Clobbers, EndLoc);
+ new (Context) MSAsmStmt(Context, AsmLoc, LBraceLoc, /*IsSimple*/ true,
+ /*IsVolatile*/ true, AsmToks, Inputs, Outputs,
+ AsmString, Clobbers, EndLoc);
return Owned(NS);
}
Clobbers.push_back(*I);
MSAsmStmt *NS =
- new (Context) MSAsmStmt(Context, AsmLoc, LBraceLoc,
- IsSimple, /* IsVolatile */ true,
- AsmToks, AsmString, Clobbers, EndLoc);
-
+ new (Context) MSAsmStmt(Context, AsmLoc, LBraceLoc, IsSimple,
+ /*IsVolatile*/ true, AsmToks, Inputs, Outputs,
+ AsmString, Clobbers, EndLoc);
return Owned(NS);
}