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:
parent
4774b7e456
commit
2ac15f4a5d
|
@ -467,7 +467,7 @@ emitRegisterNameString(raw_ostream &O, StringRef AltName,
|
||||||
for (unsigned i = 0, e = Registers.size(); i != e; ++i) {
|
for (unsigned i = 0, e = Registers.size(); i != e; ++i) {
|
||||||
const CodeGenRegister &Reg = *Registers[i];
|
const CodeGenRegister &Reg = *Registers[i];
|
||||||
|
|
||||||
StringRef AsmName;
|
std::string AsmName;
|
||||||
// "NoRegAltName" is special. We don't need to do a lookup for that,
|
// "NoRegAltName" is special. We don't need to do a lookup for that,
|
||||||
// as it's just a reference to the default register name.
|
// as it's just a reference to the default register name.
|
||||||
if (AltName == "" || AltName == "NoRegAltName") {
|
if (AltName == "" || AltName == "NoRegAltName") {
|
||||||
|
|
Loading…
Reference in New Issue