mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
Make PointerUnion3::get work properly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68067 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
73f24c9f0d
commit
2048cdb08e
@ -193,9 +193,11 @@ namespace llvm {
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
T get() const {
|
T get() const {
|
||||||
assert(is<T>() && "Invalid accessor called");
|
assert(is<T>() && "Invalid accessor called");
|
||||||
if (Val.is<T>())
|
// Is it PT1/PT2?
|
||||||
return Val.get<T>();
|
if (::llvm::getPointerUnionTypeNum<PT1, PT2>((T*)0) != -1)
|
||||||
return Val.get<InnerUnion>().get<T>();
|
return Val.get<InnerUnion>().get<T>();
|
||||||
|
|
||||||
|
return Val.get<T>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// dyn_cast<T>() - If the current value is of the specified pointer type,
|
/// dyn_cast<T>() - If the current value is of the specified pointer type,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user