mirror of
https://github.com/intel/llvm.git
synced 2026-02-08 00:50:03 +08:00
[XRay][clang] Emit "never-instrument" attribute
Summary: Before this change, we only emit the XRay attributes in LLVM IR when the -fxray-instrument flag is provided. This may cause issues with thinlto when the final binary is being built/linked with -fxray-instrument, and the constitutent LLVM IR gets re-lowered with xray instrumentation. With this change, we can honour the "never-instrument "attributes provided in the source code and preserve those in the IR. This way, even in thinlto builds, we retain the attributes which say whether functions should never be XRay instrumented. This change addresses llvm.org/PR38922. Reviewers: mboerger, eizan Subscribers: mehdi_amini, dexonsmith, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D52015 llvm-svn: 342200
This commit is contained in:
@@ -1967,9 +1967,6 @@ bool CodeGenModule::isInSanitizerBlacklist(llvm::GlobalVariable *GV,
|
||||
|
||||
bool CodeGenModule::imbueXRayAttrs(llvm::Function *Fn, SourceLocation Loc,
|
||||
StringRef Category) const {
|
||||
if (!LangOpts.XRayInstrument)
|
||||
return false;
|
||||
|
||||
const auto &XRayFilter = getContext().getXRayFilter();
|
||||
using ImbueAttr = XRayFunctionFilter::ImbueAttribute;
|
||||
auto Attr = ImbueAttr::NONE;
|
||||
|
||||
Reference in New Issue
Block a user