Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added pure, safe and nothrow to gccbuiltins.

  • Loading branch information...
commit 021f0679635180dd62ef8cf568fa4b2016cde85a 1 parent 1423a9a
@jkrempus jkrempus authored
Showing with 12 additions and 1 deletion.
  1. +12 −1 utils/gen_gccbuiltins.cpp
View
13 utils/gen_gccbuiltins.cpp
@@ -57,6 +57,17 @@ string dtype(Record* rec)
return "";
}
+string attributes(ListInit* propertyList)
+{
+ string prop = propertyList->getSize() ?
+ propertyList->getElementAsRecord(0)->getName() : "";
+
+ return
+ prop == "IntrNoMem" ? "nothrow pure @safe" :
+ prop == "IntrReadArgMem" ? "nothrow pure" :
+ prop == "IntrReadWriteArgMem" ? "nothrow pure" : "nothrow";
+}
+
void processRecord(raw_ostream& os, Record& rec, string arch)
{
if(!rec.getValue("GCCBuiltinName"))
@@ -105,7 +116,7 @@ void processRecord(raw_ostream& os, Record& rec, string arch)
for(int i = 1; i < params.size(); i++)
os << ", " << params[i];
- os << ");\n\n";
+ os << ")" + attributes(rec.getValueAsListInit("Properties")) + ";\n\n";
}
std::string arch;
Please sign in to comment.
Something went wrong with that request. Please try again.