summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/APSInt.h
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-11-16 16:25:41 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-11-16 16:25:41 +0000
commitb69143c6a9bfc969e7c95bbd48b83bb962086070 (patch)
tree6aa7a4e07fbcd33f7b6465e1e7e35d212cb493c1 /include/llvm/ADT/APSInt.h
parent411079785388290738049dd099bff8755e6a2c8d (diff)
downloadllvm-b69143c6a9bfc969e7c95bbd48b83bb962086070.tar.gz
llvm-b69143c6a9bfc969e7c95bbd48b83bb962086070.tar.bz2
llvm-b69143c6a9bfc969e7c95bbd48b83bb962086070.tar.xz
Annotate APInt methods where it's not clear whether they are in place with warn_unused_result.
Fix ScalarEvolution bugs uncovered by this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194928 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/APSInt.h')
-rw-r--r--include/llvm/ADT/APSInt.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/llvm/ADT/APSInt.h b/include/llvm/ADT/APSInt.h
index 11be4c513e..ad035a7c30 100644
--- a/include/llvm/ADT/APSInt.h
+++ b/include/llvm/ADT/APSInt.h
@@ -68,18 +68,18 @@ public:
}
using APInt::toString;
- APSInt trunc(uint32_t width) const {
+ APSInt LLVM_ATTRIBUTE_UNUSED_RESULT trunc(uint32_t width) const {
return APSInt(APInt::trunc(width), IsUnsigned);
}
- APSInt extend(uint32_t width) const {
+ APSInt LLVM_ATTRIBUTE_UNUSED_RESULT extend(uint32_t width) const {
if (IsUnsigned)
return APSInt(zext(width), IsUnsigned);
else
return APSInt(sext(width), IsUnsigned);
}
- APSInt extOrTrunc(uint32_t width) const {
+ APSInt LLVM_ATTRIBUTE_UNUSED_RESULT extOrTrunc(uint32_t width) const {
if (IsUnsigned)
return APSInt(zextOrTrunc(width), IsUnsigned);
else
@@ -212,7 +212,7 @@ public:
assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
return APSInt(static_cast<const APInt&>(*this) & RHS, IsUnsigned);
}
- APSInt And(const APSInt& RHS) const {
+ APSInt LLVM_ATTRIBUTE_UNUSED_RESULT And(const APSInt& RHS) const {
return this->operator&(RHS);
}
@@ -220,7 +220,7 @@ public:
assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
return APSInt(static_cast<const APInt&>(*this) | RHS, IsUnsigned);
}
- APSInt Or(const APSInt& RHS) const {
+ APSInt LLVM_ATTRIBUTE_UNUSED_RESULT Or(const APSInt& RHS) const {
return this->operator|(RHS);
}
@@ -229,7 +229,7 @@ public:
assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
return APSInt(static_cast<const APInt&>(*this) ^ RHS, IsUnsigned);
}
- APSInt Xor(const APSInt& RHS) const {
+ APSInt LLVM_ATTRIBUTE_UNUSED_RESULT Xor(const APSInt& RHS) const {
return this->operator^(RHS);
}