diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-12 21:17:48 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-12 21:17:48 +0000 |
commit | ffb31a23a5967c4b156d226e2a6c84693f7cb4e8 (patch) | |
tree | 2542a74be314b72988319dbeaf7d75d2b1f30e22 /clang | |
parent | df31792a6629df3bde7f7e6bd7c1cf09ca251063 (diff) | |
download | bcm5719-llvm-ffb31a23a5967c4b156d226e2a6c84693f7cb4e8.tar.gz bcm5719-llvm-ffb31a23a5967c4b156d226e2a6c84693f7cb4e8.zip |
make TryFixInvalidVariablyModifiedType a static function.
llvm-svn: 59163
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/Sema/Sema.h | 5 | ||||
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 8 |
2 files changed, 6 insertions, 7 deletions
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index 5b66694e045..6a86a8ab78d 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -1307,11 +1307,6 @@ public: void InitBuiltinVaListType(); - // Helper method to turn variable array types into - // constant array types in certain situations which would otherwise - // be errors - QualType TryFixInvalidVariablyModifiedType(QualType T); - //===--------------------------------------------------------------------===// // Extra semantic analysis beyond the C type system private: diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index bab55bf8293..1a85bf46868 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -2477,7 +2477,11 @@ void Sema::ActOnDefs(Scope *S, SourceLocation DeclStart, CollectIvars(Class, Context, Decls); } -QualType Sema::TryFixInvalidVariablyModifiedType(QualType T) { +/// TryToFixInvalidVariablyModifiedType - Helper method to turn variable array +/// types into constant array types in certain situations which would otherwise +/// be errors (for GCC compatibility). +static QualType TryToFixInvalidVariablyModifiedType(QualType T, + ASTContext &Context) { // This method tries to turn a variable array into a constant // array even when the size isn't an ICE. This is necessary // for compatibility with code that depends on gcc's buggy @@ -2532,7 +2536,7 @@ Sema::DeclTy *Sema::ActOnField(Scope *S, // C99 6.7.2.1p8: A member of a structure or union may have any type other // than a variably modified type. if (T->isVariablyModifiedType()) { - QualType FixedTy = TryFixInvalidVariablyModifiedType(T); + QualType FixedTy = TryToFixInvalidVariablyModifiedType(T, Context); if (!FixedTy.isNull()) { Diag(Loc, diag::warn_illegal_constant_array_size, Loc); T = FixedTy; |