diff options
author | Mike Stump <mrs@apple.com> | 2009-12-24 01:10:27 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-12-24 01:10:27 +0000 |
commit | c8f76f557c4839c8e5f142ac4681ad010e07c855 (patch) | |
tree | bd0029f63e97a4af8f732c92612a9f7b9c11ea6e /lib | |
parent | 4c508a12cedcf2896412a3700c1b2a35bf339828 (diff) |
Fix recent regression caught by g++.old-deja/g++.mike/eh19.C.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92109 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/CGRTTI.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/CodeGen/CGRTTI.cpp b/lib/CodeGen/CGRTTI.cpp index 2274e6211d..e241089845 100644 --- a/lib/CodeGen/CGRTTI.cpp +++ b/lib/CodeGen/CGRTTI.cpp @@ -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; } |