[dragonegg] r214827 - Update dragonegg corresponding to LLVM r214781.

NAKAMURA Takumi geek4civic at gmail.com
Mon Aug 4 16:57:02 PDT 2014


Author: chapuni
Date: Mon Aug  4 18:57:01 2014
New Revision: 214827

URL: http://llvm.org/viewvc/llvm-project?rev=214827&view=rev
Log:
Update dragonegg corresponding to LLVM r214781.

Modified:
    dragonegg/trunk/src/Backend.cpp
    dragonegg/trunk/src/Convert.cpp

Modified: dragonegg/trunk/src/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Backend.cpp?rev=214827&r1=214826&r2=214827&view=diff
==============================================================================
--- dragonegg/trunk/src/Backend.cpp (original)
+++ dragonegg/trunk/src/Backend.cpp Mon Aug  4 18:57:01 2014
@@ -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 @@ static bool SizeOfGlobalMatchesDecl(Glob
   // 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 @@ static void CreateTargetMachine(const st
 
   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 @@ static void CreateModule(const std::stri
   // 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 @@ static void InitializeBackend(void) {
   // 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 @@ static void createPerModuleOptimizationP
     // 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

Modified: dragonegg/trunk/src/Convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Convert.cpp?rev=214827&r1=214826&r2=214827&view=diff
==============================================================================
--- dragonegg/trunk/src/Convert.cpp (original)
+++ dragonegg/trunk/src/Convert.cpp Mon Aug  4 18:57:01 2014
@@ -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 @@ static void StoreRegisterToMemory(Value
 /// 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 @@ bool TreeToLLVM::EmitBuiltinCall(gimple
       // 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);
     }
 





More information about the llvm-commits mailing list