aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2017-12-09 00:21:41 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2017-12-09 00:21:41 +0000
commitc667c1f47a8ec1acfd6eceb999f8f05793218ca1 (patch)
tree90e81b64ba0ee0c00b7339818de00ac1cd486026 /llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
parent8bd9d6ad838dd6a030f4cfcf691fb54162976e48 (diff)
downloadllvm-c667c1f47a8ec1acfd6eceb999f8f05793218ca1.zip
llvm-c667c1f47a8ec1acfd6eceb999f8f05793218ca1.tar.gz
llvm-c667c1f47a8ec1acfd6eceb999f8f05793218ca1.tar.bz2
Hardware-assisted AddressSanitizer (llvm part).
Summary: This is LLVM instrumentation for the new HWASan tool. It is basically a stripped down copy of ASan at this point, w/o stack or global support. Instrumenation adds a global constructor + runtime callbacks for every load and store. HWASan comes with its own IR attribute. A brief design document can be found in clang/docs/HardwareAssistedAddressSanitizerDesign.rst (submitted earlier). Reviewers: kcc, pcc, alekseyshl Subscribers: srhines, mehdi_amini, mgorny, javed.absar, eraman, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D40932 llvm-svn: 320217
Diffstat (limited to 'llvm/lib/Analysis/MemoryDependenceAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/MemoryDependenceAnalysis.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
index cb0c6a5..a6c5901 100644
--- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -306,8 +306,10 @@ unsigned MemoryDependenceResults::getLoadLoadClobberFullWidthSize(
return 0;
if (LIOffs + NewLoadByteSize > MemLocEnd &&
- LI->getParent()->getParent()->hasFnAttribute(
- Attribute::SanitizeAddress))
+ (LI->getParent()->getParent()->hasFnAttribute(
+ Attribute::SanitizeAddress) ||
+ LI->getParent()->getParent()->hasFnAttribute(
+ Attribute::SanitizeHWAddress)))
// We will be reading past the location accessed by the original program.
// While this is safe in a regular build, Address Safety analysis tools
// may start reporting false warnings. So, don't do widening.