aboutsummaryrefslogtreecommitdiff
path: root/AST/Type.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'AST/Type.cpp')
-rw-r--r--AST/Type.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/AST/Type.cpp b/AST/Type.cpp
index bb031cb656..c078bee909 100644
--- a/AST/Type.cpp
+++ b/AST/Type.cpp
@@ -235,6 +235,22 @@ const VariableArrayType *Type::getAsVariablyModifiedType() const {
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))