From: Benjamin Segovia Date: Sat, 17 Mar 2012 07:21:05 +0000 (-0700) Subject: Fixed auto keyword use X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=04450079f15385eaa6ba8fce6ae98c30f6cbc28a;p=contrib%2Fbeignet.git Fixed auto keyword use --- diff --git a/backend/src/ir/liveness.hpp b/backend/src/ir/liveness.hpp index 6d97b1c..7b29a15 100644 --- a/backend/src/ir/liveness.hpp +++ b/backend/src/ir/liveness.hpp @@ -56,7 +56,7 @@ namespace ir { /*! Set of variables actually killed in each block */ typedef set VarKill; /*! Per-block info */ - struct BlockInfo { + struct BlockInfo : public NonCopyable { BlockInfo(const BasicBlock &bb) : bb(bb) {} const BasicBlock &bb; INLINE bool inUpwardUsed(Register reg) const { diff --git a/backend/src/ir/value.cpp b/backend/src/ir/value.cpp index 4de5c40..a4fd89b 100644 --- a/backend/src/ir/value.cpp +++ b/backend/src/ir/value.cpp @@ -49,13 +49,7 @@ namespace ir { /*! All the block definitions map in the functions */ typedef map FunctionDefMap; /*! Performs the double look-up to get the set of defs per register */ - RegDefSet &getDefSet(const BasicBlock *bb, const Register ®) { - auto bbIt = defMap.find(bb); - GBE_ASSERT(bbIt != defMap.end()); - auto defIt = bbIt->second->find(reg); - GBE_ASSERT(defIt != bbIt->second->end() && defIt->second != NULL); - return *defIt->second; - } + RegDefSet &getDefSet(const BasicBlock *bb, const Register ®); /*! Build a UD-chain as the union of the predecessor chains */ void fillUDChain(UDChain &udChain, const BasicBlock &bb, const Register ®); /*! Fast per register definition set allocation */ @@ -82,6 +76,22 @@ namespace ir { this->iterateLiveOut(); } + LiveOutSet::RegDefSet &LiveOutSet::getDefSet(const BasicBlock *bb, + const Register ®) + { + auto bbIt = defMap.find(bb); + GBE_ASSERT(bbIt != defMap.end()); + auto defIt = bbIt->second->find(reg); + GBE_ASSERT(defIt != bbIt->second->end() && defIt->second != NULL); + return *defIt->second; + } + + void LiveOutSet::fillUDChain(UDChain &udChain, + const BasicBlock &bb, + const Register ®) + { + } + void LiveOutSet::initializeInstructionDst(void) { const Function &fn = liveness.getFunction(); @@ -94,8 +104,8 @@ namespace ir { defMap.insert(std::make_pair(&bb, blockDefMap)); // We only consider liveout registers - auto info = this->liveness.getBlockInfo(bb); - auto liveOut = info.liveOut; + const auto &info = this->liveness.getBlockInfo(bb); + const auto &liveOut = info.liveOut; for (auto it = liveOut.begin(); it != liveOut.end(); ++it) { GBE_ASSERT(blockDefMap->find(*it) == blockDefMap->end()); auto regDefSet = this->newRegDefSet(); @@ -126,7 +136,7 @@ namespace ir { // The first block must also transfer the function arguments const BasicBlock &top = fn.getBlock(0); - auto info = this->liveness.getBlockInfo(top); + const auto &info = this->liveness.getBlockInfo(top); auto blockDefMapIt = defMap.find(&top); GBE_ASSERT(blockDefMapIt != defMap.end()); auto blockDefMap = blockDefMapIt->second; diff --git a/backend/src/utest/utest_llvm.cpp b/backend/src/utest/utest_llvm.cpp index 172c73d..d368c35 100644 --- a/backend/src/utest/utest_llvm.cpp +++ b/backend/src/utest/utest_llvm.cpp @@ -84,7 +84,7 @@ runTests: GBE_ASSERT(dummyKernel != NULL); fclose(dummyKernel); - UTEST_EXPECT_SUCCESS(utestLLVM2Gen("loop2.ll")); + UTEST_EXPECT_SUCCESS(utestLLVM2Gen("loop.ll")); //UTEST_EXPECT_SUCCESS(utestLLVM2Gen("function_param.ll")); //UTEST_EXPECT_SUCCESS(utestLLVM2Gen("function.ll")); //UTEST_EXPECT_SUCCESS(utestLLVM2Gen("mad.ll"));