mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 04:24:00 +00:00
Fix libLTO:
* Call InitializeAllTargets on every path where we might query the TargetRegistry. This fixes PR4604. * flush the formatted_raw_ostream& or else not all of the assembly will make it to the .s file. (It doesn't do this in its destructor?!) * Due to a reversed conditional, libLTO was reporting many symbols as both defined and undefined, including two definitions of the same symbol name in its symbol list. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77170 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -77,9 +77,8 @@ LTOCodeGenerator::LTOCodeGenerator()
|
||||
_codeModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC),
|
||||
_nativeObjectFile(NULL), _gccPath(NULL), _assemblerPath(NULL)
|
||||
{
|
||||
InitializeAllTargets();
|
||||
InitializeAllAsmPrinters();
|
||||
|
||||
InitializeAllTargets();
|
||||
InitializeAllAsmPrinters();
|
||||
}
|
||||
|
||||
LTOCodeGenerator::~LTOCodeGenerator()
|
||||
@ -398,7 +397,7 @@ void LTOCodeGenerator::applyScopeRestrictions()
|
||||
bool LTOCodeGenerator::generateAssemblyCode(formatted_raw_ostream& out,
|
||||
std::string& errMsg)
|
||||
{
|
||||
if ( this->determineTarget(errMsg) )
|
||||
if ( this->determineTarget(errMsg) )
|
||||
return true;
|
||||
|
||||
// mark which symbols can not be internalized
|
||||
@ -472,6 +471,9 @@ bool LTOCodeGenerator::generateAssemblyCode(formatted_raw_ostream& out,
|
||||
codeGenPasses->run(*it);
|
||||
|
||||
codeGenPasses->doFinalization();
|
||||
|
||||
out.flush();
|
||||
|
||||
return false; // success
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user