]> granicus.if.org Git - clang/commitdiff
Fix recent regression caught by g++.old-deja/g++.mike/eh19.C.
authorMike Stump <mrs@apple.com>
Thu, 24 Dec 2009 01:10:27 +0000 (01:10 +0000)
committerMike Stump <mrs@apple.com>
Thu, 24 Dec 2009 01:10:27 +0000 (01:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92109 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGRTTI.cpp

index 2274e6211d1028704a3bb149c37c5492a7d3ca9b..e2410898453843a0c446cce8cb21054bbb73c1f0 100644 (file)
@@ -607,6 +607,26 @@ static llvm::GlobalVariable::LinkageTypes getTypeInfoLinkage(QualType Ty) {
     return llvm::GlobalValue::WeakODRLinkage;
   }
 
+  if (const FunctionType *FT = dyn_cast<FunctionType>(Ty)) {
+    if (getTypeInfoLinkage(FT->getResultType())
+        == llvm::GlobalValue::InternalLinkage)
+      return llvm::GlobalValue::InternalLinkage;
+
+    if (const FunctionProtoType *FPT = dyn_cast<FunctionProtoType>(Ty)) {
+      for (unsigned i = 0; i < FPT->getNumArgs(); ++i)
+        if (getTypeInfoLinkage(FPT->getArgType(i))
+            == llvm::GlobalValue::InternalLinkage)
+          return llvm::GlobalValue::InternalLinkage;
+      for (unsigned i = 0; i < FPT->getNumExceptions(); ++i)
+        if (getTypeInfoLinkage(FPT->getExceptionType(i))
+            == llvm::GlobalValue::InternalLinkage)
+          return llvm::GlobalValue::InternalLinkage;
+    }
+
+    return llvm::GlobalValue::WeakODRLinkage;
+  }
+
+  // FIXME: We need to add code to handle all types.
   assert(false && "Unhandled type!");
   return llvm::GlobalValue::WeakODRLinkage;
 }