From f0644b42a7947d5a4a57682b10edce631a80f36b Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Wed, 3 Sep 2014 21:04:12 +0000 Subject: [PATCH] Make some helpers static or move into the llvm namespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217077 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ProfileData/CoverageMappingWriter.cpp | 3 ++- lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp | 1 + lib/Target/Mips/MipsOptionRecord.h | 6 ++---- lib/Transforms/Scalar/LoopUnrollPass.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/ProfileData/CoverageMappingWriter.cpp b/lib/ProfileData/CoverageMappingWriter.cpp index f5e6ab46380..15d3cd3d48d 100644 --- a/lib/ProfileData/CoverageMappingWriter.cpp +++ b/lib/ProfileData/CoverageMappingWriter.cpp @@ -103,7 +103,8 @@ static unsigned countFileIDs(ArrayRef Regions, /// A counter with kind Counter::Expression and an expression /// with kind CounterExpression::Add /// Remaining bits - Counter/Expression ID. -unsigned encodeCounter(ArrayRef Expressions, Counter C) { +static unsigned encodeCounter(ArrayRef Expressions, + Counter C) { unsigned Tag = unsigned(C.getKind()); if (C.isExpression()) Tag += Expressions[C.getExpressionID()].Kind; diff --git a/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp b/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp index 803ab85657d..7a984f5ba23 100644 --- a/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp +++ b/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp @@ -9,6 +9,7 @@ #include "MipsELFStreamer.h" #include "llvm/MC/MCInst.h" +using namespace llvm; void MipsELFStreamer::EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) { diff --git a/lib/Target/Mips/MipsOptionRecord.h b/lib/Target/Mips/MipsOptionRecord.h index bc56aa4ea6c..f82544ae43a 100644 --- a/lib/Target/Mips/MipsOptionRecord.h +++ b/lib/Target/Mips/MipsOptionRecord.h @@ -24,12 +24,9 @@ #include "llvm/MC/MCContext.h" #include "llvm/MC/MCRegisterInfo.h" -using namespace llvm; - namespace llvm { class MipsELFStreamer; class MCSubtargetInfo; -} class MipsOptionRecord { public: @@ -58,7 +55,7 @@ public: } ~MipsRegInfoRecord() {} - void EmitMipsOptionRecord(); + void EmitMipsOptionRecord() override; void SetPhysRegUsed(unsigned Reg, const MCRegisterInfo *MCRegInfo); private: @@ -77,4 +74,5 @@ private: uint32_t ri_cprmask[4]; int64_t ri_gp_value; }; +} // namespace llvm #endif diff --git a/lib/Transforms/Scalar/LoopUnrollPass.cpp b/lib/Transforms/Scalar/LoopUnrollPass.cpp index 3f12209e144..22dd65c7cf6 100644 --- a/lib/Transforms/Scalar/LoopUnrollPass.cpp +++ b/lib/Transforms/Scalar/LoopUnrollPass.cpp @@ -221,7 +221,7 @@ static unsigned ApproximateLoopSize(const Loop *L, unsigned &NumCalls, // Returns the loop hint metadata node with the given name (for example, // "llvm.loop.unroll.count"). If no such metadata node exists, then nullptr is // returned. -const MDNode *GetUnrollMetadata(const Loop *L, StringRef Name) { +static const MDNode *GetUnrollMetadata(const Loop *L, StringRef Name) { MDNode *LoopID = L->getLoopID(); if (!LoopID) return nullptr;