unsigned NumOperands = S.getNumOutputs() + S.getNumInputs();
- // FIXME: Static counters are not thread safe or reproducible.
- static unsigned AsmCounter = 0;
- AsmCounter++;
-
while (*Start) {
switch (*Start) {
default:
case '%':
// Escaped character
Start++;
- if (!*Start) {
- // FIXME: This should be caught during Sema.
- assert(0 && "Trailing '%' in asm string.");
- }
+ // FIXME: This should be caught during Sema.
+ assert(*Start && "Trailing '%' in asm string.");
char EscapedChar = *Start;
if (EscapedChar == '%') {
Result += '%';
} else if (EscapedChar == '=') {
// Generate an unique ID.
- Result += llvm::utostr(AsmCounter);
+ Result += "${:uid}";
} else if (isdigit(EscapedChar)) {
// %n - Assembler operand n
char *End;
static std::string SimplifyConstraint(const char* Constraint,
TargetInfo &Target,
const std::string *OutputNamesBegin = 0,
- const std::string *OutputNamesEnd = 0)
-{
+ const std::string *OutputNamesEnd = 0) {
std::string Result;
while (*Constraint) {
llvm::Value* CodeGenFunction::EmitAsmInput(const AsmStmt &S,
TargetInfo::ConstraintInfo Info,
const Expr *InputExpr,
- std::string &ConstraintStr)
-{
+ std::string &ConstraintStr) {
llvm::Value *Arg;
if ((Info & TargetInfo::CI_AllowsRegister) ||
!(Info & TargetInfo::CI_AllowsMemory)) {