diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-11-16 16:25:47 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-11-16 16:25:47 +0000 |
commit | 2905440bdd9627f202398137aab5ded38f681fc9 (patch) | |
tree | 5f092cfe489b904a65afd4ef0f98b19f3ff2f70c | |
parent | b69143c6a9bfc969e7c95bbd48b83bb962086070 (diff) | |
download | external_llvm-2905440bdd9627f202398137aab5ded38f681fc9.zip external_llvm-2905440bdd9627f202398137aab5ded38f681fc9.tar.gz external_llvm-2905440bdd9627f202398137aab5ded38f681fc9.tar.bz2 |
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
-rw-r--r-- | include/llvm/Analysis/ScalarEvolution.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h index 944b144..d7f6178 100644 --- a/include/llvm/Analysis/ScalarEvolution.h +++ b/include/llvm/Analysis/ScalarEvolution.h @@ -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); } |