forked from OSchip/llvm-project
Use StringRef which performs the "early exit" when compared against a constant
string. llvm-svn: 113615
This commit is contained in:
parent
6095d818e5
commit
55165fed5d
|
@ -366,12 +366,7 @@ bool llvm::UpgradeIntrinsicFunction(Function *F, Function *&NewFn) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool llvm::UpgradeGlobalVariable(GlobalVariable *GV) {
|
bool llvm::UpgradeGlobalVariable(GlobalVariable *GV) {
|
||||||
const std::string &Name = GV->getName();
|
StringRef Name(GV->getName());
|
||||||
|
|
||||||
// Early exit with simple tests.
|
|
||||||
if (Name.length() != 24 || Name[0] != '.' || Name[1] != 'l' ||
|
|
||||||
Name[3] != 'l' || Name[4] != 'v' || Name[5] != 'm' || Name[6] != '.')
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// We are only upgrading one symbol here.
|
// We are only upgrading one symbol here.
|
||||||
if (Name == ".llvm.eh.catch.all.value") {
|
if (Name == ".llvm.eh.catch.all.value") {
|
||||||
|
|
Loading…
Reference in New Issue