summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-02-06 06:06:49 +0000
committerChris Lattner <sabre@nondot.org>2008-02-06 06:06:49 +0000
commitb818af539f3047a0be3f12ea13c69606b78d6488 (patch)
treef586ba0bffd2c2db60b4e2d9f89afff115a364c2 /clang
parentd11482ea221d3408929477c3ce2937dd4143eef0 (diff)
downloadbcm5719-llvm-b818af539f3047a0be3f12ea13c69606b78d6488.tar.gz
bcm5719-llvm-b818af539f3047a0be3f12ea13c69606b78d6488.zip
now that ConvertTagDeclType is nice and simple, use it from UpdateCompletedType.
llvm-svn: 46809
Diffstat (limited to 'clang')
-rw-r--r--clang/CodeGen/CodeGenTypes.cpp15
-rw-r--r--clang/CodeGen/CodeGenTypes.h2
2 files changed, 7 insertions, 10 deletions
diff --git a/clang/CodeGen/CodeGenTypes.cpp b/clang/CodeGen/CodeGenTypes.cpp
index 24a18334cd2..3f5449056a7 100644
--- a/clang/CodeGen/CodeGenTypes.cpp
+++ b/clang/CodeGen/CodeGenTypes.cpp
@@ -139,13 +139,11 @@ void CodeGenTypes::UpdateCompletedType(const TagDecl *TD) {
// Remove it from TagDeclTypes so that it will be regenerated.
TagDeclTypes.erase(TDTI);
- QualType NewTy = Context.getTagDeclType(const_cast<TagDecl*>(TD));
- const llvm::Type *NT = ConvertNewType(NewTy);
+ // Generate the new type.
+ const llvm::Type *NT = ConvertTagDeclType(TD);
- // If getting the type didn't itself refine it, refine it to its actual type
- // now.
- if (llvm::OpaqueType *OT = dyn_cast<llvm::OpaqueType>(OpaqueHolder.get()))
- OT->refineAbstractTypeTo(NT);
+ // Refine the old opaque type to its new definition.
+ cast<llvm::OpaqueType>(OpaqueHolder.get())->refineAbstractTypeTo(NT);
}
@@ -279,7 +277,7 @@ const llvm::Type *CodeGenTypes::ConvertNewType(QualType T) {
case Type::Tagged: {
const TagDecl *TD = cast<TagType>(Ty).getDecl();
- const llvm::Type *Res = ConvertTagDeclType(T, TD);
+ const llvm::Type *Res = ConvertTagDeclType(TD);
std::string TypeName(TD->getKindName());
TypeName += '.';
@@ -316,8 +314,7 @@ void CodeGenTypes::DecodeArgumentTypes(const FunctionTypeProto &FTP,
/// ConvertTagDeclType - Lay out a tagged decl type like struct or union or
/// enum.
-const llvm::Type *CodeGenTypes::ConvertTagDeclType(QualType T,
- const TagDecl *TD) {
+const llvm::Type *CodeGenTypes::ConvertTagDeclType(const TagDecl *TD) {
llvm::DenseMap<const TagDecl*, llvm::PATypeHolder>::iterator TDTI =
TagDeclTypes.find(TD);
diff --git a/clang/CodeGen/CodeGenTypes.h b/clang/CodeGen/CodeGenTypes.h
index e68d97b1d7f..96187d81d6d 100644
--- a/clang/CodeGen/CodeGenTypes.h
+++ b/clang/CodeGen/CodeGenTypes.h
@@ -156,7 +156,7 @@ public: // These are internal details of CGT that shouldn't be used externally.
/// ConvertTagDeclType - Lay out a tagged decl type like struct or union or
/// enum.
- const llvm::Type *ConvertTagDeclType(QualType T, const TagDecl *TD);
+ const llvm::Type *ConvertTagDeclType(const TagDecl *TD);
};
} // end namespace CodeGen
OpenPOWER on IntegriCloud