Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I think this is reasonable. There is no need to record call graph profile edges from functions to imported functions in the metadata. However, I would prefer to move the check into CodeGen, so that if we receive some IR that has edges like this, we don't emit an object file that cannot be linked. I'd be OK doing the check in both places.
I think we just want to do it here, simply don't generate the "CG Profile" metadata entry for dllimport function, since the IR could complied to assembly or object file. Otherwise, we need two checks in both MCAsmStreamer and MCCOFFStreamer.
I'm saying the fix belongs in TargetObjectFileLoweringImpl.cpp, which is the point where we translate from IR to assembly. We can't fix this after producing assembly, because we don't know what symbols are marked dllimport at that point.
That's reverted. (https://reviews.llvm.org/rG91aed9bf975f1e4346cc8f4bdefc98436386ced2). I don't know if I should put two patches together.
Well, normally code that has been reverted cannot be relanded without changes, so it's common to revert the revert locally, edit it, and reupload it for code review. I believe you can even "reopen" the closed code review issue that you used for the first review, and it will show the changes you made clearly.
In any case, if you want to do that separately, I think this change stands on its own, so I will approve it as is.