mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
Function-local metadata whose operands had been optimized to no longer refer to function-local IR were not getting written by BitcodeWriter; solution is for these metadata to be enumerated just like global metadata.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95467 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -93,7 +93,7 @@ ValueEnumerator::ValueEnumerator(const Module *M) {
|
||||
for (User::const_op_iterator OI = I->op_begin(), E = I->op_end();
|
||||
OI != E; ++OI) {
|
||||
if (MDNode *MD = dyn_cast<MDNode>(*OI))
|
||||
if (MD->isFunctionLocal())
|
||||
if (MD->isFunctionLocal() && MD->getFunction())
|
||||
// These will get enumerated during function-incorporation.
|
||||
continue;
|
||||
EnumerateOperandType(*OI);
|
||||
@ -415,7 +415,7 @@ void ValueEnumerator::incorporateFunction(const Function &F) {
|
||||
for (User::const_op_iterator OI = I->op_begin(), E = I->op_end();
|
||||
OI != E; ++OI) {
|
||||
if (MDNode *MD = dyn_cast<MDNode>(*OI))
|
||||
if (MD->isFunctionLocal())
|
||||
if (MD->isFunctionLocal() && MD->getFunction())
|
||||
// Enumerate metadata after the instructions they might refer to.
|
||||
FunctionLocalMDs.push_back(MD);
|
||||
}
|
||||
|
Reference in New Issue
Block a user