diff --git a/llvm/lib/IR/Mangler.cpp b/llvm/lib/IR/Mangler.cpp --- a/llvm/lib/IR/Mangler.cpp +++ b/llvm/lib/IR/Mangler.cpp @@ -185,19 +185,19 @@ } // Check if the name needs quotes to be safe for the linker to interpret. -static bool isAcceptableChar(char C) { +static bool canBeUnquotedInDirective(char C) { return (C >= 'a' && C <= 'z') || (C >= 'A' && C <= 'Z') || (C >= '0' && C <= '9') || C == '_' || C == '$' || C == '.' || C == '@'; } -static bool isValidUnquotedName(StringRef Name) { +static bool canBeUnquotedInDirective(StringRef Name) { if (Name.empty()) return false; // If any of the characters in the string is an unacceptable character, force // quotes. for (char C : Name) { - if (!isAcceptableChar(C)) + if (!canBeUnquotedInDirective(C)) return false; } @@ -214,7 +214,7 @@ else OS << " -export:"; - bool NeedQuotes = GV->hasName() && !isValidUnquotedName(GV->getName()); + bool NeedQuotes = GV->hasName() && !canBeUnquotedInDirective(GV->getName()); if (NeedQuotes) OS << "\""; if (TT.isWindowsGNUEnvironment() || TT.isWindowsCygwinEnvironment()) { @@ -246,7 +246,7 @@ return; OS << " /INCLUDE:"; - bool NeedQuotes = GV->hasName() && !isValidUnquotedName(GV->getName()); + bool NeedQuotes = GV->hasName() && !canBeUnquotedInDirective(GV->getName()); if (NeedQuotes) OS << "\""; M.getNameWithPrefix(OS, GV, false);