diff options
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 14 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 9 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/ELFWriter.cpp | 5 |
4 files changed, 17 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 7106c6ade81..178bbaa907c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -23,8 +23,9 @@ #include "llvm/CodeGen/DwarfWriter.h" #include "llvm/Analysis/DebugInfo.h" #include "llvm/MC/MCContext.h" -#include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCInst.h" +#include "llvm/MC/MCSection.h" +#include "llvm/MC/MCStreamer.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/FormattedStream.h" @@ -132,7 +133,7 @@ void AsmPrinter::SwitchToDataSection(const char *NewSection, /// SwitchToSection - Switch to the specified section of the executable if we /// are not already in it! -void AsmPrinter::SwitchToSection(const Section *NS) { +void AsmPrinter::SwitchToSection(const MCSection *NS) { const std::string &NewSection = NS->getName(); // If we're already in this section, we're done. @@ -308,10 +309,10 @@ void AsmPrinter::SetupMachineFunction(MachineFunction &MF) { namespace { // SectionCPs - Keep track the alignment, constpool entries per Section. struct SectionCPs { - const Section *S; + const MCSection *S; unsigned Alignment; SmallVector<unsigned, 4> CPEs; - SectionCPs(const Section *s, unsigned a) : S(s), Alignment(a) {}; + SectionCPs(const MCSection *s, unsigned a) : S(s), Alignment(a) {}; }; } @@ -347,7 +348,8 @@ void AsmPrinter::EmitConstantPool(MachineConstantPool *MCP) { } } - const Section *S =getObjFileLowering().getSectionForMergeableConstant(Kind); + const MCSection *S = + getObjFileLowering().getSectionForMergeableConstant(Kind); // The number of sections are small, just do a linear search from the // last section to the first. @@ -419,7 +421,7 @@ void AsmPrinter::EmitJumpTableInfo(MachineJumpTableInfo *MJTI, const char *JumpTableDataSection = TAI->getJumpTableDataSection(); const Function *F = MF.getFunction(); - const Section *FuncSection = + const MCSection *FuncSection = getObjFileLowering().SectionForGlobal(F, Mang, TM); bool JTInDiffSection = false; diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index afcd44aeb9e..873cdc2c5cb 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -14,13 +14,14 @@ #include "DwarfDebug.h" #include "llvm/Module.h" #include "llvm/CodeGen/MachineModuleInfo.h" -#include "llvm/Support/Timer.h" -#include "llvm/System/Path.h" +#include "llvm/MC/MCSection.h" #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetRegisterInfo.h" +#include "llvm/Support/Timer.h" +#include "llvm/System/Path.h" using namespace llvm; static TimerGroup &getDwarfTimerGroup() { @@ -224,7 +225,7 @@ DbgScope::~DbgScope() { DwarfDebug::DwarfDebug(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T) : Dwarf(OS, A, T, "dbg"), ModuleCU(0), AbbreviationsSet(InitAbbreviationsSetSize), Abbreviations(), - ValuesSet(InitValuesSetSize), Values(), StringPool(), SectionMap(), + ValuesSet(InitValuesSetSize), Values(), StringPool(), SectionSourceLines(), didInitial(false), shouldEmit(false), FunctionDbgScope(0), DebugTimer(0) { if (TimePassesIsEnabled) @@ -2132,7 +2133,7 @@ void DwarfDebug::EmitDebugLines() { const std::vector<SrcLineInfo> &LineInfos = SectionSourceLines[j]; if (Asm->isVerbose()) { - const Section* S = SectionMap[j + 1]; + const MCSection *S = SectionMap[j + 1]; O << '\t' << TAI->getCommentString() << " Section" << S->getName() << '\n'; } else { diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h index a4072f5ce92..af76b0b1b18 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -120,7 +120,7 @@ class VISIBILITY_HIDDEN DwarfDebug : public Dwarf { /// SectionMap - Provides a unique id per text section. /// - UniqueVector<const Section*> SectionMap; + UniqueVector<const MCSection*> SectionMap; /// SectionSourceLines - Tracks line numbers per text section. /// diff --git a/llvm/lib/CodeGen/ELFWriter.cpp b/llvm/lib/CodeGen/ELFWriter.cpp index 230c5ac4be8..c7438329e38 100644 --- a/llvm/lib/CodeGen/ELFWriter.cpp +++ b/llvm/lib/CodeGen/ELFWriter.cpp @@ -43,6 +43,7 @@ #include "llvm/CodeGen/MachineCodeEmitter.h" #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/MC/MCContext.h" +#include "llvm/MC/MCSection.h" #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetELFWriterInfo.h" @@ -334,8 +335,8 @@ void ELFWriter::EmitGlobal(const GlobalValue *GV) { TM.getTargetLowering()->getObjFileLowering(); // Get the ELF section where this global belongs from TLOF - const Section *S = TLOF.SectionForGlobal(GV, Mang, TM); - unsigned SectionFlags = getElfSectionFlags(S->getKind()); + const MCSection *S = TLOF.SectionForGlobal(GV, Mang, TM); + unsigned SectionFlags = getElfSectionFlags(((MCSectionELF*)S)->getKind()); // The symbol align should update the section alignment if needed const TargetData *TD = TM.getTargetData(); |