change isNoalias to isAlias

dev
MITSUNARI Shigeo 9 years ago
parent 0485be010e
commit 7cd68ba02b
  1. 20
      src/llvm_gen.hpp

@ -187,10 +187,10 @@ struct Generator::Operand {
Operand(const Eval& e); Operand(const Eval& e);
void operator=(const Eval& e); void operator=(const Eval& e);
std::string toStr(bool noAlias = false) const std::string toStr(bool isAlias = true) const
{ {
if (type.isPtr) { if (type.isPtr) {
return getType(noAlias) + " " + getName(); return getType(isAlias) + " " + getName();
} }
switch (type.type) { switch (type.type) {
default: default:
@ -200,7 +200,7 @@ struct Generator::Operand {
return getType() + " " + getName(); return getType() + " " + getName();
} }
} }
std::string getType(bool noAlias = false) const std::string getType(bool isAlias = true) const
{ {
std::string s; std::string s;
switch (type.type) { switch (type.type) {
@ -213,7 +213,7 @@ struct Generator::Operand {
} }
if (type.isPtr) { if (type.isPtr) {
s += "*"; s += "*";
if (noAlias) { if (!isAlias) {
s += " noalias "; s += " noalias ";
} }
} }
@ -273,11 +273,11 @@ struct Generator::Function {
Generator::Operand ret; Generator::Operand ret;
OperandVec opv; OperandVec opv;
bool isPrivate; bool isPrivate;
bool isNoalias; bool isAlias;
void clear() void clear()
{ {
isPrivate = false; isPrivate = false;
isNoalias = false; isAlias = true;
} }
explicit Function(const std::string& name = "") : name(name) { clear(); } explicit Function(const std::string& name = "") : name(name) { clear(); }
Function(const std::string& name, const Operand& ret) Function(const std::string& name, const Operand& ret)
@ -331,7 +331,11 @@ struct Generator::Function {
} }
void setNoalias() void setNoalias()
{ {
isNoalias = true; isAlias = false;
}
void setAlias()
{
isAlias = true;
} }
std::string toStr() const std::string toStr() const
{ {
@ -343,7 +347,7 @@ struct Generator::Function {
str += " @" + name + "("; str += " @" + name + "(";
for (size_t i = 0; i < opv.size(); i++) { for (size_t i = 0; i < opv.size(); i++) {
if (i > 0) str += ", "; if (i > 0) str += ", ";
str += opv[i].toStr(isNoalias); str += opv[i].toStr(isAlias);
} }
str += ")"; str += ")";
return str; return str;

Loading…
Cancel
Save