[PATCH] D105916: [AsmPrinter][CallGraphSection] Emit call graph section

Necip Fazil Yildiran via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 22 15:15:37 PDT 2021


necipfazil updated this revision to Diff 360995.
necipfazil marked 4 inline comments as done.
necipfazil added a comment.

Several fixes and refactoring

- Emit call graph section per function right after the function information is gathered rather than collection all and emitting once. This simplifies the code with less book keeping. Also, emitting the section at AsmPrinter::doFinalization() was wrong, leading to linker issues when section is not linked with function symbol.
- Use function begin symbol as function entry label in call graph section. Avoid emitting yet another temp symbol.
- Fix MCObjectFileInfo::getCallGraphSection(). Create section based on text section instead of the function symbol.
- Move FunctionKind to AsmPrinter::FunctionInfo to make the FunctionKind values clear to call graph section consumers.
- Propagate some more call graph section logic from AsmPrinter::emitFunctionBody() to AsmPrinter::emitCallGraphSection(). This also means less bookkeeping in AsmPrinter::FunctionInfo.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105916

Files:
  llvm/include/llvm/CodeGen/AsmPrinter.h
  llvm/include/llvm/MC/MCObjectFileInfo.h
  llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  llvm/lib/MC/MCObjectFileInfo.cpp
  llvm/test/CodeGen/call-graph-section.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105916.360995.patch
Type: text/x-patch
Size: 13281 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210722/c3343ef6/attachment.bin>


More information about the llvm-commits mailing list