mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-11 21:38:19 +00:00
Materialize functions whose basic blocks are used by global variables. Fixes
PR11677. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147425 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -27,6 +27,13 @@
|
||||
#include "llvm/OperandTraits.h"
|
||||
using namespace llvm;
|
||||
|
||||
void BitcodeReader::materializeForwardReferencedFunctions() {
|
||||
while (!BlockAddrFwdRefs.empty()) {
|
||||
Function *F = BlockAddrFwdRefs.begin()->first;
|
||||
F->Materialize();
|
||||
}
|
||||
}
|
||||
|
||||
void BitcodeReader::FreeState() {
|
||||
if (BufferOwned)
|
||||
delete Buffer;
|
||||
@ -2779,6 +2786,9 @@ Module *llvm::getLazyBitcodeModule(MemoryBuffer *Buffer,
|
||||
}
|
||||
// Have the BitcodeReader dtor delete 'Buffer'.
|
||||
R->setBufferOwned(true);
|
||||
|
||||
R->materializeForwardReferencedFunctions();
|
||||
|
||||
return M;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user