forked from OSchip/llvm-project
[ms-inline asm] Add a few helper function to the MSAsmStmt class that are needed
by CodeGen. In the long-term, much of the codegen logic will be shared between the GNU-style and MS-style inline assembly, but for now I'm replicating this logic to avoid regressions with the GNU-style. llvm-svn: 162478
This commit is contained in:
parent
62b95d88dc
commit
2f7c451ae5
|
@ -1657,6 +1657,44 @@ public:
|
|||
std::string *getAsmString() { return &AsmStr; }
|
||||
void setAsmString(StringRef &E) { AsmStr = E.str(); }
|
||||
|
||||
//===--- Output operands ---===//
|
||||
|
||||
unsigned getNumOutputs() const { return NumOutputs; }
|
||||
|
||||
IdentifierInfo *getOutputIdentifier(unsigned i) const {
|
||||
return Names[i];
|
||||
}
|
||||
|
||||
StringRef getOutputName(unsigned i) const {
|
||||
if (IdentifierInfo *II = getOutputIdentifier(i))
|
||||
return II->getName();
|
||||
|
||||
return StringRef();
|
||||
}
|
||||
|
||||
const Expr *getOutputExpr(unsigned i) const {
|
||||
return const_cast<MSAsmStmt*>(this)->getOutputExpr(i);
|
||||
}
|
||||
|
||||
//===--- Input operands ---===//
|
||||
|
||||
unsigned getNumInputs() const { return NumInputs; }
|
||||
|
||||
IdentifierInfo *getInputIdentifier(unsigned i) const {
|
||||
return Names[i + NumOutputs];
|
||||
}
|
||||
|
||||
StringRef getInputName(unsigned i) const {
|
||||
if (IdentifierInfo *II = getInputIdentifier(i))
|
||||
return II->getName();
|
||||
|
||||
return StringRef();
|
||||
}
|
||||
|
||||
const Expr *getInputExpr(unsigned i) const {
|
||||
return const_cast<MSAsmStmt*>(this)->getInputExpr(i);
|
||||
}
|
||||
|
||||
//===--- Other ---===//
|
||||
|
||||
unsigned getNumClobbers() const { return NumClobbers; }
|
||||
|
|
Loading…
Reference in New Issue