llvm.org GIT mirror llvm / ac9e819
Fix size_t -> uint warnings with MSVC 64-bit build git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186736 91177308-0d34-0410-b5e6-96231b3b80d8 Matt Arsenault 7 years ago
4 changed file(s) with 15 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
327327 typedef Function::iterator nodes_iterator;
328328 static nodes_iterator nodes_begin(Function *F) { return F->begin(); }
329329 static nodes_iterator nodes_end (Function *F) { return F->end(); }
330 static unsigned size (Function *F) { return F->size(); }
330 static size_t size (Function *F) { return F->size(); }
331331 };
332332 template <> struct GraphTraits :
333333 public GraphTraits {
337337 typedef Function::const_iterator nodes_iterator;
338338 static nodes_iterator nodes_begin(const Function *F) { return F->begin(); }
339339 static nodes_iterator nodes_end (const Function *F) { return F->end(); }
340 static unsigned size (const Function *F) { return F->size(); }
340 static size_t size (const Function *F) { return F->size(); }
341341 };
342342
343343
360360 FlatCollection.end(),
361361 CheckingVal) != FlatCollection.end();
362362
363 for (unsigned i = 0, e = getNumItems(); i < e; ++i) {
363 for (size_t i = 0, e = getNumItems(); i < e; ++i) {
364364 if (RangeLinks[i].first == RangeLinks[i].second) {
365365 if (*RangeLinks[i].first == CheckingVal)
366366 return true;
381381 }
382382
383383 /// Return number of items (ranges) stored in set.
384 unsigned getNumItems() const {
384 size_t getNumItems() const {
385385 return RangeLinks.size();
386386 }
387387
408408 /// for range [<0>, <1>, <5>] the size will 3
409409 unsigned getSize() const {
410410 APInt sz(((const APInt&)getItem(0).getLow()).getBitWidth(), 0);
411 for (unsigned i = 0, e = getNumItems(); i != e; ++i) {
411 for (size_t i = 0, e = getNumItems(); i != e; ++i) {
412412 const APInt Low = getItem(i).getLow();
413413 const APInt High = getItem(i).getHigh();
414414 APInt S = High - Low + 1;
3838 DK_Warning,
3939 DK_Note
4040 };
41
41
4242 /// DiagHandlerTy - Clients that want to handle their own diagnostics in a
4343 /// custom way can register a function pointer+context as a diagnostic
4444 /// handler. It gets called each time PrintMessage is invoked.
9797 return Buffers[i].Buffer;
9898 }
9999
100 unsigned getNumBuffers() const {
100 size_t getNumBuffers() const {
101101 return Buffers.size();
102102 }
103103
108108
109109 /// AddNewSourceBuffer - Add a new source buffer to this source manager. This
110110 /// takes ownership of the memory buffer.
111 unsigned AddNewSourceBuffer(MemoryBuffer *F, SMLoc IncludeLoc) {
111 size_t AddNewSourceBuffer(MemoryBuffer *F, SMLoc IncludeLoc) {
112112 SrcBuffer NB;
113113 NB.Buffer = F;
114114 NB.IncludeLoc = IncludeLoc;
115115 Buffers.push_back(NB);
116 return Buffers.size()-1;
116 return Buffers.size() - 1;
117117 }
118118
119119 /// AddIncludeFile - Search for a file with the specified name in the current
120120 /// directory or in one of the IncludeDirs. If no file is found, this returns
121121 /// ~0, otherwise it returns the buffer ID of the stacked file.
122122 /// The full path to the included file can be found in IncludedFile.
123 unsigned AddIncludeFile(const std::string &Filename, SMLoc IncludeLoc,
124 std::string &IncludedFile);
123 size_t AddIncludeFile(const std::string &Filename, SMLoc IncludeLoc,
124 std::string &IncludedFile);
125125
126126 /// FindBufferContainingLoc - Return the ID of the buffer containing the
127127 /// specified location, returning -1 if not found.
220220 SMDiagnostic(StringRef filename, SourceMgr::DiagKind Knd, StringRef Msg)
221221 : SM(0), Filename(filename), LineNo(-1), ColumnNo(-1), Kind(Knd),
222222 Message(Msg) {}
223
223
224224 // Diagnostic with a location.
225225 SMDiagnostic(const SourceMgr &sm, SMLoc L, StringRef FN,
226226 int Line, int Col, SourceMgr::DiagKind Kind,
5151 /// AddIncludeFile - Search for a file with the specified name in the current
5252 /// directory or in one of the IncludeDirs. If no file is found, this returns
5353 /// ~0, otherwise it returns the buffer ID of the stacked file.
54 unsigned SourceMgr::AddIncludeFile(const std::string &Filename,
55 SMLoc IncludeLoc,
56 std::string &IncludedFile) {
54 size_t SourceMgr::AddIncludeFile(const std::string &Filename,
55 SMLoc IncludeLoc,
56 std::string &IncludedFile) {
5757 OwningPtr NewBuf;
5858 IncludedFile = Filename;
5959 MemoryBuffer::getFile(IncludedFile.c_str(), NewBuf);