mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 18:24:00 +00:00
AsmParser/Bitcode: Add support for MDLocation
This adds assembly and bitcode support for `MDLocation`. The assembly side is rather big, since this is the first `MDNode` subclass (that isn't `MDTuple`). Part of PR21433. (If you're wondering where the mountains of testcase updates are, we don't need them until I update `DILocation` and `DebugLoc` to actually use this class.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225830 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1267,6 +1267,20 @@ std::error_code BitcodeReader::ParseMetadata() {
|
||||
NextMDValueNo++);
|
||||
break;
|
||||
}
|
||||
case bitc::METADATA_LOCATION: {
|
||||
if (Record.size() != 5)
|
||||
return Error("Invalid record");
|
||||
|
||||
auto get = Record[0] ? MDLocation::getDistinct : MDLocation::get;
|
||||
unsigned Line = Record[1];
|
||||
unsigned Column = Record[2];
|
||||
MDNode *Scope = cast<MDNode>(MDValueList.getValueFwdRef(Record[3]));
|
||||
Metadata *InlinedAt =
|
||||
Record[4] ? MDValueList.getValueFwdRef(Record[4] - 1) : nullptr;
|
||||
MDValueList.AssignValue(get(Context, Line, Column, Scope, InlinedAt),
|
||||
NextMDValueNo++);
|
||||
break;
|
||||
}
|
||||
case bitc::METADATA_STRING: {
|
||||
std::string String(Record.begin(), Record.end());
|
||||
llvm::UpgradeMDStringConstant(String);
|
||||
|
Reference in New Issue
Block a user