llvm-3.6 getMemBuffer now returns a std::unique_ptr<MemoryBuffer>