[PATCH] D42726: [x86] Make the retpoline thunk insertion a machine function pass.

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 31 11:11:29 PST 2018


chandlerc marked 3 inline comments as done.
chandlerc added a comment.

Thanks, applied fixes. I can update the patch if useful.



================
Comment at: llvm/lib/Target/X86/X86RetpolineThunks.cpp:61
   void getAnalysisUsage(AnalysisUsage &AU) const override {
+    FunctionPass::getAnalysisUsage(AU);
     AU.addRequired<MachineModuleInfo>();
----------------
MatzeB wrote:
> Is this not using `MachineFunctionPass::getAnalysisUsage()` on purpose?
No, just a drive-by mistake on my part. Should be fixed.


================
Comment at: llvm/lib/Target/X86/X86RetpolineThunks.cpp:211
+void X86RetpolineThunks::createThunkFunction(Module &M, StringRef Name) {
   LLVMContext &Ctx = M.getContext();
   auto Type = FunctionType::get(Type::getVoidTy(Ctx), false);
----------------
MatzeB wrote:
> Add `assert(Name.startswith(ThunkNamePrefix))` as the runOnMachineFunction logic depends on it?
Good idea!


Repository:
  rL LLVM

https://reviews.llvm.org/D42726





More information about the llvm-commits mailing list