const Stmt *S;
const Decl *D;
const SourceManager *SM;
- const LocationContext *LC;
FullSourceLoc Loc;
PathDiagnosticRange Range;
public:
PathDiagnosticLocation()
- : K(SingleLocK), S(0), D(0), SM(0), LC(0) {
+ : K(SingleLocK), S(0), D(0), SM(0) {
}
PathDiagnosticLocation(FullSourceLoc L)
- : K(SingleLocK), R(L, L), S(0), D(0), SM(&L.getManager()), LC(0),
+ : K(SingleLocK), R(L, L), S(0), D(0), SM(&L.getManager()),
Loc(genLocation()), Range(genRange()) {
}
PathDiagnosticLocation(SourceLocation L, const SourceManager &sm,
Kind kind = SingleLocK)
- : K(kind), R(L, L), S(0), D(0), SM(&sm), LC(0),
+ : K(kind), R(L, L), S(0), D(0), SM(&sm),
Loc(genLocation()), Range(genRange()) {
}
const LocationContext *lc);
PathDiagnosticLocation(const Decl *d, const SourceManager &sm)
- : K(DeclK), S(0), D(d), SM(&sm), LC(0),
+ : K(DeclK), S(0), D(d), SM(&sm),
Loc(genLocation()), Range(genRange()) {
}
const PathDiagnosticLocation &PDL);
bool operator==(const PathDiagnosticLocation &X) const {
- return K == X.K && R == X.R && S == X.S && D == X.D && LC == X.LC;
+ return K == X.K && R == X.R && S == X.S && D == X.D;
}
bool operator!=(const PathDiagnosticLocation &X) const {
void flatten();
const SourceManager& getManager() const { assert(isValid()); return *SM; }
- const LocationContext* getLocationContext() const { return LC; }
void Profile(llvm::FoldingSetNodeID &ID) const;
};
PathDiagnosticLocation::PathDiagnosticLocation(const Stmt *s,
const SourceManager &sm,
const LocationContext *lc)
- : K(StmtK), S(s), D(0), SM(&sm), LC(lc)
+ : K(StmtK), S(s), D(0), SM(&sm)
{
const ParentMap* PM = 0;
if (lc)
case RangeK:
break;
case StmtK:
- return FullSourceLoc(getValidSourceLocation(S, LC->getParentMap()),
+ return FullSourceLoc(getValidSourceLocation(S, *PM),
const_cast<SourceManager&>(*SM));
case DeclK:
return FullSourceLoc(D->getLocation(), const_cast<SourceManager&>(*SM));
case Stmt::BinaryConditionalOperatorClass:
case Stmt::ConditionalOperatorClass:
case Stmt::ObjCForCollectionStmtClass: {
- SourceLocation L = getValidSourceLocation(S, LC->getParentMap());
+ SourceLocation L = getValidSourceLocation(S, *PM);
return SourceRange(L, L);
}
}