recommit r172363 & r171325 (reverted in r172756)

This adds minimalistic support for PHI nodes to llvm.objectsize() evaluation

fingers crossed so that it does break clang boostrap again..

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176408 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nuno Lopes
2013-03-02 11:36:24 +00:00
parent 2bc689c846
commit b443a0aeac
3 changed files with 160 additions and 13 deletions

View File

@ -161,12 +161,14 @@ typedef std::pair<APInt, APInt> SizeOffsetType;
class ObjectSizeOffsetVisitor
: public InstVisitor<ObjectSizeOffsetVisitor, SizeOffsetType> {
typedef DenseMap<const Value*, SizeOffsetType> CacheMapTy;
const DataLayout *TD;
const TargetLibraryInfo *TLI;
bool RoundToAlign;
unsigned IntTyBits;
APInt Zero;
SmallPtrSet<Instruction *, 8> SeenInsts;
CacheMapTy CacheMap;
APInt align(APInt Size, uint64_t Align);