/// incomplete types.
bool isConstantSizeType() const;
+ /// isSpecifierType - Returns true if this type can be represented by some
+ /// set of type specifiers.
+ bool isSpecifierType() const;
+
QualType getCanonicalTypeInternal() const { return CanonicalType; }
void dump() const;
virtual void getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const = 0;
return false;
}
+bool Type::isSpecifierType() const {
+ // Note that this intentionally does not use the canonical type.
+ switch (getTypeClass()) {
+ case Builtin:
+ case Record:
+ case Enum:
+ case Typedef:
+ return true;
+ default:
+ return false;
+ }
+}
+
const char *BuiltinType::getName(bool CPlusPlus) const {
switch (getKind()) {
default: assert(0 && "Unknown builtin type!");
S += "NULL TYPE";
return;
}
-
+
+ if (Policy.SuppressTypeSpecifiers && getTypePtr()->isSpecifierType())
+ return;
+
// Print qualifiers as appropriate.
if (unsigned Tq = getCVRQualifiers()) {
std::string TQS;
S += "(";
std::string Tmp;
+ PrintingPolicy ParamPolicy(Policy);
+ ParamPolicy.SuppressTypeSpecifiers = false;
for (unsigned i = 0, e = getNumArgs(); i != e; ++i) {
if (i) S += ", ";
- getArgType(i).getAsStringInternal(Tmp, Policy);
+ getArgType(i).getAsStringInternal(Tmp, ParamPolicy);
S += Tmp;
Tmp.clear();
}