mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-31 09:22:31 +00:00
DebugInfo: Simplify/narrow null-check for getOrCreateType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194737 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b850a05f2c
commit
41e1a18885
@ -877,10 +877,12 @@ DIE *CompileUnit::getOrCreateContextDIE(DIScope Context) {
|
|||||||
/// getOrCreateTypeDIE - Find existing DIE or create new DIE for the
|
/// getOrCreateTypeDIE - Find existing DIE or create new DIE for the
|
||||||
/// given DIType.
|
/// given DIType.
|
||||||
DIE *CompileUnit::getOrCreateTypeDIE(const MDNode *TyNode) {
|
DIE *CompileUnit::getOrCreateTypeDIE(const MDNode *TyNode) {
|
||||||
DIType Ty(TyNode);
|
if (!TyNode)
|
||||||
if (!Ty.isType())
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
DIType Ty(TyNode);
|
||||||
|
assert(Ty.isType());
|
||||||
|
|
||||||
// Construct the context before querying for the existence of the DIE in case
|
// Construct the context before querying for the existence of the DIE in case
|
||||||
// such construction creates the DIE.
|
// such construction creates the DIE.
|
||||||
DIE *ContextDIE = getOrCreateContextDIE(resolve(Ty.getContext()));
|
DIE *ContextDIE = getOrCreateContextDIE(resolve(Ty.getContext()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user