[PATCH] D40276: Add -finstrument-function-entry-bare flag

Matthew Cary via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 21 07:36:17 PST 2017


mattcary added a comment.

It looks like there also has to be a change to llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp?

Index: lib/Transforms/Utils/EntryExitInstrumenter.cpp
=====================================================

- lib/Transforms/Utils/EntryExitInstrumenter.cpp	(revision 318760)

+++ lib/Transforms/Utils/EntryExitInstrumenter.cpp	(working copy)
@@ -51,6 +51,10 @@

  CallInst::Create(Fn, ArrayRef<Value *>(Args), "", InsertionPt);
  return;

+  } else if (Func == "__cyg_profile_func_enter_bare") {
+    Constant *Fn = M.getOrInsertFunction(Func, Type::getVoidTy(C));
+    CallInst::Create(Fn, "", InsertionPt);
+    return;

  }
   
  // We only know how to call a fixed set of instrumentation functions, because


https://reviews.llvm.org/D40276





More information about the cfe-commits mailing list