From 6cdd54b6f73b1e8a00f9879a3f7eb5f20c9d4830 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Tue, 15 Jul 2008 08:56:49 +0000 Subject: Pass around const RetOrArg references instead of copying values. Also, mark RetOrArg::getDescription() as const. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53599 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/DeadArgumentElimination.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/Transforms/IPO') diff --git a/lib/Transforms/IPO/DeadArgumentElimination.cpp b/lib/Transforms/IPO/DeadArgumentElimination.cpp index b9feab6d8b..d2a5f28cb7 100644 --- a/lib/Transforms/IPO/DeadArgumentElimination.cpp +++ b/lib/Transforms/IPO/DeadArgumentElimination.cpp @@ -70,7 +70,7 @@ namespace { return F == O.F && Idx == O.Idx && IsArg == O.IsArg; } - std::string getDescription() { + std::string getDescription() const { return std::string((IsArg ? "Argument #" : "Return value #")) + utostr(Idx) + " of function " + F->getName(); } @@ -132,7 +132,7 @@ namespace { void SurveyFunction(Function &F); void MarkValue(const RetOrArg &RA, Liveness L, const UseVector &MaybeLiveUses); - void MarkLive(RetOrArg RA); + void MarkLive(const RetOrArg &RA); void MarkLive(const Function &F); bool RemoveDeadStuffFromFunction(Function *F); bool DeleteDeadVarargs(Function &Fn); @@ -540,7 +540,7 @@ void DAE::MarkLive(const Function &F) { /// MarkLive - Mark the given return value or argument as live. Additionally, /// mark any values that are used by this value (according to Uses) live as /// well. -void DAE::MarkLive(RetOrArg RA) { +void DAE::MarkLive(const RetOrArg &RA) { if (!LiveValues.insert(RA).second) return; // We were already marked Live. -- cgit v1.2.3