akhuang added inline comments.

================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:1966
+  QualType PointeeTy = D.getTypePtr()->getPointeeType();
+  llvm::DIType *DI = getOrCreateType(PointeeTy, getOrCreateFile(Loc));
+  CI->setMetadata("heapallocsite", DI);
----------------
hans wrote:
> I don't really know this code, but does this also work for void pointers, 
> i.e. the if statement in the old code was unnecessary?
I think `getOrCreateType` returns null if it gets a void type, so it doesn't 
quite work for void pointers. In theory we shouldn't be getting void pointers 
here since the type should be cast to something but that hasn't been 
implemented yet.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:1078
+      MCSymbol *EndLabel = std::get<1>(HeapAllocSite);
+      DIType *DITy = cast<DIType>(std::get<2>(HeapAllocSite));
+
----------------
hans wrote:
> Is the cast necessary? Couldn't the tuple member be made a DIType* in the 
> first place?
Changed the tuple member to be a DIType.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60800



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to