X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=lib%2FLinker%2FLinkModules.cpp;h=74ca197ddb3cf38bad3466a7b5bedb7afbf18630;hp=4a12633c3055fcb76de1a8ffc51c1a417fe9cc79;hb=46c7bcb5d1c405996dbc82cb38cdbc1207626f0a;hpb=f0a04c06ab5460e6b2fe902ce089d92d0802227e;ds=sidebyside diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index 4a12633c305..74ca197ddb3 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -1892,15 +1892,6 @@ bool ModuleLinker::run() { linkGlobalValueBody(Src); } - // Remap all of the named MDNodes in Src into the DstM module. We do this - // after linking GlobalValues so that MDNodes that reference GlobalValues - // are properly remapped. - linkNamedMDNodes(); - - // Merge the module flags into the DstM module. - if (linkModuleFlagsMetadata()) - return true; - // Update the initializers in the DstM module now that all globals that may // be referenced are in DstM. for (GlobalVariable &Src : SrcM->globals()) { @@ -1927,6 +1918,15 @@ bool ModuleLinker::run() { return true; } + // Remap all of the named MDNodes in Src into the DstM module. We do this + // after linking GlobalValues so that MDNodes that reference GlobalValues + // are properly remapped. + linkNamedMDNodes(); + + // Merge the module flags into the DstM module. + if (linkModuleFlagsMetadata()) + return true; + return false; }