gallivm: Change getExtent and readByte to non-const with llvm-3.1.
authorVinson Lee <vlee@freedesktop.org>
Thu, 9 Feb 2012 05:45:27 +0000 (21:45 -0800)
committerVinson Lee <vlee@freedesktop.org>
Sat, 11 Feb 2012 07:24:48 +0000 (23:24 -0800)
Fix build with llvm-3.1svn.

llvm-3.1svn r149918 changed BufferMemoryObject::getExtent and
BufferMemoryObject::readByte from const member functions to non-const
member functions in include/llvm/Support/MemoryObject.h.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_debug.cpp

index be8d7884bca13f2ad232ae57e4c6a9623e35a472..5d98763d8024617e21b8fa01e1c88df9379ed09d 100644 (file)
@@ -146,12 +146,20 @@ public:
       return 0;
    }
 
+#if HAVE_LLVM >= 0x0301
+   uint64_t getExtent()
+#else
    uint64_t getExtent() const
+#endif
    {
       return Length;
    }
 
+#if HAVE_LLVM >= 0x0301
+   int readByte(uint64_t addr, uint8_t *byte)
+#else
    int readByte(uint64_t addr, uint8_t *byte) const
+#endif
    {
       if (addr > getExtent())
          return -1;