forked from OSchip/llvm-project
parent
4e0f205145
commit
d346dfe881
|
@ -454,6 +454,30 @@ public:
|
|||
return getFIDInfo(getPhysicalLoc(Loc).getFileID())->getFileCharacteristic();
|
||||
}
|
||||
|
||||
// Iterators over FileIDs.
|
||||
|
||||
class fileid_iterator {
|
||||
std::vector<SrcMgr::FileIDInfo>::iterator I;
|
||||
unsigned fid;
|
||||
public:
|
||||
fileid_iterator(std::vector<SrcMgr::FileIDInfo>::iterator i, unsigned f)
|
||||
: I(i), fid(f) {}
|
||||
|
||||
bool operator==(const fileid_iterator& X) const { return X.fid == fid; }
|
||||
bool operator!=(const fileid_iterator& X) const { return X.fid != fid; }
|
||||
fileid_iterator& operator++() { ++fid; ++I; return *this; }
|
||||
|
||||
unsigned getFileID() const { return fid; }
|
||||
SrcMgr::FileIDInfo& getFileIDInfo() { return *I; }
|
||||
};
|
||||
|
||||
fileid_iterator fileid_begin() {
|
||||
return fileid_iterator(FileIDs.begin(), 1);
|
||||
}
|
||||
|
||||
fileid_iterator fileid_end() {
|
||||
return fileid_iterator(FileIDs.end(), FileIDs.size()+1);
|
||||
}
|
||||
|
||||
/// PrintStats - Print statistics to stderr.
|
||||
///
|
||||
|
|
Loading…
Reference in New Issue