Update clang to r339409b.
Change-Id: Ied8a188bb072c40035320acedc86164b66d920af
diff --git a/linux-x64/clang/include/llvm/Analysis/AliasSetTracker.h b/linux-x64/clang/include/llvm/Analysis/AliasSetTracker.h
index 0e6d229..cf4981d 100644
--- a/linux-x64/clang/include/llvm/Analysis/AliasSetTracker.h
+++ b/linux-x64/clang/include/llvm/Analysis/AliasSetTracker.h
@@ -52,9 +52,13 @@
PointerRec **PrevInList = nullptr;
PointerRec *NextInList = nullptr;
AliasSet *AS = nullptr;
- LocationSize Size = 0;
+ LocationSize Size = LocationSize::mapEmpty();
AAMDNodes AAInfo;
+ // Whether the size for this record has been set at all. This makes no
+ // guarantees about the size being known.
+ bool isSizeSet() const { return Size != LocationSize::mapEmpty(); }
+
public:
PointerRec(Value *V)
: Val(V), AAInfo(DenseMapInfo<AAMDNodes>::getEmptyKey()) {}
@@ -71,9 +75,10 @@
bool updateSizeAndAAInfo(LocationSize NewSize, const AAMDNodes &NewAAInfo) {
bool SizeChanged = false;
- if (NewSize > Size) {
- Size = NewSize;
- SizeChanged = true;
+ if (NewSize != Size) {
+ LocationSize OldSize = Size;
+ Size = isSizeSet() ? Size.unionWith(NewSize) : NewSize;
+ SizeChanged = OldSize != Size;
}
if (AAInfo == DenseMapInfo<AAMDNodes>::getEmptyKey())
@@ -91,7 +96,10 @@
return SizeChanged;
}
- LocationSize getSize() const { return Size; }
+ LocationSize getSize() const {
+ assert(isSizeSet() && "Getting an unset size!");
+ return Size;
+ }
/// Return the AAInfo, or null if there is no information or conflicting
/// information.
@@ -175,9 +183,6 @@
};
unsigned Alias : 1;
- /// True if this alias set contains volatile loads or stores.
- unsigned Volatile : 1;
-
unsigned SetSize = 0;
void addRef() { ++RefCount; }
@@ -203,9 +208,6 @@
bool isMustAlias() const { return Alias == SetMustAlias; }
bool isMayAlias() const { return Alias == SetMayAlias; }
- /// Return true if this alias set contains volatile loads or stores.
- bool isVolatile() const { return Volatile; }
-
/// Return true if this alias set should be ignored as part of the
/// AliasSetTracker object.
bool isForwardingAliasSet() const { return Forward; }
@@ -226,17 +228,7 @@
/// If this alias set is known to contain a single instruction and *only* a
/// single unique instruction, return it. Otherwise, return nullptr.
- Instruction* getUniqueInstruction() {
- if (size() != 0)
- // Can't track source of pointer, might be many instruction
- return nullptr;
- if (AliasAny)
- // May have collapses alias set
- return nullptr;
- if (1 != UnknownInsts.size())
- return nullptr;
- return cast<Instruction>(UnknownInsts[0]);
- }
+ Instruction* getUniqueInstruction();
void print(raw_ostream &OS) const;
void dump() const;
@@ -278,7 +270,7 @@
// Can only be created by AliasSetTracker.
AliasSet()
: PtrListEnd(&PtrList), RefCount(0), AliasAny(false), Access(NoAccess),
- Alias(SetMustAlias), Volatile(false) {}
+ Alias(SetMustAlias) {}
PointerRec *getSomePointer() const {
return PtrList;
@@ -317,8 +309,6 @@
dropRef(AST);
}
- void setVolatile() { Volatile = true; }
-
public:
/// Return true if the specified pointer "may" (or must) alias one of the
/// members in the set.
@@ -393,19 +383,11 @@
/// Return the alias sets that are active.
const ilist<AliasSet> &getAliasSets() const { return AliasSets; }
- /// Return the alias set that the specified pointer lives in. If the New
- /// argument is non-null, this method sets the value to true if a new alias
- /// set is created to contain the pointer (because the pointer didn't alias
- /// anything).
- AliasSet &getAliasSetForPointer(Value *P, LocationSize Size,
- const AAMDNodes &AAInfo);
-
- /// Return the alias set containing the location specified if one exists,
- /// otherwise return null.
- AliasSet *getAliasSetForPointerIfExists(const Value *P, LocationSize Size,
- const AAMDNodes &AAInfo) {
- return mergeAliasSetsForPointer(P, Size, AAInfo);
- }
+ /// Return the alias set which contains the specified memory location. If
+ /// the memory location aliases two or more existing alias sets, will have
+ /// the effect of merging those alias sets before the single resulting alias
+ /// set is returned.
+ AliasSet &getAliasSetFor(const MemoryLocation &MemLoc);
/// Return true if the specified instruction "may" (or must) alias one of the
/// members in any of the sets.
@@ -461,6 +443,10 @@
AliasSet &addPointer(Value *P, LocationSize Size, const AAMDNodes &AAInfo,
AliasSet::AccessLattice E);
+ AliasSet &addPointer(MemoryLocation Loc,
+ AliasSet::AccessLattice E) {
+ return addPointer(const_cast<Value*>(Loc.Ptr), Loc.Size, Loc.AATags, E);
+ }
AliasSet *mergeAliasSetsForPointer(const Value *Ptr, LocationSize Size,
const AAMDNodes &AAInfo);