Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
fd1d07da
Commit
fd1d07da
authored
Nov 20, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Memory: Put pragma tables in the pool.
Fixes #916 (the last change covered by the PR). 3rd list item in #976.
parent
cbdf871d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
9 deletions
+12
-9
Common.h
glslang/Include/Common.h
+4
-1
intermediate.h
glslang/Include/intermediate.h
+3
-3
Intermediate.cpp
glslang/MachineIndependent/Intermediate.cpp
+3
-3
glslang.y
glslang/MachineIndependent/glslang.y
+1
-1
glslang_tab.cpp
glslang/MachineIndependent/glslang_tab.cpp
+1
-1
No files found.
glslang/Include/Common.h
View file @
fd1d07da
...
...
@@ -240,7 +240,10 @@ struct TSourceLoc {
int
column
;
};
typedef
TMap
<
TString
,
TString
>
TPragmaTable
;
class
TPragmaTable
:
public
TMap
<
TString
,
TString
>
{
public
:
POOL_ALLOCATOR_NEW_DELETE
(
GetThreadPoolAllocator
())
};
const
int
MaxTokenLength
=
1024
;
...
...
glslang/Include/intermediate.h
View file @
fd1d07da
...
...
@@ -1303,8 +1303,8 @@ typedef TVector<TStorageQualifier> TQualifierList;
//
class
TIntermAggregate
:
public
TIntermOperator
{
public
:
TIntermAggregate
()
:
TIntermOperator
(
EOpNull
),
userDefined
(
false
),
pragmaTable
(
0
)
{
}
TIntermAggregate
(
TOperator
o
)
:
TIntermOperator
(
o
),
pragmaTable
(
0
)
{
}
TIntermAggregate
()
:
TIntermOperator
(
EOpNull
),
userDefined
(
false
),
pragmaTable
(
nullptr
)
{
}
TIntermAggregate
(
TOperator
o
)
:
TIntermOperator
(
o
),
pragmaTable
(
nullptr
)
{
}
~
TIntermAggregate
()
{
delete
pragmaTable
;
}
virtual
TIntermAggregate
*
getAsAggregate
()
{
return
this
;
}
virtual
const
TIntermAggregate
*
getAsAggregate
()
const
{
return
this
;
}
...
...
@@ -1322,7 +1322,7 @@ public:
void
setDebug
(
bool
d
)
{
debug
=
d
;
}
bool
getOptimize
()
const
{
return
optimize
;
}
bool
getDebug
()
const
{
return
debug
;
}
void
addTo
PragmaTable
(
const
TPragmaTable
&
pTable
);
void
set
PragmaTable
(
const
TPragmaTable
&
pTable
);
const
TPragmaTable
&
getPragmaTable
()
const
{
return
*
pragmaTable
;
}
protected
:
TIntermAggregate
(
const
TIntermAggregate
&
);
// disallow copy constructor
...
...
glslang/MachineIndependent/Intermediate.cpp
View file @
fd1d07da
...
...
@@ -3170,10 +3170,10 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
node
->
getLoc
());
}
void
TIntermAggregate
::
addTo
PragmaTable
(
const
TPragmaTable
&
pTable
)
void
TIntermAggregate
::
set
PragmaTable
(
const
TPragmaTable
&
pTable
)
{
assert
(
!
pragmaTable
);
pragmaTable
=
new
TPragmaTable
()
;
assert
(
pragmaTable
==
nullptr
);
pragmaTable
=
new
TPragmaTable
;
*
pragmaTable
=
pTable
;
}
...
...
glslang/MachineIndependent/glslang.y
View file @
fd1d07da
...
...
@@ -2916,7 +2916,7 @@ function_definition
// information. This information can be queried from the parse tree
$$->getAsAggregate()->setOptimize(parseContext.contextPragma.optimize);
$$->getAsAggregate()->setDebug(parseContext.contextPragma.debug);
$$->getAsAggregate()->
addTo
PragmaTable(parseContext.contextPragma.pragmaTable);
$$->getAsAggregate()->
set
PragmaTable(parseContext.contextPragma.pragmaTable);
}
;
...
...
glslang/MachineIndependent/glslang_tab.cpp
View file @
fd1d07da
...
...
@@ -7975,7 +7975,7 @@ yyreduce:
// information. This information can be queried from the parse tree
(
yyval
.
interm
.
intermNode
)
->
getAsAggregate
()
->
setOptimize
(
parseContext
.
contextPragma
.
optimize
);
(
yyval
.
interm
.
intermNode
)
->
getAsAggregate
()
->
setDebug
(
parseContext
.
contextPragma
.
debug
);
(
yyval
.
interm
.
intermNode
)
->
getAsAggregate
()
->
addTo
PragmaTable
(
parseContext
.
contextPragma
.
pragmaTable
);
(
yyval
.
interm
.
intermNode
)
->
getAsAggregate
()
->
set
PragmaTable
(
parseContext
.
contextPragma
.
pragmaTable
);
}
#line 7981 "MachineIndependent/glslang_tab.cpp"
/* yacc.c:1646 */
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment