[llvm] r287462 - Give some helper classes/functions internal linkage. NFC.

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 19 12:44:26 PST 2016


Author: d0k
Date: Sat Nov 19 14:44:26 2016
New Revision: 287462

URL: http://llvm.org/viewvc/llvm-project?rev=287462&view=rev
Log:
Give some helper classes/functions internal linkage. NFC.

Modified:
    llvm/trunk/lib/LTO/LTO.cpp
    llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp
    llvm/trunk/lib/Target/SystemZ/SystemZHazardRecognizer.cpp
    llvm/trunk/lib/Transforms/Utils/LibCallsShrinkWrap.cpp

Modified: llvm/trunk/lib/LTO/LTO.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTO.cpp?rev=287462&r1=287461&r2=287462&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/LTO.cpp (original)
+++ llvm/trunk/lib/LTO/LTO.cpp Sat Nov 19 14:44:26 2016
@@ -530,6 +530,7 @@ public:
   virtual Error wait() = 0;
 };
 
+namespace {
 class InProcessThinBackend : public ThinBackendProc {
   ThreadPool BackendThreadPool;
   AddStreamFn AddStream;
@@ -629,6 +630,7 @@ public:
       return Error::success();
   }
 };
+} // end anonymous namespace
 
 ThinBackend lto::createInProcessThinBackend(unsigned ParallelismLevel) {
   return [=](Config &Conf, ModuleSummaryIndex &CombinedIndex,
@@ -660,6 +662,7 @@ std::string lto::getThinLTOOutputFile(co
   return NewPath.str();
 }
 
+namespace {
 class WriteIndexesThinBackend : public ThinBackendProc {
   std::string OldPrefix, NewPrefix;
   bool ShouldEmitImportsFiles;
@@ -717,6 +720,7 @@ public:
 
   Error wait() override { return Error::success(); }
 };
+} // end anonymous namespace
 
 ThinBackend lto::createWriteIndexesThinBackend(std::string OldPrefix,
                                                std::string NewPrefix,

Modified: llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp?rev=287462&r1=287461&r2=287462&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp Sat Nov 19 14:44:26 2016
@@ -52,9 +52,9 @@ AArch64ELFObjectWriter::~AArch64ELFObjec
         "supported (LP64 eqv: " #lp64rtype ")"
 
 // assumes IsILP32 is true
-bool isNonILP32reloc(const MCFixup &Fixup, AArch64MCExpr::VariantKind RefKind,
-                     MCContext &Ctx)
-{
+static bool isNonILP32reloc(const MCFixup &Fixup,
+                            AArch64MCExpr::VariantKind RefKind,
+                            MCContext &Ctx) {
   if ((unsigned)Fixup.getKind() != AArch64::fixup_aarch64_movw)
     return false;
   switch(RefKind) {

Modified: llvm/trunk/lib/Target/SystemZ/SystemZHazardRecognizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZHazardRecognizer.cpp?rev=287462&r1=287461&r2=287462&view=diff
==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZHazardRecognizer.cpp (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZHazardRecognizer.cpp Sat Nov 19 14:44:26 2016
@@ -31,10 +31,10 @@ using namespace llvm;
 // This is the limit of processor resource usage at which the
 // scheduler should try to look for other instructions (not using the
 // critical resource).
-cl::opt<int> ProcResCostLim("procres-cost-lim", cl::Hidden,
-                            cl::desc("The OOO window for processor "
-                                     "resources during scheduling."),
-                            cl::init(8));
+static cl::opt<int> ProcResCostLim("procres-cost-lim", cl::Hidden,
+                                   cl::desc("The OOO window for processor "
+                                            "resources during scheduling."),
+                                   cl::init(8));
 
 SystemZHazardRecognizer::
 SystemZHazardRecognizer(const MachineSchedContext *C) : DAG(nullptr),

Modified: llvm/trunk/lib/Transforms/Utils/LibCallsShrinkWrap.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LibCallsShrinkWrap.cpp?rev=287462&r1=287461&r2=287462&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LibCallsShrinkWrap.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LibCallsShrinkWrap.cpp Sat Nov 19 14:44:26 2016
@@ -79,6 +79,7 @@ INITIALIZE_PASS_DEPENDENCY(TargetLibrary
 INITIALIZE_PASS_END(LibCallsShrinkWrapLegacyPass, "libcalls-shrinkwrap",
                     "Conditionally eliminate dead library calls", false, false)
 
+namespace {
 class LibCallsShrinkWrap : public InstVisitor<LibCallsShrinkWrap> {
 public:
   LibCallsShrinkWrap(const TargetLibraryInfo &TLI) : TLI(TLI), Changed(false){};
@@ -136,6 +137,7 @@ private:
   SmallVector<CallInst *, 16> WorkList;
   bool Changed;
 };
+} // end anonymous namespace
 
 // Perform the transformation to calls with errno set by domain error.
 bool LibCallsShrinkWrap::performCallDomainErrorOnly(CallInst *CI,
@@ -534,7 +536,7 @@ void LibCallsShrinkWrapLegacyPass::getAn
   AU.addRequired<TargetLibraryInfoWrapperPass>();
 }
 
-bool runImpl(Function &F, const TargetLibraryInfo &TLI) {
+static bool runImpl(Function &F, const TargetLibraryInfo &TLI) {
   if (F.hasFnAttribute(Attribute::OptimizeForSize))
     return false;
   LibCallsShrinkWrap CCDCE(TLI);




More information about the llvm-commits mailing list