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
This commit is contained in:
Chris Lattner
2009-04-17 00:26:12 +00:00
parent 84fc33ed92
commit 9062d9a55b
3 changed files with 17 additions and 0 deletions

View File

@@ -93,6 +93,12 @@ char MSILWriter::ID = 0;
bool MSILWriter::runOnFunction(Function &F) {
if (F.isDeclaration()) return false;
// Do not codegen any 'available_externally' functions at all, they have
// definitions outside the translation unit.
if (F.hasAvailableExternallyLinkage())
return false;
LInfo = &getAnalysis<LoopInfo>();
printFunction(F);
return false;