]> granicus.if.org Git - llvm/commitdiff
Give some helper classes/functions internal linkage. NFC.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 19 Nov 2016 20:44:26 +0000 (20:44 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 19 Nov 2016 20:44:26 +0000 (20:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287462 91177308-0d34-0410-b5e6-96231b3b80d8

lib/LTO/LTO.cpp
lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp
lib/Target/SystemZ/SystemZHazardRecognizer.cpp
lib/Transforms/Utils/LibCallsShrinkWrap.cpp

index f867582454d1a157228c6e4bfab416efcc8c8612..b5339cd61df1b296591fb93e80693c30428695ea 100644 (file)
@@ -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(const std::string &Path,
   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,
index 6839e775c5290f899a0da254261d78ca33782b7f..a1edb3cef46ac752af2453b0e67479b01465a884 100644 (file)
@@ -52,9 +52,9 @@ AArch64ELFObjectWriter::~AArch64ELFObjectWriter() {}
         "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) {
index 26284df1d789c44e63e36d59c2cfa556bdb76b5f..fe4b52b515e0cb607508eb48329a6e713e9d5667 100644 (file)
@@ -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),
index b59ddcffeff50e357fc7b10992bf6b48f1827d17..d97cd7582eaae26164fd810d5c5444b23e6204a3 100644 (file)
@@ -79,6 +79,7 @@ INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass)
 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::getAnalysisUsage(AnalysisUsage &AU) const {
   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);