SourceMgr: consistently use 'unsigned' for the memory buffer ID type

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212595 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dmitri Gribenko 2014-07-09 08:30:15 +00:00
parent 2bd8e0cde3
commit 7b39c067ac
2 changed files with 7 additions and 7 deletions

View File

@ -99,7 +99,7 @@ public:
return Buffers[i - 1].Buffer; return Buffers[i - 1].Buffer;
} }
size_t getNumBuffers() const { unsigned getNumBuffers() const {
return Buffers.size(); return Buffers.size();
} }
@ -115,7 +115,7 @@ public:
/// Add a new source buffer to this source manager. This takes ownership of /// Add a new source buffer to this source manager. This takes ownership of
/// the memory buffer. /// the memory buffer.
size_t AddNewSourceBuffer(MemoryBuffer *F, SMLoc IncludeLoc) { unsigned AddNewSourceBuffer(MemoryBuffer *F, SMLoc IncludeLoc) {
SrcBuffer NB; SrcBuffer NB;
NB.Buffer = F; NB.Buffer = F;
NB.IncludeLoc = IncludeLoc; NB.IncludeLoc = IncludeLoc;
@ -129,8 +129,8 @@ public:
/// If no file is found, this returns 0, otherwise it returns the buffer ID /// If no file is found, this returns 0, otherwise it returns the buffer ID
/// of the stacked file. The full path to the included file can be found in /// of the stacked file. The full path to the included file can be found in
/// \p IncludedFile. /// \p IncludedFile.
size_t AddIncludeFile(const std::string &Filename, SMLoc IncludeLoc, unsigned AddIncludeFile(const std::string &Filename, SMLoc IncludeLoc,
std::string &IncludedFile); std::string &IncludedFile);
/// Return the ID of the buffer containing the specified location. /// Return the ID of the buffer containing the specified location.
/// ///

View File

@ -49,9 +49,9 @@ SourceMgr::~SourceMgr() {
} }
} }
size_t SourceMgr::AddIncludeFile(const std::string &Filename, unsigned SourceMgr::AddIncludeFile(const std::string &Filename,
SMLoc IncludeLoc, SMLoc IncludeLoc,
std::string &IncludedFile) { std::string &IncludedFile) {
IncludedFile = Filename; IncludedFile = Filename;
ErrorOr<std::unique_ptr<MemoryBuffer>> NewBufOrErr = ErrorOr<std::unique_ptr<MemoryBuffer>> NewBufOrErr =
MemoryBuffer::getFile(IncludedFile.c_str()); MemoryBuffer::getFile(IncludedFile.c_str());