From 7b39c067ac3c1ff08e25ef7b48444440c4136bd2 Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Wed, 9 Jul 2014 08:30:15 +0000 Subject: [PATCH] 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 --- include/llvm/Support/SourceMgr.h | 8 ++++---- lib/Support/SourceMgr.cpp | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/llvm/Support/SourceMgr.h b/include/llvm/Support/SourceMgr.h index 104b6962c76..4717553bd0d 100644 --- a/include/llvm/Support/SourceMgr.h +++ b/include/llvm/Support/SourceMgr.h @@ -99,7 +99,7 @@ public: return Buffers[i - 1].Buffer; } - size_t getNumBuffers() const { + unsigned getNumBuffers() const { return Buffers.size(); } @@ -115,7 +115,7 @@ public: /// Add a new source buffer to this source manager. This takes ownership of /// the memory buffer. - size_t AddNewSourceBuffer(MemoryBuffer *F, SMLoc IncludeLoc) { + unsigned AddNewSourceBuffer(MemoryBuffer *F, SMLoc IncludeLoc) { SrcBuffer NB; NB.Buffer = F; NB.IncludeLoc = IncludeLoc; @@ -129,8 +129,8 @@ public: /// 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 /// \p IncludedFile. - size_t AddIncludeFile(const std::string &Filename, SMLoc IncludeLoc, - std::string &IncludedFile); + unsigned AddIncludeFile(const std::string &Filename, SMLoc IncludeLoc, + std::string &IncludedFile); /// Return the ID of the buffer containing the specified location. /// diff --git a/lib/Support/SourceMgr.cpp b/lib/Support/SourceMgr.cpp index 595c6eec110..003cb56e6cb 100644 --- a/lib/Support/SourceMgr.cpp +++ b/lib/Support/SourceMgr.cpp @@ -49,9 +49,9 @@ SourceMgr::~SourceMgr() { } } -size_t SourceMgr::AddIncludeFile(const std::string &Filename, - SMLoc IncludeLoc, - std::string &IncludedFile) { +unsigned SourceMgr::AddIncludeFile(const std::string &Filename, + SMLoc IncludeLoc, + std::string &IncludedFile) { IncludedFile = Filename; ErrorOr> NewBufOrErr = MemoryBuffer::getFile(IncludedFile.c_str()); -- 2.34.1