LEFT | RIGHT |
(no file at all) | |
1 // | 1 // |
2 // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. | 2 // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 // | 5 // |
6 | 6 |
7 #include "compiler/ParseHelper.h" | 7 #include "compiler/ParseHelper.h" |
8 | 8 |
9 #include <stdarg.h> | 9 #include <stdarg.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 | 875 |
876 return false; | 876 return false; |
877 } | 877 } |
878 | 878 |
879 // | 879 // |
880 // Do semantic checking for a variable declaration that has no initializer, | 880 // Do semantic checking for a variable declaration that has no initializer, |
881 // and update the symbol table. | 881 // and update the symbol table. |
882 // | 882 // |
883 // Returns true if there was an error. | 883 // Returns true if there was an error. |
884 // | 884 // |
885 bool TParseContext::nonInitErrorCheck(int line, TString& identifier, TPublicType
& type) | 885 bool TParseContext::nonInitErrorCheck(int line, TString& identifier, TPublicType
& type, TVariable*& variable) |
886 { | 886 { |
887 if (reservedErrorCheck(line, identifier)) | 887 if (reservedErrorCheck(line, identifier)) |
888 recover(); | 888 recover(); |
889 | 889 |
890 TVariable* variable = new TVariable(&identifier, TType(type)); | 890 variable = new TVariable(&identifier, TType(type)); |
891 | 891 |
892 if (! symbolTable.insert(*variable)) { | 892 if (! symbolTable.insert(*variable)) { |
893 error(line, "redefinition", variable->getName().c_str(), ""); | 893 error(line, "redefinition", variable->getName().c_str(), ""); |
894 delete variable; | 894 delete variable; |
| 895 variable = 0; |
895 return true; | 896 return true; |
896 } | 897 } |
897 | 898 |
898 if (voidErrorCheck(line, identifier, type)) | 899 if (voidErrorCheck(line, identifier, type)) |
899 return true; | 900 return true; |
900 | 901 |
901 return false; | 902 return false; |
902 } | 903 } |
903 | 904 |
904 bool TParseContext::paramErrorCheck(int line, TQualifier qualifier, TQualifier p
aramQualifier, TType* type) | 905 bool TParseContext::paramErrorCheck(int line, TQualifier qualifier, TQualifier p
aramQualifier, TType* type) |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1521 { | 1522 { |
1522 // | 1523 // |
1523 // Minimal error checking for speed | 1524 // Minimal error checking for speed |
1524 // | 1525 // |
1525 | 1526 |
1526 TThreadParseContext *lpParseContext = static_cast<TThreadParseContext *>(OS_
GetTLSValue(GlobalParseContextIndex)); | 1527 TThreadParseContext *lpParseContext = static_cast<TThreadParseContext *>(OS_
GetTLSValue(GlobalParseContextIndex)); |
1527 | 1528 |
1528 return lpParseContext->lpGlobalParseContext; | 1529 return lpParseContext->lpGlobalParseContext; |
1529 } | 1530 } |
1530 | 1531 |
LEFT | RIGHT |