return 0;
}
+bool Type::isIncompleteArrayType() const {
+ if (const VariableArrayType *VAT = getAsVariableArrayType()) {
+ if (!VAT->getSizeExpr())
+ return true;
+ }
+ return false;
+}
+
+const VariableArrayType *Type::getAsIncompleteArrayType() const {
+ if (const VariableArrayType *VAT = getAsVariableArrayType()) {
+ if (!VAT->getSizeExpr())
+ return VAT;
+ }
+ return 0;
+}
+
const RecordType *Type::getAsRecordType() const {
// If this is directly a reference type, return it.
if (const RecordType *RTy = dyn_cast<RecordType>(this))
/// types that have a non-constant expression. This does not include "[]".
bool isVariablyModifiedType() const;
+ /// isIncompleteArrayType (C99 6.2.5p22) - Return true for variable array
+ /// types that don't have any expression ("[]").
+ bool isIncompleteArrayType() const;
+
/// Helper methods to distinguish type categories. All type predicates
/// operate on the canonical type, ignoring typedefs.
const ArrayType *getAsArrayType() const;
const ConstantArrayType *getAsConstantArrayType() const;
const VariableArrayType *getAsVariableArrayType() const;
+ const VariableArrayType *getAsIncompleteArrayType() const;
const VariableArrayType *getAsVariablyModifiedType() const;
const RecordType *getAsRecordType() const;
const RecordType *getAsStructureType() const;