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:
73f24c9
)
Make PointerUnion3::get work properly
author
Douglas Gregor
<dgregor@apple.com>
Mon, 30 Mar 2009 21:44:13 +0000
(21:44 +0000)
committer
Douglas Gregor
<dgregor@apple.com>
Mon, 30 Mar 2009 21:44:13 +0000
(21:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68067
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/ADT/PointerUnion.h
patch
|
blob
|
history
diff --git
a/include/llvm/ADT/PointerUnion.h
b/include/llvm/ADT/PointerUnion.h
index 6f5d01af86af35784626a86f6aab9d62c05ddb18..43f5e09cf9e316d00e527f76323ee25c816c2c41 100644
(file)
--- a/
include/llvm/ADT/PointerUnion.h
+++ b/
include/llvm/ADT/PointerUnion.h
@@
-193,9
+193,11
@@
namespace llvm {
template<typename T>
T get() const {
assert(is<T>() && "Invalid accessor called");
- if (Val.is<T>())
- return Val.get<T>();
- return Val.get<InnerUnion>().get<T>();
+ // Is it PT1/PT2?
+ if (::llvm::getPointerUnionTypeNum<PT1, PT2>((T*)0) != -1)
+ return Val.get<InnerUnion>().get<T>();
+
+ return Val.get<T>();
}
/// dyn_cast<T>() - If the current value is of the specified pointer type,