diff options
author | Nirav Dave <niravd@google.com> | 2017-01-31 17:00:35 +0000 |
---|---|---|
committer | Nirav Dave <niravd@google.com> | 2017-01-31 17:00:35 +0000 |
commit | 0c86ccf4b418dde2d4b4d5b57a2aeae1e7d381fc (patch) | |
tree | 698c1022857b6fe985efcd347f3a4fb3c29c5871 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | a7c041d1477bdfd753f7155b2cb1fb739eaddb0f (diff) | |
download | bcm5719-llvm-0c86ccf4b418dde2d4b4d5b57a2aeae1e7d381fc.tar.gz bcm5719-llvm-0c86ccf4b418dde2d4b4d5b57a2aeae1e7d381fc.zip |
[X86] Teach Clang about -mfentry flag
Replace mcount calls with calls to fentry.
Reviewers: hfinkel, craig.topper
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D28001
llvm-svn: 293649
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 00bde1c5b28..126390957fb 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -860,8 +860,12 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, // inlining, we just add an attribute to insert a mcount call in backend. // The attribute "counting-function" is set to mcount function name which is // architecture dependent. - if (CGM.getCodeGenOpts().InstrumentForProfiling) - Fn->addFnAttr("counting-function", getTarget().getMCountName()); + if (CGM.getCodeGenOpts().InstrumentForProfiling) { + if (CGM.getCodeGenOpts().CallFEntry) + Fn->addFnAttr("fentry-call", "true"); + else + Fn->addFnAttr("counting-function", getTarget().getMCountName()); + } if (RetTy->isVoidType()) { // Void type; nothing to return. |