Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Side by Side Diff: src/IceTargetLoweringX8664.cpp

Issue 1516753008: Subzero: Use "auto" per (unwritten) auto coding style. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: More <cast> instances without the llvm:: prefix Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | src/IceTargetLoweringX86BaseImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceTargetLoweringX8664.cpp - x86-64 lowering -----------===// 1 //===- subzero/src/IceTargetLoweringX8664.cpp - x86-64 lowering -----------===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 Operand::OperandKind K = (*Pool.begin())->getKind(); 776 Operand::OperandKind K = (*Pool.begin())->getKind();
777 RandomNumberGenerator RNG(Ctx->getFlags().getRandomSeed(), 777 RandomNumberGenerator RNG(Ctx->getFlags().getRandomSeed(),
778 RPE_PooledConstantReordering, K); 778 RPE_PooledConstantReordering, K);
779 RandomShuffle(Pool.begin(), Pool.end(), 779 RandomShuffle(Pool.begin(), Pool.end(),
780 [&RNG](uint64_t N) { return (uint32_t)RNG.next(N); }); 780 [&RNG](uint64_t N) { return (uint32_t)RNG.next(N); });
781 } 781 }
782 782
783 for (Constant *C : Pool) { 783 for (Constant *C : Pool) {
784 if (!C->getShouldBePooled()) 784 if (!C->getShouldBePooled())
785 continue; 785 continue;
786 typename T::IceType *Const = llvm::cast<typename T::IceType>(C); 786 auto *Const = llvm::cast<typename T::IceType>(C);
787 typename T::IceType::PrimType Value = Const->getValue(); 787 typename T::IceType::PrimType Value = Const->getValue();
788 // Use memcpy() to copy bits from Value into RawValue in a way that avoids 788 // Use memcpy() to copy bits from Value into RawValue in a way that avoids
789 // breaking strict-aliasing rules. 789 // breaking strict-aliasing rules.
790 typename T::PrimitiveIntType RawValue; 790 typename T::PrimitiveIntType RawValue;
791 memcpy(&RawValue, &Value, sizeof(Value)); 791 memcpy(&RawValue, &Value, sizeof(Value));
792 char buf[30]; 792 char buf[30];
793 int CharsPrinted = 793 int CharsPrinted =
794 snprintf(buf, llvm::array_lengthof(buf), T::PrintfString, RawValue); 794 snprintf(buf, llvm::array_lengthof(buf), T::PrintfString, RawValue);
795 assert(CharsPrinted >= 0 && 795 assert(CharsPrinted >= 0 &&
796 (size_t)CharsPrinted < llvm::array_lengthof(buf)); 796 (size_t)CharsPrinted < llvm::array_lengthof(buf));
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 // case the high-level table has extra entries. 979 // case the high-level table has extra entries.
980 #define X(tag, sizeLog2, align, elts, elty, str) \ 980 #define X(tag, sizeLog2, align, elts, elty, str) \
981 static_assert(_table1_##tag == _table2_##tag, \ 981 static_assert(_table1_##tag == _table2_##tag, \
982 "Inconsistency between ICETYPEX8664_TABLE and ICETYPE_TABLE"); 982 "Inconsistency between ICETYPEX8664_TABLE and ICETYPE_TABLE");
983 ICETYPE_TABLE 983 ICETYPE_TABLE
984 #undef X 984 #undef X
985 } // end of namespace dummy3 985 } // end of namespace dummy3
986 } // end of anonymous namespace 986 } // end of anonymous namespace
987 987
988 } // end of namespace Ice 988 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | src/IceTargetLoweringX86BaseImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698