Skip to content

Commit

Permalink
EntryExitInstrumenter: support __cyg_profile_func_enter_bare
Browse files Browse the repository at this point in the history
It works just like __cyg_profile_func_enter but takes no arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318783 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
zmodem committed Nov 21, 2017
1 parent 36acc9a commit 1176434
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Transforms/Utils/EntryExitInstrumenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions test/Transforms/CountingFunctionInserter/mcount.ll
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" }

0 comments on commit 1176434

Please sign in to comment.