mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 19:31:58 +00:00
ScalarEvolution: Warn if the result of setFlags/clearFlags is unused.
This was a source of bugs in the past. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194929 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b69143c6a9
commit
2905440bdd
@ -189,15 +189,16 @@ namespace llvm {
|
||||
|
||||
/// Convenient NoWrapFlags manipulation that hides enum casts and is
|
||||
/// visible in the ScalarEvolution name space.
|
||||
static SCEV::NoWrapFlags maskFlags(SCEV::NoWrapFlags Flags, int Mask) {
|
||||
static SCEV::NoWrapFlags LLVM_ATTRIBUTE_UNUSED_RESULT
|
||||
maskFlags(SCEV::NoWrapFlags Flags, int Mask) {
|
||||
return (SCEV::NoWrapFlags)(Flags & Mask);
|
||||
}
|
||||
static SCEV::NoWrapFlags setFlags(SCEV::NoWrapFlags Flags,
|
||||
SCEV::NoWrapFlags OnFlags) {
|
||||
static SCEV::NoWrapFlags LLVM_ATTRIBUTE_UNUSED_RESULT
|
||||
setFlags(SCEV::NoWrapFlags Flags, SCEV::NoWrapFlags OnFlags) {
|
||||
return (SCEV::NoWrapFlags)(Flags | OnFlags);
|
||||
}
|
||||
static SCEV::NoWrapFlags clearFlags(SCEV::NoWrapFlags Flags,
|
||||
SCEV::NoWrapFlags OffFlags) {
|
||||
static SCEV::NoWrapFlags LLVM_ATTRIBUTE_UNUSED_RESULT
|
||||
clearFlags(SCEV::NoWrapFlags Flags, SCEV::NoWrapFlags OffFlags) {
|
||||
return (SCEV::NoWrapFlags)(Flags & ~OffFlags);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user