diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-03-23 21:22:04 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-03-23 21:22:04 +0000 |
| commit | f2b408c64e3d1503a3e7c63b3b48fb9c42e7aff6 (patch) | |
| tree | 45e4c02585d401dc3d72cfa3d5954af80293ced0 /llvm/lib/MC/MCSection.cpp | |
| parent | 328c0c11a8033fa6b8d716e6a08be3e07a20a1af (diff) | |
| download | bcm5719-llvm-f2b408c64e3d1503a3e7c63b3b48fb9c42e7aff6.tar.gz bcm5719-llvm-f2b408c64e3d1503a3e7c63b3b48fb9c42e7aff6.zip | |
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.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCSection.cpp b/llvm/lib/MC/MCSection.cpp index ccf4a7dddf7..7889f837b11 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() { } |

