From: Rong Xu Date: Tue, 24 Nov 2015 21:55:50 +0000 (+0000) Subject: [PGO] Fix build errors in x86_64-darwin X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f52f1369a2f0736b00c83ad6ee0646f13a61faf5;p=oota-llvm.git [PGO] Fix build errors in x86_64-darwin Fix buildbot failure for x86_64-darwin due to r254021 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254028 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Instrumentation/CFGMST.h b/lib/Transforms/Instrumentation/CFGMST.h index 3f0496d3073..71a82761741 100644 --- a/lib/Transforms/Instrumentation/CFGMST.h +++ b/lib/Transforms/Instrumentation/CFGMST.h @@ -97,7 +97,7 @@ public: uint64_t BBWeight = BFI->getBlockFreq(&*BB).getFrequency(); uint64_t Weight; if (int successors = TI->getNumSuccessors()) { - for (uint32_t i = 0; i != successors; ++i) { + for (int i = 0; i != successors; ++i) { BasicBlock *TargetBB = TI->getSuccessor(i); bool Critical = isCriticalEdge(TI, i); uint64_t scaleFactor = BBWeight; diff --git a/lib/Transforms/Instrumentation/PGOInstrumentation.cpp b/lib/Transforms/Instrumentation/PGOInstrumentation.cpp index 6d4a8ac9793..89e4cd7a0c4 100644 --- a/lib/Transforms/Instrumentation/PGOInstrumentation.cpp +++ b/lib/Transforms/Instrumentation/PGOInstrumentation.cpp @@ -264,8 +264,8 @@ void FuncPGOInstrumentation::computeCFGHash() { for (unsigned s = 0, e = TI->getNumSuccessors(); s != e; ++s) { BasicBlock *Succ = TI->getSuccessor(s); uint32_t Index = getBBInfo(Succ).Index; - for (int i = 0; i < sizeof(uint32_t) / sizeof(char); i++) - Indexes.push_back((char)(Index >> (i * sizeof(char)))); + for (int i = 0; i < 4; i++) + Indexes.push_back((char)(Index >> i)); } } JC.update(Indexes);