mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 18:24:00 +00:00
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
This commit is contained in:
@ -250,10 +250,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
DISerializeVisitor(DISerializer &S, std::vector<Constant*> &E)
|
DISerializeVisitor(DISerializer &S, std::vector<Constant*> &E)
|
||||||
: DIVisitor()
|
: DIVisitor(), SR(S), Elements(E) {}
|
||||||
, SR(S)
|
|
||||||
, Elements(E)
|
|
||||||
{}
|
|
||||||
|
|
||||||
/// Apply - Set the value of each of the fields.
|
/// Apply - Set the value of each of the fields.
|
||||||
///
|
///
|
||||||
@ -337,10 +334,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
DIGetTypesVisitor(DISerializer &S, std::vector<const Type*> &F)
|
DIGetTypesVisitor(DISerializer &S, std::vector<const Type*> &F)
|
||||||
: DIVisitor()
|
: DIVisitor(), SR(S), Fields(F) {}
|
||||||
, SR(S)
|
|
||||||
, Fields(F)
|
|
||||||
{}
|
|
||||||
|
|
||||||
/// Apply - Set the value of each of the fields.
|
/// Apply - Set the value of each of the fields.
|
||||||
///
|
///
|
||||||
@ -511,8 +505,7 @@ const PointerType *DISerializer::getEmptyStructPtrType() {
|
|||||||
if (EmptyStructPtrTy) return EmptyStructPtrTy;
|
if (EmptyStructPtrTy) return EmptyStructPtrTy;
|
||||||
|
|
||||||
// Construct the pointer to empty structure type.
|
// Construct the pointer to empty structure type.
|
||||||
const StructType *EmptyStructTy =
|
const StructType *EmptyStructTy = StructType::get(NULL, NULL);
|
||||||
StructType::get(std::vector<const Type*>());
|
|
||||||
|
|
||||||
// Construct the pointer to empty structure type.
|
// Construct the pointer to empty structure type.
|
||||||
EmptyStructPtrTy = PointerType::getUnqual(EmptyStructTy);
|
EmptyStructPtrTy = PointerType::getUnqual(EmptyStructTy);
|
||||||
@ -529,6 +522,7 @@ const StructType *DISerializer::getTagType(DebugInfoDesc *DD) {
|
|||||||
if (!Ty) {
|
if (!Ty) {
|
||||||
// Set up fields vector.
|
// Set up fields vector.
|
||||||
std::vector<const Type*> Fields;
|
std::vector<const Type*> Fields;
|
||||||
|
|
||||||
// Get types of fields.
|
// Get types of fields.
|
||||||
DIGetTypesVisitor GTAM(*this, Fields);
|
DIGetTypesVisitor GTAM(*this, Fields);
|
||||||
GTAM.ApplyToFields(DD);
|
GTAM.ApplyToFields(DD);
|
||||||
@ -596,6 +590,7 @@ GlobalVariable *DISerializer::Serialize(DebugInfoDesc *DD) {
|
|||||||
|
|
||||||
// Set up elements vector
|
// Set up elements vector
|
||||||
std::vector<Constant*> Elements;
|
std::vector<Constant*> Elements;
|
||||||
|
|
||||||
// Add fields.
|
// Add fields.
|
||||||
DISerializeVisitor SRAM(*this, Elements);
|
DISerializeVisitor SRAM(*this, Elements);
|
||||||
SRAM.ApplyToFields(DD);
|
SRAM.ApplyToFields(DD);
|
||||||
|
Reference in New Issue
Block a user