[llvm] r341443 - Fix -Wunused-function in release build after rL341386

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 4 20:10:20 PDT 2018


Author: maskray
Date: Tue Sep  4 20:10:20 2018
New Revision: 341443

URL: http://llvm.org/viewvc/llvm-project?rev=341443&view=rev
Log:
Fix -Wunused-function in release build after rL341386

Modified:
    llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp

Modified: llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp?rev=341443&r1=341442&r2=341443&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp Tue Sep  4 20:10:20 2018
@@ -160,7 +160,8 @@ struct CHRStats {
                                      // count at the scope entry.
 };
 
-inline raw_ostream &operator<<(raw_ostream &OS, const CHRStats &Stats) {
+inline raw_ostream LLVM_ATTRIBUTE_UNUSED &operator<<(raw_ostream &OS,
+                                                     const CHRStats &Stats) {
   Stats.print(OS);
   return OS;
 }
@@ -459,7 +460,8 @@ static bool shouldApply(Function &F, Pro
   return PSI.isFunctionEntryHot(&F);
 }
 
-static void dumpIR(Function &F, const char *Label, CHRStats *Stats) {
+static void LLVM_ATTRIBUTE_UNUSED dumpIR(Function &F, const char *Label,
+                                         CHRStats *Stats) {
   std::string Name = F.getName().str();
   const char *DemangledName = nullptr;
 #if !defined(_MSC_VER)
@@ -479,7 +481,6 @@ static void dumpIR(Function &F, const ch
   CHR_DEBUG(F.dump());
 }
 
-
 void CHRScope::print(raw_ostream &OS) const {
   assert(RegInfos.size() > 0 && "Empty CHRScope");
   OS << "CHRScope[";
@@ -1566,7 +1567,8 @@ static void insertTrivialPHIs(CHRScope *
 }
 
 // Assert that all the CHR regions of the scope have a biased branch or select.
-static void assertCHRRegionsHaveBiasedBranchOrSelect(CHRScope *Scope) {
+static void LLVM_ATTRIBUTE_UNUSED
+assertCHRRegionsHaveBiasedBranchOrSelect(CHRScope *Scope) {
 #ifndef NDEBUG
   auto HasBiasedBranchOrSelect = [](RegInfo &RI, CHRScope *Scope) {
     if (Scope->TrueBiasedRegions.count(RI.R) ||
@@ -1587,8 +1589,8 @@ static void assertCHRRegionsHaveBiasedBr
 
 // Assert that all the condition values of the biased branches and selects have
 // been hoisted to the pre-entry block or outside of the scope.
-static void assertBranchOrSelectConditionHoisted(CHRScope *Scope,
-                                                 BasicBlock *PreEntryBlock) {
+static void LLVM_ATTRIBUTE_UNUSED assertBranchOrSelectConditionHoisted(
+    CHRScope *Scope, BasicBlock *PreEntryBlock) {
   CHR_DEBUG(dbgs() << "Biased regions condition values \n");
   for (RegInfo &RI : Scope->CHRRegions) {
     Region *R = RI.R;
@@ -1908,7 +1910,8 @@ void CHR::transformScopes(SmallVectorImp
   }
 }
 
-static void dumpScopes(SmallVectorImpl<CHRScope *> &Scopes, const char * Label) {
+static void LLVM_ATTRIBUTE_UNUSED
+dumpScopes(SmallVectorImpl<CHRScope *> &Scopes, const char *Label) {
   dbgs() << Label << " " << Scopes.size() << "\n";
   for (CHRScope *Scope : Scopes) {
     dbgs() << *Scope << "\n";




More information about the llvm-commits mailing list