From a5b27a7128a7bc6a1b746540dd4c493109db3039 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 llvm-svn: 212595 --- llvm/include/llvm/Support/SourceMgr.h | 8 ++++---- llvm/lib/Support/SourceMgr.cpp | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/llvm/include/llvm/Support/SourceMgr.h b/llvm/include/llvm/Support/SourceMgr.h index 104b696..4717553 100644 --- a/llvm/include/llvm/Support/SourceMgr.h +++ b/llvm/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/llvm/lib/Support/SourceMgr.cpp b/llvm/lib/Support/SourceMgr.cpp index 595c6ee..003cb56 100644 --- a/llvm/lib/Support/SourceMgr.cpp +++ b/llvm/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.7.4