From faa7506f18a603ba97862c86c49ce946cdf2d0dd Mon Sep 17 00:00:00 2001 From: Teresa Johnson Date: Thu, 11 Aug 2016 20:38:39 +0000 Subject: Fix type truncation warnings Avoid type truncation warnings from a 32-bit bot due to size_t not being unsigned long long, by converting the variables and constants to unsigned. This was introduced by r278338 and caused warnings here: http://bb.pgr.jp/builders/i686-mingw32-RA-on-linux/builds/15527/steps/build_llvmclang/logs/warnings%20%287%29 llvm-svn: 278406 --- llvm/lib/LTO/LTO.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'llvm/lib/LTO/LTO.cpp') diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp index 282e127ac5d..c12a8ee32e2 100644 --- a/llvm/lib/LTO/LTO.cpp +++ b/llvm/lib/LTO/LTO.cpp @@ -185,7 +185,7 @@ LTO::LTO(Config Conf, ThinBackend Backend, void LTO::addSymbolToGlobalRes(IRObjectFile *Obj, SmallPtrSet &Used, const InputFile::Symbol &Sym, - SymbolResolution Res, size_t Partition) { + SymbolResolution Res, unsigned Partition) { GlobalValue *GV = Obj->getSymbolGV(Sym.I->getRawDataRefImpl()); auto &GlobalRes = GlobalResolutions[Sym.getName()]; @@ -345,7 +345,7 @@ Error LTO::addThinLTO(std::unique_ptr Input, return Error(); } -size_t LTO::getMaxTasks() const { +unsigned LTO::getMaxTasks() const { CalledGetMaxTasks = true; return RegularLTO.ParallelCodeGenParallelismLevel + ThinLTO.ModuleMap.size(); } @@ -408,7 +408,7 @@ public: ModuleToDefinedGVSummaries(ModuleToDefinedGVSummaries) {} virtual ~ThinBackendProc() {} - virtual Error start(size_t Task, MemoryBufferRef MBRef, + virtual Error start(unsigned Task, MemoryBufferRef MBRef, StringMap &ImportLists, MapVector &ModuleMap) = 0; virtual Error wait() = 0; @@ -430,7 +430,7 @@ public: BackendThreadPool(ThinLTOParallelismLevel) {} Error - runThinLTOBackendThread(AddStreamFn AddStream, size_t Task, + runThinLTOBackendThread(AddStreamFn AddStream, unsigned Task, MemoryBufferRef MBRef, ModuleSummaryIndex &CombinedIndex, const FunctionImporter::ImportMapTy &ImportList, @@ -446,7 +446,7 @@ public: ImportList, DefinedGlobals, ModuleMap); } - Error start(size_t Task, MemoryBufferRef MBRef, + Error start(unsigned Task, MemoryBufferRef MBRef, StringMap &ImportLists, MapVector &ModuleMap) override { StringRef ModulePath = MBRef.getBufferIdentifier(); @@ -529,7 +529,7 @@ public: return NewPath.str(); } - Error start(size_t Task, MemoryBufferRef MBRef, + Error start(unsigned Task, MemoryBufferRef MBRef, StringMap &ImportLists, MapVector &ModuleMap) override { StringRef ModulePath = MBRef.getBufferIdentifier(); @@ -629,8 +629,8 @@ Error LTO::runThinLTO(AddStreamFn AddStream) { // ParallelCodeGenParallelismLevel, as tasks 0 through // ParallelCodeGenParallelismLevel-1 are reserved for parallel code generation // partitions. - size_t Task = RegularLTO.ParallelCodeGenParallelismLevel; - size_t Partition = 1; + unsigned Task = RegularLTO.ParallelCodeGenParallelismLevel; + unsigned Partition = 1; for (auto &Mod : ThinLTO.ModuleMap) { if (Error E = BackendProc->start(Task, Mod.second, ImportLists, -- cgit v1.2.3