bool addToAccelTable = false;
DIELoc *Loc = nullptr;
std::unique_ptr<DIEDwarfExpression> DwarfExpr;
- bool AllConstant = std::all_of(
- GlobalExprs.begin(), GlobalExprs.end(),
- [&](const GlobalExpr GE) {
- return GE.Expr && GE.Expr->isConstant();
- });
-
for (const auto &GE : GlobalExprs) {
const GlobalVariable *Global = GE.Var;
const DIExpression *Expr = GE.Expr;
addConstantValue(*VariableDIE, /*Unsigned=*/true, Expr->getElement(1));
// We cannot describe the location of dllimport'd variables: the
// computation of their address requires loads from the IAT.
- } else if ((Global && !Global->hasDLLImportStorageClass()) || AllConstant) {
+ } else if ((Global && !Global->hasDLLImportStorageClass()) ||
+ (Expr && Expr->isConstant())) {
if (!Loc) {
Loc = new (DIEValueAllocator) DIELoc;
DwarfExpr = llvm::make_unique<DIEDwarfExpression>(*Asm, *this, *Loc);
@point.y = global i32 2, align 4, !dbg !13
@point.x = global i32 1, align 4, !dbg !12
-@part_const.x = global i32 1, align 4, !dbg !15
+@part_const.x = global i32 1, align 4, !dbg !14
!llvm.dbg.cu = !{!1}
!llvm.module.flags = !{!10, !11}