Change getPassName return type to StringRef. (#4247)

This commit is contained in:
Xiang Li 2022-02-10 14:14:43 -08:00 коммит произвёл GitHub
Родитель 8348ff8d9e
Коммит 4452103355
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
79 изменённых файлов: 112 добавлений и 112 удалений

Просмотреть файл

@ -70,7 +70,7 @@ private:
public:
const char *getPassName() const override;
StringRef getPassName() const override;
DxilValueCache();
void getAnalysisUsage(AnalysisUsage &) const override;

Просмотреть файл

@ -106,7 +106,7 @@ public:
// LPPassManager needs LoopInfo.
void getAnalysisUsage(AnalysisUsage &Info) const override;
const char *getPassName() const override {
StringRef getPassName() const override {
return "Loop Pass Manager";
}

Просмотреть файл

@ -101,7 +101,7 @@ public:
/// RGPassManager needs RegionInfo.
void getAnalysisUsage(AnalysisUsage &Info) const override;
const char *getPassName() const override {
StringRef getPassName() const override {
return "Region Pass Manager";
}

Просмотреть файл

@ -291,7 +291,7 @@ public:
/// the source file name, line number and column.
void getLocation(StringRef *Filename, unsigned *Line, unsigned *Column) const;
const char *getPassName() const { return PassName; }
StringRef getPassName() const { return PassName; }
const Function &getFunction() const { return Fn; }
const DebugLoc &getDebugLoc() const { return DLoc; }
const Twine &getMsg() const { return Msg; }

Просмотреть файл

@ -461,7 +461,7 @@ public:
// Print passes managed by this manager
void dumpPassStructure(unsigned Offset) override;
const char *getPassName() const override {
StringRef getPassName() const override {
return "Function Pass Manager";
}

Просмотреть файл

@ -73,7 +73,7 @@ public:
<< P->getPassArgument() << ") attempted to be registered!\n";
llvm_unreachable(nullptr);
}
addLiteralOption(P->getPassArgument(), P, P->getPassName());
addLiteralOption(P->getPassArgument(), P, P->getPassName().data());
}
void passEnumerate(const PassInfo *P) override { passRegistered(P); }

Просмотреть файл

@ -136,7 +136,7 @@ public:
/// implemented in terms of the name that is registered by one of the
/// Registration templates, but can be overloaded directly.
///
virtual const char *getPassName() const;
virtual StringRef getPassName() const;
const char *getPassArgument() const; // HLSL Change
/// getPassID - Return the PassID number that corresponds to this pass.

Просмотреть файл

@ -65,7 +65,7 @@ public:
/// getPassName - Return the friendly name for the pass, never returns null
///
const char *getPassName() const { return PassName; }
StringRef getPassName() const { return PassName; }
/// getPassArgument - Return the command line option that may be passed to
/// 'opt' that will cause this pass to be run. This will return null if there

Просмотреть файл

@ -437,7 +437,7 @@ DxilValueCache::DxilValueCache() : ImmutablePass(ID) {
initializeDxilValueCachePass(*PassRegistry::getPassRegistry());
}
const char *DxilValueCache::getPassName() const {
StringRef DxilValueCache::getPassName() const {
return "Dxil Value Cache";
}

Просмотреть файл

@ -70,7 +70,7 @@ public:
Info.setPreservesAll();
}
const char *getPassName() const override {
StringRef getPassName() const override {
return "CallGraph Pass Manager";
}

Просмотреть файл

@ -34,7 +34,7 @@ namespace {
: ModulePass(ID), OS(o),
ShouldPreserveUseListOrder(ShouldPreserveUseListOrder) {}
const char *getPassName() const override { return "Bitcode Writer"; }
StringRef getPassName() const override { return "Bitcode Writer"; }
bool runOnModule(Module &M) override {
WriteBitcodeToFile(&M, OS, ShouldPreserveUseListOrder);

Просмотреть файл

@ -158,7 +158,7 @@ class TypePromotionTransaction;
}
bool runOnFunction(Function &F) override;
const char *getPassName() const override { return "CodeGen Prepare"; }
StringRef getPassName() const override { return "CodeGen Prepare"; }
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addPreserved<DominatorTreeWrapperPass>();

Просмотреть файл

@ -71,7 +71,7 @@ namespace {
void getAnalysisUsage(AnalysisUsage &AU) const override;
const char *getPassName() const override {
StringRef getPassName() const override {
return "Exception handling preparation";
}
};

Просмотреть файл

@ -602,7 +602,7 @@ public:
EarlyIfConverter() : MachineFunctionPass(ID) {}
void getAnalysisUsage(AnalysisUsage &AU) const override;
bool runOnMachineFunction(MachineFunction &MF) override;
const char *getPassName() const override { return "Early If-Conversion"; }
StringRef getPassName() const override { return "Early If-Conversion"; }
private:
bool tryConvertIf(MachineBasicBlock*);

Просмотреть файл

@ -168,7 +168,7 @@ public:
bool runOnMachineFunction(MachineFunction &MF) override;
const char *getPassName() const override {
StringRef getPassName() const override {
return "Execution dependency fix";
}

Просмотреть файл

@ -32,7 +32,7 @@ class Printer : public FunctionPass {
public:
explicit Printer(raw_ostream &OS) : FunctionPass(ID), OS(OS) {}
const char *getPassName() const override;
StringRef getPassName() const override;
void getAnalysisUsage(AnalysisUsage &AU) const override;
bool runOnFunction(Function &F) override;

Просмотреть файл

@ -45,7 +45,7 @@ public:
static char ID;
LowerIntrinsics();
const char *getPassName() const override;
StringRef getPassName() const override;
void getAnalysisUsage(AnalysisUsage &AU) const override;
bool doInitialization(Module &M) override;

Просмотреть файл

@ -168,7 +168,7 @@ namespace {
bool runOnFunction(Function &F) override;
bool doFinalization(Module &M) override;
const char *getPassName() const override {
StringRef getPassName() const override {
return "Merge internal globals";
}

Просмотреть файл

@ -71,7 +71,7 @@ public:
initializeInterleavedAccessPass(*PassRegistry::getPassRegistry());
}
const char *getPassName() const override { return "Interleaved Access Pass"; }
StringRef getPassName() const override { return "Interleaved Access Pass"; }
bool runOnFunction(Function &F) override;

Просмотреть файл

@ -33,7 +33,7 @@ struct MIRPrintingPass : public MachineFunctionPass {
MIRPrintingPass() : MachineFunctionPass(ID), OS(dbgs()) {}
MIRPrintingPass(raw_ostream &OS) : MachineFunctionPass(ID), OS(OS) {}
const char *getPassName() const override { return "MIR Printing Pass"; }
StringRef getPassName() const override { return "MIR Printing Pass"; }
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();

Просмотреть файл

@ -57,7 +57,7 @@ public:
}
void getAnalysisUsage(AnalysisUsage &AU) const override;
bool runOnMachineFunction(MachineFunction &MF) override;
const char *getPassName() const override { return "Machine InstCombiner"; }
StringRef getPassName() const override { return "Machine InstCombiner"; }
private:
bool doSubstitute(unsigned NewSize, unsigned OldSize);

Просмотреть файл

@ -34,7 +34,7 @@ struct MachineFunctionPrinterPass : public MachineFunctionPass {
MachineFunctionPrinterPass(raw_ostream &os, const std::string &banner)
: MachineFunctionPass(ID), OS(os), Banner(banner) {}
const char *getPassName() const override { return "MachineFunction Printer"; }
StringRef getPassName() const override { return "MachineFunction Printer"; }
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();

Просмотреть файл

@ -150,7 +150,7 @@ namespace {
spillImpossible = ~0u
};
public:
const char *getPassName() const override {
StringRef getPassName() const override {
return "Fast Register Allocator";
}

Просмотреть файл

@ -166,7 +166,7 @@ public:
MachineFunctionPass::getAnalysisUsage(AU);
}
const char *getPassName() const override {
StringRef getPassName() const override {
return "Shrink Wrapping analysis";
}

Просмотреть файл

@ -67,7 +67,7 @@ public:
bool runOnFunction(Function &F) override;
void getAnalysisUsage(AnalysisUsage &AU) const override {}
const char *getPassName() const override {
StringRef getPassName() const override {
return "SJLJ Exception Handling preparation";
}

Просмотреть файл

@ -85,7 +85,7 @@ public:
void getAnalysisUsage(AnalysisUsage &AU) const override;
const char *getPassName() const override {
StringRef getPassName() const override {
return "Windows exception handling preparation";
}

Просмотреть файл

@ -303,7 +303,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit DxilLoadMetadata () : ModulePass(ID) {}
const char *getPassName() const override { return "HLSL load DxilModule from metadata"; }
StringRef getPassName() const override { return "HLSL load DxilModule from metadata"; }
bool runOnModule(Module &M) override {
if (!M.HasDxilModule()) {

Просмотреть файл

@ -37,7 +37,7 @@ class DxilAddPixelHitInstrumentation : public ModulePass {
public:
static char ID; // Pass identification, replacement for typeid
explicit DxilAddPixelHitInstrumentation() : ModulePass(ID) {}
const char *getPassName() const override { return "DXIL Constant Color Mod"; }
StringRef getPassName() const override { return "DXIL Constant Color Mod"; }
void applyOptions(PassOptions O) override;
bool runOnModule(Module &M) override;
};

Просмотреть файл

@ -247,7 +247,7 @@ private:
public:
static char ID; // Pass identification, replacement for typeid
explicit DxilDebugInstrumentation() : ModulePass(ID) {}
const char *getPassName() const override {
StringRef getPassName() const override {
return "Add PIX debug instrumentation";
}
void applyOptions(PassOptions O) override;

Просмотреть файл

@ -22,7 +22,7 @@ class DxilForceEarlyZ : public ModulePass {
public:
static char ID; // Pass identification, replacement for typeid
explicit DxilForceEarlyZ() : ModulePass(ID) {}
const char *getPassName() const override { return "DXIL Force Early Z"; }
StringRef getPassName() const override { return "DXIL Force Early Z"; }
bool runOnModule(Module &M) override;
};

Просмотреть файл

@ -46,7 +46,7 @@ class DxilOutputColorBecomesConstant : public ModulePass {
public:
static char ID; // Pass identification, replacement for typeid
explicit DxilOutputColorBecomesConstant() : ModulePass(ID) {}
const char *getPassName() const override { return "DXIL Constant Color Mod"; }
StringRef getPassName() const override { return "DXIL Constant Color Mod"; }
void applyOptions(PassOptions O) override;
bool runOnModule(Module &M) override;
};

Просмотреть файл

@ -32,7 +32,7 @@ class DxilPIXAddTidToAmplificationShaderPayload : public ModulePass {
public:
static char ID; // Pass identification, replacement for typeid
DxilPIXAddTidToAmplificationShaderPayload() : ModulePass(ID) {}
const char *getPassName() const override { return "DXIL Add flat thread id to payload from AS to MS"; }
StringRef getPassName() const override { return "DXIL Add flat thread id to payload from AS to MS"; }
bool runOnModule(Module &M) override;
void applyOptions(PassOptions O) override;
};

Просмотреть файл

@ -55,7 +55,7 @@ class DxilPIXMeshShaderOutputInstrumentation : public ModulePass
public:
static char ID; // Pass identification, replacement for typeid
explicit DxilPIXMeshShaderOutputInstrumentation() : ModulePass(ID) {}
const char *getPassName() const override {
StringRef getPassName() const override {
return "DXIL mesh shader output instrumentation";
}
void applyOptions(PassOptions O) override;

Просмотреть файл

@ -28,7 +28,7 @@ class DxilReduceMSAAToSingleSample : public ModulePass {
public:
static char ID; // Pass identification, replacement for typeid
explicit DxilReduceMSAAToSingleSample() : ModulePass(ID) {}
const char *getPassName() const override {
StringRef getPassName() const override {
return "HLSL DXIL Reduce all MSAA reads to single-sample reads";
}
bool runOnModule(Module &M) override;

Просмотреть файл

@ -25,7 +25,7 @@ class DxilRemoveDiscards : public ModulePass {
public:
static char ID; // Pass identification, replacement for typeid
explicit DxilRemoveDiscards() : ModulePass(ID) {}
const char *getPassName() const override {
StringRef getPassName() const override {
return "DXIL Remove all discard instructions";
}
bool runOnModule(Module &M) override;

Просмотреть файл

@ -202,7 +202,7 @@ class DxilShaderAccessTracking : public ModulePass {
public:
static char ID; // Pass identification, replacement for typeid
explicit DxilShaderAccessTracking() : ModulePass(ID) {}
const char *getPassName() const override {
StringRef getPassName() const override {
return "DXIL shader access tracking";
}
bool runOnModule(Module &M) override;

Просмотреть файл

@ -174,7 +174,7 @@ public:
}
size_t size() const { return Passes.size(); }
const char *getPassNameAt(size_t index) const {
StringRef getPassNameAt(size_t index) const {
return Passes[index]->getPassName();
}
llvm::AnalysisID getPassIDAt(size_t index) const {
@ -216,7 +216,7 @@ HRESULT STDMETHODCALLTYPE DxcOptimizer::GetAvailablePass(
return E_INVALIDARG;
return DxcOptimizerPass::Create(
m_pMalloc, m_passes[index]->getPassArgument(),
m_passes[index]->getPassName(),
m_passes[index]->getPassName().data(),
GetPassArgNames(m_passes[index]->getPassArgument()),
GetPassArgDescriptions(m_passes[index]->getPassArgument()), ppResult);
}

Просмотреть файл

@ -493,7 +493,7 @@ public:
AU.addRequired<DxilValueCache>();
}
const char *getPassName() const override {
StringRef getPassName() const override {
return "DXIL Lower createHandleForLib";
}
@ -580,7 +580,7 @@ public:
// Load up debug information, to cross-reference values and the instructions
// used to load them.
m_HasDbgInfo = hasDebugInfo(M);
m_HasDbgInfo = llvm::getDebugMetadataVersionFromModule(M) != 0;
GenerateDxilResourceHandles();
@ -1610,7 +1610,7 @@ public:
explicit DxilLegalizeResources()
: ModulePass(ID) {}
const char *getPassName() const override {
StringRef getPassName() const override {
return "DXIL Legalize Resource Use";
}
@ -2771,7 +2771,7 @@ public:
void applyOptions(PassOptions O) override {
GetPassOptionUInt32(O, "auto-binding-space", &m_AutoBindingSpace, UINT_MAX);
}
const char *getPassName() const override { return "DXIL Allocate Resources For Library"; }
StringRef getPassName() const override { return "DXIL Allocate Resources For Library"; }
bool runOnModule(Module &M) override {
DxilModule &DM = M.GetOrCreateDxilModule();
@ -3194,7 +3194,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit DxilCleanupDynamicResourceHandle() : ModulePass(ID) {}
const char *getPassName() const override { return "DXIL Cleanup dynamic resource handle calls"; }
StringRef getPassName() const override { return "DXIL Cleanup dynamic resource handle calls"; }
bool runOnModule(Module &M) override {
DxilModule &DM = M.GetOrCreateDxilModule();

Просмотреть файл

@ -41,7 +41,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit DxilConvergentMark() : ModulePass(ID) {}
const char *getPassName() const override {
StringRef getPassName() const override {
return "DxilConvergentMark";
}
@ -210,7 +210,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit DxilConvergentClear() : ModulePass(ID) {}
const char *getPassName() const override {
StringRef getPassName() const override {
return "DxilConvergentClear";
}

Просмотреть файл

@ -33,7 +33,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit DxilEliminateOutputDynamicIndexing() : ModulePass(ID) {}
const char *getPassName() const override {
StringRef getPassName() const override {
return "DXIL eliminate output dynamic indexing";
}

Просмотреть файл

@ -67,7 +67,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit DxilExpandTrigIntrinsics() : FunctionPass(ID) {}
const char *getPassName() const override {
StringRef getPassName() const override {
return "DXIL expand trig intrinsics";
}

Просмотреть файл

@ -189,7 +189,7 @@ public:
explicit DxilGenerationPass(bool NoOpt = false)
: ModulePass(ID), m_pHLModule(nullptr), m_extensionsCodegenHelper(nullptr), NotOptimized(NoOpt) {}
const char *getPassName() const override { return "DXIL Generator"; }
StringRef getPassName() const override { return "DXIL Generator"; }
void SetExtensionsHelper(HLSLExtensionsCodegenHelper *helper) {
m_extensionsCodegenHelper = helper;

Просмотреть файл

@ -35,7 +35,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit DxilLegalizeEvalOperations() : ModulePass(ID) {}
const char *getPassName() const override {
StringRef getPassName() const override {
return "DXIL Legalize EvalOperations";
}

Просмотреть файл

@ -55,7 +55,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit DxilLegalizeSampleOffsetPass() : FunctionPass(ID) {}
const char *getPassName() const override {
StringRef getPassName() const override {
return "DXIL legalize sample offset";
}

Просмотреть файл

@ -448,7 +448,7 @@ struct DxilInsertPreserves : public ModulePass {
return Changed;
}
const char *getPassName() const override { return "Dxil Insert Preserves"; }
StringRef getPassName() const override { return "Dxil Insert Preserves"; }
};
char DxilInsertPreserves::ID;
@ -501,7 +501,7 @@ public:
return Changed;
}
const char *getPassName() const override { return "Dxil Lower Preserves to Selects"; }
StringRef getPassName() const override { return "Dxil Lower Preserves to Selects"; }
};
char DxilPreserveToSelect::ID;
@ -570,7 +570,7 @@ public:
return Changed;
}
const char *getPassName() const override { return "Dxil Rewrite Output Arg Debug Info"; }
StringRef getPassName() const override { return "Dxil Rewrite Output Arg Debug Info"; }
};
char DxilRewriteOutputArgDebugInfo::ID;
@ -622,7 +622,7 @@ public:
bool LowerPreserves(Module &M);
bool LowerNoops(Module &M);
bool runOnModule(Module &M) override;
const char *getPassName() const override { return "Dxil Finalize Preserves"; }
StringRef getPassName() const override { return "Dxil Finalize Preserves"; }
};
char DxilFinalizePreserves::ID;

Просмотреть файл

@ -100,7 +100,7 @@ class DxilPatchShaderRecordBindings : public ModulePass {
public:
static char ID; // Pass identification, replacement for typeid
explicit DxilPatchShaderRecordBindings() : ModulePass(ID) {}
const char *getPassName() const override { return "DXIL Patch Shader Record Binding"; }
StringRef getPassName() const override { return "DXIL Patch Shader Record Binding"; }
void applyOptions(PassOptions O) override;
bool runOnModule(Module &M) override;

Просмотреть файл

@ -42,7 +42,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit DxilPrecisePropagatePass() : ModulePass(ID) {}
const char *getPassName() const override { return "DXIL Precise Propagate"; }
StringRef getPassName() const override { return "DXIL Precise Propagate"; }
bool runOnModule(Module &M) override {
m_pDM = &(M.GetOrCreateDxilModule());

Просмотреть файл

@ -53,7 +53,7 @@ public:
initializeScalarizerPass(*PassRegistry::getPassRegistry());
}
const char *getPassName() const override { return "Invalidate undef resources"; }
StringRef getPassName() const override { return "Invalidate undef resources"; }
bool runOnModule(Module &M) override;
};
@ -128,7 +128,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit DxilDeadFunctionElimination () : ModulePass(ID) {}
const char *getPassName() const override { return "Remove all unused function except entry from DxilModule"; }
StringRef getPassName() const override { return "Remove all unused function except entry from DxilModule"; }
bool runOnModule(Module &M) override {
if (M.HasDxilModule()) {
@ -337,7 +337,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit DxilFinalizeModule() : ModulePass(ID) {}
const char *getPassName() const override { return "HLSL DXIL Finalize Module"; }
StringRef getPassName() const override { return "HLSL DXIL Finalize Module"; }
void patchValidation_1_1(Module &M) {
for (iplist<Function>::iterator F : M.getFunctionList()) {
@ -1303,7 +1303,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit DxilCleanupAddrSpaceCast() : ModulePass(ID) {}
const char *getPassName() const override { return "HLSL DXIL Cleanup Address Space Cast"; }
StringRef getPassName() const override { return "HLSL DXIL Cleanup Address Space Cast"; }
bool runOnModule(Module &M) override {
return CleanupSharedMemoryAddrSpaceCast(M);
@ -1327,7 +1327,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit DxilEmitMetadata() : ModulePass(ID) {}
const char *getPassName() const override { return "HLSL DXIL Metadata Emit"; }
StringRef getPassName() const override { return "HLSL DXIL Metadata Emit"; }
bool runOnModule(Module &M) override {
if (M.HasDxilModule()) {
@ -1398,7 +1398,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit DxilValidateWaveSensitivity() : ModulePass(ID) {}
const char *getPassName() const override {
StringRef getPassName() const override {
return "HLSL DXIL wave sensitiveity validation";
}
@ -1567,7 +1567,7 @@ class CleanupDxBreak : public FunctionPass {
public:
static char ID; // Pass identification, replacement for typeid
explicit CleanupDxBreak() : FunctionPass(ID) {}
const char *getPassName() const override { return "HLSL Remove unnecessary dx.break conditions"; }
StringRef getPassName() const override { return "HLSL Remove unnecessary dx.break conditions"; }
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequired<LoopInfoWrapperPass>();
}

Просмотреть файл

@ -198,7 +198,7 @@ public:
static char ID; // Pass identification, replacement for typeid
DxilPreserveAllOutputs() : FunctionPass(ID) {}
const char *getPassName() const override {
StringRef getPassName() const override {
return "DXIL preserve all outputs";
}

Просмотреть файл

@ -51,7 +51,7 @@ public:
explicit DxilPromoteStaticResources()
: ModulePass(ID) {}
const char *getPassName() const override {
StringRef getPassName() const override {
return "DXIL Legalize Static Resource Use";
}
@ -74,7 +74,7 @@ public:
explicit DxilPromoteLocalResources()
: FunctionPass(ID) {}
const char *getPassName() const override {
StringRef getPassName() const override {
return "DXIL Legalize Resource Use";
}
@ -254,7 +254,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit DxilMutateResourceToHandle() : ModulePass(ID) {}
const char *getPassName() const override {
StringRef getPassName() const override {
return "DXIL Mutate resource to handle";
}

Просмотреть файл

@ -37,7 +37,7 @@ public:
m_Prefix = prefix.str();
}
const char *getPassName() const override {
StringRef getPassName() const override {
return "DXIL rename resources";
}

Просмотреть файл

@ -446,7 +446,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit DxilSimpleGVNHoist() : FunctionPass(ID) {}
const char *getPassName() const override {
StringRef getPassName() const override {
return "DXIL simple GVN hoist";
}

Просмотреть файл

@ -23,7 +23,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit HLDeadFunctionElimination () : ModulePass(ID) {}
const char *getPassName() const override { return "Remove all unused function except entry from HLModule"; }
StringRef getPassName() const override { return "Remove all unused function except entry from HLModule"; }
bool runOnModule(Module &M) override {
if (M.HasHLModule()) {

Просмотреть файл

@ -35,7 +35,7 @@ public:
static char ID;
explicit HLExpandStoreIntrinsics() : FunctionPass(ID) {}
const char *getPassName() const override {
StringRef getPassName() const override {
return "Expand HLSL store intrinsics";
}

Просмотреть файл

@ -81,7 +81,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit MatrixBitcastLowerPass() : FunctionPass(ID) {}
const char *getPassName() const override { return "Matrix Bitcast lower"; }
StringRef getPassName() const override { return "Matrix Bitcast lower"; }
bool runOnFunction(Function &F) override {
bool bUpdated = false;
std::unordered_set<BitCastInst*> matCastSet;

Просмотреть файл

@ -126,7 +126,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit HLMatrixLowerPass() : ModulePass(ID) {}
const char *getPassName() const override { return "HL matrix lower"; }
StringRef getPassName() const override { return "HL matrix lower"; }
bool runOnModule(Module &M) override;
private:

Просмотреть файл

@ -21,7 +21,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit HLEmitMetadata() : ModulePass(ID) {}
const char *getPassName() const override { return "HLSL High-Level Metadata Emit"; }
StringRef getPassName() const override { return "HLSL High-Level Metadata Emit"; }
bool runOnModule(Module &M) override {
if (M.HasHLModule()) {
@ -51,7 +51,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit HLEnsureMetadata() : ModulePass(ID) {}
const char *getPassName() const override { return "HLSL High-Level Metadata Ensure"; }
StringRef getPassName() const override { return "HLSL High-Level Metadata Ensure"; }
bool runOnModule(Module &M) override {
if (!M.HasHLModule()) {

Просмотреть файл

@ -31,7 +31,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit HLPreprocess() : ModulePass(ID) {}
const char *getPassName() const override {
StringRef getPassName() const override {
return "Preprocess HLModule after inline";
}

Просмотреть файл

@ -64,7 +64,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit NoPausePasses() : ModulePass(ID) {}
const char *getPassName() const override { return "NoPausePasses"; }
StringRef getPassName() const override { return "NoPausePasses"; }
bool runOnModule(Module &M) override {
return ClearPauseResumePasses(M);
@ -76,7 +76,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit PausePasses() : ModulePass(ID) {}
const char *getPassName() const override { return "PausePasses"; }
StringRef getPassName() const override { return "PausePasses"; }
bool runOnModule(Module &M) override {
StringRef pause, resume;
@ -96,7 +96,7 @@ public:
static char ID; // Pass identification, replacement for typeid
explicit ResumePasses() : ModulePass(ID) {}
const char *getPassName() const override { return "ResumePasses"; }
StringRef getPassName() const override { return "ResumePasses"; }
bool runOnModule(Module &M) override {
StringRef pause, resume;

Просмотреть файл

@ -187,7 +187,7 @@ public:
PMDataManager *getAsPMDataManager() override { return this; }
Pass *getAsPass() override { return this; }
const char *getPassName() const override {
StringRef getPassName() const override {
return "BasicBlock Pass Manager";
}
@ -342,7 +342,7 @@ public:
/// its runOnFunction() for function F.
Pass* getOnTheFlyPass(Pass *MP, AnalysisID PI, Function &F) override;
const char *getPassName() const override {
StringRef getPassName() const override {
return "Module Pass Manager";
}
@ -679,8 +679,8 @@ void PMTopLevelManager::schedulePass(Pass *P) {
}
if (PI && !PI->isAnalysis() && ShouldPrintBeforePass(PI)) {
Pass *PP = P->createPrinterPass(
dbgs(), std::string("*** IR Dump Before ") + P->getPassName() + " ***");
Pass *PP = P->createPrinterPass(dbgs(), std::string("*** IR Dump Before ") +
P->getPassName().str() + " ***");
PP->assignPassManager(activeStack, getTopLevelPassManagerType());
}
@ -689,8 +689,8 @@ void PMTopLevelManager::schedulePass(Pass *P) {
P->assignPassManager(activeStack, getTopLevelPassManagerType());
if (PI && !PI->isAnalysis() && ShouldPrintAfterPass(PI)) {
Pass *PP = P->createPrinterPass(
dbgs(), std::string("*** IR Dump After ") + P->getPassName() + " ***");
Pass *PP = P->createPrinterPass(dbgs(), std::string("*** IR Dump After ") +
P->getPassName().str() + " ***");
PP->assignPassManager(activeStack, getTopLevelPassManagerType());
}
@ -707,7 +707,7 @@ void PMTopLevelManager::schedulePass(Pass *P) {
static direct_stderr_stream stderr_stream;
Pass *PP = P->createPrinterPass(
stderr_stream, std::string("*** IR Dump After ") + P->getPassName() + " (" + PI->getPassArgument() + ") ***");
stderr_stream, std::string("*** IR Dump After ") + P->getPassName().str() + " (" + PI->getPassArgument() + ") ***");
PP->assignPassManager(activeStack, getTopLevelPassManagerType());
}
// HLSL Change - end

Просмотреть файл

@ -75,7 +75,7 @@ void Pass::dumpPassStructure(unsigned Offset) {
/// implemented in terms of the name that is registered by one of the
/// Registration templates, but can be overloaded directly.
///
const char *Pass::getPassName() const {
StringRef Pass::getPassName() const {
AnalysisID AID = getPassID();
const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(AID);
if (PI)

Просмотреть файл

@ -48,7 +48,7 @@ struct FunctionPassPrinter : public FunctionPass {
return false;
}
const char *getPassName() const override { return PassName.c_str(); }
StringRef getPassName() const override { return PassName.c_str(); }
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequiredID(PassToPrint->getTypeInfo());
@ -85,7 +85,7 @@ struct CallGraphSCCPassPrinter : public CallGraphSCCPass {
return false;
}
const char *getPassName() const override { return PassName.c_str(); }
StringRef getPassName() const override { return PassName.c_str(); }
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequiredID(PassToPrint->getTypeInfo());
@ -117,7 +117,7 @@ struct ModulePassPrinter : public ModulePass {
return false;
}
const char *getPassName() const override { return PassName.c_str(); }
StringRef getPassName() const override { return PassName.c_str(); }
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequiredID(PassToPrint->getTypeInfo());
@ -150,7 +150,7 @@ struct LoopPassPrinter : public LoopPass {
return false;
}
const char *getPassName() const override { return PassName.c_str(); }
StringRef getPassName() const override { return PassName.c_str(); }
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequiredID(PassToPrint->getTypeInfo());
@ -185,7 +185,7 @@ struct RegionPassPrinter : public RegionPass {
return false;
}
const char *getPassName() const override { return PassName.c_str(); }
StringRef getPassName() const override { return PassName.c_str(); }
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequiredID(PassToPrint->getTypeInfo());
@ -219,7 +219,7 @@ struct BasicBlockPassPrinter : public BasicBlockPass {
return false;
}
const char *getPassName() const override { return PassName.c_str(); }
StringRef getPassName() const override { return PassName.c_str(); }
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequiredID(PassToPrint->getTypeInfo());

Просмотреть файл

@ -393,7 +393,7 @@ struct AddressSanitizer : public FunctionPass {
: FunctionPass(ID), CompileKernel(CompileKernel || ClEnableKasan) {
initializeAddressSanitizerPass(*PassRegistry::getPassRegistry());
}
const char *getPassName() const override {
StringRef getPassName() const override {
return "AddressSanitizerFunctionPass";
}
void getAnalysisUsage(AnalysisUsage &AU) const override {
@ -481,7 +481,7 @@ class AddressSanitizerModule : public ModulePass {
: ModulePass(ID), CompileKernel(CompileKernel || ClEnableKasan) {}
bool runOnModule(Module &M) override;
static char ID; // Pass identification, replacement for typeid
const char *getPassName() const override { return "AddressSanitizerModule"; }
StringRef getPassName() const override { return "AddressSanitizerModule"; }
private:
void initializeCallbacks(Module &M);

Просмотреть файл

@ -84,7 +84,7 @@ namespace {
ReversedVersion[4] = '\0';
initializeGCOVProfilerPass(*PassRegistry::getPassRegistry());
}
const char *getPassName() const override {
StringRef getPassName() const override {
return "GCOV Profiler";
}

Просмотреть файл

@ -36,7 +36,7 @@ public:
InstrProfiling(const InstrProfOptions &Options)
: ModulePass(ID), Options(Options) {}
const char *getPassName() const override {
StringRef getPassName() const override {
return "Frontend instrumentation-based coverage lowering";
}

Просмотреть файл

@ -140,7 +140,7 @@ class SanitizerCoverageModule : public ModulePass {
bool runOnModule(Module &M) override;
bool runOnFunction(Function &F);
static char ID; // Pass identification, replacement for typeid
const char *getPassName() const override {
StringRef getPassName() const override {
return "SanitizerCoverageModule";
}

Просмотреть файл

@ -80,7 +80,7 @@ namespace {
/// ThreadSanitizer: instrument the code in module to find races.
struct ThreadSanitizer : public FunctionPass {
ThreadSanitizer() : FunctionPass(ID) {}
const char *getPassName() const override;
StringRef getPassName() const override;
bool runOnFunction(Function &F) override;
bool doInitialization(Module &M) override;
static char ID; // Pass identification, replacement for typeid.

Просмотреть файл

@ -289,7 +289,7 @@ class MemorySanitizer : public FunctionPass {
: FunctionPass(ID),
TrackOrigins(std::max(TrackOrigins, (int)ClTrackOrigins)),
WarningFn(nullptr) {}
const char *getPassName() const override { return "MemorySanitizer"; }
StringRef getPassName() const override { return "MemorySanitizer"; }
bool runOnFunction(Function &F) override;
bool doInitialization(Module &M) override;
static char ID; // Pass identification, replacement for typeid.

Просмотреть файл

@ -127,7 +127,7 @@ public:
bool runOnFunction(Function &Fn) override;
const char *getPassName() const override { return "Constant Hoisting"; }
StringRef getPassName() const override { return "Constant Hoisting"; }
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesCFG();

Просмотреть файл

@ -44,7 +44,7 @@ public:
bool TryRewriteDebugInfoForVector(InsertElementInst *IE);
bool runOnFunction(Function &F) override;
const char *getPassName() const override { return "Dxil Eliminate Vector"; }
StringRef getPassName() const override { return "Dxil Eliminate Vector"; }
};
char DxilEliminateVector::ID;

Просмотреть файл

@ -32,7 +32,7 @@ public:
initializeDxilFixConstArrayInitializerPass(*PassRegistry::getPassRegistry());
}
bool runOnModule(Module &M) override;
const char *getPassName() const override { return "Dxil Fix Const Array Initializer"; }
StringRef getPassName() const override { return "Dxil Fix Const Array Initializer"; }
};
char DxilFixConstArrayInitializer::ID;

Просмотреть файл

@ -121,7 +121,7 @@ public:
{
initializeDxilLoopUnrollPass(*PassRegistry::getPassRegistry());
}
const char *getPassName() const override { return "Dxil Loop Unroll"; }
StringRef getPassName() const override { return "Dxil Loop Unroll"; }
bool runOnLoop(Loop *L, LPPassManager &LPM) override;
bool doFinalization() override;
bool IsLoopSafeToClone(Loop *L);

Просмотреть файл

@ -64,7 +64,7 @@ public:
bool runOnBasicBlock(BasicBlock &BB) override;
void getAnalysisUsage(AnalysisUsage &AU) const override;
const char *getPassName() const override { return "LoadCombine"; }
StringRef getPassName() const override { return "LoadCombine"; }
static char ID;
typedef IRBuilder<true, TargetFolder> BuilderTy;

Просмотреть файл

@ -1297,7 +1297,7 @@ public:
bool runOnFunction(Function &F) override;
void getAnalysisUsage(AnalysisUsage &AU) const override;
const char *getPassName() const override { return "SROA"; }
StringRef getPassName() const override { return "SROA"; }
static char ID;
private:

Просмотреть файл

@ -94,7 +94,7 @@ public:
void dump() { Reader->dump(); }
const char *getPassName() const override { return "Sample profile pass"; }
StringRef getPassName() const override { return "Sample profile pass"; }
bool runOnFunction(Function &F) override;

Просмотреть файл

@ -3943,7 +3943,7 @@ class SROA_Parameter_HLSL : public ModulePass {
public:
static char ID; // Pass identification, replacement for typeid
explicit SROA_Parameter_HLSL() : ModulePass(ID) {}
const char *getPassName() const override { return "SROA Parameter HLSL"; }
StringRef getPassName() const override { return "SROA Parameter HLSL"; }
static void RewriteBitcastWithIdenticalStructs(Function *F);
static void RewriteBitcastWithIdenticalStructs(BitCastInst *BCI);
static bool DeleteSimpleStoreOnlyAlloca(AllocaInst *AI);
@ -6005,7 +6005,7 @@ class LowerStaticGlobalIntoAlloca : public ModulePass {
public:
static char ID; // Pass identification, replacement for typeid
explicit LowerStaticGlobalIntoAlloca() : ModulePass(ID) {}
const char *getPassName() const override { return "Lower static global into Alloca"; }
StringRef getPassName() const override { return "Lower static global into Alloca"; }
bool runOnModule(Module &M) override {
m_DbgFinder.processModule(M);

Просмотреть файл

@ -245,7 +245,7 @@ public:
bool runOnRegion(Region *R, RGPassManager &RGM) override;
const char *getPassName() const override {
StringRef getPassName() const override {
return "Structurize control flow";
}

Просмотреть файл

@ -47,7 +47,7 @@ namespace llvm {
// Normalize incoming dxil ir.
bool runOnFunction(Function &F) override;
virtual const char *getPassName() const override { return "Normalize Dxil"; }
virtual StringRef getPassName() const override { return "Normalize Dxil"; }
void getAnalysisUsage(AnalysisUsage &AU) const override;
};

Просмотреть файл

@ -469,7 +469,7 @@ void BackendConsumer::EmitOptimizationMessage(
Loc = FD->getASTContext().getFullLoc(FD->getBodyRBrace());
Diags.Report(Loc, DiagID)
<< AddFlagValue(D.getPassName() ? D.getPassName() : "")
<< AddFlagValue(D.getPassName())
<< D.getMsg().str();
if (DILoc.isInvalid() && D.isLocationAvailable())