mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-06 09:54:49 +00:00
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165318 91177308-0d34-0410-b5e6-96231b3b80d8
54 lines
1.6 KiB
C++
54 lines
1.6 KiB
C++
//===-- 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 <typename UIntTy>
|
|
static UIntTy RoundUpAlignment(UIntTy Val, unsigned Alignment) {
|
|
return DataLayout::RoundUpAlignment(Val, Alignment);
|
|
}
|
|
};
|
|
|
|
} // End llvm namespace
|
|
|
|
#endif
|