[PATCH] D68588: [Bitcode] Update naming of UNOP_NEG to UNOP_FNEG

Cameron McInally via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 7 13:02:16 PDT 2019


cameron.mcinally created this revision.
cameron.mcinally added a reviewer: lebedev.ri.
Herald added a reviewer: deadalnix.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

As requested in D53877 <https://reviews.llvm.org/D53877> post-commit review, update naming of UNOP_NEG to UNOP_FNEG.

Also add UnaryOperator to the LLVMIsA##name macro. There does not appear to be existing tests for the LLVMIsA* functions, so I'm not sure how to test it.


Repository:
  rL LLVM

https://reviews.llvm.org/D68588

Files:
  llvm/include/llvm-c/Core.h
  llvm/include/llvm/Bitcode/LLVMBitCodes.h
  llvm/lib/Bitcode/Reader/BitcodeReader.cpp
  llvm/lib/Bitcode/Writer/BitcodeWriter.cpp


Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
===================================================================
--- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -520,7 +520,7 @@
 static unsigned getEncodedUnaryOpcode(unsigned Opcode) {
   switch (Opcode) {
   default: llvm_unreachable("Unknown binary instruction!");
-  case Instruction::FNeg: return bitc::UNOP_NEG;
+  case Instruction::FNeg: return bitc::UNOP_FNEG;
   }
 }
 
Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp
===================================================================
--- llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -1063,7 +1063,7 @@
   switch (Val) {
   default:
     return -1;
-  case bitc::UNOP_NEG:
+  case bitc::UNOP_FNEG:
     return IsFP ? Instruction::FNeg : -1;
   }
 }
Index: llvm/include/llvm/Bitcode/LLVMBitCodes.h
===================================================================
--- llvm/include/llvm/Bitcode/LLVMBitCodes.h
+++ llvm/include/llvm/Bitcode/LLVMBitCodes.h
@@ -391,7 +391,7 @@
 /// have no fixed relation to the LLVM IR enum values.  Changing these will
 /// break compatibility with old files.
 enum UnaryOpcodes {
-  UNOP_NEG = 0
+  UNOP_FNEG = 0
 };
 
 /// BinaryOpcodes - These are values used in the bitcode files to encode which
Index: llvm/include/llvm-c/Core.h
===================================================================
--- llvm/include/llvm-c/Core.h
+++ llvm/include/llvm-c/Core.h
@@ -1543,6 +1543,7 @@
           macro(GlobalVariable)             \
       macro(UndefValue)                     \
     macro(Instruction)                      \
+      macro(UnaryOperator)                  \
       macro(BinaryOperator)                 \
       macro(CallInst)                       \
         macro(IntrinsicInst)                \


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68588.223637.patch
Type: text/x-patch
Size: 1856 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191007/b74a21e0/attachment.bin>


More information about the llvm-commits mailing list