]> granicus.if.org Git - clang/commitdiff
Fix rtti generation for throws. WIP.
authorMike Stump <mrs@apple.com>
Fri, 20 Nov 2009 00:43:57 +0000 (00:43 +0000)
committerMike Stump <mrs@apple.com>
Fri, 20 Nov 2009 00:43:57 +0000 (00:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89420 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGException.cpp

index adfd0055f93675bd4afbd193e6be535f79bf0677..93f3eb9f7c5a65b86363843e3d281612056b9a3b 100644 (file)
@@ -84,15 +84,7 @@ void CodeGenFunction::EmitCXXThrowExpr(const CXXThrowExpr *E) {
   
   // Now throw the exception.
   const llvm::Type *Int8PtrTy = llvm::Type::getInt8PtrTy(getLLVMContext());
-  
-  llvm::SmallString<256> OutName;
-  llvm::raw_svector_ostream Out(OutName);
-  mangleCXXRtti(CGM.getMangleContext(), ThrowType, Out);
-  
-  // FIXME: Is it OK to use CreateRuntimeVariable for this?
-  llvm::Constant *TypeInfo = 
-    CGM.CreateRuntimeVariable(llvm::Type::getInt8Ty(getLLVMContext()),
-                              OutName.c_str());
+  llvm::Constant *TypeInfo = CGM.GenerateRtti(ThrowType);
   llvm::Constant *Dtor = llvm::Constant::getNullValue(Int8PtrTy);
   
   llvm::CallInst *ThrowCall =