summaryrefslogtreecommitdiffstats
path: root/clang/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-02-05 06:55:31 +0000
committerChris Lattner <sabre@nondot.org>2008-02-05 06:55:31 +0000
commit86964a96530925e04d4c99ee0c84a7f5e86d1f3f (patch)
tree67fd8aafdb52ee15400229edf432770bac2c228c /clang/CodeGen/CodeGenFunction.cpp
parentb977b6a59b768dd0507abd3c152b562e24b79306 (diff)
downloadbcm5719-llvm-86964a96530925e04d4c99ee0c84a7f5e86d1f3f.tar.gz
bcm5719-llvm-86964a96530925e04d4c99ee0c84a7f5e86d1f3f.zip
Change the key of CGRecordLayouts from being an llvm type* to being a decl*. LLVM
Type*'s can change as types are refined, so we can't use them as a stable key in the map. Decls don't change, so use them instead. This patch was written by Anders, but he's too shy to commit it himself :) llvm-svn: 46743
Diffstat (limited to 'clang/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/CodeGen/CodeGenFunction.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/clang/CodeGen/CodeGenFunction.cpp b/clang/CodeGen/CodeGenFunction.cpp
index 98d0b01ad5a..dc31a27945b 100644
--- a/clang/CodeGen/CodeGenFunction.cpp
+++ b/clang/CodeGen/CodeGenFunction.cpp
@@ -139,14 +139,11 @@ void CodeGenFunction::StartBlock(const char *N) {
/// getCGRecordLayout - Return record layout info.
const CGRecordLayout *CodeGenFunction::getCGRecordLayout(CodeGenTypes &CGT,
- QualType RTy) {
- assert (isa<RecordType>(RTy)
- && "Unexpected type. RecordType expected here.");
+ QualType Ty) {
+ const RecordType *RTy = Ty->getAsRecordType();
+ assert (RTy && "Unexpected type. RecordType expected here.");
- const llvm::Type *Ty = ConvertType(RTy);
- assert (Ty && "Unable to find llvm::Type");
-
- return CGT.getCGRecordLayout(Ty);
+ return CGT.getCGRecordLayout(RTy->getDecl());
}
/// WarnUnsupported - Print out a warning that codegen doesn't support the
OpenPOWER on IntegriCloud