[PATCH] D60800: [MS] Emit S_HEAPALLOCSITE debug info
Amy Huang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 18 10:43:45 PDT 2019
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
More information about the llvm-commits
mailing list