diff options
author | Dan Gohman <dan433584@gmail.com> | 2016-12-01 23:39:08 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2016-12-01 23:39:08 +0000 |
commit | 14b34deb6887ca5bea98263f0a3f16b5419394f7 (patch) | |
tree | 5c3edfc2c7d6028ab61f6080de63661f4d95cff7 /lib/Target/XCore | |
parent | a11b564b77a1ddef8f198363ac6ea1d99180839c (diff) |
[MC] Refactor emitELFSize to make usage more consistent. NFC.
Move the cast<MCSymbolELF> inside emitELFSize, so that:
- it's done in one place instead of at each call
- it's more consistent with similar functions like EmitCOFFSafeSEH
- ambiguity between cast<> and dyn_cast<> is avoided (which also
eliminates an unnecessary dyn_cast call)
This also makes it easier to experiment with using ".size" directives on
non-ELF targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288437 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/XCore')
-rw-r--r-- | lib/Target/XCore/XCoreAsmPrinter.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Target/XCore/XCoreAsmPrinter.cpp b/lib/Target/XCore/XCoreAsmPrinter.cpp index a4ce5af2278..b35aa0b9582 100644 --- a/lib/Target/XCore/XCoreAsmPrinter.cpp +++ b/lib/Target/XCore/XCoreAsmPrinter.cpp @@ -153,8 +153,7 @@ void XCoreAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) { unsigned Size = DL.getTypeAllocSize(C->getType()); if (MAI->hasDotTypeDotSizeDirective()) { OutStreamer->EmitSymbolAttribute(GVSym, MCSA_ELF_TypeObject); - OutStreamer->emitELFSize(cast<MCSymbolELF>(GVSym), - MCConstantExpr::create(Size, OutContext)); + OutStreamer->emitELFSize(GVSym, MCConstantExpr::create(Size, OutContext)); } OutStreamer->EmitLabel(GVSym); |