mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-07-19 21:55:21 +02:00
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.
This commit is contained in:
@@ -512,13 +512,11 @@ int main(int argc, char** argv)
|
||||
// FIXME: Detect O32/N32 variants (MIPS_{O32,N32}[_SoftFP,_HardFP]).
|
||||
VersionCondition::addPredefinedGlobalIdent("MIPS");
|
||||
break;
|
||||
#if LDC_LLVM_VER >= 301
|
||||
case llvm::Triple::mips64:
|
||||
case llvm::Triple::mips64el:
|
||||
// FIXME: Detect N64 variants (MIPS64_N64[_SoftFP,_HardFP]).
|
||||
VersionCondition::addPredefinedGlobalIdent("MIPS64");
|
||||
break;
|
||||
#endif
|
||||
case llvm::Triple::sparc:
|
||||
// FIXME: Detect SPARC v8+ (SPARC_V8Plus).
|
||||
// FIXME: Detect soft float (SPARC_SoftFP/SPARC_HardFP).
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "driver/target.h"
|
||||
#include "gen/llvmcompat.h"
|
||||
#include "llvm/ADT/Triple.h"
|
||||
#include "llvm/MC/SubtargetFeature.h"
|
||||
#include "llvm/Support/Host.h"
|
||||
@@ -88,19 +87,11 @@ llvm::TargetMachine* createTargetMachine(
|
||||
std::string defaultTriple = llvm::sys::getDefaultTargetTriple();
|
||||
if (sizeof(void*) == 4 && bitness == ExplicitBitness::M64)
|
||||
{
|
||||
#if LDC_LLVM_VER >= 301
|
||||
defaultTriple = llvm::Triple(defaultTriple).get64BitArchVariant().str();
|
||||
#else
|
||||
defaultTriple = llvm::Triple__get64BitArchVariant(defaultTriple).str();
|
||||
#endif
|
||||
}
|
||||
else if (sizeof(void*) == 8 && bitness == ExplicitBitness::M32)
|
||||
{
|
||||
#if LDC_LLVM_VER >= 301
|
||||
defaultTriple = llvm::Triple(defaultTriple).get32BitArchVariant().str();
|
||||
#else
|
||||
defaultTriple = llvm::Triple__get32BitArchVariant(defaultTriple).str();
|
||||
#endif
|
||||
}
|
||||
|
||||
llvm::Triple triple;
|
||||
@@ -182,12 +173,6 @@ llvm::TargetMachine* createTargetMachine(
|
||||
relocModel = llvm::Reloc::PIC_;
|
||||
}
|
||||
|
||||
#if LDC_LLVM_VER == 300
|
||||
llvm::NoFramePointerElim = genDebugInfo;
|
||||
|
||||
return theTarget->createTargetMachine(triple.str(), cpu, FeaturesStr,
|
||||
relocModel, codeModel);
|
||||
#else
|
||||
llvm::TargetOptions targetOptions;
|
||||
targetOptions.NoFramePointerElim = genDebugInfo;
|
||||
|
||||
@@ -200,5 +185,4 @@ llvm::TargetMachine* createTargetMachine(
|
||||
codeModel,
|
||||
codeGenOptLevel
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -16,9 +16,6 @@
|
||||
#define LDC_DRIVER_TARGET_H
|
||||
|
||||
#include "llvm/Support/CodeGen.h"
|
||||
#if LDC_LLVM_VER == 300
|
||||
#include "llvm/Target/TargetMachine.h" // For llvm::CodeGenOpt::Level.
|
||||
#endif
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user