Non-functional: Rationalizing parse helper hierarchy, step 1 (effected memory of...
authorJohn Kessenich <cepheus@frii.com>
Sat, 1 Oct 2016 23:47:40 +0000 (17:47 -0600)
committerJohn Kessenich <cepheus@frii.com>
Sat, 1 Oct 2016 23:47:40 +0000 (17:47 -0600)
glslang/Include/revision.h
glslang/MachineIndependent/ShaderLang.cpp
hlsl/hlslParseHelper.cpp

index c003acd..797c2f2 100644 (file)
@@ -2,5 +2,5 @@
 // For the version, it uses the latest git tag followed by the number of commits.
 // For the date, it uses the current date (when then script is run).
 
-#define GLSLANG_REVISION "Overload400-PrecQual.1545"
+#define GLSLANG_REVISION "Overload400-PrecQual.1546"
 #define GLSLANG_DATE "01-Oct-2016"
index ffd6b00..d6ff782 100644 (file)
@@ -51,6 +51,7 @@
 #include "../../hlsl/hlslParseables.h"
 #include "Scan.h"
 #include "ScanContext.h"
+#include "../../hlsl/hlslScanContext.h"
 
 #include "../Include/ShHandle.h"
 #include "../../OGLCompilersDLL/InitializeDll.h"
@@ -1049,6 +1050,7 @@ int ShInitialize()
         PerProcessGPA = new TPoolAllocator();
 
     glslang::TScanContext::fillInKeywordMap();
+    glslang::HlslScanContext::fillInKeywordMap();
 
     return 1;
 }
@@ -1141,6 +1143,7 @@ int __fastcall ShFinalize()
     }
 
     glslang::TScanContext::deleteKeywordMap();
+    glslang::HlslScanContext::deleteKeywordMap();
 
     return 1;
 }
index 2fa892f..f1294ef 100755 (executable)
@@ -117,8 +117,6 @@ bool HlslParseContext::parseShaderStrings(TPpContext& ppContext, TInputScanner&
     currentScanner = &input;
     ppContext.setInput(input, versionWillBeError);
 
-    HlslScanContext::fillInKeywordMap();      // TODO: right place, and include the delete too
-
     HlslScanContext scanContext(*this, ppContext);
     HlslGrammar grammar(scanContext, *this);
     if (!grammar.parse()) {
@@ -4774,34 +4772,6 @@ void HlslParseContext::declareBlock(const TSourceLoc& loc, TType& type, const TS
     if (arraySizes)
         blockType.newArraySizes(*arraySizes);
 
-    //
-    // Don't make a user-defined type out of block name; that will cause an error
-    // if the same block name gets reused in a different interface.
-    //
-    // "Block names have no other use within a shader
-    // beyond interface matching; it is a compile-time error to use a block name at global scope for anything
-    // other than as a block name (e.g., use of a block name for a global variable name or function name is
-    // currently reserved)."
-    //
-    // Use the symbol table to prevent normal reuse of the block's name, as a variable entry,
-    // whose type is EbtBlock, but without all the structure; that will come from the type
-    // the instances point to.
-    //
-    //??TType blockNameType(EbtBlock, blockType.getQualifier().storage);
-    //??TVariable* blockNameVar = new TVariable(blockName, blockNameType);
-    //if (! symbolTable.insert(*blockNameVar)) {
-    //    TSymbol* existingName = symbolTable.find(*blockName);
-    //    if (existingName->getType().getBasicType() == EbtBlock) {
-    //        if (existingName->getType().getQualifier().storage == blockType.getQualifier().storage) {
-    //            error(loc, "Cannot reuse block name within the same interface:", blockName->c_str(), blockType.getStorageQualifierString());
-    //            return;
-    //        }
-    //    } else {
-    //        error(loc, "block name cannot redefine a non-block name", blockName->c_str(), "");
-    //        return;
-    //    }
-    //}
-
     // Add the variable, as anonymous or named instanceName.
     // Make an anonymous variable if no name was provided.
     if (! instanceName)