Skip to content

Commit ffd49ec

Browse files
committed
Use StringLiteral and constexpr
1 parent 0b04404 commit ffd49ec

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/Object/IRSymtab.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,16 @@ static cl::opt<bool> DisableBitcodeVersionUpgrade(
4646
"disable-bitcode-version-upgrade", cl::Hidden,
4747
cl::desc("Disable automatic bitcode upgrade for version mismatch"));
4848

49-
static const char *PreservedSymbols[] = {
49+
static constexpr StringLiteral PreservedSymbols[] = {
5050
// There are global variables, so put it here instead of in
5151
// RuntimeLibcalls.td.
5252
// TODO: Are there similar such variables?
5353
"__ssp_canary_word",
5454
"__stack_chk_guard",
5555
};
5656

57-
static bool isPreservedGlobalVarName(StringRef Name) {
58-
return StringRef(PreservedSymbols[0]) == Name ||
59-
StringRef(PreservedSymbols[1]) == Name;
57+
static constexpr bool isPreservedGlobalVarName(StringRef Name) {
58+
return PreservedSymbols[0] == Name || PreservedSymbols[1] == Name;
6059
}
6160

6261
namespace {

0 commit comments

Comments
 (0)