diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp b/llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp index 53af1b1969c2..d424ebbef99d 100644 --- a/llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp +++ b/llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp @@ -7,7 +7,6 @@ //===----------------------------------------------------------------------===// #include "llvm/Transforms/Utils/EntryExitInstrumenter.h" -#include "llvm/ADT/Triple.h" #include "llvm/Analysis/GlobalsModRef.h" #include "llvm/IR/DebugInfoMetadata.h" #include "llvm/IR/Dominators.h" @@ -16,9 +15,7 @@ #include "llvm/IR/Intrinsics.h" #include "llvm/IR/Module.h" #include "llvm/IR/Type.h" -#include "llvm/InitializePasses.h" -#include "llvm/Pass.h" -#include "llvm/Transforms/Utils.h" +#include "llvm/TargetParser/Triple.h" using namespace llvm; @@ -83,6 +80,13 @@ static void insertCall(Function &CurFn, StringRef Func, } static bool runOnFunction(Function &F, bool PostInlining) { + // The asm in a naked function may reasonably expect the argument registers + // and the return address register (if present) to be live. An inserted + // function call will clobber these registers. Simply skip naked functions for + // all targets. + if (F.hasFnAttribute(Attribute::Naked)) + return false; + StringRef EntryAttr = PostInlining ? "instrument-function-entry-inlined" : "instrument-function-entry"; @@ -145,8 +149,8 @@ void llvm::EntryExitInstrumenterPass::printPipeline( raw_ostream &OS, function_ref<StringRef(StringRef)> MapClassName2PassName) { static_cast<PassInfoMixin<llvm::EntryExitInstrumenterPass> *>(this) ->printPipeline(OS, MapClassName2PassName); - OS << "<"; + OS << '<'; if (PostInlining) OS << "post-inline"; - OS << ">"; + OS << '>'; } |