diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2018-01-25 21:28:51 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2018-01-25 21:28:51 +0000 |
commit | 31475a039a629f575f828c0c9bdc7a7d98e662b4 (patch) | |
tree | 026c0bc38130cf86a3a7c1ba6a1cabd4b80a3d08 /llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | |
parent | 6fd634b11b5be0126723acf30fe5c7c65c1cbee3 (diff) | |
download | bcm5719-llvm-31475a039a629f575f828c0c9bdc7a7d98e662b4.tar.gz bcm5719-llvm-31475a039a629f575f828c0c9bdc7a7d98e662b4.zip |
[asan] Fix kernel callback naming in instrumentation module.
Right now clang uses "_n" suffix for some user space callbacks and "N" for the matching kernel ones. There's no need for this and it actually breaks kernel build with inline instrumentation. Use the same callback names for user space and the kernel (and also make them consistent with the names GCC uses).
Patch by Andrey Konovalov.
Differential Revision: https://reviews.llvm.org/D42423
llvm-svn: 323470
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp index 68b4146e254..1c8bff41b57 100644 --- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -2247,7 +2247,6 @@ void AddressSanitizer::initializeCallbacks(Module &M) { for (size_t AccessIsWrite = 0; AccessIsWrite <= 1; AccessIsWrite++) { const std::string TypeStr = AccessIsWrite ? "store" : "load"; const std::string ExpStr = Exp ? "exp_" : ""; - const std::string SuffixStr = CompileKernel ? "N" : "_n"; const std::string EndingStr = Recover ? "_noabort" : ""; SmallVector<Type *, 3> Args2 = {IntptrTy, IntptrTy}; @@ -2259,8 +2258,7 @@ void AddressSanitizer::initializeCallbacks(Module &M) { } AsanErrorCallbackSized[AccessIsWrite][Exp] = checkSanitizerInterfaceFunction(M.getOrInsertFunction( - kAsanReportErrorTemplate + ExpStr + TypeStr + SuffixStr + - EndingStr, + kAsanReportErrorTemplate + ExpStr + TypeStr + "_n" + EndingStr, FunctionType::get(IRB.getVoidTy(), Args2, false))); AsanMemoryAccessCallbackSized[AccessIsWrite][Exp] = |