On Fri, Oct 9, 2015 at 2:26 AM, Alexey Bataev via cfe-commits < cfe-commits@lists.llvm.org> wrote:
> ABataev created this revision. > ABataev added a reviewer: echristo. > ABataev added a subscriber: cfe-commits. > > Currently debug info for types used in explicit cast only is not emitted. > It happened after a patch for better alignment handling. You mean a patch related to alignment regressed this functionality? Do you have the specific revision number of that change (since it sounds like you tracked it down)? > This patch fixes this bug. > > http://reviews.llvm.org/D13582 > > Files: > lib/CodeGen/CGExpr.cpp > test/CodeGenCXX/debug-info-explicit-cast.cpp > > Index: lib/CodeGen/CGExpr.cpp > =================================================================== > --- lib/CodeGen/CGExpr.cpp > +++ lib/CodeGen/CGExpr.cpp > @@ -799,6 +799,10 @@ > if (E->getType()->isVariablyModifiedType()) > EmitVariablyModifiedType(E->getType()); > > + if (isa<ExplicitCastExpr>(CE)) > + if (CGDebugInfo *DI = getDebugInfo()) > + DI->EmitExplicitCastType(E->getType()); > + > switch (CE->getCastKind()) { > // Non-converting casts (but not C's implicit conversion from void*). > case CK_BitCast: > Index: test/CodeGenCXX/debug-info-explicit-cast.cpp > =================================================================== > --- test/CodeGenCXX/debug-info-explicit-cast.cpp > +++ test/CodeGenCXX/debug-info-explicit-cast.cpp > @@ -0,0 +1,18 @@ > +// RUN: %clangxx -c -target x86_64-unknown-unknown -g %s -emit-llvm -S -o > - | FileCheck %s > +struct Foo { > + int a; > + Foo() : a(1){}; > +}; > + > +struct Bar { > + int b; > + Bar() : b(2){}; > +}; > + > +int main() { > + Bar *pb = new Bar; > + > + return reinterpret_cast<Foo *>(pb)->a; > +} > + > +// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Foo", > > > > _______________________________________________ > cfe-commits mailing list > cfe-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits > >
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits