forked from OSchip/llvm-project
[PM/AA] Run clang-format over the ObjCARC Alias Analysis code to
normalize its formatting before I make more substantial changes. llvm-svn: 245024
This commit is contained in:
parent
b4ebdf3d72
commit
d541e7304f
|
@ -48,8 +48,7 @@ bool ObjCARCAliasAnalysis::doInitialization(Module &M) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void ObjCARCAliasAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {
|
||||||
ObjCARCAliasAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {
|
|
||||||
AU.setPreservesAll();
|
AU.setPreservesAll();
|
||||||
AliasAnalysis::getAnalysisUsage(AU);
|
AliasAnalysis::getAnalysisUsage(AU);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,44 +29,42 @@
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
namespace objcarc {
|
namespace objcarc {
|
||||||
|
|
||||||
/// \brief This is a simple alias analysis implementation that uses knowledge
|
/// \brief This is a simple alias analysis implementation that uses knowledge
|
||||||
/// of ARC constructs to answer queries.
|
/// of ARC constructs to answer queries.
|
||||||
///
|
///
|
||||||
/// TODO: This class could be generalized to know about other ObjC-specific
|
/// TODO: This class could be generalized to know about other ObjC-specific
|
||||||
/// tricks. Such as knowing that ivars in the non-fragile ABI are non-aliasing
|
/// tricks. Such as knowing that ivars in the non-fragile ABI are non-aliasing
|
||||||
/// even though their offsets are dynamic.
|
/// even though their offsets are dynamic.
|
||||||
class ObjCARCAliasAnalysis : public ImmutablePass,
|
class ObjCARCAliasAnalysis : public ImmutablePass, public AliasAnalysis {
|
||||||
public AliasAnalysis {
|
public:
|
||||||
public:
|
static char ID; // Class identification, replacement for typeinfo
|
||||||
static char ID; // Class identification, replacement for typeinfo
|
ObjCARCAliasAnalysis() : ImmutablePass(ID) {
|
||||||
ObjCARCAliasAnalysis() : ImmutablePass(ID) {
|
initializeObjCARCAliasAnalysisPass(*PassRegistry::getPassRegistry());
|
||||||
initializeObjCARCAliasAnalysisPass(*PassRegistry::getPassRegistry());
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool doInitialization(Module &M) override;
|
bool doInitialization(Module &M) override;
|
||||||
|
|
||||||
/// This method is used when a pass implements an analysis interface through
|
/// This method is used when a pass implements an analysis interface through
|
||||||
/// multiple inheritance. If needed, it should override this to adjust the
|
/// multiple inheritance. If needed, it should override this to adjust the
|
||||||
/// this pointer as needed for the specified pass info.
|
/// this pointer as needed for the specified pass info.
|
||||||
void *getAdjustedAnalysisPointer(const void *PI) override {
|
void *getAdjustedAnalysisPointer(const void *PI) override {
|
||||||
if (PI == &AliasAnalysis::ID)
|
if (PI == &AliasAnalysis::ID)
|
||||||
return static_cast<AliasAnalysis *>(this);
|
return static_cast<AliasAnalysis *>(this);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void getAnalysisUsage(AnalysisUsage &AU) const override;
|
void getAnalysisUsage(AnalysisUsage &AU) const override;
|
||||||
AliasResult alias(const MemoryLocation &LocA,
|
AliasResult alias(const MemoryLocation &LocA,
|
||||||
const MemoryLocation &LocB) override;
|
const MemoryLocation &LocB) override;
|
||||||
bool pointsToConstantMemory(const MemoryLocation &Loc,
|
bool pointsToConstantMemory(const MemoryLocation &Loc, bool OrLocal) override;
|
||||||
bool OrLocal) override;
|
FunctionModRefBehavior getModRefBehavior(ImmutableCallSite CS) override;
|
||||||
FunctionModRefBehavior getModRefBehavior(ImmutableCallSite CS) override;
|
FunctionModRefBehavior getModRefBehavior(const Function *F) override;
|
||||||
FunctionModRefBehavior getModRefBehavior(const Function *F) override;
|
ModRefInfo getModRefInfo(ImmutableCallSite CS,
|
||||||
ModRefInfo getModRefInfo(ImmutableCallSite CS,
|
const MemoryLocation &Loc) override;
|
||||||
const MemoryLocation &Loc) override;
|
ModRefInfo getModRefInfo(ImmutableCallSite CS1,
|
||||||
ModRefInfo getModRefInfo(ImmutableCallSite CS1,
|
ImmutableCallSite CS2) override;
|
||||||
ImmutableCallSite CS2) override;
|
};
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace objcarc
|
} // namespace objcarc
|
||||||
} // namespace llvm
|
} // namespace llvm
|
||||||
|
|
Loading…
Reference in New Issue