/// getOrCreateContextDIE - Get context owner's DIE.
DIE *CompileUnit::getOrCreateContextDIE(DIScope Context) {
+ if (!Context || Context.isFile())
+ return getCUDie();
if (Context.isType())
return getOrCreateTypeDIE(DIType(Context));
if (Context.isNameSpace())
// Construct the context before querying for the existence of the DIE in case
// such construction creates the DIE.
DIE *ContextDIE = getOrCreateContextDIE(resolve(Ty.getContext()));
- if (!ContextDIE)
- ContextDIE = CUDie.get();
DIE *TyDIE = getDIE(Ty);
if (TyDIE)
// Construct the context before querying for the existence of the DIE in case
// such construction creates the DIE.
DIE *ContextDIE = getOrCreateContextDIE(NS.getContext());
- if (!ContextDIE)
- // If the context is null, DIE should belong to the CU we call construct
- // function on.
- ContextDIE = CUDie.get();
DIE *NDie = getDIE(NS);
if (NDie)
// such construction creates the DIE (as is the case for member function
// declarations).
DIE *ContextDIE = getOrCreateContextDIE(resolve(SP.getContext()));
- if (!ContextDIE)
- ContextDIE = CUDie.get();
DIE *SPDie = getDIE(SP);
if (SPDie)
// Construct the context before querying for the existence of the DIE in
// case such construction creates the DIE.
DIE *ContextDIE = getOrCreateContextDIE(GVContext);
- if (!ContextDIE)
- ContextDIE = CUDie.get();
// Add to map.
VariableDIE = createAndAddDIE(GV.getTag(), *ContextDIE, N);
// Construct the context before querying for the existence of the DIE in case
// such construction creates the DIE.
DIE *ContextDIE = getOrCreateContextDIE(resolve(DT.getContext()));
- assert(ContextDIE && "Static member should belong to a non-CU context.");
+ assert(dwarf::isType(ContextDIE->getTag()) &&
+ "Static member should belong to a type.");
DIE *StaticMemberDIE = getDIE(DT);
if (StaticMemberDIE)