Pass around const RetOrArg references instead of copying values. Also, mark
RetOrArg::getDescription() as const. llvm-svn: 53599
This commit is contained in:
parent
f2860b9fb3
commit
2ce5709e31
|
@ -70,7 +70,7 @@ namespace {
|
||||||
return F == O.F && Idx == O.Idx && IsArg == O.IsArg;
|
return F == O.F && Idx == O.Idx && IsArg == O.IsArg;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string getDescription() {
|
std::string getDescription() const {
|
||||||
return std::string((IsArg ? "Argument #" : "Return value #"))
|
return std::string((IsArg ? "Argument #" : "Return value #"))
|
||||||
+ utostr(Idx) + " of function " + F->getName();
|
+ utostr(Idx) + " of function " + F->getName();
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ namespace {
|
||||||
void SurveyFunction(Function &F);
|
void SurveyFunction(Function &F);
|
||||||
void MarkValue(const RetOrArg &RA, Liveness L,
|
void MarkValue(const RetOrArg &RA, Liveness L,
|
||||||
const UseVector &MaybeLiveUses);
|
const UseVector &MaybeLiveUses);
|
||||||
void MarkLive(RetOrArg RA);
|
void MarkLive(const RetOrArg &RA);
|
||||||
void MarkLive(const Function &F);
|
void MarkLive(const Function &F);
|
||||||
bool RemoveDeadStuffFromFunction(Function *F);
|
bool RemoveDeadStuffFromFunction(Function *F);
|
||||||
bool DeleteDeadVarargs(Function &Fn);
|
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,
|
/// 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
|
/// mark any values that are used by this value (according to Uses) live as
|
||||||
/// well.
|
/// well.
|
||||||
void DAE::MarkLive(RetOrArg RA) {
|
void DAE::MarkLive(const RetOrArg &RA) {
|
||||||
if (!LiveValues.insert(RA).second)
|
if (!LiveValues.insert(RA).second)
|
||||||
return; // We were already marked Live.
|
return; // We were already marked Live.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue