From 3574eca1b02600bac4e625297f4ecf745f4c4f32 Mon Sep 17 00:00:00 2001 From: Micah Villmow Date: Mon, 8 Oct 2012 16:38:25 +0000 Subject: Move TargetData to DataLayout. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165402 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Target/Mangler.h | 6 ++-- include/llvm/Target/TargetData.h | 53 ---------------------------- include/llvm/Target/TargetLowering.h | 6 ++-- include/llvm/Target/TargetMachine.h | 4 +-- include/llvm/Target/TargetSelectionDAGInfo.h | 6 ++-- 5 files changed, 11 insertions(+), 64 deletions(-) delete mode 100644 include/llvm/Target/TargetData.h (limited to 'include/llvm/Target') diff --git a/include/llvm/Target/Mangler.h b/include/llvm/Target/Mangler.h index d5e165e..48b8c0c 100644 --- a/include/llvm/Target/Mangler.h +++ b/include/llvm/Target/Mangler.h @@ -22,7 +22,7 @@ class GlobalValue; template class SmallVectorImpl; class MCContext; class MCSymbol; -class TargetData; +class DataLayout; class Mangler { public: @@ -34,7 +34,7 @@ public: private: MCContext &Context; - const TargetData &TD; + const DataLayout &TD; /// AnonGlobalIDs - We need to give global values the same name every time /// they are mangled. This keeps track of the number we give to anonymous @@ -47,7 +47,7 @@ private: unsigned NextAnonGlobalID; public: - Mangler(MCContext &context, const TargetData &td) + Mangler(MCContext &context, const DataLayout &td) : Context(context), TD(td), NextAnonGlobalID(1) {} /// getSymbol - Return the MCSymbol for the specified global value. This diff --git a/include/llvm/Target/TargetData.h b/include/llvm/Target/TargetData.h deleted file mode 100644 index 302efa2..0000000 --- a/include/llvm/Target/TargetData.h +++ /dev/null @@ -1,53 +0,0 @@ -//===-- llvm/Target/TargetData.h - Data size & alignment info ---*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the wrapper for DataLayout to provide compatibility -// with the old TargetData class. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_TARGET_TARGETDATA_H -#define LLVM_TARGET_TARGETDATA_H - -#include "llvm/DataLayout.h" -#include "llvm/Pass.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/Support/DataTypes.h" - -namespace llvm { - -/// TargetData - This class is just a wrapper to help with the transition to the -/// new DataLayout class. -class TargetData : public DataLayout { -public: - /// Default ctor. - /// - /// @note This has to exist, because this is a pass, but it should never be - /// used. - TargetData() : DataLayout() {} - - /// Constructs a TargetData from a specification string. - /// See DataLayout::init(). - explicit TargetData(StringRef TargetDescription) - : DataLayout(TargetDescription) {} - - /// Initialize target data from properties stored in the module. - explicit TargetData(const Module *M) : DataLayout(M) {} - - TargetData(const TargetData &TD) : DataLayout(TD) {} - - template - static UIntTy RoundUpAlignment(UIntTy Val, unsigned Alignment) { - return DataLayout::RoundUpAlignment(Val, Alignment); - } -}; - -} // End llvm namespace - -#endif diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index 9663931..4ea1fb5 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -50,7 +50,7 @@ namespace llvm { class MCContext; class MCExpr; template class SmallVectorImpl; - class TargetData; + class DataLayout; class TargetRegisterClass; class TargetLibraryInfo; class TargetLoweringObjectFile; @@ -137,7 +137,7 @@ public: virtual ~TargetLowering(); const TargetMachine &getTargetMachine() const { return TM; } - const TargetData *getTargetData() const { return TD; } + const DataLayout *getDataLayout() const { return TD; } const TargetLoweringObjectFile &getObjFileLowering() const { return TLOF; } bool isBigEndian() const { return !IsLittleEndian; } @@ -1789,7 +1789,7 @@ public: private: const TargetMachine &TM; - const TargetData *TD; + const DataLayout *TD; const TargetLoweringObjectFile &TLOF; /// PointerTy - The type to use for pointers, usually i32 or i64. diff --git a/include/llvm/Target/TargetMachine.h b/include/llvm/Target/TargetMachine.h index b6fa817..988916f 100644 --- a/include/llvm/Target/TargetMachine.h +++ b/include/llvm/Target/TargetMachine.h @@ -31,7 +31,7 @@ class MCCodeGenInfo; class MCContext; class PassManagerBase; class Target; -class TargetData; +class DataLayout; class TargetELFWriterInfo; class TargetFrameLowering; class TargetInstrInfo; @@ -106,7 +106,7 @@ public: virtual const TargetFrameLowering *getFrameLowering() const { return 0; } virtual const TargetLowering *getTargetLowering() const { return 0; } virtual const TargetSelectionDAGInfo *getSelectionDAGInfo() const{ return 0; } - virtual const TargetData *getTargetData() const { return 0; } + virtual const DataLayout *getDataLayout() const { return 0; } /// getMCAsmInfo - Return target specific asm information. /// diff --git a/include/llvm/Target/TargetSelectionDAGInfo.h b/include/llvm/Target/TargetSelectionDAGInfo.h index 8c5874e..96793bc 100644 --- a/include/llvm/Target/TargetSelectionDAGInfo.h +++ b/include/llvm/Target/TargetSelectionDAGInfo.h @@ -20,7 +20,7 @@ namespace llvm { -class TargetData; +class DataLayout; class TargetMachine; //===----------------------------------------------------------------------===// @@ -31,10 +31,10 @@ class TargetSelectionDAGInfo { TargetSelectionDAGInfo(const TargetSelectionDAGInfo &) LLVM_DELETED_FUNCTION; void operator=(const TargetSelectionDAGInfo &) LLVM_DELETED_FUNCTION; - const TargetData *TD; + const DataLayout *TD; protected: - const TargetData *getTargetData() const { return TD; } + const DataLayout *getDataLayout() const { return TD; } public: explicit TargetSelectionDAGInfo(const TargetMachine &TM); -- cgit v1.1