diff options
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp index c81288c..c957ca8 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp @@ -174,12 +174,16 @@ uint64_t DebugHandlerBase::getBaseTypeSize(const DIType *Ty) { } bool DebugHandlerBase::isUnsignedDIType(const DIType *Ty) { - // SROA may generate dbg value intrinsics to assign an unsigned value to a - // Fortran CHARACTER(1) type variables. Make them as unsigned. if (isa<DIStringType>(Ty)) { - assert((Ty->getSizeInBits()) == 8 && "Not a valid unsigned type!"); + // Some transformations (e.g. instcombine) may decide to turn a Fortran + // character object into an integer, and later ones (e.g. SROA) may + // further inject a constant integer in a llvm.dbg.value call to track + // the object's value. Here we trust the transformations are doing the + // right thing, and treat the constant as unsigned to preserve that value + // (i.e. avoid sign extension). return true; } + if (auto *CTy = dyn_cast<DICompositeType>(Ty)) { // FIXME: Enums without a fixed underlying type have unknown signedness // here, leading to incorrectly emitted constants. |