Update dragonegg corresponding to LLVM r214781.
llvm-svn: 214827
diff --git a/dragonegg/src/Backend.cpp b/dragonegg/src/Backend.cpp
index 791d09f..2596365 100644
--- a/dragonegg/src/Backend.cpp
+++ b/dragonegg/src/Backend.cpp
@@ -45,6 +45,7 @@
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Target/TargetLibraryInfo.h"
+#include "llvm/Target/TargetSubtargetInfo.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
#include "llvm-c/Target.h"
@@ -313,10 +314,10 @@
// TODO: Change getTypeSizeInBits for aggregate types so it is no longer
// rounded up to the alignment.
uint64_t gcc_size = getInt64(DECL_SIZE(decl), true);
- const DataLayout *DL = TheTarget->getDataLayout();
+ const DataLayout *DL = TheTarget->getSubtargetImpl()->getDataLayout();
unsigned Align = 8 * DL->getABITypeAlignment(Ty);
- return TheTarget->getDataLayout()->getTypeAllocSizeInBits(Ty) ==
- ((gcc_size + Align - 1) / Align) * Align;
+ return TheTarget->getSubtargetImpl()->getDataLayout()->getTypeAllocSizeInBits(
+ Ty) == ((gcc_size + Align - 1) / Align) * Align;
}
#endif
@@ -533,7 +534,8 @@
TheTarget = TME->createTargetMachine(TargetTriple, CPU, FeatureStr, Options,
RelocModel, CMModel, CodeGenOptLevel());
- assert(TheTarget->getDataLayout()->isBigEndian() == BYTES_BIG_ENDIAN);
+ assert(TheTarget->getSubtargetImpl()->getDataLayout()->isBigEndian() ==
+ BYTES_BIG_ENDIAN);
}
/// output_ident - Insert a .ident directive that identifies the plugin.
@@ -581,8 +583,9 @@
// Install information about the target triple and data layout into the module
// for optimizer use.
TheModule->setTargetTriple(TargetTriple);
- TheModule->setDataLayout(
- TheTarget->getDataLayout()->getStringRepresentation());
+ TheModule->setDataLayout(TheTarget->getSubtargetImpl()
+ ->getDataLayout()
+ ->getStringRepresentation());
}
/// flag_default_initialize_globals - Whether global variables with no explicit
@@ -643,7 +646,7 @@
// Create a module to hold the generated LLVM IR.
CreateModule(TargetTriple);
- TheFolder = new TargetFolder(TheTarget->getDataLayout());
+ TheFolder = new TargetFolder(TheTarget->getSubtargetImpl()->getDataLayout());
if (debug_info_level > DINFO_LEVEL_NONE) {
TheDebugInfo = new DebugInfo(TheModule);
@@ -781,7 +784,8 @@
// this for fast -O0 compiles!
if (PerModulePasses || 1) {
PassManager *PM = CodeGenPasses = new PassManager();
- PM->add(new DataLayoutPass(*TheTarget->getDataLayout()));
+ PM->add(
+ new DataLayoutPass(*TheTarget->getSubtargetImpl()->getDataLayout()));
TheTarget->addAnalysisPasses(*PM);
// Request that addPassesToEmitFile run the Verifier after running
diff --git a/dragonegg/src/Convert.cpp b/dragonegg/src/Convert.cpp
index 62bc989..38b707f 100644
--- a/dragonegg/src/Convert.cpp
+++ b/dragonegg/src/Convert.cpp
@@ -1,6 +1,6 @@
//===------------- Convert.cpp - Converting gimple to LLVM IR -------------===//
//
-// Copyright (C) 2005 to 2013 Chris Lattner, Duncan Sands et al.
+// Copyright (C) 2005 to 2014 Chris Lattner, Duncan Sands et al.
//
// This file is part of DragonEgg.
//
@@ -35,6 +35,7 @@
#include "llvm/IR/CFG.h"
#include "llvm/Support/Debug.h"
#include "llvm/Target/TargetLowering.h"
+#include "llvm/Target/TargetSubtargetInfo.h"
// System headers
#include <gmp.h>
@@ -569,7 +570,9 @@
/// TheTreeToLLVM - Keep track of the current function being compiled.
TreeToLLVM *TheTreeToLLVM = 0;
-const DataLayout &getDataLayout() { return *TheTarget->getDataLayout(); }
+const DataLayout &getDataLayout() {
+ return *TheTarget->getSubtargetImpl()->getDataLayout();
+}
/// EmitDebugInfo - Return true if debug info is to be emitted for current
/// function.
@@ -8657,7 +8660,8 @@
// Give the backend a chance to upgrade the inline asm to LLVM code. This
// handles some common cases that LLVM has intrinsics for, e.g. x86 bswap ->
// llvm.bswap.
- if (const TargetLowering *TLI = TheTarget->getTargetLowering())
+ if (const TargetLowering *TLI =
+ TheTarget->getSubtargetImpl()->getTargetLowering())
TLI->ExpandInlineAsm(CV);
}