mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Linker: Copy over function metadata attachments
Update `lib/Linker` to handle `Function` metadata attachments. The attachments stick with the function body. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235786 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1205,6 +1205,13 @@ bool ModuleLinker::linkFunctionBody(Function &Dst, Function &Src) {
|
||||
++DI;
|
||||
}
|
||||
|
||||
// Copy over the metadata attachments.
|
||||
SmallVector<std::pair<unsigned, MDNode *>, 8> MDs;
|
||||
Src.getAllMetadata(MDs);
|
||||
for (const auto &I : MDs)
|
||||
Dst.setMetadata(I.first, MapMetadata(I.second, ValueMap, RF_None, &TypeMap,
|
||||
&ValMaterializer));
|
||||
|
||||
// Splice the body of the source function into the dest function.
|
||||
Dst.getBasicBlockList().splice(Dst.end(), Src.getBasicBlockList());
|
||||
|
||||
|
Reference in New Issue
Block a user