diff options
| author | Oren Ben Simhon <oren.ben.simhon@intel.com> | 2018-01-09 08:53:59 +0000 |
|---|---|---|
| committer | Oren Ben Simhon <oren.ben.simhon@intel.com> | 2018-01-09 08:53:59 +0000 |
| commit | 57cc1a5d77d89a01508782dec8dabece351fbf1c (patch) | |
| tree | e935fd62cd93a81b1943a80801473910228ad027 /clang/lib/CodeGen/CodeGenFunction.cpp | |
| parent | 1c6308ecd5e203650bf2d852361cdb1bd5e0e537 (diff) | |
| download | llvm-57cc1a5d77d89a01508782dec8dabece351fbf1c.zip llvm-57cc1a5d77d89a01508782dec8dabece351fbf1c.tar.gz llvm-57cc1a5d77d89a01508782dec8dabece351fbf1c.tar.bz2 | |
Added Control Flow Protection Flag
Cf-protection is a target independent flag that instructs the back-end to instrument control flow mechanisms like: Branch, Return, etc.
For example in X86 this flag will be used to instrument Indirect Branch Tracking instructions.
Differential Revision: https://reviews.llvm.org/D40478
Change-Id: I5126e766c0e6b84118cae0ee8a20fe78cc373dea
llvm-svn: 322063
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 0cbe071d..4a45b5a 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -887,7 +887,8 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, } // Apply xray attributes to the function (as a string, for now) - if (D && ShouldXRayInstrumentFunction()) { + bool InstrumentXray = ShouldXRayInstrumentFunction(); + if (D && InstrumentXray) { if (const auto *XRayAttr = D->getAttr<XRayInstrumentAttr>()) { if (XRayAttr->alwaysXRayInstrument()) Fn->addFnAttr("function-instrument", "xray-always"); |
