forked from OSchip/llvm-project
Use StringRef in Pass Info/Support API (NFC)
llvm-svn: 283008
This commit is contained in:
parent
e11b745b66
commit
f20abe53f4
|
@ -15,6 +15,8 @@
|
|||
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
|
@ -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) {}
|
||||
|
|
|
@ -101,7 +101,7 @@ template <typename PassName> Pass *callTargetMachineCtor(TargetMachine *TM) {
|
|||
///
|
||||
template <typename passName> 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<passName>), CFGOnly,
|
||||
|
@ -131,7 +131,7 @@ template <typename passName> 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);
|
||||
};
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue