diff options
author | Steve Naroff <snaroff@apple.com> | 2008-01-21 22:59:18 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2008-01-21 22:59:18 +0000 |
commit | 5c06a69a3ef19cc6dbeed7f2acb9de28b66c45d4 (patch) | |
tree | 478beaca98a62f95f44a2c4ccbfe35642646b0c5 /AST/Type.cpp | |
parent | 2c46ce8de96787aa8e040690a80896f1148c29b0 (diff) |
Add a predicate/getter when checking for incomplete array types ("[]").
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46231 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'AST/Type.cpp')
-rw-r--r-- | AST/Type.cpp | 16 |
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)) |