mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 03:25:23 +00:00
Remove the TargetMachine forwards for TargetSubtargetInfo based
information and update all callers. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214781 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/Target/TargetLowering.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/Target/TargetSubtargetInfo.h"
|
||||
using namespace llvm;
|
||||
using namespace dwarf;
|
||||
|
||||
@@ -72,9 +73,10 @@ void TargetLoweringObjectFileELF::emitPersonalityValue(MCStreamer &Streamer,
|
||||
Flags,
|
||||
SectionKind::getDataRel(),
|
||||
0, Label->getName());
|
||||
unsigned Size = TM.getDataLayout()->getPointerSize();
|
||||
unsigned Size = TM.getSubtargetImpl()->getDataLayout()->getPointerSize();
|
||||
Streamer.SwitchSection(Sec);
|
||||
Streamer.EmitValueToAlignment(TM.getDataLayout()->getPointerABIAlignment());
|
||||
Streamer.EmitValueToAlignment(
|
||||
TM.getSubtargetImpl()->getDataLayout()->getPointerABIAlignment());
|
||||
Streamer.EmitSymbolAttribute(Label, MCSA_ELF_TypeObject);
|
||||
const MCExpr *E = MCConstantExpr::Create(Size, getContext());
|
||||
Streamer.EmitELFSize(Label, E);
|
||||
@@ -287,7 +289,8 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
|
||||
// FIXME: this is getting the alignment of the character, not the
|
||||
// alignment of the global!
|
||||
unsigned Align =
|
||||
TM.getDataLayout()->getPreferredAlignment(cast<GlobalVariable>(GV));
|
||||
TM.getSubtargetImpl()->getDataLayout()->getPreferredAlignment(
|
||||
cast<GlobalVariable>(GV));
|
||||
|
||||
const char *SizeSpec = ".rodata.str1.";
|
||||
if (Kind.isMergeable2ByteCString())
|
||||
@@ -611,14 +614,16 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
|
||||
|
||||
// FIXME: Alignment check should be handled by section classifier.
|
||||
if (Kind.isMergeable1ByteCString() &&
|
||||
TM.getDataLayout()->getPreferredAlignment(cast<GlobalVariable>(GV)) < 32)
|
||||
TM.getSubtargetImpl()->getDataLayout()->getPreferredAlignment(
|
||||
cast<GlobalVariable>(GV)) < 32)
|
||||
return CStringSection;
|
||||
|
||||
// Do not put 16-bit arrays in the UString section if they have an
|
||||
// externally visible label, this runs into issues with certain linker
|
||||
// versions.
|
||||
if (Kind.isMergeable2ByteCString() && !GV->hasExternalLinkage() &&
|
||||
TM.getDataLayout()->getPreferredAlignment(cast<GlobalVariable>(GV)) < 32)
|
||||
TM.getSubtargetImpl()->getDataLayout()->getPreferredAlignment(
|
||||
cast<GlobalVariable>(GV)) < 32)
|
||||
return UStringSection;
|
||||
|
||||
if (Kind.isMergeableConst()) {
|
||||
|
Reference in New Issue
Block a user