remove copy of ParamAttrs
MODIFY
ir/value.cpp
ir/value.cpp
@@ -156,9 +156,9 @@ void AggregateValue::print(std::ostream &os) const {
}
-Input::Input(Type &type, string &&name, const ParamAttrs &attributes)
+Input::Input(Type &type, string &&name, ParamAttrs &&attributes)
: Value(type, attributes.str() + name), smt_name(move(name)),
- attrs(attributes) {}
+ attrs(move(attributes)) {}
void Input::copySMTName(const Input &other) {
smt_name = other.smt_name;

MODIFY
ir/value.h
ir/value.h
@@ -113,7 +113,7 @@ class Input final : public Value {
ParamAttrs attrs;
public:
Input(Type &type, std::string &&name,
- const ParamAttrs &attrs = ParamAttrs::None);
+ ParamAttrs &&attrs = ParamAttrs::None);
void copySMTName(const Input &other);
void print(std::ostream &os) const override;
bool hasAttribute(ParamAttrs::Attribute a) const { return attrs.has(a); }

MODIFY
llvm_util/llvm2alive.cpp
llvm_util/llvm2alive.cpp
@@ -872,7 +872,7 @@ public:
auto attrs = handleAttributes(arg);
if (!ty || !attrs)
return {};
- auto val = make_unique<Input>(*ty, value_name(arg), *attrs);
+ auto val = make_unique<Input>(*ty, value_name(arg), move(*attrs));
add_identifier(arg, *val.get());
Fn.addInput(move(val));
}

remove copy of ParamAttrs