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

Side by Side Diff: src/IceTypeConverter.h

Issue 619893002: Subzero: Auto-awesome iterators. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Use AsmCodeByte instead of uint8_t Created 6 years, 2 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/IceTranslator.cpp ('k') | src/PNaClTranslator.cpp » ('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/IceTypeConverter.h - Convert ICE/LLVM Types --*- C++ -*-===// 1 //===- subzero/src/IceTypeConverter.h - Convert ICE/LLVM Types --*- C++ -*-===//
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 how to convert LLVM types to ICE types, and ICE types 10 // This file defines how to convert LLVM types to ICE types, and ICE types
(...skipping 26 matching lines...) Expand all
37 37
38 /// Returns the LLVM type for the corresponding ICE type Ty. 38 /// Returns the LLVM type for the corresponding ICE type Ty.
39 llvm::Type *convertToLLVMType(Type Ty) const { 39 llvm::Type *convertToLLVMType(Type Ty) const {
40 // Note: We use "at" here in case Ty wasn't registered. 40 // Note: We use "at" here in case Ty wasn't registered.
41 return LLVMTypes.at(Ty); 41 return LLVMTypes.at(Ty);
42 } 42 }
43 43
44 /// Converts LLVM type LLVMTy to an ICE type. Returns 44 /// Converts LLVM type LLVMTy to an ICE type. Returns
45 /// Ice::IceType_NUM if unable to convert. 45 /// Ice::IceType_NUM if unable to convert.
46 Type convertToIceType(llvm::Type *LLVMTy) const { 46 Type convertToIceType(llvm::Type *LLVMTy) const {
47 std::map<llvm::Type *, Type>::const_iterator Pos = LLVM2IceMap.find(LLVMTy); 47 auto Pos = LLVM2IceMap.find(LLVMTy);
48 if (Pos == LLVM2IceMap.end()) 48 if (Pos == LLVM2IceMap.end())
49 return convertToIceTypeOther(LLVMTy); 49 return convertToIceTypeOther(LLVMTy);
50 return Pos->second; 50 return Pos->second;
51 } 51 }
52 52
53 /// Returns ICE model of pointer type. 53 /// Returns ICE model of pointer type.
54 Type getIcePointerType() const { return IceType_i32; } 54 Type getIcePointerType() const { return IceType_i32; }
55 55
56 /// Returns LLVM integer type with specified number of bits. Returns 56 /// Returns LLVM integer type with specified number of bits. Returns
57 /// NULL if not a valid PNaCl integer type. 57 /// NULL if not a valid PNaCl integer type.
(...skipping 12 matching lines...) Expand all
70 // Add LLVM/ICE pair to internal tables. 70 // Add LLVM/ICE pair to internal tables.
71 void AddLLVMType(Type Ty, llvm::Type *LLVMTy); 71 void AddLLVMType(Type Ty, llvm::Type *LLVMTy);
72 72
73 // Converts types not in LLVM2IceMap. 73 // Converts types not in LLVM2IceMap.
74 Type convertToIceTypeOther(llvm::Type *LLVMTy) const; 74 Type convertToIceTypeOther(llvm::Type *LLVMTy) const;
75 }; 75 };
76 76
77 } // end of Ice namespace. 77 } // end of Ice namespace.
78 78
79 #endif // SUBZERO_SRC_ICETYPECONVERTER_H 79 #endif // SUBZERO_SRC_ICETYPECONVERTER_H
OLDNEW
« no previous file with comments | « src/IceTranslator.cpp ('k') | src/PNaClTranslator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698