[PATCH] D46326: ThinLTO+CFI: short-circuit direct calls to jump table entries

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 15 16:43:27 PDT 2018


pcc accepted this revision.
pcc added a comment.

LGTM



================
Comment at: llvm/lib/Transforms/IPO/LowerTypeTests.cpp:982
+  if (F->isDeclarationForLinker() && isDefinition) {
+    FDecl = Function::Create(F->getFunctionType(), GlobalValue::ExternalLinkage,
+                             Name + ".cfi", &M);
----------------
It's a little confusing that `FDecl` is used for a different purpose here than in the rest of the function (where it is used to refer to a jump table entry). Maybe make this declare a separate `RealF` variable, and then once you take care of the else after return below you can move the declaration of `FDecl` after the  if statement.


================
Comment at: llvm/lib/Transforms/IPO/LowerTypeTests.cpp:987
+    return;
+  } else if (F->isDeclarationForLinker() && !isDefinition) {
     // Declaration of an external function.
----------------
No else after return.


https://reviews.llvm.org/D46326





More information about the llvm-commits mailing list