From 4fb78518f1f64e4e2bb853647788164ecaeac1e7 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Thu, 7 Apr 2016 10:10:09 +0000 Subject: [PATCH] Make helper functions static. NFC. llvm-svn: 265653 --- .../Target/AMDGPU/Utils/AMDKernelCodeTUtils.cpp | 24 +++++++++------------- .../Transforms/Instrumentation/ThreadSanitizer.cpp | 2 +- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/Utils/AMDKernelCodeTUtils.cpp b/llvm/lib/Target/AMDGPU/Utils/AMDKernelCodeTUtils.cpp index 41d758f..99f56bb 100644 --- a/llvm/lib/Target/AMDGPU/Utils/AMDKernelCodeTUtils.cpp +++ b/llvm/lib/Target/AMDGPU/Utils/AMDKernelCodeTUtils.cpp @@ -49,21 +49,19 @@ static StringRef get_amd_kernel_code_t_FieldName(int index) { // Field printing -raw_ostream& printName(raw_ostream& OS, StringRef Name) { +static raw_ostream &printName(raw_ostream &OS, StringRef Name) { return OS << Name << " = "; } template -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 -void printBitField(StringRef Name, - const amd_kernel_code_t& c, - raw_ostream& OS) { +template +static void printBitField(StringRef Name, const amd_kernel_code_t &c, + raw_ostream &OS) { const auto Mask = (static_cast(1) << width) - 1; printName(OS, Name) << (int)((c.*ptr >> shift) & Mask); } @@ -117,9 +115,8 @@ static bool expectEqualInt(MCAsmLexer& Lexer, raw_ostream& Err) { } template -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 -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; diff --git a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp index dad42a8..48bf1c3 100644 --- a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp @@ -246,7 +246,7 @@ static bool isVtableAccess(Instruction *I) { // 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(); -- 2.7.4