// It would be better if this were unconditional, but malformed input that
// mixes non-fragments and fragments for the same variable is too expensive
// to detect in the verifier.
- if (!DwarfExpr->isMemoryLocation())
+ if (DwarfExpr->isUnknownLocation())
DwarfExpr->setMemoryLocationKind();
DwarfExpr->addExpression(Expr);
}
void addUnsignedConstant(const APInt &Value);
bool isMemoryLocation() const { return LocationKind == Memory; }
+ bool isUnknownLocation() const { return LocationKind == Unknown; }
/// Lock this down to become a memory location description.
void setMemoryLocationKind() {
target triple = "x86_64-apple-macosx10.13.0"
@i = global i32 23, align 4
-@indirect = global i32* @i, align 8, !dbg !6, !dbg !0, !dbg !14, !dbg !15
+@indirect = global i32* @i, align 8, !dbg !6, !dbg !0, !dbg !14, !dbg !15, !dbg !16
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!10, !11, !12, !13}
; This is malformed, but too expensive to detect in the verifier.
!14 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())
!15 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression(DW_OP_LLVM_fragment, 0, 1))
+!16 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression(DW_OP_deref, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value))