diff --git a/include/llvm/IR/Metadata.h b/include/llvm/IR/Metadata.h index aac03a531c5..c5840564454 100644 --- a/include/llvm/IR/Metadata.h +++ b/include/llvm/IR/Metadata.h @@ -677,17 +677,17 @@ struct AAMDNodes { MDNode *NoAlias = nullptr; // Shift tbaa Metadata node to start off bytes later - static MDNode *ShiftTBAA(MDNode *M, size_t off); + static MDNode *shiftTBAA(MDNode *M, size_t off); // Shift tbaa.struct Metadata node to start off bytes later - static MDNode *ShiftTBAAStruct(MDNode *M, size_t off); + static MDNode *shiftTBAAStruct(MDNode *M, size_t off); /// Given two sets of AAMDNodes that apply to the same pointer, /// give the best AAMDNodes that are compatible with both (i.e. a set of /// nodes whose allowable aliasing conclusions are a subset of those /// allowable by both of the inputs). However, for efficiency /// reasons, do not create any new MDNodes. - AAMDNodes intersect(const AAMDNodes &Other) { + AAMDNodes intersect(const AAMDNodes &Other) const { AAMDNodes Result; Result.TBAA = Other.TBAA == TBAA ? TBAA : nullptr; Result.TBAAStruct = Other.TBAAStruct == TBAAStruct ? TBAAStruct : nullptr; @@ -697,12 +697,12 @@ struct AAMDNodes { } /// Create a new AAMDNode that describes this AAMDNode after applying a - /// constant offset to the start of the pointer - AAMDNodes shift(size_t Offset) { + /// constant offset to the start of the pointer. + AAMDNodes shift(size_t Offset) const { AAMDNodes Result; - Result.TBAA = TBAA ? ShiftTBAA(TBAA, Offset) : nullptr; + Result.TBAA = TBAA ? shiftTBAA(TBAA, Offset) : nullptr; Result.TBAAStruct = - TBAAStruct ? ShiftTBAAStruct(TBAAStruct, Offset) : nullptr; + TBAAStruct ? shiftTBAAStruct(TBAAStruct, Offset) : nullptr; Result.Scope = Scope; Result.NoAlias = NoAlias; return Result; diff --git a/lib/Analysis/TypeBasedAliasAnalysis.cpp b/lib/Analysis/TypeBasedAliasAnalysis.cpp index 9f381209ef7..20d718f4fad 100644 --- a/lib/Analysis/TypeBasedAliasAnalysis.cpp +++ b/lib/Analysis/TypeBasedAliasAnalysis.cpp @@ -738,7 +738,7 @@ void TypeBasedAAWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); } -MDNode *AAMDNodes::ShiftTBAA(MDNode *MD, size_t Offset) { +MDNode *AAMDNodes::shiftTBAA(MDNode *MD, size_t Offset) { // Fast path if there's no offset if (Offset == 0) return MD; @@ -757,7 +757,7 @@ MDNode *AAMDNodes::ShiftTBAA(MDNode *MD, size_t Offset) { return MD; } -MDNode *AAMDNodes::ShiftTBAAStruct(MDNode *MD, size_t Offset) { +MDNode *AAMDNodes::shiftTBAAStruct(MDNode *MD, size_t Offset) { // Fast path if there's no offset if (Offset == 0) return MD;