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
diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp
index 5e06a06..33d4f39 100644
--- a/llvm/lib/LTO/LTOBackend.cpp
+++ b/llvm/lib/LTO/LTOBackend.cpp
@@ -46,7 +46,7 @@
auto setHook = [&](std::string PathSuffix, ModuleHookFn &Hook) {
// Keep track of the hook provided by the linker, which also needs to run.
ModuleHookFn LinkerHook = Hook;
- Hook = [=](size_t Task, Module &M) {
+ Hook = [=](unsigned Task, Module &M) {
// If the linker's hook returned false, we need to pass that result
// through.
if (LinkerHook && !LinkerHook(Task, M))
@@ -115,7 +115,8 @@
C.CodeModel, C.CGOptLevel));
}
-bool opt(Config &C, TargetMachine *TM, size_t Task, Module &M, bool IsThinLto) {
+bool opt(Config &C, TargetMachine *TM, unsigned Task, Module &M,
+ bool IsThinLto) {
M.setDataLayout(TM->createDataLayout());
legacy::PassManager passes;
@@ -143,7 +144,7 @@
return true;
}
-void codegen(Config &C, TargetMachine *TM, AddStreamFn AddStream, size_t Task,
+void codegen(Config &C, TargetMachine *TM, AddStreamFn AddStream, unsigned Task,
Module &M) {
if (C.PreCodeGenModuleHook && !C.PreCodeGenModuleHook(Task, M))
return;
@@ -234,8 +235,8 @@
return Error();
}
-Error lto::thinBackend(Config &C, size_t Task, AddStreamFn AddStream, Module &M,
- ModuleSummaryIndex &CombinedIndex,
+Error lto::thinBackend(Config &C, unsigned Task, AddStreamFn AddStream,
+ Module &M, ModuleSummaryIndex &CombinedIndex,
const FunctionImporter::ImportMapTy &ImportList,
const GVSummaryMapTy &DefinedGlobals,
MapVector<StringRef, MemoryBufferRef> &ModuleMap) {