DebugInfo: don't require full definitions for friend classes

Fixes a crash-on-valid introduced by r188486 (which should've occurred
earlier but for a blatant bug where calling createFwdDecl from the
requireCompleteType callback was useless under -flimit-debug-info and we
were just getting lucky with other later callbacks requiring the type
anyway).

llvm-svn: 188622
This commit is contained in:
David Blaikie 2013-08-18 04:50:23 +00:00
parent 6dd203288d
commit 5043815a60
2 changed files with 13 additions and 8 deletions

View File

@ -1136,9 +1136,8 @@ CollectCXXFriends(const CXXRecordDecl *RD, llvm::DIFile Unit,
if ((*BI)->isUnsupportedFriend())
continue;
if (TypeSourceInfo *TInfo = (*BI)->getFriendType())
EltTys.push_back(DBuilder.createFriend(RecordTy,
getOrCreateType(TInfo->getType(),
Unit)));
EltTys.push_back(DBuilder.createFriend(
RecordTy, getOrCreateType(TInfo->getType(), Unit, true)));
}
}

View File

@ -1,11 +1,17 @@
// RUN: %clang -fverbose-asm -S -g %s -o - | grep DW_TAG_friend
// RUN: %clang -emit-llvm -S -g %s -o - | FileCheck %s
class MyFriend;
class SomeClass
{
friend class MyFriend;
class SomeClass {
friend class MyFriend;
typedef int SomeType;
};
SomeClass sc;
SomeClass *x;
struct MyFriend {
static void func(SomeClass::SomeType) {
}
};
// CHECK: DW_TAG_friend