[PATCH] D66328: [DebugInfo] Add debug location to stubs generated by CGDeclCXX and mark them as artificial

Alexandre Ganea via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 3 12:32:42 PDT 2019


aganea marked an inline comment as done.
aganea added inline comments.


================
Comment at: lib/CodeGen/CGDebugInfo.cpp:3581
+    llvm::DILocalScope *PrevScope =
+        !LexicalBlockStack.empty()
+            ? dyn_cast<llvm::DILocalScope>(LexicalBlockStack.back())
----------------
aganea wrote:
> rnk wrote:
> > Is it OK to look up the lexical block stack at this point? The block stack isn't function local, it's part of CGDebugInfo, which is for the whole module, unlike CodeGenFunction. If we start emitting one of these thunks while we're emitting some other function, we could get some strange results. Does anything ensure we've pushed at least one scope by the time we come here?
> You're right, it was looking too much like smart code. Replaced by a new flag `DynamicInitKind::Global` to make explicit the decision to emit an artificial function.
Actually, it is `DynamicInitKind::GlobalDestructor`, sorry about that.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66328/new/

https://reviews.llvm.org/D66328





More information about the cfe-commits mailing list