EntryExitInstrumenter: support __cyg_profile_func_enter_bare
authorHans Wennborg <hans@hanshq.net>
Tue, 21 Nov 2017 17:22:19 +0000 (17:22 +0000)
committerHans Wennborg <hans@hanshq.net>
Tue, 21 Nov 2017 17:22:19 +0000 (17:22 +0000)
It works just like __cyg_profile_func_enter but takes no arguments.

llvm-svn: 318783

llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp
llvm/test/Transforms/CountingFunctionInserter/mcount.ll

index bdcd3d4..064d7d0 100644 (file)
@@ -29,7 +29,8 @@ static void insertCall(Function &CurFn, StringRef Func,
       Func == "\01_mcount" ||
       Func == "\01mcount" ||
       Func == "__mcount" ||
-      Func == "_mcount") {
+      Func == "_mcount" ||
+      Func == "__cyg_profile_func_enter_bare") {
     Constant *Fn = M.getOrInsertFunction(Func, Type::getVoidTy(C));
     CallInst::Create(Fn, "", InsertionPt);
     return;
index 6d9aaab..50e6b13 100644 (file)
@@ -73,6 +73,10 @@ define void @f6() #6 { entry: ret void }
 ; CHECK-LABEL: define void @f6
 ; CHECK: call void @_mcount
 
+define void @f7() #7 { entry: ret void }
+; CHECK-LABEL: define void @f7
+; CHECK: call void @__cyg_profile_func_enter_bare
+
 
 ; The attributes are "consumed" when the instrumentation is inserted.
 ; CHECK: attributes
@@ -84,3 +88,4 @@ attributes #3 = { "instrument-function-entry-inlined"="\01_mcount" }
 attributes #4 = { "instrument-function-entry-inlined"="\01mcount" }
 attributes #5 = { "instrument-function-entry-inlined"="__mcount" }
 attributes #6 = { "instrument-function-entry-inlined"="_mcount" }
+attributes #7 = { "instrument-function-entry-inlined"="__cyg_profile_func_enter_bare" }