[llvm] r194929 - ScalarEvolution: Warn if the result of setFlags/clearFlags is unused.
Benjamin Kramer
benny.kra at googlemail.com
Sat Nov 16 08:25:47 PST 2013
Author: d0k
Date: Sat Nov 16 10:25:47 2013
New Revision: 194929
URL: http://llvm.org/viewvc/llvm-project?rev=194929&view=rev
Log:
ScalarEvolution: Warn if the result of setFlags/clearFlags is unused.
This was a source of bugs in the past.
Modified:
llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=194929&r1=194928&r2=194929&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Sat Nov 16 10:25:47 2013
@@ -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);
}
More information about the llvm-commits
mailing list