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

Side by Side Diff: src/IceTypes.cpp

Issue 413393005: Subzero: Make Ice::Ostream a typedef for llvm::raw_ostream. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 5 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/IceTypes.h ('k') | no next file » | 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/IceTypes.cpp - Primitive type properties ---------------===// 1 //===- subzero/src/IceTypes.cpp - Primitive type properties ---------------===//
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 // This file defines a few attributes of Subzero primitive types. 10 // This file defines a few attributes of Subzero primitive types.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 Type ElementType = IceType_void; 74 Type ElementType = IceType_void;
75 size_t Index = static_cast<size_t>(Ty); 75 size_t Index = static_cast<size_t>(Ty);
76 if (Index < TypeAttributesSize) { 76 if (Index < TypeAttributesSize) {
77 ElementType = TypeAttributes[Index].TypeElementType; 77 ElementType = TypeAttributes[Index].TypeElementType;
78 } else { 78 } else {
79 llvm_unreachable("Invalid type for typeElementType()"); 79 llvm_unreachable("Invalid type for typeElementType()");
80 } 80 }
81 return ElementType; 81 return ElementType;
82 } 82 }
83 83
84 // ======================== Dump routines ======================== // 84 const char *typeString(Type Ty) {
85
86 template <> Ostream &operator<<(Ostream &Str, const Type &Ty) {
87 size_t Index = static_cast<size_t>(Ty); 85 size_t Index = static_cast<size_t>(Ty);
88 if (Index < TypeAttributesSize) { 86 if (Index < TypeAttributesSize) {
89 Str << TypeAttributes[Index].DisplayString; 87 return TypeAttributes[Index].DisplayString;
90 } else {
91 Str << "???";
92 llvm_unreachable("Invalid type for printing");
93 } 88 }
94 89 llvm_unreachable("Invalid type for typeString");
95 return Str; 90 return "???";
96 } 91 }
97 92
98 } // end of namespace Ice 93 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTypes.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698