const llvm::MemoryBuffer* getBuffer() const;
const char* getSourceName() const;
- const FileEntry* getFileEntryForLoc() const;
bool isInSystemHeader() const;
return FileIDs[ChunkID-1].getContentCache();
}
- /// getFileEntryForLoc - Return the FileEntry record for the spelling loc of
- /// the specified SourceLocation, if one exists.
- const FileEntry* getFileEntryForLoc(SourceLocation Loc) const {
- return getContentCacheForLoc(Loc)->Entry;
- }
-
/// getFileEntryForID - Returns the FileEntry record for the provided FileID.
const FileEntry *getFileEntryForID(FileID FID) const {
return getContentCache(FID)->Entry;
return SrcMgr->getSourceName(*this);
}
-const FileEntry* FullSourceLoc::getFileEntryForLoc() const {
- assert(isValid());
- return SrcMgr->getFileEntryForLoc(*this);
-}
-
bool FullSourceLoc::isInSystemHeader() const {
assert(isValid());
return SrcMgr->isInSystemHeader(*this);
return llvm::DICompileUnit();
SourceManager &SM = M->getContext().getSourceManager();
- const FileEntry *FE = SM.getFileEntryForLoc(Loc);
+ const FileEntry *FE = SM.getFileEntryForID(SM.getCanonicalFileID(Loc));
if (FE == 0) return llvm::DICompileUnit();
// See if this compile unit has been used before.