From 3a43a7f8b247cb3c6273bda3b595155117584e84 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 2 Jul 2008 00:50:02 +0000 Subject: [PATCH] Use the canonical form for getting an empty structure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53003 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/MachineModuleInfo.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/CodeGen/MachineModuleInfo.cpp b/lib/CodeGen/MachineModuleInfo.cpp index 473b60554b6..bdd771bb2b1 100644 --- a/lib/CodeGen/MachineModuleInfo.cpp +++ b/lib/CodeGen/MachineModuleInfo.cpp @@ -250,10 +250,7 @@ private: public: DISerializeVisitor(DISerializer &S, std::vector &E) - : DIVisitor() - , SR(S) - , Elements(E) - {} + : DIVisitor(), SR(S), Elements(E) {} /// Apply - Set the value of each of the fields. /// @@ -337,10 +334,7 @@ private: public: DIGetTypesVisitor(DISerializer &S, std::vector &F) - : DIVisitor() - , SR(S) - , Fields(F) - {} + : DIVisitor(), SR(S), Fields(F) {} /// Apply - Set the value of each of the fields. /// @@ -511,8 +505,7 @@ const PointerType *DISerializer::getEmptyStructPtrType() { if (EmptyStructPtrTy) return EmptyStructPtrTy; // Construct the pointer to empty structure type. - const StructType *EmptyStructTy = - StructType::get(std::vector()); + const StructType *EmptyStructTy = StructType::get(NULL, NULL); // Construct the pointer to empty structure type. EmptyStructPtrTy = PointerType::getUnqual(EmptyStructTy); @@ -529,6 +522,7 @@ const StructType *DISerializer::getTagType(DebugInfoDesc *DD) { if (!Ty) { // Set up fields vector. std::vector Fields; + // Get types of fields. DIGetTypesVisitor GTAM(*this, Fields); GTAM.ApplyToFields(DD); @@ -596,6 +590,7 @@ GlobalVariable *DISerializer::Serialize(DebugInfoDesc *DD) { // Set up elements vector std::vector Elements; + // Add fields. DISerializeVisitor SRAM(*this, Elements); SRAM.ApplyToFields(DD); -- 2.34.1