projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
45982a5
)
Add an intersects method to APInt, to capture a common idiom.
author
Dan Gohman
<gohman@apple.com>
Wed, 20 Feb 2008 16:08:11 +0000
(16:08 +0000)
committer
Dan Gohman
<gohman@apple.com>
Wed, 20 Feb 2008 16:08:11 +0000
(16:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47379
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/ADT/APInt.h
patch
|
blob
|
history
diff --git
a/include/llvm/ADT/APInt.h
b/include/llvm/ADT/APInt.h
index fdb1fa47f5b630f502262111d5144cda4983c7bb..d5d4d520cc19b7c0f4fc86d2bc1dc26e38766e99 100644
(file)
--- a/
include/llvm/ADT/APInt.h
+++ b/
include/llvm/ADT/APInt.h
@@
-778,6
+778,12
@@
public:
return !slt(RHS);
}
+ /// This operation tests if there are any pairs of corresponding bits
+ /// between this APInt and RHS that are both set.
+ bool intersects(const APInt &RHS) const {
+ return (*this & RHS) != 0;
+ }
+
/// @}
/// @name Resizing Operators
/// @{