ldc/gen/llvmcompat.h
David Nadlinger c02b38fe9a Removed LLVM 3.0 compatibility code.
There might be still some pieces left here and there, and
there is certainly code that could be rewritten in a nicer
way with the 3.0 requirement out of the picture.
2013-05-31 20:48:38 +02:00

35 lines
837 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//===-- gen/llvmcompat.h - LLVM API compatibilty shims ----------*- C++ -*-===//
//
// LDC the LLVM D compiler
//
// This file is distributed under the BSD-style LDC license. See the LICENSE
// file for details.
//
//===----------------------------------------------------------------------===//
//
// Provides a central place to handle API changes between supported LLVM
// versions.
//
//===----------------------------------------------------------------------===//
#ifdef _MSC_VER
#pragma once
#endif
#ifndef LDC_LLVMCOMPAT_H
#define LDC_LLVMCOMPAT_H
#if !defined(LDC_LLVM_VER)
#error "Please specify value for LDC_LLVM_VER."
#endif
#if LDC_LLVM_VER >= 302
#define ADDRESS_SPACE 0
#define HAS_ATTRIBUTES(x) (x).hasAttributes()
#else
#define ADDRESS_SPACE
#define HAS_ATTRIBUTES(x) (x)
#endif
#endif