From 3ed055f5739e78d47ccbd7481e9f7a9d7982dc7b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 17 Apr 2009 00:26:12 +0000 Subject: Fix some failures in targets on available_externally functions, this fixes a crash on CodeGen/Generic/externally_available.ll on ppc hosts. Thanks to Nicholas L for pointing this out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69333 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/CBackend/CBackend.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/Target/CBackend') diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index fc99f50..8b2473b 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -116,6 +116,11 @@ namespace { virtual bool doInitialization(Module &M); bool runOnFunction(Function &F) { + // Do not codegen any 'available_externally' functions at all, they have + // definitions outside the translation unit. + if (F.hasAvailableExternallyLinkage()) + return false; + LI = &getAnalysis(); // Get rid of intrinsics we can't handle. -- cgit v1.1