don't repeat function names in comments; NFC

llvm-svn: 257649
This commit is contained in:
Sanjay Patel 2016-01-13 19:01:43 +00:00
parent 81efb6b418
commit 728af60aed
1 changed files with 51 additions and 62 deletions

View File

@ -7,9 +7,9 @@
//
//===----------------------------------------------------------------------===//
//
// This file defines two classes: AliasSetTracker and AliasSet. These interface
// This file defines two classes: AliasSetTracker and AliasSet. These interfaces
// are used to classify a collection of pointer references into a maximal number
// of disjoint sets. Each AliasSet object constructed by the AliasSetTracker
// of disjoint sets. Each AliasSet object constructed by the AliasSetTracker
// object refers to memory disjoint from the other sets.
//
//===----------------------------------------------------------------------===//
@ -71,8 +71,8 @@ class AliasSet : public ilist_node<AliasSet> {
uint64_t getSize() const { return Size; }
/// getAAInfo - Return the AAInfo, or null if there is no
/// information or conflicting information.
/// Return the AAInfo, or null if there is no information or conflicting
/// information.
AAMDNodes getAAInfo() const {
// If we have missing or conflicting AAInfo, return null.
if (AAInfo == DenseMapInfo<AAMDNodes>::getEmptyKey() ||
@ -111,11 +111,11 @@ class AliasSet : public ilist_node<AliasSet> {
PointerRec *PtrList, **PtrListEnd; // Doubly linked list of nodes.
AliasSet *Forward; // Forwarding pointer.
// All instructions without a specific address in this alias set.
/// All instructions without a specific address in this alias set.
std::vector<AssertingVH<Instruction> > UnknownInsts;
// RefCount - Number of nodes pointing to this AliasSet plus the number of
// AliasSets forwarding to it.
/// Number of nodes pointing to this AliasSet plus the number of AliasSets
/// forwarding to it.
unsigned RefCount : 28;
/// The kinds of access this alias set models.
@ -143,7 +143,7 @@ class AliasSet : public ilist_node<AliasSet> {
};
unsigned Alias : 1;
// Volatile - True if this alias set contains volatile loads or stores.
/// True if this alias set contains volatile loads or stores.
bool Volatile : 1;
void addRef() { ++RefCount; }
@ -165,20 +165,18 @@ public:
bool isMustAlias() const { return Alias == SetMustAlias; }
bool isMayAlias() const { return Alias == SetMayAlias; }
// isVolatile - Return true if this alias set contains volatile loads or
// stores.
/// Return true if this alias set contains volatile loads or stores.
bool isVolatile() const { return Volatile; }
/// isForwardingAliasSet - Return true if this alias set should be ignored as
/// part of the AliasSetTracker object.
/// Return true if this alias set should be ignored as part of the
/// AliasSetTracker object.
bool isForwardingAliasSet() const { return Forward; }
/// mergeSetIn - Merge the specified alias set into this alias set...
///
/// Merge the specified alias set into this alias set.
void mergeSetIn(AliasSet &AS, AliasSetTracker &AST);
// Alias Set iteration - Allow access to all of the pointer which are part of
// this alias set...
// Alias Set iteration - Allow access to all of the pointers which are part of
// this alias set.
class iterator;
iterator begin() const { return iterator(PtrList); }
iterator end() const { return iterator(); }
@ -236,9 +234,9 @@ private:
return PtrList;
}
/// getForwardedTarget - Return the real alias set this represents. If this
/// has been merged with another set and is forwarding, return the ultimate
/// destination set. This also implements the union-find collapsing as well.
/// Return the real alias set this represents. If this has been merged with
/// another set and is forwarding, return the ultimate destination set. This
/// also implements the union-find collapsing as well.
AliasSet *getForwardedTarget(AliasSetTracker &AST) {
if (!Forward) return this;
@ -271,9 +269,8 @@ private:
void setVolatile() { Volatile = true; }
public:
/// aliasesPointer - Return true if the specified pointer "may" (or must)
/// alias one of the members in the set.
///
/// Return true if the specified pointer "may" (or must) alias one of the
/// members in the set.
bool aliasesPointer(const Value *Ptr, uint64_t Size, const AAMDNodes &AAInfo,
AliasAnalysis &AA) const;
bool aliasesUnknownInst(const Instruction *Inst, AliasAnalysis &AA) const;
@ -285,8 +282,8 @@ inline raw_ostream& operator<<(raw_ostream &OS, const AliasSet &AS) {
}
class AliasSetTracker {
/// CallbackVH - A CallbackVH to arrange for AliasSetTracker to be
/// notified whenever a Value is deleted.
/// A CallbackVH to arrange for AliasSetTracker to be notified whenever a
/// Value is deleted.
class ASTCallbackVH final : public CallbackVH {
AliasSetTracker *AST;
void deleted() override;
@ -296,8 +293,8 @@ class AliasSetTracker {
ASTCallbackVH(Value *V, AliasSetTracker *AST = nullptr);
ASTCallbackVH &operator=(Value *V);
};
/// ASTCallbackVHDenseMapInfo - Traits to tell DenseMap that tell us how to
/// compare and hash the value handle.
/// Traits to tell DenseMap that tell us how to compare and hash the value
/// handle.
struct ASTCallbackVHDenseMapInfo : public DenseMapInfo<Value *> {};
AliasAnalysis &AA;
@ -311,15 +308,14 @@ class AliasSetTracker {
PointerMapType PointerMap;
public:
/// AliasSetTracker ctor - Create an empty collection of AliasSets, and use
/// the specified alias analysis object to disambiguate load and store
/// addresses.
/// Create an empty collection of AliasSets, and use the specified alias
/// analysis object to disambiguate load and store addresses.
explicit AliasSetTracker(AliasAnalysis &aa) : AA(aa) {}
~AliasSetTracker() { clear(); }
/// add methods - These methods are used to add different types of
/// instructions to the alias sets. Adding a new instruction can result in
/// one of three actions happening:
/// These methods are used to add different types of instructions to the alias
/// sets. Adding a new instruction can result in one of three actions
/// happening:
///
/// 1. If the instruction doesn't alias any other sets, create a new set.
/// 2. If the instruction aliases exactly one set, add it to the set
@ -338,10 +334,9 @@ public:
void add(const AliasSetTracker &AST); // Add alias relations from another AST
bool addUnknown(Instruction *I);
/// remove methods - These methods are used to remove all entries that might
/// be aliased by the specified instruction. These methods return true if any
/// alias sets were eliminated.
// Remove a location
/// These methods are used to remove all entries that might be aliased by the
/// specified instruction. These methods return true if any alias sets were
/// eliminated.
bool remove(Value *Ptr, uint64_t Size, const AAMDNodes &AAInfo);
bool remove(LoadInst *LI);
bool remove(StoreInst *SI);
@ -352,28 +347,26 @@ public:
void clear();
/// getAliasSets - Return the alias sets that are active.
///
/// Return the alias sets that are active.
const ilist<AliasSet> &getAliasSets() const { return AliasSets; }
/// getAliasSetForPointer - 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).
/// 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, uint64_t Size,
const AAMDNodes &AAInfo,
bool *New = nullptr);
/// getAliasSetForPointerIfExists - Return the alias set containing the
/// location specified if one exists, otherwise return null.
/// Return the alias set containing the location specified if one exists,
/// otherwise return null.
AliasSet *getAliasSetForPointerIfExists(const Value *P, uint64_t Size,
const AAMDNodes &AAInfo) {
return findAliasSetForPointer(P, Size, AAInfo);
}
/// containsPointer - Return true if the specified location is represented by
/// this alias set, false otherwise. This does not modify the AST object or
/// alias sets.
/// Return true if the specified location is represented by this alias set,
/// false otherwise. This does not modify the AST object or alias sets.
bool containsPointer(const Value *P, uint64_t Size,
const AAMDNodes &AAInfo) const;
@ -381,23 +374,19 @@ public:
/// members in any of the sets.
bool containsUnknown(const Instruction *I) const;
/// getAliasAnalysis - Return the underlying alias analysis object used by
/// this tracker.
/// Return the underlying alias analysis object used by this tracker.
AliasAnalysis &getAliasAnalysis() const { return AA; }
/// deleteValue method - This method is used to remove a pointer value from
/// the AliasSetTracker entirely. It should be used when an instruction is
/// deleted from the program to update the AST. If you don't use this, you
/// would have dangling pointers to deleted instructions.
///
/// This method is used to remove a pointer value from the AliasSetTracker
/// entirely. It should be used when an instruction is deleted from the
/// program to update the AST. If you don't use this, you would have dangling
/// pointers to deleted instructions.
void deleteValue(Value *PtrVal);
/// copyValue - This method should be used whenever a preexisting value in the
/// program is copied or cloned, introducing a new value. Note that it is ok
/// for clients that use this method to introduce the same value multiple
/// times: if the tracker already knows about a value, it will ignore the
/// request.
///
/// This method should be used whenever a preexisting value in the program is
/// copied or cloned, introducing a new value. Note that it is ok for clients
/// that use this method to introduce the same value multiple times: if the
/// tracker already knows about a value, it will ignore the request.
void copyValue(Value *From, Value *To);
typedef ilist<AliasSet>::iterator iterator;
@ -416,8 +405,8 @@ private:
friend class AliasSet;
void removeAliasSet(AliasSet *AS);
// getEntryFor - Just like operator[] on the map, except that it creates an
// entry for the pointer if it doesn't already exist.
/// Just like operator[] on the map, except that it creates an entry for the
/// pointer if it doesn't already exist.
AliasSet::PointerRec &getEntryFor(Value *V) {
AliasSet::PointerRec *&Entry = PointerMap[ASTCallbackVH(V, this)];
if (!Entry)