llvm.org GIT mirror llvm / 47d60da
Make helper functions static. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265653 91177308-0d34-0410-b5e6-96231b3b80d8 Benjamin Kramer 4 years ago
2 changed file(s) with 11 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
4848
4949 // Field printing
5050
51 raw_ostream& printName(raw_ostream& OS, StringRef Name) {
51 static raw_ostream &printName(raw_ostream &OS, StringRef Name) {
5252 return OS << Name << " = ";
5353 }
5454
5555 template
56 void printField(StringRef Name,
57 const amd_kernel_code_t& C,
58 raw_ostream& OS) {
56 static void printField(StringRef Name, const amd_kernel_code_t &C,
57 raw_ostream &OS) {
5958 printName(OS, Name) << (int)(C.*ptr);
6059 }
6160
62 template
63 void printBitField(StringRef Name,
64 const amd_kernel_code_t& c,
65 raw_ostream& OS) {
61 template
62 static void printBitField(StringRef Name, const amd_kernel_code_t &c,
63 raw_ostream &OS) {
6664 const auto Mask = (static_cast(1) << width) - 1;
6765 printName(OS, Name) << (int)((c.*ptr >> shift) & Mask);
6866 }
116114 }
117115
118116 template
119 bool parseField(amd_kernel_code_t& C,
120 MCAsmLexer& Lexer,
121 raw_ostream& Err) {
117 static bool parseField(amd_kernel_code_t &C, MCAsmLexer &Lexer,
118 raw_ostream &Err) {
122119 if (!expectEqualInt(Lexer, Err))
123120 return false;
124121 C.*ptr = (T)Lexer.getTok().getIntVal();
126123 }
127124
128125 template
129 bool parseBitField(amd_kernel_code_t& C,
130 MCAsmLexer& Lexer,
131 raw_ostream& Err) {
126 static bool parseBitField(amd_kernel_code_t &C, MCAsmLexer &Lexer,
127 raw_ostream &Err) {
132128 if (!expectEqualInt(Lexer, Err))
133129 return false;
134130 const uint64_t Mask = ((UINT64_C(1) << width) - 1) << shift;
245245
246246 // Do not instrument known races/"benign races" that come from compiler
247247 // instrumentatin. The user has no way of suppressing them.
248 bool shouldInstrumentReadWriteFromAddress(Value *Addr) {
248 static bool shouldInstrumentReadWriteFromAddress(Value *Addr) {
249249 // Peel off GEPs and BitCasts.
250250 Addr = Addr->stripInBoundsOffsets();
251251