[PATCH] D105909: [clang][CallGraphSection] Add type id metadata to indirect call and targets

Necip Fazil Yildiran via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 15 08:43:51 PDT 2021


necipfazil added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2068
+    EmittedMDIdGeneralized = true;
+  }
+
----------------
morehouse wrote:
> This code also seems unnecessary as it puts metadata on function definitions.
We need the metadata for mapping indirect calls to receiver indirect targets with matching type id.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2177
+      !CodeGenOpts.SanitizeCfiCanonicalJumpTables ||
+      CodeGenOpts.CallGraphSection)
     CreateFunctionTypeMetadataForIcall(FD, F);
----------------
morehouse wrote:
> Also seems unnecessary.
As described above, we need the metadata for indirect targets.


================
Comment at: clang/test/CodeGen/call-graph-section.c:20
+
+// CHECK-DAG: define {{(dso_local)?}} i32 @baz({{.*}} !type [[F_TPRIMITIVE:![0-9]+]]
+int baz(char a, float b, double c) {
----------------
morehouse wrote:
> Do we still expect type metadata on function definitions on the latest diff?
As described above, we need the metadata for indirect targets.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105909



More information about the llvm-commits mailing list