summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2016-06-22 18:31:14 +0000
committerReid Kleckner <rnk@google.com>2016-06-22 18:31:14 +0000
commit156a7239c15bd7b253ceddcc8719d6f71bc9cd9c (patch)
tree33ab9c3734555324ba61c359c16467e40ca595e5 /llvm/lib/CodeGen
parentd5f947968b4a124ec5eba5988f3f95ead789f640 (diff)
downloadbcm5719-llvm-156a7239c15bd7b253ceddcc8719d6f71bc9cd9c.tar.gz
bcm5719-llvm-156a7239c15bd7b253ceddcc8719d6f71bc9cd9c.zip
[codeview] Add IntroducingVirtual debug info flag
CodeView needs to know if a virtual method was introduced in the current class, and base classes may not have complete type information, so we need to thread this bit through from the frontend. llvm-svn: 273453
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp27
1 files changed, 6 insertions, 21 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index da69f8b6ab6..3e4563947a1 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -12,6 +12,7 @@
//===----------------------------------------------------------------------===//
#include "CodeViewDebug.h"
+#include "llvm/ADT/TinyPtrVector.h"
#include "llvm/DebugInfo/CodeView/CodeView.h"
#include "llvm/DebugInfo/CodeView/FieldListRecordBuilder.h"
#include "llvm/DebugInfo/CodeView/Line.h"
@@ -1174,12 +1175,6 @@ TypeIndex CodeViewDebug::lowerTypeMemberFunction(const DISubroutineType *Ty,
// Lower the containing class type.
TypeIndex ClassType = getTypeIndex(ClassTy);
- // While processing the class type it is possible we already created this
- // member function. If so, we check here and return the existing one.
- auto I = TypeIndices.find({Ty, ClassTy});
- if (I != TypeIndices.end())
- return I->second;
-
SmallVector<TypeIndex, 8> ReturnAndArgTypeIndices;
for (DITypeRef ArgTypeRef : Ty->getTypeArray())
ReturnAndArgTypeIndices.push_back(getTypeIndex(ArgTypeRef));
@@ -1313,12 +1308,7 @@ struct llvm::ClassInfo {
// [MemberInfo]
typedef std::vector<MemberInfo> MemberList;
- struct MethodInfo {
- const DISubprogram *Method;
- bool Introduced;
- };
- // [MethodInfo]
- typedef std::vector<MethodInfo> MethodsList;
+ typedef TinyPtrVector<const DISubprogram *> MethodsList;
// MethodName -> MethodsList
typedef MapVector<MDString *, MethodsList> MethodsMap;
@@ -1367,10 +1357,7 @@ ClassInfo CodeViewDebug::collectClassInfo(const DICompositeType *Ty) {
if (!Element)
continue;
if (auto *SP = dyn_cast<DISubprogram>(Element)) {
- // Non-virtual methods does not need the introduced marker.
- // Set it to false.
- bool Introduced = false;
- Info.Methods[SP->getRawName()].push_back({SP, Introduced});
+ Info.Methods[SP->getRawName()].push_back(SP);
} else if (auto *DDTy = dyn_cast<DIDerivedType>(Element)) {
if (DDTy->getTag() == dwarf::DW_TAG_member)
collectMemberInfo(Info, DDTy);
@@ -1491,11 +1478,9 @@ CodeViewDebug::lowerRecordFieldList(const DICompositeType *Ty) {
StringRef Name = MethodItr.first->getString();
std::vector<OneMethodRecord> Methods;
- for (ClassInfo::MethodInfo &MethodInfo : MethodItr.second) {
- const DISubprogram *SP = MethodInfo.Method;
- bool Introduced = MethodInfo.Introduced;
-
- TypeIndex MethodType = getTypeIndex(SP->getType(), Ty);
+ for (const DISubprogram *SP : MethodItr.second) {
+ TypeIndex MethodType = getMemberFunctionType(SP, Ty);
+ bool Introduced = SP->getFlags() & DINode::FlagIntroducedVirtual;
unsigned VFTableOffset = -1;
if (Introduced)
OpenPOWER on IntegriCloud