diff options
author | George Burgess IV <george.burgess.iv@gmail.com> | 2018-10-10 01:35:22 +0000 |
---|---|---|
committer | George Burgess IV <george.burgess.iv@gmail.com> | 2018-10-10 01:35:22 +0000 |
commit | d98d505c0dc793233f83f33ac11eaaa9904db5b2 (patch) | |
tree | 4469b12c652ce94fa88e48e292f1b7b508e593ee /llvm/lib/Analysis/MemoryLocation.cpp | |
parent | 108e98ec32ba61a19965611206633cd2ebb0d6ba (diff) | |
download | bcm5719-llvm-d98d505c0dc793233f83f33ac11eaaa9904db5b2.tar.gz bcm5719-llvm-d98d505c0dc793233f83f33ac11eaaa9904db5b2.zip |
[Analysis] Make LocationSize pretty-printing more descriptive
This is the third patch in a series intended to make
https://reviews.llvm.org/D44748 more easily reviewable. Please see that
patch for more context. The second being r344013.
The intent is to make the output of printing a LocationSize more
precise. The main motivation for this is that we plan to add a bit to
distinguish whether a given LocationSize is an upper-bound or is
precise; making that information available in pretty-printing is nice.
llvm-svn: 344108
Diffstat (limited to 'llvm/lib/Analysis/MemoryLocation.cpp')
-rw-r--r-- | llvm/lib/Analysis/MemoryLocation.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/MemoryLocation.cpp b/llvm/lib/Analysis/MemoryLocation.cpp index 326944f2964..df863d6f8d0 100644 --- a/llvm/lib/Analysis/MemoryLocation.cpp +++ b/llvm/lib/Analysis/MemoryLocation.cpp @@ -18,6 +18,18 @@ #include "llvm/IR/Type.h" using namespace llvm; +void LocationSize::print(raw_ostream &OS) const { + OS << "LocationSize::"; + if (*this == unknown()) + OS << "unknown"; + else if (*this == mapEmpty()) + OS << "mapEmpty"; + else if (*this == mapTombstone()) + OS << "mapTombstone"; + else + OS << "precise(" << getValue() << ')'; +} + MemoryLocation MemoryLocation::get(const LoadInst *LI) { AAMDNodes AATags; LI->getAAMetadata(AATags); |