mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-02 07:32:52 +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>
|
||||
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,
|
||||
|
Loading…
Reference in New Issue
Block a user