Change AsmName's type from StringRef to std::string. AsmName was pointing to a temporary string object that was destroyed. This is undefined behavior and MSVC didn't like it.

This fixes over 300+ failing tests on MSVC.
Credit for this fix goes to chapuni.

llvm-svn: 134064
This commit is contained in:
Francois Pichet 2011-06-29 11:25:34 +00:00
parent 4774b7e456
commit 2ac15f4a5d
1 changed files with 1 additions and 1 deletions

View File

@ -467,7 +467,7 @@ emitRegisterNameString(raw_ostream &O, StringRef AltName,
for (unsigned i = 0, e = Registers.size(); i != e; ++i) {
const CodeGenRegister &Reg = *Registers[i];
StringRef AsmName;
std::string AsmName;
// "NoRegAltName" is special. We don't need to do a lookup for that,
// as it's just a reference to the default register name.
if (AltName == "" || AltName == "NoRegAltName") {