diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-02-28 18:33:55 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-02-28 18:33:55 +0000 |
| commit | 73a9c7d8919d03292e53ee1824fd543ab2c83483 (patch) | |
| tree | 1c7fd9485206ca51335a6041f9e0ba0ec0ece85b /clang/lib | |
| parent | e489a7d3d397214a43d587d88378f3df642aba60 (diff) | |
| download | bcm5719-llvm-73a9c7d8919d03292e53ee1824fd543ab2c83483.tar.gz bcm5719-llvm-73a9c7d8919d03292e53ee1824fd543ab2c83483.zip | |
pull some altivec stuff out of line.
llvm-svn: 97405
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 2ae5146e897..277d69f2cd7 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -3303,3 +3303,69 @@ void Parser::ParseTypeofSpecifier(DeclSpec &DS) { DiagID, Operand.release())) Diag(StartLoc, DiagID) << PrevSpec; } + + +/// TryAltiVecVectorTokenOutOfLine - Out of line body that should only be called +/// from TryAltiVecVectorToken. +bool Parser::TryAltiVecVectorTokenOutOfLine() { + Token Next = NextToken(); + switch (Next.getKind()) { + default: return false; + case tok::kw_short: + case tok::kw_long: + case tok::kw_signed: + case tok::kw_unsigned: + case tok::kw_void: + case tok::kw_char: + case tok::kw_int: + case tok::kw_float: + case tok::kw_double: + case tok::kw_bool: + case tok::kw___pixel: + Tok.setKind(tok::kw___vector); + return true; + case tok::identifier: + if (Next.getIdentifierInfo() == Ident_pixel) { + Tok.setKind(tok::kw___vector); + return true; + } + return false; + } +} + +bool Parser::TryAltiVecTokenOutOfLine(DeclSpec &DS, SourceLocation Loc, + const char *&PrevSpec, unsigned &DiagID, + bool &isInvalid) { + if (Tok.getIdentifierInfo() == Ident_vector) { + Token Next = NextToken(); + switch (Next.getKind()) { + case tok::kw_short: + case tok::kw_long: + case tok::kw_signed: + case tok::kw_unsigned: + case tok::kw_void: + case tok::kw_char: + case tok::kw_int: + case tok::kw_float: + case tok::kw_double: + case tok::kw_bool: + case tok::kw___pixel: + isInvalid = DS.SetTypeAltiVecVector(true, Loc, PrevSpec, DiagID); + return true; + case tok::identifier: + if (Next.getIdentifierInfo() == Ident_pixel) { + isInvalid = DS.SetTypeAltiVecVector(true, Loc, PrevSpec, DiagID); + return true; + } + break; + default: + break; + } + } else if (Tok.getIdentifierInfo() == Ident_pixel && + DS.isTypeAltiVecVector()) { + isInvalid = DS.SetTypeAltiVecPixel(true, Loc, PrevSpec, DiagID); + return true; + } + return false; +} + |

