return PrimaryTarget->getVAListDeclaration();
}
+static void removeGCCRegisterPrefix(const char *&Name)
+{
+ if (Name[0] == '%' || Name[0] == '#')
+ Name++;
+}
+
/// isValidGCCRegisterName - Returns whether the passed in string
/// is a valid register name according to GCC. This is used by Sema for
/// inline asm statements.
unsigned NumNames;
// Get rid of any register prefix.
- if (Name[0] == '%' || Name[0] == '#')
- Name++;
+ removeGCCRegisterPrefix(Name);
+
if (strcmp(Name, "memory") == 0 ||
strcmp(Name, "cc") == 0)
{
assert(isValidGCCRegisterName(Name) && "Invalid register passed in");
- if (strcmp(Name, "memory") == 0)
- return "~{memory}";
+ removeGCCRegisterPrefix(Name);
const char * const *Names;
unsigned NumNames;
Clobber = Target.getNormalizedGCCRegisterName(Clobber.c_str());
- if (i != 0)
+ if (i != 0 || NumConstraints != 0)
Constraints += ',';
+
+ Constraints += "~{";
Constraints += Clobber;
+ Constraints += '}';
}
// Add machine specific clobbers