mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-12-06 06:51:30 +00:00
IR: Replace the "Linker Options" module flag with "llvm.linker.options" named metadata.
The new metadata is easier to manipulate than module flags. Differential Revision: https://reviews.llvm.org/D31349 llvm-svn: 305227
This commit is contained in:
1 parent
30b2c6bdb7
commit
89061b2224
32 files changed
+141
-168
No files matched your search
@@ -2608,6 +2608,16 @@ Error BitcodeReader::materializeMetadata() {
|
||||
if (Error Err = MDLoader->parseModuleMetadata())
|
||||
return Err;
|
||||
}
|
||||
|
||||
// Upgrade "Linker Options" module flag to "llvm.linker.options" module-level
|
||||
// metadata.
|
||||
if (Metadata *Val = TheModule->getModuleFlag("Linker Options")) {
|
||||
NamedMDNode *LinkerOpts =
|
||||
TheModule->getOrInsertNamedMetadata("llvm.linker.options");
|
||||
for (const MDOperand &MDOptions : cast<MDNode>(Val)->operands())
|
||||
LinkerOpts->addOperand(cast<MDNode>(MDOptions));
|
||||
}
|
||||
|
||||
DeferredMetadataInfo.clear();
|
||||
return Error::success();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user