Non-functional: Rationalizing parse helper hierarchy, step 1 (effected memory of HLSL keyword map).

This commit is contained in:
John Kessenich 2016-10-01 17:47:40 -06:00
parent a08c929d8e
commit 273060c2d3
3 changed files with 4 additions and 31 deletions

View 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"

View 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;
}

View File

@ -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)