]> granicus.if.org Git - clang/commitdiff
Fix a bug in my previous patch, CGF is not valid for constants outside a function
authorChris Lattner <sabre@nondot.org>
Sat, 26 Jul 2008 22:39:33 +0000 (22:39 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 26 Jul 2008 22:39:33 +0000 (22:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54108 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExprConstant.cpp

index 2aaf2979bc6992ca12e74eb39a86de5c62b2be08..9efe801852b2a246bbd4467c96891ab8193de1be 100644 (file)
@@ -627,8 +627,8 @@ public:
   
   llvm::Constant *EmitConversion(llvm::Constant *Src, QualType SrcType, 
                                  QualType DstType) {
-    SrcType = CGF->getContext().getCanonicalType(SrcType);
-    DstType = CGF->getContext().getCanonicalType(DstType);
+    SrcType = CGM.getContext().getCanonicalType(SrcType);
+    DstType = CGM.getContext().getCanonicalType(DstType);
     if (SrcType == DstType) return Src;
     
     // Handle conversions to bool first, they are special: comparisons against 0.