[llvm] 62c0bda - [CodeGen] Fix a warning in release builds

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 9 11:00:25 PDT 2023


Author: Kazu Hirata
Date: 2023-06-09T11:00:14-07:00
New Revision: 62c0bdabfa32f6e32b17b45425b15309db340dfb

URL: https://github.com/llvm/llvm-project/commit/62c0bdabfa32f6e32b17b45425b15309db340dfb
DIFF: https://github.com/llvm/llvm-project/commit/62c0bdabfa32f6e32b17b45425b15309db340dfb.diff

LOG: [CodeGen] Fix a warning in release builds

This patch fixes:

  llvm/lib/CodeGen/MachineScheduler.cpp:4223:9: error: unused type
  alias 'IntervalTy' [-Werror,-Wunused-local-typedef]

Added: 
    

Modified: 
    llvm/lib/CodeGen/MachineScheduler.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp
index 59248bdea1914..d7ea86142fb59 100644
--- a/llvm/lib/CodeGen/MachineScheduler.cpp
+++ b/llvm/lib/CodeGen/MachineScheduler.cpp
@@ -4220,11 +4220,10 @@ unsigned ResourceSegments::getFirstAvailableAt(
 
 void ResourceSegments::add(ResourceSegments::IntervalTy A,
                            const unsigned CutOff) {
-  using IntervalTy = ResourceSegments::IntervalTy;
   assert(A.first < A.second && "Cannot add empty resource usage");
   assert(CutOff > 0 && "0-size interval history has no use.");
   assert(all_of(_Intervals,
-                [&A](const IntervalTy &Interval) -> bool {
+                [&A](const ResourceSegments::IntervalTy &Interval) -> bool {
                   return !intersects(A, Interval);
                 }) &&
          "A resource is being overwritten");


        


More information about the llvm-commits mailing list