#include #include #include #include #include #include #include #include ">

clang: lib/Basic/SourceManager.cpp File Reference (original) (raw)

#include "[clang/Basic/SourceManager.h](SourceManager%5F8h%5Fsource.html)"
#include "[clang/Basic/Diagnostic.h](Basic%5F2Diagnostic%5F8h%5Fsource.html)"
#include "[clang/Basic/FileManager.h](FileManager%5F8h%5Fsource.html)"
#include "[clang/Basic/LLVM.h](LLVM%5F8h%5Fsource.html)"
#include "[clang/Basic/SourceLocation.h](SourceLocation%5F8h%5Fsource.html)"
#include "[clang/Basic/SourceManagerInternals.h](SourceManagerInternals%5F8h%5Fsource.html)"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/AutoConvert.h"
#include "llvm/Support/Capacity.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Endian.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 <optional>
#include <tuple>
#include <utility>
#include <vector>

Go to the source code of this file.

Functions
STATISTIC (MaxUsedSLocBytes, "Maximum number of bytes used by source locations " "(both loaded and local).")
bool needConversion (StringRef Filename)
Helper function to determine if an input file requires conversion.
template
static bool isInvalid (LocType Loc, bool *Invalid)
template
static constexpr T likelyhasbetween (T x, unsigned char m, unsigned char n)
static bool MoveUpTranslationUnitIncludeHierarchy (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 within the same translation unit.

DEBUG_TYPE

#define DEBUG_TYPE "source-manager"

isInvalid()

template

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

Definition at line 1197 of file SourceManager.cpp.

References clang::Invalid, clang::SourceLocation::isInvalid(), and Loc.

Referenced by clang::Sema::BuildStaticAssertDeclaration(), clang::Sema::CheckConstraintSatisfaction(), clang::Sema::CreateUnaryExprOrTypeTraitExpr(), clang::Sema::DiagnoseAssignmentResult(), 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().

likelyhasbetween()

template

static constexpr T likelyhasbetween ( T x, unsigned char m, unsigned char n ) inlinestaticconstexpr

MoveUpTranslationUnitIncludeHierarchy()

Given a decomposed source location, move it up the include/expansion stack to the parent source location within the same translation unit.

If this is possible, return the decomposed version of the parent in Loc and return false. If Loc is a top-level entry, return true and don't modify it.

Definition at line 1996 of file SourceManager.cpp.

References Loc, and SM.

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

needConversion()

bool needConversion ( StringRef Filename )

STATISTIC()

STATISTIC ( MaxUsedSLocBytes ,
"Maximum number of bytes used by source locations " "(both loaded and local)."
)