clang  10.0.0svn
Functions
FileManager.cpp File Reference
#include "clang/Basic/FileManager.h"
#include "clang/Basic/FileSystemStatCache.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <climits>
#include <cstdint>
#include <cstdlib>
#include <string>
#include <utility>
Include dependency graph for FileManager.cpp:

Go to the source code of this file.

Functions

static llvm::ErrorOr< const DirectoryEntry * > getDirectoryFromFile (FileManager &FileMgr, StringRef Filename, bool CacheFailure)
 Retrieve the directory that the given file name resides in. More...
 
template<typename T >
static llvm::ErrorOr< T * > promoteInnerReference (llvm::ErrorOr< T &> value)
 Converts a llvm::ErrorOr<T &> to an llvm::ErrorOr<T *> by promoting the address of the inner reference to a pointer or by propagating the error. More...
 

Function Documentation

◆ getDirectoryFromFile()

static llvm::ErrorOr<const DirectoryEntry *> getDirectoryFromFile ( FileManager FileMgr,
StringRef  Filename,
bool  CacheFailure 
)
static

Retrieve the directory that the given file name resides in.

Filename can point to either a real file or a virtual file.

Definition at line 67 of file FileManager.cpp.

References clang::FileManager::getDirectory().

Referenced by clang::FileManager::getFileRef(), and clang::FileManager::getVirtualFile().

◆ promoteInnerReference()

template<typename T >
static llvm::ErrorOr<T *> promoteInnerReference ( llvm::ErrorOr< T &>  value)
static

Converts a llvm::ErrorOr<T &> to an llvm::ErrorOr<T *> by promoting the address of the inner reference to a pointer or by propagating the error.

Definition at line 113 of file FileManager.cpp.

Referenced by clang::FileManager::getDirectory().