Add a DIModule metadata node to the IR.

It is meant to be used to record modules @imported by the current
compile unit, so a debugger an import the same modules to replicate this
environment before dropping into the expression evaluator.

DIModule is a sibling to DINamespace and behaves quite similarly.
In addition to the name of the module it also records the module
configuration details that are necessary to uniquely identify the module.
This includes the configuration macros (e.g., -DNDEBUG), the include path
where the module.map file is to be found, and the isysroot.

The idea is that the backend will turn this into a DW_TAG_module.

http://reviews.llvm.org/D9614
rdar://problem/20965932

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241017 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Adrian Prantl
2015-06-29 23:03:47 +00:00
parent 88f33c9916
commit 717764717b
16 changed files with 261 additions and 0 deletions

View File

@@ -1827,6 +1827,20 @@ std::error_code BitcodeReader::parseMetadata() {
NextMDValueNo++);
break;
}
case bitc::METADATA_MODULE: {
if (Record.size() != 6)
return error("Invalid record");
MDValueList.assignValue(
GET_OR_DISTINCT(DIModule, Record[0],
(Context, getMDOrNull(Record[1]),
getMDString(Record[2]), getMDString(Record[3]),
getMDString(Record[4]), getMDString(Record[5]))),
NextMDValueNo++);
break;
}
case bitc::METADATA_FILE: {
if (Record.size() != 3)
return error("Invalid record");