Author: Nuno Lopes Date: 2020-12-10T15:32:11Z New Revision: d2a7b83c5c7b9b26e73261be2a4d60a5b53ba80f
URL: https://github.com/llvm/llvm-project/commit/d2a7b83c5c7b9b26e73261be2a4d60a5b53ba80f DIFF: https://github.com/llvm/llvm-project/commit/d2a7b83c5c7b9b26e73261be2a4d60a5b53ba80f.diff LOG: AA: make AliasAnalysis.h compatible with C++20 (NFC) can't mix arithmetic with different enums Added: Modified: llvm/include/llvm/Analysis/AliasAnalysis.h Removed: ################################################################################ diff --git a/llvm/include/llvm/Analysis/AliasAnalysis.h b/llvm/include/llvm/Analysis/AliasAnalysis.h index ce4ebab3efa4..cc5cec44b455 100644 --- a/llvm/include/llvm/Analysis/AliasAnalysis.h +++ b/llvm/include/llvm/Analysis/AliasAnalysis.h @@ -540,7 +540,7 @@ class AAResults { /// write at most from objects pointed to by their pointer-typed arguments /// (with arbitrary offsets). static bool onlyAccessesArgPointees(FunctionModRefBehavior MRB) { - return !(MRB & FMRL_Anywhere & ~FMRL_ArgumentPointees); + return !((unsigned)MRB & FMRL_Anywhere & ~FMRL_ArgumentPointees); } /// Checks if functions with the specified behavior are known to potentially @@ -548,26 +548,27 @@ class AAResults { /// (with arbitrary offsets). static bool doesAccessArgPointees(FunctionModRefBehavior MRB) { return isModOrRefSet(createModRefInfo(MRB)) && - (MRB & FMRL_ArgumentPointees); + ((unsigned)MRB & FMRL_ArgumentPointees); } /// Checks if functions with the specified behavior are known to read and /// write at most from memory that is inaccessible from LLVM IR. static bool onlyAccessesInaccessibleMem(FunctionModRefBehavior MRB) { - return !(MRB & FMRL_Anywhere & ~FMRL_InaccessibleMem); + return !((unsigned)MRB & FMRL_Anywhere & ~FMRL_InaccessibleMem); } /// Checks if functions with the specified behavior are known to potentially /// read or write from memory that is inaccessible from LLVM IR. static bool doesAccessInaccessibleMem(FunctionModRefBehavior MRB) { - return isModOrRefSet(createModRefInfo(MRB)) && (MRB & FMRL_InaccessibleMem); + return isModOrRefSet(createModRefInfo(MRB)) && + ((unsigned)MRB & FMRL_InaccessibleMem); } /// Checks if functions with the specified behavior are known to read and /// write at most from memory that is inaccessible from LLVM IR or objects /// pointed to by their pointer-typed arguments (with arbitrary offsets). static bool onlyAccessesInaccessibleOrArgMem(FunctionModRefBehavior MRB) { - return !(MRB & FMRL_Anywhere & + return !((unsigned)MRB & FMRL_Anywhere & ~(FMRL_InaccessibleMem | FMRL_ArgumentPointees)); } _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits