[PATCH] D139217: [CodeExtractor] Correctly propagate scope information post extraction
Felipe de Azevedo Piovezan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 6 06:24:35 PST 2022
fdeazeve added inline comments.
================
Comment at: llvm/include/llvm/IR/DebugInfoMetadata.h:2119
+ void setScope(DIScope *Scope) {
+ assert(!isUniqued());
----------------
aprantl wrote:
> The other sibling classes would call this `replaceScope()`.
Good point!
================
Comment at: llvm/lib/IR/DebugLoc.cpp:72
+/// recreating the chain with "NewSP" instead.
+static DIScope *replaceSubprogram(DILocalScope &RootScope, DISubprogram &NewSP,
+ LLVMContext &Ctx,
----------------
aprantl wrote:
> This function doesn't replace anything. What do you think of `reparentScopeChain`, `cloneScopesForSubprogram()`?
The irony here is that we've just created a "replaceScope" method... but you're right, this makes it sound like we're modifying the original scope. I'll go with the "clone" variant
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139217/new/
https://reviews.llvm.org/D139217
More information about the llvm-commits
mailing list