Remove global std::strings. NFCI.

This commit is contained in:
Benjamin Kramer 2020-06-17 14:27:36 +02:00
parent c1034d044a
commit df9a51dab3
6 changed files with 13 additions and 11 deletions

View File

@ -32,7 +32,7 @@ llvm::cl::opt<std::string> IndexLocation(
llvm::cl::opt<std::string>
ExecCommand("c", llvm::cl::desc("Command to execute and then exit"));
static const std::string Overview = R"(
static constexpr char Overview[] = R"(
This is an **experimental** interactive tool to process user-provided search
queries over given symbol collection obtained via clangd-indexer. The
tool can be used to evaluate search quality of existing index implementations

View File

@ -23,7 +23,7 @@ namespace clangd {
namespace remote {
namespace {
static const std::string Overview = R"(
static constexpr char Overview[] = R"(
This is an experimental remote index implementation. The server opens Dex and
awaits gRPC lookup requests from the client.
)";

View File

@ -92,7 +92,7 @@
#define DEBUG_TYPE "bpf-abstract-member-access"
namespace llvm {
const std::string BPFCoreSharedInfo::AmaAttr = "btf_ama";
constexpr StringRef BPFCoreSharedInfo::AmaAttr;
} // namespace llvm
using namespace llvm;

View File

@ -9,6 +9,8 @@
#ifndef LLVM_LIB_TARGET_BPF_BPFCORE_H
#define LLVM_LIB_TARGET_BPF_BPFCORE_H
#include "llvm/ADT/StringRef.h"
namespace llvm {
class BPFCoreSharedInfo {
@ -34,9 +36,9 @@ public:
};
/// The attribute attached to globals representing a field access
static const std::string AmaAttr;
static constexpr StringRef AmaAttr = "btf_ama";
/// The attribute attached to globals representing a type id
static const std::string TypeIdAttr;
static constexpr StringRef TypeIdAttr = "btf_type_id";
};
} // namespace llvm

View File

@ -26,7 +26,7 @@
#define DEBUG_TYPE "bpf-preserve-di-type"
namespace llvm {
const std::string BPFCoreSharedInfo::TypeIdAttr = "btf_type_id";
constexpr StringRef BPFCoreSharedInfo::TypeIdAttr;
} // namespace llvm
using namespace llvm;

View File

@ -244,10 +244,10 @@ INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass)
INITIALIZE_PASS_DEPENDENCY(ScalarEvolutionWrapperPass)
INITIALIZE_PASS_END(PPCLoopInstrFormPrep, DEBUG_TYPE, name, false, false)
static const std::string PHINodeNameSuffix = ".phi";
static const std::string CastNodeNameSuffix = ".cast";
static const std::string GEPNodeIncNameSuffix = ".inc";
static const std::string GEPNodeOffNameSuffix = ".off";
static constexpr StringRef PHINodeNameSuffix = ".phi";
static constexpr StringRef CastNodeNameSuffix = ".cast";
static constexpr StringRef GEPNodeIncNameSuffix = ".inc";
static constexpr StringRef GEPNodeOffNameSuffix = ".off";
FunctionPass *llvm::createPPCLoopInstrFormPrepPass(PPCTargetMachine &TM) {
return new PPCLoopInstrFormPrep(TM);
@ -263,7 +263,7 @@ static bool IsPtrInBounds(Value *BasePtr) {
return false;
}
static std::string getInstrName(const Value *I, const std::string Suffix) {
static std::string getInstrName(const Value *I, StringRef Suffix) {
assert(I && "Invalid paramater!");
if (I->hasName())
return (I->getName() + Suffix).str();