SpellingLoc,
SourceLocation::getFromRawEncoding(Record[2]),
SourceLocation::getFromRawEncoding(Record[3]),
- Lexer::MeasureTokenLength(SpellingLoc,
- SourceMgr,
- PP.getLangOptions()));
+ Record[4]);
break;
}
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // Spelling location
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // Start location
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // End location
+ Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Token length
return S.EmitAbbrev(Abbrev);
}
Record.push_back(Inst.getInstantiationLocStart().getRawEncoding());
Record.push_back(Inst.getInstantiationLocEnd().getRawEncoding());
+ // Compute the token length for this macro expansion.
+ unsigned NextOffset = SourceMgr.getNextOffset();
+ SourceManager::sloc_entry_iterator NextSLoc = SLoc;
+ if (++NextSLoc != SLocEnd)
+ NextOffset = NextSLoc->getOffset();
+ Record.push_back(NextOffset - SLoc->getOffset() - 1);
+
if (SLocInstantiationAbbrv == -1)
SLocInstantiationAbbrv = CreateSLocInstantiationAbbrev(S);
S.EmitRecordWithAbbrev(SLocInstantiationAbbrv, Record);