summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-03-04 01:35:23 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-03-04 01:35:23 +0000
commit310e4b592f78091557d3cf14bda3606af1d28f9e (patch)
tree301c998b3ee293f91c1626a5bd44643d4966acee /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
parent151315f4718105c4dda6df9e31ea594d11cfdde5 (diff)
downloadbcm5719-llvm-310e4b592f78091557d3cf14bda3606af1d28f9e.tar.gz
bcm5719-llvm-310e4b592f78091557d3cf14bda3606af1d28f9e.zip
Use the vanilla func_end symbol for .size.
No need to create yet another temp symbol. llvm-svn: 231198
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index da66bc91ec0..3721458d699 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -882,7 +882,7 @@ void AsmPrinter::EmitFunctionBody() {
// Emit target-specific gunk after the function body.
EmitFunctionBodyEnd();
- if (!MMI->getLandingPads().empty()) {
+ if (!MMI->getLandingPads().empty() || MAI->hasDotTypeDotSizeDirective()) {
// Create a symbol for the end of function.
CurrentFnEnd = createTempSymbol("func_end", getFunctionNumber());
OutStreamer.EmitLabel(CurrentFnEnd);
@@ -891,13 +891,10 @@ void AsmPrinter::EmitFunctionBody() {
// If the target wants a .size directive for the size of the function, emit
// it.
if (MAI->hasDotTypeDotSizeDirective()) {
- // Create a symbol for the end of function, so we can get the size as
- // difference between the function label and the temp label.
- MCSymbol *FnEndLabel = OutContext.CreateTempSymbol();
- OutStreamer.EmitLabel(FnEndLabel);
-
+ // We can get the size as difference between the function label and the
+ // temp label.
const MCExpr *SizeExp =
- MCBinaryExpr::CreateSub(MCSymbolRefExpr::Create(FnEndLabel, OutContext),
+ MCBinaryExpr::CreateSub(MCSymbolRefExpr::Create(CurrentFnEnd, OutContext),
MCSymbolRefExpr::Create(CurrentFnSymForSize,
OutContext),
OutContext);
OpenPOWER on IntegriCloud