[llvm] r265653 - Make helper functions static. NFC.
Benjamin Kramer via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 7 03:10:09 PDT 2016
Author: d0k
Date: Thu Apr 7 05:10:09 2016
New Revision: 265653
URL: http://llvm.org/viewvc/llvm-project?rev=265653&view=rev
Log:
Make helper functions static. NFC.
Modified:
llvm/trunk/lib/Target/AMDGPU/Utils/AMDKernelCodeTUtils.cpp
llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
Modified: llvm/trunk/lib/Target/AMDGPU/Utils/AMDKernelCodeTUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/Utils/AMDKernelCodeTUtils.cpp?rev=265653&r1=265652&r2=265653&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/Utils/AMDKernelCodeTUtils.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/Utils/AMDKernelCodeTUtils.cpp Thu Apr 7 05:10:09 2016
@@ -49,21 +49,19 @@ static StringRef get_amd_kernel_code_t_F
// Field printing
-raw_ostream& printName(raw_ostream& OS, StringRef Name) {
+static raw_ostream &printName(raw_ostream &OS, StringRef Name) {
return OS << Name << " = ";
}
template <typename T, T amd_kernel_code_t::*ptr>
-void printField(StringRef Name,
- const amd_kernel_code_t& C,
- raw_ostream& OS) {
+static void printField(StringRef Name, const amd_kernel_code_t &C,
+ raw_ostream &OS) {
printName(OS, Name) << (int)(C.*ptr);
}
-template <typename T, T amd_kernel_code_t::*ptr, int shift, int width=1>
-void printBitField(StringRef Name,
- const amd_kernel_code_t& c,
- raw_ostream& OS) {
+template <typename T, T amd_kernel_code_t::*ptr, int shift, int width = 1>
+static void printBitField(StringRef Name, const amd_kernel_code_t &c,
+ raw_ostream &OS) {
const auto Mask = (static_cast<T>(1) << width) - 1;
printName(OS, Name) << (int)((c.*ptr >> shift) & Mask);
}
@@ -117,9 +115,8 @@ static bool expectEqualInt(MCAsmLexer& L
}
template <typename T, T amd_kernel_code_t::*ptr>
-bool parseField(amd_kernel_code_t& C,
- MCAsmLexer& Lexer,
- raw_ostream& Err) {
+static bool parseField(amd_kernel_code_t &C, MCAsmLexer &Lexer,
+ raw_ostream &Err) {
if (!expectEqualInt(Lexer, Err))
return false;
C.*ptr = (T)Lexer.getTok().getIntVal();
@@ -127,9 +124,8 @@ bool parseField(amd_kernel_code_t& C,
}
template <typename T, T amd_kernel_code_t::*ptr, int shift, int width = 1>
-bool parseBitField(amd_kernel_code_t& C,
- MCAsmLexer& Lexer,
- raw_ostream& Err) {
+static bool parseBitField(amd_kernel_code_t &C, MCAsmLexer &Lexer,
+ raw_ostream &Err) {
if (!expectEqualInt(Lexer, Err))
return false;
const uint64_t Mask = ((UINT64_C(1) << width) - 1) << shift;
Modified: llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp?rev=265653&r1=265652&r2=265653&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp Thu Apr 7 05:10:09 2016
@@ -246,7 +246,7 @@ static bool isVtableAccess(Instruction *
// Do not instrument known races/"benign races" that come from compiler
// instrumentatin. The user has no way of suppressing them.
-bool shouldInstrumentReadWriteFromAddress(Value *Addr) {
+static bool shouldInstrumentReadWriteFromAddress(Value *Addr) {
// Peel off GEPs and BitCasts.
Addr = Addr->stripInBoundsOffsets();
More information about the llvm-commits
mailing list