Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
7d31e25a
Commit
7d31e25a
authored
Jan 29, 2018
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AddRef no longer need to lookup
parent
5ba1c33e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
20 deletions
+15
-20
vcc_action.c
lib/libvcc/vcc_action.c
+1
-1
vcc_compile.h
lib/libvcc/vcc_compile.h
+3
-3
vcc_expr.c
lib/libvcc/vcc_expr.c
+8
-9
vcc_parse.c
lib/libvcc/vcc_parse.c
+1
-1
vcc_xref.c
lib/libvcc/vcc_xref.c
+2
-6
No files found.
lib/libvcc/vcc_action.c
View file @
7d31e25a
...
...
@@ -393,7 +393,7 @@ vcc_ParseAction(struct vcc *tl)
{
struct
token
*
at
;
struct
action_table
*
atp
;
const
struct
symbol
*
sym
;
struct
symbol
*
sym
;
at
=
tl
->
t
;
assert
(
at
->
tok
==
ID
);
...
...
lib/libvcc/vcc_compile.h
View file @
7d31e25a
...
...
@@ -105,7 +105,7 @@ enum symkind {
};
typedef
void
sym_expr_t
(
struct
vcc
*
tl
,
struct
expr
**
,
const
struct
symbol
*
sym
,
vcc_type_t
);
struct
symbol
*
sym
,
vcc_type_t
);
typedef
void
sym_wildcard_t
(
struct
vcc
*
,
struct
symbol
*
,
const
char
*
,
const
char
*
);
...
...
@@ -274,7 +274,7 @@ char *TlDup(struct vcc *tl, const char *s);
/* vcc_expr.c */
void
vcc_Expr
(
struct
vcc
*
tl
,
vcc_type_t
typ
);
void
vcc_Expr_Call
(
struct
vcc
*
tl
,
const
struct
symbol
*
sym
);
void
vcc_Expr_Call
(
struct
vcc
*
tl
,
struct
symbol
*
sym
);
void
vcc_Expr_Init
(
struct
vcc
*
tl
);
sym_expr_t
vcc_Eval_Var
;
sym_expr_t
vcc_Eval_Handle
;
...
...
@@ -346,7 +346,7 @@ void vcc_ParseImport(struct vcc *tl);
void
vcc_ParseNew
(
struct
vcc
*
tl
);
/* vcc_xref.c */
struct
symbol
*
vcc_AddRef
(
struct
vcc
*
,
enum
symkind
);
void
vcc_AddRef
(
struct
vcc
*
,
struct
symbol
*
);
int
vcc_CheckReferences
(
struct
vcc
*
tl
);
void
VCC_XrefTable
(
struct
vcc
*
);
...
...
lib/libvcc/vcc_expr.c
View file @
7d31e25a
...
...
@@ -282,7 +282,7 @@ vcc_expr_tostring(struct vcc *tl, struct expr **e, vcc_type_t fmt)
*/
static
void
v_matchproto_
(
sym_expr_t
)
vcc_Eval_Regsub
(
struct
vcc
*
tl
,
struct
expr
**
e
,
const
struct
symbol
*
sym
,
vcc_Eval_Regsub
(
struct
vcc
*
tl
,
struct
expr
**
e
,
struct
symbol
*
sym
,
vcc_type_t
fmt
)
{
struct
expr
*
e2
;
...
...
@@ -312,7 +312,7 @@ vcc_Eval_Regsub(struct vcc *tl, struct expr **e, const struct symbol *sym,
*/
static
void
v_matchproto_
(
sym_expr_t
)
vcc_Eval_BoolConst
(
struct
vcc
*
tl
,
struct
expr
**
e
,
const
struct
symbol
*
sym
,
vcc_Eval_BoolConst
(
struct
vcc
*
tl
,
struct
expr
**
e
,
struct
symbol
*
sym
,
vcc_type_t
fmt
)
{
...
...
@@ -326,20 +326,19 @@ vcc_Eval_BoolConst(struct vcc *tl, struct expr **e, const struct symbol *sym,
*/
void
v_matchproto_
(
sym_expr_t
)
vcc_Eval_Handle
(
struct
vcc
*
tl
,
struct
expr
**
e
,
const
struct
symbol
*
sym
,
vcc_Eval_Handle
(
struct
vcc
*
tl
,
struct
expr
**
e
,
struct
symbol
*
sym
,
vcc_type_t
fmt
)
{
AN
(
sym
->
rname
);
vcc_AddRef
(
tl
,
sym
);
if
(
sym
->
fmt
!=
STRING
&&
fmt
==
STRINGS
)
{
(
void
)
vcc_AddRef
(
tl
,
sym
->
kind
);
*
e
=
vcc_mk_expr
(
STRINGS
,
"
\"
%s
\"
"
,
sym
->
name
);
(
*
e
)
->
nstr
=
1
;
(
*
e
)
->
constant
|=
EXPR_CONST
|
EXPR_STR_CONST
;
}
else
{
vcc_ExpectVid
(
tl
,
"handle"
);
(
void
)
vcc_AddRef
(
tl
,
sym
->
kind
);
*
e
=
vcc_mk_expr
(
sym
->
fmt
,
"%s"
,
sym
->
rname
);
(
*
e
)
->
constant
=
EXPR_VAR
;
(
*
e
)
->
nstr
=
1
;
...
...
@@ -353,7 +352,7 @@ vcc_Eval_Handle(struct vcc *tl, struct expr **e, const struct symbol *sym,
*/
void
v_matchproto_
(
sym_expr_t
)
vcc_Eval_Var
(
struct
vcc
*
tl
,
struct
expr
**
e
,
const
struct
symbol
*
sym
,
vcc_Eval_Var
(
struct
vcc
*
tl
,
struct
expr
**
e
,
struct
symbol
*
sym
,
vcc_type_t
fmt
)
{
...
...
@@ -598,7 +597,7 @@ vcc_Eval_Func(struct vcc *tl, const char *spec,
*/
void
v_matchproto_
(
sym_expr_t
)
vcc_Eval_SymFunc
(
struct
vcc
*
tl
,
struct
expr
**
e
,
const
struct
symbol
*
sym
,
vcc_Eval_SymFunc
(
struct
vcc
*
tl
,
struct
expr
**
e
,
struct
symbol
*
sym
,
vcc_type_t
fmt
)
{
...
...
@@ -630,7 +629,7 @@ vcc_expr4(struct vcc *tl, struct expr **e, vcc_type_t fmt)
{
struct
expr
*
e1
,
*
e2
;
const
char
*
ip
,
*
sign
;
const
struct
symbol
*
sym
;
struct
symbol
*
sym
;
enum
symkind
kind
;
double
d
;
int
i
;
...
...
@@ -1264,7 +1263,7 @@ vcc_Expr(struct vcc *tl, vcc_type_t fmt)
*/
void
vcc_Expr_Call
(
struct
vcc
*
tl
,
const
struct
symbol
*
sym
)
vcc_Expr_Call
(
struct
vcc
*
tl
,
struct
symbol
*
sym
)
{
struct
expr
*
e
;
...
...
lib/libvcc/vcc_parse.c
View file @
7d31e25a
...
...
@@ -247,7 +247,7 @@ vcc_ParseFunction(struct vcc *tl)
/* Add to VCL sub */
AN
(
p
->
method
);
if
(
p
->
name
==
NULL
)
{
(
void
)
vcc_AddRef
(
tl
,
SYM_SUB
);
vcc_AddRef
(
tl
,
sym
);
p
->
name
=
tl
->
t
;
}
}
...
...
lib/libvcc/vcc_xref.c
View file @
7d31e25a
...
...
@@ -63,17 +63,13 @@ struct procuse {
* Keep track of definitions and references
*/
struct
symbol
*
vcc_AddRef
(
struct
vcc
*
tl
,
enum
symkind
kind
)
void
vcc_AddRef
(
struct
vcc
*
tl
,
struct
symbol
*
sym
)
{
struct
symbol
*
sym
;
sym
=
VCC_SymbolTok
(
tl
,
kind
,
1
);
if
(
sym
->
ref_b
==
NULL
)
sym
->
ref_b
=
tl
->
t
;
AN
(
sym
);
sym
->
nref
++
;
return
(
sym
);
}
/*--------------------------------------------------------------------*/
...
...
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