From 1ca3a8b824d68903e3e6791c60b1f59852aeae76 Mon Sep 17 00:00:00 2001 From: Rafael Auler Date: Mon, 20 Sep 2021 15:16:01 -0700 Subject: [PATCH] [NFC] Fix warnings when building with clang Summary: Fix switch-cases that don't handle all MCCFIInstruction enumeration types. Fix range-loop iterator forced copy. (cherry picked from FBD31068505) --- bolt/src/BinaryFunction.cpp | 3 +++ bolt/src/DynoStats.h | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bolt/src/BinaryFunction.cpp b/bolt/src/BinaryFunction.cpp index ff307bbb9840..a27801fab386 100644 --- a/bolt/src/BinaryFunction.cpp +++ b/bolt/src/BinaryFunction.cpp @@ -2514,6 +2514,7 @@ private: case MCCFIInstruction::OpAdjustCfaOffset: case MCCFIInstruction::OpWindowSave: case MCCFIInstruction::OpNegateRAState: + case MCCFIInstruction::OpLLVMDefAspaceCfa: llvm_unreachable("unsupported CFI opcode"); break; case MCCFIInstruction::OpRememberState: @@ -2652,6 +2653,7 @@ struct CFISnapshotDiff : public CFISnapshot { case MCCFIInstruction::OpAdjustCfaOffset: case MCCFIInstruction::OpWindowSave: case MCCFIInstruction::OpNegateRAState: + case MCCFIInstruction::OpLLVMDefAspaceCfa: llvm_unreachable("unsupported CFI opcode"); return false; case MCCFIInstruction::OpRememberState: @@ -2800,6 +2802,7 @@ BinaryFunction::unwindCFIState(int32_t FromState, int32_t ToState, case MCCFIInstruction::OpAdjustCfaOffset: case MCCFIInstruction::OpWindowSave: case MCCFIInstruction::OpNegateRAState: + case MCCFIInstruction::OpLLVMDefAspaceCfa: llvm_unreachable("unsupported CFI opcode"); break; case MCCFIInstruction::OpGnuArgsSize: diff --git a/bolt/src/DynoStats.h b/bolt/src/DynoStats.h index be84f5db3d87..6f666bd2b1f8 100644 --- a/bolt/src/DynoStats.h +++ b/bolt/src/DynoStats.h @@ -124,10 +124,9 @@ public: /// and BB offsets where intructions of these opcodes occur. using MaxOpcodeHistogramTy = std::multimap>; - using OpcodeStatTy = - std::pair>; using OpcodeHistogramTy = std::unordered_map>; + using OpcodeStatTy = OpcodeHistogramTy::value_type; OpcodeHistogramTy OpcodeHistogram; };