[cfe-commits] r97342 - /cfe/trunk/lib/CodeGen/CGVtable.cpp
Devang Patel
devang.patel at gmail.com
Tue Mar 2 14:56:41 PST 2010
Anders,
One of your patch between r97339 and r97342 caused a regression.
Please investigate this soon. Thanks!
-
Devang
$ clang++ -c virtfunc.cc
0 clang 0x0000000100f3953b PrintStackTrace(void*) + 38
1 clang 0x0000000100f39ac9 SignalHandler(int) + 336
2 libSystem.B.dylib 0x00007fff830a6eaa _sigtramp + 26
3 clang 0x000000010055c111 bool
llvm::isa_impl_cl<clang::Type*>::isa<clang::ReferenceType>(clang::Type*)
+ 21
4 libSystem.B.dylib 0x00007fff83122e74 __pthread_markcancel + 0
5 clang 0x00000001001f2466 (anonymous
namespace)::FinalOverriders::MergeSubobjectOffsets(llvm::DenseMap<clang::CXXRecordDecl
const*, llvm::SmallVector<unsigned long long, 1u>,
llvm::DenseMapInfo<clang::CXXRecordDecl const*>,
llvm::DenseMapInfo<llvm::SmallVector<unsigned long long, 1u> > >
const&, llvm::DenseMap<clang::CXXRecordDecl const*,
llvm::SmallVector<unsigned long long, 1u>,
llvm::DenseMapInfo<clang::CXXRecordDecl const*>,
llvm::DenseMapInfo<llvm::SmallVector<unsigned long long, 1u> > >&) +
418
6 clang 0x00000001001f845c (anonymous
namespace)::FinalOverriders::ComputeFinalOverriders(clang::CodeGen::BaseSubobject,
bool, llvm::DenseMap<clang::CXXRecordDecl const*,
llvm::SmallVector<unsigned long long, 1u>,
llvm::DenseMapInfo<clang::CXXRecordDecl const*>,
llvm::DenseMapInfo<llvm::SmallVector<unsigned long long, 1u> > >&) +
466
7 clang 0x00000001001f8407 (anonymous
namespace)::FinalOverriders::ComputeFinalOverriders(clang::CodeGen::BaseSubobject,
bool, llvm::DenseMap<clang::CXXRecordDecl const*,
llvm::SmallVector<unsigned long long, 1u>,
llvm::DenseMapInfo<clang::CXXRecordDecl const*>,
llvm::DenseMapInfo<llvm::SmallVector<unsigned long long, 1u> > >&) +
381
8 clang 0x00000001001f8557 (anonymous
namespace)::FinalOverriders::FinalOverriders(clang::CXXRecordDecl
const*) + 185
9 clang 0x00000001001f9431 (anonymous
namespace)::VtableBuilder::VtableBuilder(clang::CodeGen::CGVtableInfo&,
clang::CXXRecordDecl const*, unsigned long long, bool,
clang::CXXRecordDecl const*) + 129
10 clang 0x00000001001f9595
clang::CodeGen::CGVtableInfo::GenerateVtable(llvm::GlobalValue::LinkageTypes,
bool, clang::CXXRecordDecl const*, clang::CXXRecordDecl const*,
unsigned long long, bool,
llvm::DenseMap<clang::CodeGen::BaseSubobject, unsigned long long,
llvm::DenseMapInfo<clang::CodeGen::BaseSubobject>,
llvm::DenseMapInfo<unsigned long long> >&) + 217
11 clang 0x00000001001f9be7
clang::CodeGen::CGVtableInfo::GenerateClassData(llvm::GlobalValue::LinkageTypes,
clang::CXXRecordDecl const*) + 187
12 clang 0x00000001001f9ce5
clang::CodeGen::CGVtableInfo::MaybeEmitVtable(clang::CodeGen::GlobalDecl)
+ 211
13 clang 0x0000000100213479
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::CodeGen::GlobalDecl)
+ 171
14 clang 0x00000001002137a5
clang::CodeGen::CodeGenModule::EmitGlobal(clang::CodeGen::GlobalDecl)
+ 341
On Sat, Feb 27, 2010 at 12:39 PM, Anders Carlsson <andersca at mac.com> wrote:
> Author: andersca
> Date: Sat Feb 27 14:39:05 2010
> New Revision: 97342
>
> URL: http://llvm.org/viewvc/llvm-project?rev=97342&view=rev
> Log:
> Start fleshing out construction vtable support.
>
> Modified:
> cfe/trunk/lib/CodeGen/CGVtable.cpp
>
> Modified: cfe/trunk/lib/CodeGen/CGVtable.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVtable.cpp?rev=97342&r1=97341&r2=97342&view=diff
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGVtable.cpp Sat Feb 27 14:39:05 2010
> @@ -1058,6 +1058,15 @@
> /// vtable.
> const CXXRecordDecl *MostDerivedClass;
>
> + /// MostDerivedClassOffset - If we're building a construction vtable, this
> + /// holds the offset from the layout class to the most derived class.
> + const uint64_t MostDerivedClassOffset;
> +
> + /// LayoutClass - The class we're using for layout information. Will be
> + /// different than the most derived class if we're building a construction
> + /// vtable.
> + const CXXRecordDecl *LayoutClass;
> +
> /// Context - The ASTContext which we will use for layout information.
> ASTContext &Context;
>
> @@ -1215,9 +1224,12 @@
> VisitedVirtualBasesSetTy &VBases);
>
> public:
> - VtableBuilder(CGVtableInfo &VtableInfo, const CXXRecordDecl *MostDerivedClass)
> - : VtableInfo(VtableInfo), MostDerivedClass(MostDerivedClass),
> - Context(MostDerivedClass->getASTContext()), Overriders(MostDerivedClass) {
> + VtableBuilder(CGVtableInfo &VtableInfo, const CXXRecordDecl *MostDerivedClass,
> + uint64_t MostDerivedClassOffset,
> + const CXXRecordDecl *LayoutClass)
> + : VtableInfo(VtableInfo), MostDerivedClass(MostDerivedClass),
> + MostDerivedClassOffset(MostDerivedClassOffset), LayoutClass(LayoutClass),
> + Context(MostDerivedClass->getASTContext()), Overriders(MostDerivedClass) {
>
> LayoutVtable();
> }
> @@ -1808,8 +1820,17 @@
>
> /// dumpLayout - Dump the vtable layout.
> void VtableBuilder::dumpLayout(llvm::raw_ostream& Out) {
> -
> - Out << "Vtable for '" << MostDerivedClass->getQualifiedNameAsString();
> +
> + if (MostDerivedClass == LayoutClass) {
> + Out << "Vtable for '";
> + Out << MostDerivedClass->getQualifiedNameAsString();
> + } else {
> + Out << "Construction vtable for ('";
> + Out << MostDerivedClass->getQualifiedNameAsString() << "', ";
> + // FIXME: Don't use / 8 .
> + Out << MostDerivedClassOffset / 8 << ") in '";
> + Out << LayoutClass->getQualifiedNameAsString();
> + }
> Out << "' (" << Components.size() << " entries).\n";
>
> // Iterate through the address points and insert them into a new map where
> @@ -1983,7 +2004,8 @@
>
> Out << '\n';
> }
> -
> +
> + Out << '\n';
> }
>
> }
> @@ -3272,11 +3294,17 @@
> const CXXRecordDecl *LayoutClass,
> const CXXRecordDecl *RD, uint64_t Offset,
> AddressPointsMapTy& AddressPoints) {
> - if (GenerateDefinition && LayoutClass == RD) {
> - VtableBuilder Builder(*this, RD);
> -
> - if (CGM.getLangOptions().DumpVtableLayouts)
> + if (GenerateDefinition) {
> + if (LayoutClass == RD) {
> + VtableBuilder Builder(*this, RD, Offset, LayoutClass);
> +
> + if (CGM.getLangOptions().DumpVtableLayouts)
> + Builder.dumpLayout(llvm::errs());
> + } else if (CGM.getLangOptions().DumpVtableLayouts) {
> + // We only build construction vtables when dumping vtable layouts for now.
> + VtableBuilder Builder(*this, RD, Offset, LayoutClass);
> Builder.dumpLayout(llvm::errs());
> + }
> }
>
> llvm::SmallString<256> OutName;
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
--
-
Devang
-------------- next part --------------
A non-text attachment was scrubbed...
Name: virtfunc.cc
Type: application/octet-stream
Size: 3498 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20100302/c31fee35/attachment.obj>
More information about the cfe-commits
mailing list