aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCSection.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-03-23 21:22:04 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-03-23 21:22:04 +0000
commitf2b408c64e3d1503a3e7c63b3b48fb9c42e7aff6 (patch)
tree45e4c02585d401dc3d72cfa3d5954af80293ced0 /llvm/lib/MC/MCSection.cpp
parent328c0c11a8033fa6b8d716e6a08be3e07a20a1af (diff)
downloadllvm-f2b408c64e3d1503a3e7c63b3b48fb9c42e7aff6.zip
llvm-f2b408c64e3d1503a3e7c63b3b48fb9c42e7aff6.tar.gz
llvm-f2b408c64e3d1503a3e7c63b3b48fb9c42e7aff6.tar.bz2
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
Diffstat (limited to 'llvm/lib/MC/MCSection.cpp')
-rw-r--r--llvm/lib/MC/MCSection.cpp9
1 files changed, 9 insertions, 0 deletions
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() {
}