[llvm] r257657 - [WebAssembly] Add an assertion to catch unexpected MCFixupKindInfo flags.

Dan Gohman via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 13 11:31:58 PST 2016


Author: djg
Date: Wed Jan 13 13:31:57 2016
New Revision: 257657

URL: http://llvm.org/viewvc/llvm-project?rev=257657&view=rev
Log:
[WebAssembly] Add an assertion to catch unexpected MCFixupKindInfo flags.

Modified:
    llvm/trunk/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyAsmBackend.cpp

Modified: llvm/trunk/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyAsmBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyAsmBackend.cpp?rev=257657&r1=257656&r2=257657&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyAsmBackend.cpp (original)
+++ llvm/trunk/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyAsmBackend.cpp Wed Jan 13 13:31:57 2016
@@ -73,6 +73,8 @@ void WebAssemblyAsmBackend::applyFixup(c
                                        unsigned DataSize, uint64_t Value,
                                        bool IsPCRel) const {
   const MCFixupKindInfo &Info = getFixupKindInfo(Fixup.getKind());
+  assert(Info.Flags == 0 && "WebAssembly does not use MCFixupKindInfo flags");
+
   unsigned NumBytes = (Info.TargetSize + 7) / 8;
   if (Value == 0)
     return; // Doesn't change encoding.




More information about the llvm-commits mailing list