diff options
author | Ian Levesque <ianlevesque@fb.com> | 2020-06-16 20:36:11 -0400 |
---|---|---|
committer | Ian Levesque <ianlevesque@fb.com> | 2020-06-17 13:49:01 -0400 |
commit | 7c7c8e0da4e0c400e7e06c4c6658372ea0b487ea (patch) | |
tree | 470a101986e1efd2ec880cafcca85a533b597273 /llvm/lib/CodeGen/CommandFlags.cpp | |
parent | acb30f6856c34b929b30bfd76dc938a1087af0a9 (diff) | |
download | llvm-7c7c8e0da4e0c400e7e06c4c6658372ea0b487ea.zip llvm-7c7c8e0da4e0c400e7e06c4c6658372ea0b487ea.tar.gz llvm-7c7c8e0da4e0c400e7e06c4c6658372ea0b487ea.tar.bz2 |
[xray] Option to omit the function index
Summary:
Add a flag to omit the xray_fn_idx to cut size overhead and relocations
roughly in half at the cost of reduced performance for single function
patching. Minor additions to compiler-rt support per-function patching
without the index.
Reviewers: dberris, MaskRay, johnislarry
Subscribers: hiraditya, arphaman, cfe-commits, #sanitizers, llvm-commits
Tags: #clang, #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D81995
Diffstat (limited to 'llvm/lib/CodeGen/CommandFlags.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CommandFlags.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/CommandFlags.cpp b/llvm/lib/CodeGen/CommandFlags.cpp index 947ae32..12dadf9 100644 --- a/llvm/lib/CodeGen/CommandFlags.cpp +++ b/llvm/lib/CodeGen/CommandFlags.cpp @@ -86,6 +86,7 @@ CGOPT(bool, EnableAddrsig) CGOPT(bool, EmitCallSiteInfo) CGOPT(bool, EnableDebugEntryValues) CGOPT(bool, ForceDwarfFrameSection) +CGOPT(bool, XRayOmitFunctionIndex) codegen::RegisterCodeGenFlags::RegisterCodeGenFlags() { #define CGBINDOPT(NAME) \ @@ -404,6 +405,11 @@ codegen::RegisterCodeGenFlags::RegisterCodeGenFlags() { cl::desc("Always emit a debug frame section."), cl::init(false)); CGBINDOPT(ForceDwarfFrameSection); + static cl::opt<bool> XRayOmitFunctionIndex( + "no-xray-index", cl::desc("Don't emit xray_fn_idx section"), + cl::init(false)); + CGBINDOPT(XRayOmitFunctionIndex); + #undef CGBINDOPT mc::RegisterMCTargetOptionsFlags(); @@ -470,6 +476,7 @@ TargetOptions codegen::InitTargetOptionsFromCodeGenFlags() { Options.EmitCallSiteInfo = getEmitCallSiteInfo(); Options.EnableDebugEntryValues = getEnableDebugEntryValues(); Options.ForceDwarfFrameSection = getForceDwarfFrameSection(); + Options.XRayOmitFunctionIndex = getXRayOmitFunctionIndex(); Options.MCOptions = mc::InitMCTargetOptionsFromFlags(); |