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

Side by Side Diff: src/IceTargetLoweringX8664.cpp

Issue 1343843003: Refactor all instances of `typedef y x` to the C++11 `using x = y` syntax. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 3 months 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/IceTargetLoweringX8632Traits.h ('k') | src/IceTargetLoweringX8664Traits.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 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 // On X8664 ILP32 pointers are 32-bit hence the use of .long 658 // On X8664 ILP32 pointers are 32-bit hence the use of .long
659 for (SizeT I = 0; I < JumpTable->getNumTargets(); ++I) 659 for (SizeT I = 0; I < JumpTable->getNumTargets(); ++I)
660 Str << "\n\t.long\t" << JumpTable->getTarget(I)->getAsmName(); 660 Str << "\n\t.long\t" << JumpTable->getTarget(I)->getAsmName();
661 Str << "\n"; 661 Str << "\n";
662 } 662 }
663 663
664 namespace { 664 namespace {
665 template <typename T> struct PoolTypeConverter {}; 665 template <typename T> struct PoolTypeConverter {};
666 666
667 template <> struct PoolTypeConverter<float> { 667 template <> struct PoolTypeConverter<float> {
668 typedef uint32_t PrimitiveIntType; 668 using PrimitiveIntType = uint32_t;
669 typedef ConstantFloat IceType; 669 using IceType = ConstantFloat;
670 static const Type Ty = IceType_f32; 670 static const Type Ty = IceType_f32;
671 static const char *TypeName; 671 static const char *TypeName;
672 static const char *AsmTag; 672 static const char *AsmTag;
673 static const char *PrintfString; 673 static const char *PrintfString;
674 }; 674 };
675 const char *PoolTypeConverter<float>::TypeName = "float"; 675 const char *PoolTypeConverter<float>::TypeName = "float";
676 const char *PoolTypeConverter<float>::AsmTag = ".long"; 676 const char *PoolTypeConverter<float>::AsmTag = ".long";
677 const char *PoolTypeConverter<float>::PrintfString = "0x%x"; 677 const char *PoolTypeConverter<float>::PrintfString = "0x%x";
678 678
679 template <> struct PoolTypeConverter<double> { 679 template <> struct PoolTypeConverter<double> {
680 typedef uint64_t PrimitiveIntType; 680 using PrimitiveIntType = uint64_t;
681 typedef ConstantDouble IceType; 681 using IceType = ConstantDouble;
682 static const Type Ty = IceType_f64; 682 static const Type Ty = IceType_f64;
683 static const char *TypeName; 683 static const char *TypeName;
684 static const char *AsmTag; 684 static const char *AsmTag;
685 static const char *PrintfString; 685 static const char *PrintfString;
686 }; 686 };
687 const char *PoolTypeConverter<double>::TypeName = "double"; 687 const char *PoolTypeConverter<double>::TypeName = "double";
688 const char *PoolTypeConverter<double>::AsmTag = ".quad"; 688 const char *PoolTypeConverter<double>::AsmTag = ".quad";
689 const char *PoolTypeConverter<double>::PrintfString = "0x%llx"; 689 const char *PoolTypeConverter<double>::PrintfString = "0x%llx";
690 690
691 // Add converter for int type constant pooling 691 // Add converter for int type constant pooling
692 template <> struct PoolTypeConverter<uint32_t> { 692 template <> struct PoolTypeConverter<uint32_t> {
693 typedef uint32_t PrimitiveIntType; 693 using PrimitiveIntType = uint32_t;
694 typedef ConstantInteger32 IceType; 694 using IceType = ConstantInteger32;
695 static const Type Ty = IceType_i32; 695 static const Type Ty = IceType_i32;
696 static const char *TypeName; 696 static const char *TypeName;
697 static const char *AsmTag; 697 static const char *AsmTag;
698 static const char *PrintfString; 698 static const char *PrintfString;
699 }; 699 };
700 const char *PoolTypeConverter<uint32_t>::TypeName = "i32"; 700 const char *PoolTypeConverter<uint32_t>::TypeName = "i32";
701 const char *PoolTypeConverter<uint32_t>::AsmTag = ".long"; 701 const char *PoolTypeConverter<uint32_t>::AsmTag = ".long";
702 const char *PoolTypeConverter<uint32_t>::PrintfString = "0x%x"; 702 const char *PoolTypeConverter<uint32_t>::PrintfString = "0x%x";
703 703
704 // Add converter for int type constant pooling 704 // Add converter for int type constant pooling
705 template <> struct PoolTypeConverter<uint16_t> { 705 template <> struct PoolTypeConverter<uint16_t> {
706 typedef uint32_t PrimitiveIntType; 706 using PrimitiveIntType = uint32_t;
707 typedef ConstantInteger32 IceType; 707 using IceType = ConstantInteger32;
708 static const Type Ty = IceType_i16; 708 static const Type Ty = IceType_i16;
709 static const char *TypeName; 709 static const char *TypeName;
710 static const char *AsmTag; 710 static const char *AsmTag;
711 static const char *PrintfString; 711 static const char *PrintfString;
712 }; 712 };
713 const char *PoolTypeConverter<uint16_t>::TypeName = "i16"; 713 const char *PoolTypeConverter<uint16_t>::TypeName = "i16";
714 const char *PoolTypeConverter<uint16_t>::AsmTag = ".short"; 714 const char *PoolTypeConverter<uint16_t>::AsmTag = ".short";
715 const char *PoolTypeConverter<uint16_t>::PrintfString = "0x%x"; 715 const char *PoolTypeConverter<uint16_t>::PrintfString = "0x%x";
716 716
717 // Add converter for int type constant pooling 717 // Add converter for int type constant pooling
718 template <> struct PoolTypeConverter<uint8_t> { 718 template <> struct PoolTypeConverter<uint8_t> {
719 typedef uint32_t PrimitiveIntType; 719 using PrimitiveIntType = uint32_t;
720 typedef ConstantInteger32 IceType; 720 using IceType = ConstantInteger32;
721 static const Type Ty = IceType_i8; 721 static const Type Ty = IceType_i8;
722 static const char *TypeName; 722 static const char *TypeName;
723 static const char *AsmTag; 723 static const char *AsmTag;
724 static const char *PrintfString; 724 static const char *PrintfString;
725 }; 725 };
726 const char *PoolTypeConverter<uint8_t>::TypeName = "i8"; 726 const char *PoolTypeConverter<uint8_t>::TypeName = "i8";
727 const char *PoolTypeConverter<uint8_t>::AsmTag = ".byte"; 727 const char *PoolTypeConverter<uint8_t>::AsmTag = ".byte";
728 const char *PoolTypeConverter<uint8_t>::PrintfString = "0x%x"; 728 const char *PoolTypeConverter<uint8_t>::PrintfString = "0x%x";
729 } // end of anonymous namespace 729 } // end of anonymous namespace
730 730
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 // entries in case the high-level table has extra entries. 956 // entries in case the high-level table has extra entries.
957 #define X(tag, sizeLog2, align, elts, elty, str) \ 957 #define X(tag, sizeLog2, align, elts, elty, str) \
958 static_assert(_table1_##tag == _table2_##tag, \ 958 static_assert(_table1_##tag == _table2_##tag, \
959 "Inconsistency between ICETYPEX8664_TABLE and ICETYPE_TABLE"); 959 "Inconsistency between ICETYPEX8664_TABLE and ICETYPE_TABLE");
960 ICETYPE_TABLE 960 ICETYPE_TABLE
961 #undef X 961 #undef X
962 } // end of namespace dummy3 962 } // end of namespace dummy3
963 } // end of anonymous namespace 963 } // end of anonymous namespace
964 964
965 } // end of namespace Ice 965 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX8632Traits.h ('k') | src/IceTargetLoweringX8664Traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698