Make some helpers static or move into the llvm namespace.
authorBenjamin Kramer <benny.kra@googlemail.com>
Wed, 3 Sep 2014 21:04:12 +0000 (21:04 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Wed, 3 Sep 2014 21:04:12 +0000 (21:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217077 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ProfileData/CoverageMappingWriter.cpp
lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp
lib/Target/Mips/MipsOptionRecord.h
lib/Transforms/Scalar/LoopUnrollPass.cpp

index f5e6ab4638053a8d9c15051e9bcae32421754a2d..15d3cd3d48d0d2a086fad4754fdb854a36ab346c 100644 (file)
@@ -103,7 +103,8 @@ static unsigned countFileIDs(ArrayRef<CounterMappingRegion> Regions,
 ///     A counter with kind Counter::Expression and an expression
 ///     with kind CounterExpression::Add
 /// Remaining bits - Counter/Expression ID.
-unsigned encodeCounter(ArrayRef<CounterExpression> Expressions, Counter C) {
+static unsigned encodeCounter(ArrayRef<CounterExpression> Expressions,
+                              Counter C) {
   unsigned Tag = unsigned(C.getKind());
   if (C.isExpression())
     Tag += Expressions[C.getExpressionID()].Kind;
index 803ab85657dcd553fdceb93e5345f154a2796b32..7a984f5ba2322e71ed8dea362e85646c41a56dcf 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "MipsELFStreamer.h"
 #include "llvm/MC/MCInst.h"
+using namespace llvm;
 
 void MipsELFStreamer::EmitInstruction(const MCInst &Inst,
                                       const MCSubtargetInfo &STI) {
index bc56aa4ea6c9a7cf40a401c502ac7a4c4b3e7465..f82544ae43aed9fde526f07802e15a0ad4a0b7ea 100644 (file)
 #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
index 3f12209e144f034870f332cb55d44230cac61a34..22dd65c7cf69094b21d05c3797d5d0e14ac97f71 100644 (file)
@@ -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;