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

Side by Side Diff: src/IceDefs.h

Issue 837553009: Make fixups reference any constant (allow const float/double pool literals). (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: go back to one arenaallocator type alias Created 5 years, 11 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/IceCfg.cpp ('k') | src/IceELFObjectWriter.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/IceDefs.h - Common Subzero declaraions -------*- C++ -*-===// 1 //===- subzero/src/IceDefs.h - Common Subzero declaraions -------*- 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 declares various useful types and classes that have 10 // This file declares various useful types and classes that have
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 class InstPhi; 51 class InstPhi;
52 class InstTarget; 52 class InstTarget;
53 class LiveRange; 53 class LiveRange;
54 class Liveness; 54 class Liveness;
55 class Operand; 55 class Operand;
56 class TargetLowering; 56 class TargetLowering;
57 class Variable; 57 class Variable;
58 class VariableDeclaration; 58 class VariableDeclaration;
59 class VariablesMetadata; 59 class VariablesMetadata;
60 60
61 typedef llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 1024 * 1024> 61 template <size_t SlabSize = 1024 * 1024>
62 ArenaAllocator; 62 using ArenaAllocator =
63 llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, SlabSize>;
63 64
64 ArenaAllocator *getCurrentCfgAllocator(); 65 ArenaAllocator<> *getCurrentCfgAllocator();
65 66
66 template <typename T> struct CfgLocalAllocator { 67 template <typename T> struct CfgLocalAllocator {
67 using value_type = T; 68 using value_type = T;
68 CfgLocalAllocator() = default; 69 CfgLocalAllocator() = default;
69 template <class U> CfgLocalAllocator(const CfgLocalAllocator<U> &) {} 70 template <class U> CfgLocalAllocator(const CfgLocalAllocator<U> &) {}
70 T *allocate(std::size_t Num) { 71 T *allocate(std::size_t Num) {
71 return getCurrentCfgAllocator()->Allocate<T>(Num); 72 return getCurrentCfgAllocator()->Allocate<T>(Num);
72 } 73 }
73 void deallocate(T *, std::size_t) {} 74 void deallocate(T *, std::size_t) {}
74 }; 75 };
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 return llvm::make_range(Container.rbegin(), Container.rend()); 166 return llvm::make_range(Container.rbegin(), Container.rend());
166 } 167 }
167 template <typename T> 168 template <typename T>
168 llvm::iterator_range<typename T::reverse_iterator> reverse_range(T &Container) { 169 llvm::iterator_range<typename T::reverse_iterator> reverse_range(T &Container) {
169 return llvm::make_range(Container.rbegin(), Container.rend()); 170 return llvm::make_range(Container.rbegin(), Container.rend());
170 } 171 }
171 172
172 } // end of namespace Ice 173 } // end of namespace Ice
173 174
174 #endif // SUBZERO_SRC_ICEDEFS_H 175 #endif // SUBZERO_SRC_ICEDEFS_H
OLDNEW
« no previous file with comments | « src/IceCfg.cpp ('k') | src/IceELFObjectWriter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698