From f2b408c64e3d1503a3e7c63b3b48fb9c42e7aff6 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 23 Mar 2015 21:22:04 +0000 Subject: Refactor how passes get a symbol at the end of a section. There is now a canonical symbol at the end of a section that different passes can request. This also allows us to assert that we don't switch back to a section whose end symbol has already been printed. llvm-svn: 233026 --- llvm/lib/MC/MCSection.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'llvm/lib/MC/MCSection.cpp') diff --git a/llvm/lib/MC/MCSection.cpp b/llvm/lib/MC/MCSection.cpp index ccf4a7d..7889f83 100644 --- a/llvm/lib/MC/MCSection.cpp +++ b/llvm/lib/MC/MCSection.cpp @@ -10,6 +10,7 @@ #include "llvm/MC/MCSection.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" +#include "llvm/MC/MCSymbol.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; @@ -17,6 +18,14 @@ using namespace llvm; // MCSection //===----------------------------------------------------------------------===// +MCSymbol *MCSection::getEndSymbol(MCContext &Ctx) const { + if (!End) + End = Ctx.createTempSymbol("sec_end", true); + return End; +} + +bool MCSection::hasEnded() const { return End && End->isInSection(); } + MCSection::~MCSection() { } -- cgit v1.1