}
static std::string ConvertAsmString(const char *Start, unsigned NumOperands,
- bool IsSimple) {
+ bool IsSimple, bool &Failed) {
+ Failed = false;
+
static unsigned AsmCounter = 0;
AsmCounter++;
std::string Result;
Result += "${" + llvm::utostr(n) + ':' + EscapedChar + '}';
Start = End - 1;
} else {
- assert(0 && "Unhandled asm escaped character!");
+ Failed = true;
+ return "";
}
}
Start++;
}
void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) {
+ bool Failed;
std::string AsmString =
ConvertAsmString(std::string(S.getAsmString()->getStrData(),
S.getAsmString()->getByteLength()).c_str(),
- S.getNumOutputs() + S.getNumInputs(), S.isSimple());
+ S.getNumOutputs() + S.getNumInputs(), S.isSimple(),
+ Failed);
+
+ if (Failed) {
+ ErrorUnsupported(&S, "asm string");
+ return;
+ }
std::string Constraints;