[llvm] ed9cc64 - [llvm-exegesis][mips] Fix -Wunused-function after D72858

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 18 13:57:27 PST 2020


Author: Fangrui Song
Date: 2020-01-18T13:57:19-08:00
New Revision: ed9cc6404e7fc509096b30c8d8e9dc28d531c718

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

LOG: [llvm-exegesis][mips] Fix -Wunused-function after D72858

Added: 
    

Modified: 
    llvm/tools/llvm-exegesis/lib/Mips/Target.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-exegesis/lib/Mips/Target.cpp b/llvm/tools/llvm-exegesis/lib/Mips/Target.cpp
index 8d59dcfea0c1..dc408f252805 100644
--- a/llvm/tools/llvm-exegesis/lib/Mips/Target.cpp
+++ b/llvm/tools/llvm-exegesis/lib/Mips/Target.cpp
@@ -14,12 +14,12 @@
 namespace llvm {
 namespace exegesis {
 
+#ifndef NDEBUG
 // Returns an error if we cannot handle the memory references in this
 // instruction.
 static Error isInvalidMemoryInstr(const Instruction &Instr) {
   switch (Instr.Description.TSFlags & MipsII::FormMask) {
   default:
-    return Error::success();
     llvm_unreachable("Unknown FormMask value");
   // These have no memory access.
   case MipsII::Pseudo:
@@ -36,6 +36,7 @@ static Error isInvalidMemoryInstr(const Instruction &Instr) {
     return make_error<Failure>("unsupported opcode: non uniform memory access");
   }
 }
+#endif
 
 // Helper to fill a memory operand with a value.
 static void setMemOp(InstructionTemplate &IT, int OpIdx,


        


More information about the llvm-commits mailing list