//===--- SourceManager.cpp - Track and cache source files -----------------===////// The LLVM Compiler Infrastructure//// This file is distributed under the University of Illinois Open Source// License. See LICENSE.TXT for details.////===----------------------------------------------------------------------===////// This file implements the SourceManager interface.////===----------------------------------------------------------------------===//#include"clang/Basic/SourceManager.h"#include"clang/Basic/SourceManagerInternals.h"#include"clang/Basic/Diagnostic.h"#include"clang/Basic/FileManager.h"#include"llvm/ADT/StringSwitch.h"#include"llvm/ADT/Optional.h"#include"llvm/Support/Compiler.h"#include"llvm/Support/MemoryBuffer.h"#include"llvm/Support/raw_ostream.h"#include"llvm/Support/Path.h"#include<algorithm>#include<string>#include<cstring>#include<sys/stat.h>usingnamespaceclang;usingnamespaceSrcMgr;usingllvm::MemoryBuffer;//===----------------------------------------------------------------------===//// SourceManager Helper Classes//===----------------------------------------------------------------------===//ContentCache::~ContentCache(){if(shouldFreeBuffer())deleteBuffer.getPointer();}/// getSizeBytesMapped - Returns the number of bytes actually mapped for/// this ContentCache. This can be 0 if the MemBuffer was not actually/// instantiated.unsignedContentCache::getSizeBytesMapped()const{returnBuffer.getPointer()?Buffer.getPointer()->getBufferSize():0;}/// getSize - Returns the size of the