[PATCH] XCore target: Add TypeString meta data to IR output.
Richard Osborne
richard at xmos.com
Fri Apr 25 09:43:33 PDT 2014
================
Comment at: lib/CodeGen/TargetInfo.cpp:6117
@@ +6116,3 @@
+/// Recursive: The type encoding is recursive;
+/// Incomplete: An incomplete TypesString;
+/// IncompleteUsed: The Incomplete was used in a Recursive encoding.
----------------
TypesString -> TypeString
================
Comment at: lib/CodeGen/TargetInfo.cpp:6118
@@ +6117,3 @@
+/// Incomplete: An incomplete TypesString;
+/// IncompleteUsed: The Incomplete was used in a Recursive encoding.
+///
----------------
A found this a bit unclear. How about:
An incomplete TypesString that has been used in a Recursive type encoding
================
Comment at: lib/CodeGen/TargetInfo.cpp:6154
@@ +6153,3 @@
+ enum Status {NonRecursive, Recursive, Incomplete, IncompleteUsed};
+ struct Entry {std::string Str; enum Status State; std::string Swapped;};
+ std::map<const IdentifierInfo *, struct Entry> Map;
----------------
The members of the Entry struct could do with comments. What does Swapped represent?
================
Comment at: lib/CodeGen/TargetInfo.cpp:6163
@@ +6162,3 @@
+ bool SelfRecursive);
+ StringRef str(const IdentifierInfo *ID);
+};
----------------
Could you rename this to have lookup or find in the name - it isn't clear what the method does from the name.
================
Comment at: lib/CodeGen/TargetInfo.cpp:6174
@@ +6173,3 @@
+ StringRef str() {return Enc.c_str();};
+ bool operator<(const FieldEncoding& rhs) const {
+ if (HasName != rhs.HasName) return HasName;
----------------
& should be next to the variable name.
================
Comment at: lib/CodeGen/TargetInfo.cpp:6256
@@ +6255,3 @@
+ return;
+ Entry& E = Map[ID];
+ assert( (E.Str.empty() || E.State == Recursive) &&
----------------
& should be next to the variable name.
================
Comment at: lib/CodeGen/TargetInfo.cpp:6279
@@ +6278,3 @@
+ "Entry must be an incomplete type");
+ bool SelfRecursive = false;
+ if (E.State == IncompleteUsed) {
----------------
What's the difference between self recusive typestrings and recursive typestrings?
http://reviews.llvm.org/D2929
More information about the llvm-commits
mailing list