clang 10.0.0git

Functions
SourceManager.cpp File Reference
`#include "clang/Basic/SourceManager.h"`
`#include "clang/Basic/Diagnostic.h"`
`#include "clang/Basic/FileManager.h"`
`#include "clang/Basic/LLVM.h"`
`#include "clang/Basic/SourceLocation.h"`
`#include "clang/Basic/SourceManagerInternals.h"`
`#include "llvm/ADT/DenseMap.h"`
`#include "llvm/ADT/Optional.h"`
`#include "llvm/ADT/None.h"`
`#include "llvm/ADT/STLExtras.h"`
`#include "llvm/ADT/SmallVector.h"`
`#include "llvm/ADT/StringSwitch.h"`
`#include "llvm/ADT/StringRef.h"`
`#include "llvm/Support/Allocator.h"`
`#include "llvm/Support/Capacity.h"`
`#include "llvm/Support/Compiler.h"`
`#include "llvm/Support/ErrorHandling.h"`
`#include "llvm/Support/FileSystem.h"`
`#include "llvm/Support/MathExtras.h"`
`#include "llvm/Support/MemoryBuffer.h"`
`#include "llvm/Support/Path.h"`
`#include "llvm/Support/raw_ostream.h"`
`#include <algorithm>`
`#include <cassert>`
`#include <cstddef>`
`#include <cstdint>`
`#include <memory>`
`#include <tuple>`
`#include <utility>`
`#include <vector>`
Include dependency graph for SourceManager.cpp:

Go to the source code of this file.

## Functions
template<typename LocType >
static bool | isInvalid (LocType Loc, bool *Invalid)
static LLVM_ATTRIBUTE_NOINLINE void | ComputeLineNumbers (DiagnosticsEngine &Diag, ContentCache *FI, llvm::BumpPtrAllocator &Alloc, const SourceManager &SM, bool &Invalid)
static bool | MoveUpIncludeHierarchy (std::pair< FileID, unsigned > &Loc, const SourceManager &SM)
| Given a decomposed source location, move it up the include/expansion stack to the parent source location. More...

## Function Documentation

## ◆ ComputeLineNumbers()

static void ComputeLineNumbers | ( | DiagnosticsEngine & | Diag,
|  | ContentCache * | FI,
|  | llvm::BumpPtrAllocator & | Alloc,
|  | const SourceManager & | SM,
|  | bool & | Invalid
| ) |  |
| static

Definition at line 1235 of file SourceManager.cpp.

References End, clang::SrcMgr::ContentCache::getBuffer(), clang::SourceManager::getFileManager(), clang::SrcMgr::ContentCache::NumLines, and clang::SrcMgr::ContentCache::SourceLineCache.

Referenced by clang::SourceManager::getLineNumber(), clang::SourceManager::getPresumedColumnNumber(), and clang::SourceManager::translateLineCol().

## ◆ isInvalid()

template<typename LocType >

static bool isInvalid | ( | LocType | Loc,
|  | bool * | Invalid
| ) |  |
| static

Definition at line 1199 of file SourceManager.cpp.

Referenced by clang::Sema::BuildStaticAssertDeclaration(), clang::Sema::CreateUnaryExprOrTypeTraitExpr(), clang::Sema::DiagnoseAssignmentResult(), clang::SourceManager::getBufferName(), clang::SourceManager::getExpansionColumnNumber(), clang::SourceManager::getExpansionLineNumber(), clang::MacroDirective::DefInfo::getLocation(), clang::MacroDirective::DefInfo::getMacroInfo(), clang::SourceManager::getPresumedColumnNumber(), clang::SourceManager::getPresumedLineNumber(), clang::MacroDirective::DefInfo::getPreviousDefinition(), clang::SourceManager::getSpellingColumnNumber(), clang::SourceManager::getSpellingLineNumber(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), isConfigurationPattern(), clang::RawComment::isDocumentation(), clang::TokenLexer::Lex(), SetupFixedPointError(), and clang::Parser::TryAnnotateOptionalCXXScopeToken().

## ◆ MoveUpIncludeHierarchy()

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 1897 of file SourceManager.cpp.

References clang::SourceManager::getDecomposedIncludedLoc().

Referenced by clang::SourceManager::isInTheSameTranslationUnit().