diff options
author | Chris Lattner <sabre@nondot.org> | 2011-07-12 05:53:08 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-07-12 05:53:08 +0000 |
commit | cd87d1e4d1b0097877b0f9c2065900717d2aacba (patch) | |
tree | 535b1d110cd85ad7cd12139950aee36108bfaa86 /lib/CodeGen | |
parent | 1961791626ab0ebbd8bf901a37476d527def4edb (diff) |
fix an unintended behavior change in the type system rewrite, which caused us to compile
stuff like this:
typedef struct {
int x, y, z;
} foo_t;
foo_t g;
into:
%"struct.<anonymous>" = type { i32, i32, i32 }
we now get:
%struct.foo_t = type { i32, i32, i32 }
This doesn't change the behavior of the compiler, but makes the IR much easier to read.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134969 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CodeGenTypes.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp index 84b9fba5fd..64348ea7d1 100644 --- a/lib/CodeGen/CodeGenTypes.cpp +++ b/lib/CodeGen/CodeGenTypes.cpp @@ -451,10 +451,10 @@ llvm::StructType *CodeGenTypes::ConvertRecordDeclType(const RecordDecl *RD) { llvm::StructType *&Entry = RecordDeclTypes[Key]; // If we don't have a StructType at all yet, create the forward declaration. - if (Entry == 0) - Entry = llvm::StructType::createNamed(getLLVMContext(), - std::string(RD->getKindName()) + "." + - RD->getQualifiedNameAsString()); + if (Entry == 0) { + Entry = llvm::StructType::createNamed(getLLVMContext(), ""); + addRecordTypeName(RD, Entry, ""); + } llvm::StructType *Ty = Entry; // If this is still a forward declaration, or the LLVM type is already |