FAIL* works with LLVM 3.9, 4.0, 5.0 or 6.0

Change-Id: I5480c3451daac7c8ea6160a9afe5ce557b73afb1
This commit is contained in:
Horst Schirmeier
2018-07-24 10:33:20 +02:00
parent 5d5927a88a
commit eef19b80a0
5 changed files with 16 additions and 6 deletions

View File

@ -4,6 +4,14 @@ using namespace fail;
using namespace llvm;
using namespace llvm::object;
// In LLVM 3.9, llvm::Triple::getArchTypeName() returns const char*, since LLVM
// 4.0 it returns StringRef. This overload catches the latter case.
__attribute__((unused))
static std::ostream& operator<<(std::ostream& stream, const llvm::StringRef& s)
{
stream << s.str();
return stream;
}
LLVMtoFailTranslator *LLVMDisassembler::getTranslator() {
if (ltofail == 0) {

View File

@ -23,7 +23,6 @@
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/MemoryObject.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/ADT/StringExtras.h"