diff --git a/llvm/include/llvm/PassInfo.h b/llvm/include/llvm/PassInfo.h index 7327fd63b55f..d13d51b94c64 100644 --- a/llvm/include/llvm/PassInfo.h +++ b/llvm/include/llvm/PassInfo.h @@ -15,6 +15,8 @@ #include "llvm/ADT/StringRef.h" +#include "llvm/ADT/StringRef.h" + #include #include @@ -58,7 +60,7 @@ public: /// PassInfo ctor - Do not call this directly, this should only be invoked /// through RegisterPass. This version is for use by analysis groups; it /// does not auto-register the pass. - PassInfo(const char *name, const void *pi) + PassInfo(StringRef name, const void *pi) : PassName(name), PassArgument(""), PassID(pi), IsCFGOnlyPass(false), IsAnalysis(false), IsAnalysisGroup(true), NormalCtor(nullptr), TargetMachineCtor(nullptr) {} diff --git a/llvm/include/llvm/PassSupport.h b/llvm/include/llvm/PassSupport.h index ba6d84f04ba0..e77a0b9882b2 100644 --- a/llvm/include/llvm/PassSupport.h +++ b/llvm/include/llvm/PassSupport.h @@ -101,7 +101,7 @@ template Pass *callTargetMachineCtor(TargetMachine *TM) { /// template struct RegisterPass : public PassInfo { // Register Pass using default constructor... - RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false, + RegisterPass(StringRef PassArg, StringRef Name, bool CFGOnly = false, bool is_analysis = false) : PassInfo(Name, PassArg, &passName::ID, PassInfo::NormalCtor_t(callDefaultCtor), CFGOnly, @@ -131,7 +131,7 @@ template struct RegisterPass : public PassInfo { /// class RegisterAGBase : public PassInfo { public: - RegisterAGBase(const char *Name, const void *InterfaceID, + RegisterAGBase(StringRef Name, const void *InterfaceID, const void *PassID = nullptr, bool isDefault = false); }; diff --git a/llvm/lib/IR/Pass.cpp b/llvm/lib/IR/Pass.cpp index 943252939977..a42945ef3fff 100644 --- a/llvm/lib/IR/Pass.cpp +++ b/llvm/lib/IR/Pass.cpp @@ -218,7 +218,7 @@ Pass *Pass::createPass(AnalysisID ID) { // RegisterAGBase implementation // -RegisterAGBase::RegisterAGBase(const char *Name, const void *InterfaceID, +RegisterAGBase::RegisterAGBase(StringRef Name, const void *InterfaceID, const void *PassID, bool isDefault) : PassInfo(Name, InterfaceID) { PassRegistry::getPassRegistry()->registerAnalysisGroup(InterfaceID, PassID,