1 //===-- llvm/Target/TargetAsmInfo.cpp - Target Assembly Info --------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/Target/TargetAsmInfo.h"
11 #include "llvm/Target/TargetData.h"
12 #include "llvm/Target/TargetLowering.h"
13 #include "llvm/Target/TargetLoweringObjectFile.h"
14 #include "llvm/Target/TargetMachine.h"
15 #include "llvm/Target/TargetRegisterInfo.h"
18 TargetAsmInfo::TargetAsmInfo(const TargetMachine
&TM
) {
19 TLOF
= &TM
.getTargetLowering()->getObjFileLowering();
20 const TargetData
&TD
= *TM
.getTargetData();
21 IsLittleEndian
= TD
.isLittleEndian();
22 PointerSize
= TD
.getPointerSize();
24 TFI
= TM
.getFrameLowering();
25 StackDir
= TFI
->getStackGrowthDirection();
26 TRI
= TM
.getRegisterInfo();
27 TFI
->getInitialFrameState(InitialFrameState
);
30 int TargetAsmInfo::getCompactUnwindEncoding(ArrayRef
<MCCFIInstruction
> Instrs
,
31 int DataAlignmentFactor
,
33 return TFI
->getCompactUnwindEncoding(Instrs
, DataAlignmentFactor
, IsEH
);