mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 15:13:49 -04:00
[Debugify] Set a DI version module flag for llc compatibility
Setting the "Debug Info Version" module flag makes it possible to pipe synthetic debug info into llc, which is useful for testing backends. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333237 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
+10
-2
@@ -121,6 +121,12 @@ bool applyDebugifyMetadata(Module &M,
|
||||
addDebugifyOperand(NextVar - 1); // Original number of variables.
|
||||
assert(NMD->getNumOperands() == 2 &&
|
||||
"llvm.debugify should have exactly 2 operands!");
|
||||
|
||||
// Claim that this synthetic debug info is valid.
|
||||
StringRef DIVersionKey = "Debug Info Version";
|
||||
if (!M.getModuleFlag(DIVersionKey))
|
||||
M.addModuleFlag(Module::Warning, DIVersionKey, DEBUG_METADATA_VERSION);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -270,10 +276,12 @@ struct CheckDebugifyFunctionPass : public FunctionPass {
|
||||
Module &M = *F.getParent();
|
||||
auto FuncIt = F.getIterator();
|
||||
return checkDebugifyMetadata(M, make_range(FuncIt, std::next(FuncIt)),
|
||||
NameOfWrappedPass, "CheckFunctionDebugify", Strip);
|
||||
NameOfWrappedPass, "CheckFunctionDebugify",
|
||||
Strip);
|
||||
}
|
||||
|
||||
CheckDebugifyFunctionPass(bool Strip = false, StringRef NameOfWrappedPass = "")
|
||||
CheckDebugifyFunctionPass(bool Strip = false,
|
||||
StringRef NameOfWrappedPass = "")
|
||||
: FunctionPass(ID), Strip(Strip), NameOfWrappedPass(NameOfWrappedPass) {}
|
||||
|
||||
void getAnalysisUsage(AnalysisUsage &AU) const override {
|
||||
|
||||
Reference in New Issue
Block a user