Follow up for r307085: a better fix for a dangling StringRef.

llvm-svn: 309092
This commit is contained in:
Alexander Kornienko 2017-07-26 10:14:55 +00:00
parent 84941ef158
commit a45648b9dd
1 changed files with 2 additions and 6 deletions

View File

@ -1627,7 +1627,7 @@ void COFFDumper::printCOFFDirectives() {
}
}
static StringRef getBaseRelocTypeName(uint8_t Type) {
static std::string getBaseRelocTypeName(uint8_t Type) {
switch (Type) {
case COFF::IMAGE_REL_BASED_ABSOLUTE: return "ABSOLUTE";
case COFF::IMAGE_REL_BASED_HIGH: return "HIGH";
@ -1636,11 +1636,7 @@ static StringRef getBaseRelocTypeName(uint8_t Type) {
case COFF::IMAGE_REL_BASED_HIGHADJ: return "HIGHADJ";
case COFF::IMAGE_REL_BASED_ARM_MOV32T: return "ARM_MOV32(T)";
case COFF::IMAGE_REL_BASED_DIR64: return "DIR64";
default: {
static std::string Result;
Result = "unknown (" + llvm::utostr(Type) + ")";
return Result;
}
default: return "unknown (" + llvm::utostr(Type) + ")";
}
}