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

Side by Side Diff: src/IceGlobalContext.h

Issue 460233002: Subzero: Randomize immediates by constant blinding or pooling. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Comments round 1 Created 6 years, 4 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 | « no previous file | src/IceGlobalContext.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/IceGlobalContext.h - Global context defs -----*- C++ -*-===// 1 //===- subzero/src/IceGlobalContext.h - Global context defs -----*- 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 aspects of the compilation that persist across 10 // This file declares aspects of the compilation that persist across
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 Constant *getConstantInt(Type Ty, uint64_t ConstantInt64); 78 Constant *getConstantInt(Type Ty, uint64_t ConstantInt64);
79 Constant *getConstantFloat(float Value); 79 Constant *getConstantFloat(float Value);
80 Constant *getConstantDouble(double Value); 80 Constant *getConstantDouble(double Value);
81 // Returns a symbolic constant. 81 // Returns a symbolic constant.
82 Constant *getConstantSym(Type Ty, int64_t Offset, const IceString &Name = "", 82 Constant *getConstantSym(Type Ty, int64_t Offset, const IceString &Name = "",
83 bool SuppressMangling = false); 83 bool SuppressMangling = false);
84 // Returns an undef. 84 // Returns an undef.
85 Constant *getConstantUndef(Type Ty); 85 Constant *getConstantUndef(Type Ty);
86 // Returns a zero value. 86 // Returns a zero value.
87 Constant *getConstantZero(Type Ty); 87 Constant *getConstantZero(Type Ty);
88
89 // Adds the given constant to the list of pooled immediates.
90 void addConstantPooledImmediate(const IceString &Name, Constant *Immediate);
91
88 // getConstantPool() returns a copy of the constant pool for 92 // getConstantPool() returns a copy of the constant pool for
89 // constants of a given type. 93 // constants of a given type.
90 ConstantList getConstantPool(Type Ty) const; 94 ConstantList getConstantPool(Type Ty) const;
91 95
96 // getImmediatePool() returns the list of pooled immediates.
97 ConstantList getImmediatePool() const;
98
92 const ClFlags &getFlags() const { return Flags; } 99 const ClFlags &getFlags() const { return Flags; }
93 100
94 // Allocate data of type T using the global allocator. 101 // Allocate data of type T using the global allocator.
95 template <typename T> T *allocate() { return Allocator.Allocate<T>(); } 102 template <typename T> T *allocate() { return Allocator.Allocate<T>(); }
96 103
97 const Intrinsics &getIntrinsicsInfo() const { return IntrinsicsInfo; } 104 const Intrinsics &getIntrinsicsInfo() const { return IntrinsicsInfo; }
98 105
99 // TODO(wala,stichnot): Make the RNG play nicely with multithreaded 106 // TODO(wala,stichnot): Make the RNG play nicely with multithreaded
100 // translation. 107 // translation.
101 RandomNumberGenerator &getRNG() { return RNG; } 108 RandomNumberGenerator &getRNG() { return RNG; }
(...skipping 16 matching lines...) Expand all
118 GlobalContext &operator=(const GlobalContext &) LLVM_DELETED_FUNCTION; 125 GlobalContext &operator=(const GlobalContext &) LLVM_DELETED_FUNCTION;
119 126
120 // Private helpers for mangleName() 127 // Private helpers for mangleName()
121 typedef llvm::SmallVector<char, 32> ManglerVector; 128 typedef llvm::SmallVector<char, 32> ManglerVector;
122 void incrementSubstitutions(ManglerVector &OldName) const; 129 void incrementSubstitutions(ManglerVector &OldName) const;
123 }; 130 };
124 131
125 } // end of namespace Ice 132 } // end of namespace Ice
126 133
127 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H 134 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H
OLDNEW
« no previous file with comments | « no previous file | src/IceGlobalContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698