mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-24 07:35:04 +00:00
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:
parent
84fc33ed92
commit
9062d9a55b
@ -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<LoopInfo>();
|
||||
|
||||
// Get rid of intrinsics we can't handle.
|
||||
|
@ -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;
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "llvm/CodeGen/SelectionDAGISel.h"
|
||||
#include "llvm/Target/TargetOptions.h"
|
||||
#include "llvm/Constants.h"
|
||||
#include "llvm/Function.h"
|
||||
#include "llvm/GlobalValue.h"
|
||||
#include "llvm/Intrinsics.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
@ -49,6 +50,11 @@ namespace {
|
||||
PPCSubTarget(*TM.getSubtargetImpl()) {}
|
||||
|
||||
virtual bool runOnFunction(Function &Fn) {
|
||||
// Do not codegen any 'available_externally' functions at all, they have
|
||||
// definitions outside the translation unit.
|
||||
if (Fn.hasAvailableExternallyLinkage())
|
||||
return false;
|
||||
|
||||
// Make sure we re-emit a set of the global base reg if necessary
|
||||
GlobalBaseReg = 0;
|
||||
SelectionDAGISel::runOnFunction(Fn);
|
||||
|
Loading…
x
Reference in New Issue
Block a user