[clang] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

Namhyung Kim via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 6 10:00:44 PST 2024


================
@@ -5636,6 +5636,31 @@ void CGDebugInfo::EmitExternalVariable(llvm::GlobalVariable *Var,
   Var->addDebugInfo(GVE);
 }
 
+void CGDebugInfo::EmitPseudoVariable(llvm::AllocaInst *Alloca, QualType Ty,
+                                     SourceLocation Loc) {
+  llvm::DIFile *Unit = getOrCreateFile(Loc);
+  unsigned Line = getLineNumber(Loc);
+  unsigned Column = getColumnNumber(Loc);
+  llvm::DILocalVariable *D = DBuilder.createAutoVariable(
+      LexicalBlockStack.back(), Alloca->getName(), getOrCreateFile(Loc), Line,
----------------
namhyung wrote:

Can it generate a variable without name?  I think name is useless here and just bloats the binary size.

https://github.com/llvm/llvm-project/pull/81545


More information about the cfe-commits mailing list