explicit FullSourceLoc(SourceLocation Loc, SourceManager &SM)
: SourceLocation(Loc), SrcMgr(&SM) {}
- SourceLocation getLocation() const { return *this; }
-
SourceManager& getManager() {
assert (SrcMgr && "SourceManager is NULL.");
return *SrcMgr;
FullSourceLoc L = I->getLocation().getInstantiationLoc();
if (!FileIDInitialized) {
- FileID = SMgr.getCanonicalFileID(L.getLocation());
+ FileID = SMgr.getCanonicalFileID(L);
FileIDInitialized = true;
- } else if (SMgr.getCanonicalFileID(L.getLocation()) != FileID)
+ } else if (SMgr.getCanonicalFileID(L) != FileID)
return; // FIXME: Emit a warning?
// Check the source ranges.
SourceManager& SM = R.getSourceMgr();
FullSourceLoc LPos = Pos.getInstantiationLoc();
- unsigned FileID = SM.getCanonicalFileID(LPos.getLocation());
+ unsigned FileID = SM.getCanonicalFileID(LPos);
assert (&LPos.getManager() == &SM && "SourceManagers are different!");
- if (SM.getCanonicalFileID(LPos.getLocation()) != BugFileID)
+ if (SM.getCanonicalFileID(LPos) != BugFileID)
return;
const llvm::MemoryBuffer *Buf = SM.getBuffer(FileID);
// Compute the column number. Rewind from the current position to the start
// of the line.
-
unsigned ColNo = LPos.getColumnNumber();
const char *TokInstantiationPtr = LPos.getCharacterData();
const char *LineStart = TokInstantiationPtr-ColNo;
FullSourceLoc L = P.getLocation();
Indent(o, indent) << "<key>location</key>\n";
- EmitLocation(o, SM, L.getLocation(), FM, indent);
+ EmitLocation(o, SM, L, FM, indent);
// Output the ranges (if any).
PathDiagnosticPiece::range_iterator RI = P.ranges_begin(),
llvm::SmallVector<unsigned, 10> Fids;
for (PathDiagnostic::const_iterator I=D->begin(), E=D->end(); I != E; ++I) {
- AddFID(FM, Fids, SM, I->getLocation().getLocation());
+ AddFID(FM, Fids, SM, I->getLocation());
for (PathDiagnosticPiece::range_iterator RI=I->ranges_begin(),
RE=I->ranges_end(); RI!=RE; ++RI) {
switch (Level) {
default: assert(0 && "Diagnostic not handled during diagnostic buffering!");
case Diagnostic::Note:
- Notes.push_back(std::make_pair(Info.getLocation().getLocation(), Str));
+ Notes.push_back(std::make_pair(Info.getLocation(), Str));
break;
case Diagnostic::Warning:
- Warnings.push_back(std::make_pair(Info.getLocation().getLocation(), Str));
+ Warnings.push_back(std::make_pair(Info.getLocation(), Str));
break;
case Diagnostic::Error:
- Errors.push_back(std::make_pair(Info.getLocation().getLocation(), Str));
+ Errors.push_back(std::make_pair(Info.getLocation(), Str));
break;
}
}
if (Pos.isValid()) {
FullSourceLoc LPos = Pos.getInstantiationLoc();
LineNo = LPos.getLineNumber();
- FileID = LPos.getLocation().getFileID();
+ FileID = LPos.getFileID();
// First, if this diagnostic is not in the main file, print out the
// "included from" lines.