SourceMgr: consistently use 'unsigned' for the memory buffer ID type
authorDmitri Gribenko <gribozavr@gmail.com>
Wed, 9 Jul 2014 08:30:15 +0000 (08:30 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Wed, 9 Jul 2014 08:30:15 +0000 (08:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212595 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/SourceMgr.h
lib/Support/SourceMgr.cpp

index 104b6962c761efef1d26d9c1fa0a69edd2d5b858..4717553bd0de13ee47f478d7ae896eeee9fb65a2 100644 (file)
@@ -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.
   ///
index 595c6eec1107fd0b3651cbe89bbd528b989c9bab..003cb56e6cb5f22afa5b6f022f104ecf8f1d5325 100644 (file)
@@ -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<std::unique_ptr<MemoryBuffer>> NewBufOrErr =
       MemoryBuffer::getFile(IncludedFile.c_str());