[llvm] [RemoveDIs][DebugInfo][IR] Add parsing for non-intrinsic debug values (PR #79818)
Stephen Tozer via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 19 09:51:44 PST 2024
================
@@ -62,13 +62,24 @@ static cl::opt<bool> AllowIncompleteIR(
"Allow incomplete IR on a best effort basis (references to unknown "
"metadata will be dropped)"));
+extern llvm::cl::opt<bool> UseNewDbgInfoFormat;
+
static std::string getTypeString(Type *T) {
std::string Result;
raw_string_ostream Tmp(Result);
Tmp << *T;
return Tmp.str();
}
+// Currently, we should always process modules in the old debug info format by
+// default regardless of the module's format in IR; convert it to the old format
+// here.
+bool finalizeDebugInfoFormat(Module *M) {
+ if (M)
+ M->setIsNewDbgInfoFormat(false);
----------------
SLTozer wrote:
Just due to an awkward combination of factors at the moment: not all LLVM features internally support the new debug info format yet, so we use `UseNewDbgInfoFormat` immediately before running optimization passes (the only part that fully supports the new format right now) and convert back afterwards. Right now `UseNewDbgInfoFormat` defaults to true, so if we use it here to conditionally use the new format then we'll break the tools that use the parser but don't support the new format. We might be able to change that so that `UseNewDbgInfoFormat` is only true when we use a tool that fully supports it, but that probably involves a separate patch.
In short, the declaration is the mistake here - I'll remove it.
https://github.com/llvm/llvm-project/pull/79818
More information about the llvm-commits
mailing list