From 05cf44346346c0308396cf59b2c7228b2b3eff30 Mon Sep 17 00:00:00 2001 From: Dean Michael Berris Date: Fri, 14 Sep 2018 01:59:12 +0000 Subject: [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 --- clang/lib/CodeGen/CodeGenModule.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 7df2ea714ea2..49c926db5628 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -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; -- cgit v1.2.3