clang API Documentation
#include "clang/Basic/SourceManager.h"#include "clang/Basic/Diagnostic.h"#include "clang/Basic/FileManager.h"#include "clang/Basic/SourceManagerInternals.h"#include "llvm/ADT/Optional.h"#include "llvm/ADT/STLExtras.h"#include "llvm/ADT/StringSwitch.h"#include "llvm/Support/Capacity.h"#include "llvm/Support/Compiler.h"#include "llvm/Support/MemoryBuffer.h"#include "llvm/Support/Path.h"#include "llvm/Support/raw_ostream.h"#include <algorithm>#include <cstring>#include <string>
Go to the source code of this file.
Functions | |
| static bool | isInvalid (SourceLocation Loc, bool *Invalid) |
| static LLVM_ATTRIBUTE_NOINLINE void | ComputeLineNumbers (DiagnosticsEngine &Diag, ContentCache *FI, llvm::BumpPtrAllocator &Alloc, const SourceManager &SM, bool &Invalid) |
| static Optional < llvm::sys::fs::UniqueID > | getActualFileUID (const FileEntry *File) |
| Retrieve the inode for the given file entry, if possible. | |
| static bool | MoveUpIncludeHierarchy (std::pair< FileID, unsigned > &Loc, const SourceManager &SM) |
| static void ComputeLineNumbers | ( | DiagnosticsEngine & | Diag, |
| ContentCache * | FI, | ||
| llvm::BumpPtrAllocator & | Alloc, | ||
| const SourceManager & | SM, | ||
| bool & | Invalid | ||
| ) | [static] |
Definition at line 1196 of file SourceManager.cpp.
References clang::SrcMgr::ContentCache::getBuffer(), clang::SrcMgr::ContentCache::NumLines, and clang::SrcMgr::ContentCache::SourceLineCache.
Referenced by clang::SourceManager::getLineNumber(), and clang::SourceManager::translateLineCol().
| static Optional<llvm::sys::fs::UniqueID> getActualFileUID | ( | const FileEntry * | File | ) | [static] |
Retrieve the inode for the given file entry, if possible.
This routine involves a system call, and therefore should only be used in non-performance-critical code.
Definition at line 1569 of file SourceManager.cpp.
References clang::FileEntry::getName().
Referenced by clang::SourceManager::translateFile().
| static bool isInvalid | ( | SourceLocation | Loc, |
| bool * | Invalid | ||
| ) | [static] |
Definition at line 1161 of file SourceManager.cpp.
References clang::SourceLocation::isInvalid().
Referenced by clang::Sema::BuildStaticAssertDeclaration(), clang::Sema::CreateUnaryExprOrTypeTraitExpr(), clang::Sema::DiagnoseAssignmentResult(), clang::DeclSpec::Finish(), clang::SourceManager::getBufferName(), clang::SourceManager::getExpansionColumnNumber(), clang::SourceManager::getExpansionLineNumber(), clang::MacroDirective::DefInfo::getMacroInfo(), clang::SourceManager::getPresumedColumnNumber(), clang::SourceManager::getPresumedLineNumber(), clang::MacroDirective::DefInfo::getPreviousDefinition(), clang::SourceManager::getSpellingColumnNumber(), clang::SourceManager::getSpellingLineNumber(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), and clang::DeclSpec::SetStorageClassSpec().
| static bool MoveUpIncludeHierarchy | ( | std::pair< FileID, unsigned > & | Loc, |
| const SourceManager & | SM | ||
| ) | [static] |
Given a decomposed source location, move it up the include/expansion stack to the parent source location. If this is possible, return the decomposed version of the parent in Loc and return false. If Loc is the top-level entry, return true and don't modify it.
Definition at line 1986 of file SourceManager.cpp.
References clang::SourceManager::getDecomposedIncludedLoc().
Referenced by clang::SourceManager::isBeforeInTranslationUnit().