Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
3d79c1f5
Commit
3d79c1f5
authored
Jan 24, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Add source location information to attributes.
parent
a10740f3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
37 deletions
+40
-37
attribute.c
tools/widl/attribute.c
+36
-34
parser.y
tools/widl/parser.y
+0
-0
typetree.c
tools/widl/typetree.c
+1
-1
widl.h
tools/widl/widl.h
+2
-2
widltypes.h
tools/widl/widltypes.h
+1
-0
No files found.
tools/widl/attribute.c
View file @
3d79c1f5
...
@@ -24,17 +24,19 @@
...
@@ -24,17 +24,19 @@
#include "parser.tab.h"
#include "parser.tab.h"
attr_t
*
attr_int
(
enum
attr_type
attr_type
,
unsigned
int
val
)
attr_t
*
attr_int
(
struct
location
where
,
enum
attr_type
attr_type
,
unsigned
int
val
)
{
{
attr_t
*
a
=
xmalloc
(
sizeof
(
attr_t
)
);
attr_t
*
a
=
xmalloc
(
sizeof
(
attr_t
)
);
a
->
where
=
where
;
a
->
type
=
attr_type
;
a
->
type
=
attr_type
;
a
->
u
.
ival
=
val
;
a
->
u
.
ival
=
val
;
return
a
;
return
a
;
}
}
attr_t
*
attr_ptr
(
enum
attr_type
attr_type
,
void
*
val
)
attr_t
*
attr_ptr
(
struct
location
where
,
enum
attr_type
attr_type
,
void
*
val
)
{
{
attr_t
*
a
=
xmalloc
(
sizeof
(
attr_t
)
);
attr_t
*
a
=
xmalloc
(
sizeof
(
attr_t
)
);
a
->
where
=
where
;
a
->
type
=
attr_type
;
a
->
type
=
attr_type
;
a
->
u
.
pval
=
val
;
a
->
u
.
pval
=
val
;
return
a
;
return
a
;
...
@@ -338,8 +340,8 @@ attr_list_t *check_apicontract_attrs( const char *name, attr_list_t *attrs )
...
@@ -338,8 +340,8 @@ attr_list_t *check_apicontract_attrs( const char *name, attr_list_t *attrs )
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
{
{
if
(
!
allowed_attr
[
attr
->
type
].
on_apicontract
)
if
(
!
allowed_attr
[
attr
->
type
].
on_apicontract
)
error_
loc
(
"inapplicable attribute %s for apicontract %s
\n
"
,
error_
at
(
&
attr
->
where
,
"inapplicable attribute %s for apicontract %s
\n
"
,
allowed_attr
[
attr
->
type
].
display_name
,
name
);
allowed_attr
[
attr
->
type
].
display_name
,
name
);
}
}
return
attrs
;
return
attrs
;
}
}
...
@@ -351,8 +353,8 @@ attr_list_t *check_coclass_attrs( const char *name, attr_list_t *attrs )
...
@@ -351,8 +353,8 @@ attr_list_t *check_coclass_attrs( const char *name, attr_list_t *attrs )
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
{
{
if
(
!
allowed_attr
[
attr
->
type
].
on_coclass
)
if
(
!
allowed_attr
[
attr
->
type
].
on_coclass
)
error_
loc
(
"inapplicable attribute %s for coclass %s
\n
"
,
error_
at
(
&
attr
->
where
,
"inapplicable attribute %s for coclass %s
\n
"
,
allowed_attr
[
attr
->
type
].
display_name
,
name
);
allowed_attr
[
attr
->
type
].
display_name
,
name
);
}
}
return
attrs
;
return
attrs
;
}
}
...
@@ -364,8 +366,8 @@ attr_list_t *check_dispiface_attrs( const char *name, attr_list_t *attrs )
...
@@ -364,8 +366,8 @@ attr_list_t *check_dispiface_attrs( const char *name, attr_list_t *attrs )
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
{
{
if
(
!
allowed_attr
[
attr
->
type
].
on_dispinterface
)
if
(
!
allowed_attr
[
attr
->
type
].
on_dispinterface
)
error_
loc
(
"inapplicable attribute %s for dispinterface %s
\n
"
,
error_
at
(
&
attr
->
where
,
"inapplicable attribute %s for dispinterface %s
\n
"
,
allowed_attr
[
attr
->
type
].
display_name
,
name
);
allowed_attr
[
attr
->
type
].
display_name
,
name
);
}
}
return
attrs
;
return
attrs
;
}
}
...
@@ -377,8 +379,8 @@ attr_list_t *check_enum_attrs( attr_list_t *attrs )
...
@@ -377,8 +379,8 @@ attr_list_t *check_enum_attrs( attr_list_t *attrs )
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
{
{
if
(
!
allowed_attr
[
attr
->
type
].
on_enum
)
if
(
!
allowed_attr
[
attr
->
type
].
on_enum
)
error_
loc
(
"inapplicable attribute %s for enum
\n
"
,
error_
at
(
&
attr
->
where
,
"inapplicable attribute %s for enum
\n
"
,
allowed_attr
[
attr
->
type
].
display_name
);
allowed_attr
[
attr
->
type
].
display_name
);
}
}
return
attrs
;
return
attrs
;
}
}
...
@@ -390,8 +392,8 @@ attr_list_t *check_enum_member_attrs( attr_list_t *attrs )
...
@@ -390,8 +392,8 @@ attr_list_t *check_enum_member_attrs( attr_list_t *attrs )
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
{
{
if
(
!
allowed_attr
[
attr
->
type
].
on_enum_member
)
if
(
!
allowed_attr
[
attr
->
type
].
on_enum_member
)
error_
loc
(
"inapplicable attribute %s for enum member
\n
"
,
error_
at
(
&
attr
->
where
,
"inapplicable attribute %s for enum member
\n
"
,
allowed_attr
[
attr
->
type
].
display_name
);
allowed_attr
[
attr
->
type
].
display_name
);
}
}
return
attrs
;
return
attrs
;
}
}
...
@@ -403,8 +405,8 @@ attr_list_t *check_field_attrs( const char *name, attr_list_t *attrs )
...
@@ -403,8 +405,8 @@ attr_list_t *check_field_attrs( const char *name, attr_list_t *attrs )
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
{
{
if
(
!
allowed_attr
[
attr
->
type
].
on_field
)
if
(
!
allowed_attr
[
attr
->
type
].
on_field
)
error_
loc
(
"inapplicable attribute %s for field %s
\n
"
,
error_
at
(
&
attr
->
where
,
"inapplicable attribute %s for field %s
\n
"
,
allowed_attr
[
attr
->
type
].
display_name
,
name
);
allowed_attr
[
attr
->
type
].
display_name
,
name
);
}
}
return
attrs
;
return
attrs
;
}
}
...
@@ -416,8 +418,8 @@ attr_list_t *check_function_attrs( const char *name, attr_list_t *attrs )
...
@@ -416,8 +418,8 @@ attr_list_t *check_function_attrs( const char *name, attr_list_t *attrs )
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
{
{
if
(
!
allowed_attr
[
attr
->
type
].
on_function
)
if
(
!
allowed_attr
[
attr
->
type
].
on_function
)
error_
loc
(
"inapplicable attribute %s for function %s
\n
"
,
error_
at
(
&
attr
->
where
,
"inapplicable attribute %s for function %s
\n
"
,
allowed_attr
[
attr
->
type
].
display_name
,
name
);
allowed_attr
[
attr
->
type
].
display_name
,
name
);
}
}
return
attrs
;
return
attrs
;
}
}
...
@@ -429,8 +431,8 @@ attr_list_t *check_interface_attrs( const char *name, attr_list_t *attrs )
...
@@ -429,8 +431,8 @@ attr_list_t *check_interface_attrs( const char *name, attr_list_t *attrs )
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
{
{
if
(
!
allowed_attr
[
attr
->
type
].
on_interface
)
if
(
!
allowed_attr
[
attr
->
type
].
on_interface
)
error_
loc
(
"inapplicable attribute %s for interface %s
\n
"
,
error_
at
(
&
attr
->
where
,
"inapplicable attribute %s for interface %s
\n
"
,
allowed_attr
[
attr
->
type
].
display_name
,
name
);
allowed_attr
[
attr
->
type
].
display_name
,
name
);
if
(
attr
->
type
==
ATTR_IMPLICIT_HANDLE
)
if
(
attr
->
type
==
ATTR_IMPLICIT_HANDLE
)
{
{
const
var_t
*
var
=
attr
->
u
.
pval
;
const
var_t
*
var
=
attr
->
u
.
pval
;
...
@@ -438,8 +440,8 @@ attr_list_t *check_interface_attrs( const char *name, attr_list_t *attrs )
...
@@ -438,8 +440,8 @@ attr_list_t *check_interface_attrs( const char *name, attr_list_t *attrs )
type_basic_get_type
(
var
->
declspec
.
type
)
==
TYPE_BASIC_HANDLE
)
type_basic_get_type
(
var
->
declspec
.
type
)
==
TYPE_BASIC_HANDLE
)
continue
;
continue
;
if
(
is_aliaschain_attr
(
var
->
declspec
.
type
,
ATTR_HANDLE
))
continue
;
if
(
is_aliaschain_attr
(
var
->
declspec
.
type
,
ATTR_HANDLE
))
continue
;
error_
loc
(
"attribute %s requires a handle type in interface %s
\n
"
,
error_
at
(
&
attr
->
where
,
"attribute %s requires a handle type in interface %s
\n
"
,
allowed_attr
[
attr
->
type
].
display_name
,
name
);
allowed_attr
[
attr
->
type
].
display_name
,
name
);
}
}
}
}
return
attrs
;
return
attrs
;
...
@@ -452,8 +454,8 @@ attr_list_t *check_library_attrs( const char *name, attr_list_t *attrs )
...
@@ -452,8 +454,8 @@ attr_list_t *check_library_attrs( const char *name, attr_list_t *attrs )
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
{
{
if
(
!
allowed_attr
[
attr
->
type
].
on_library
)
if
(
!
allowed_attr
[
attr
->
type
].
on_library
)
error_
loc
(
"inapplicable attribute %s for library %s
\n
"
,
error_
at
(
&
attr
->
where
,
"inapplicable attribute %s for library %s
\n
"
,
allowed_attr
[
attr
->
type
].
display_name
,
name
);
allowed_attr
[
attr
->
type
].
display_name
,
name
);
}
}
return
attrs
;
return
attrs
;
}
}
...
@@ -465,8 +467,8 @@ attr_list_t *check_module_attrs( const char *name, attr_list_t *attrs )
...
@@ -465,8 +467,8 @@ attr_list_t *check_module_attrs( const char *name, attr_list_t *attrs )
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
{
{
if
(
!
allowed_attr
[
attr
->
type
].
on_module
)
if
(
!
allowed_attr
[
attr
->
type
].
on_module
)
error_
loc
(
"inapplicable attribute %s for module %s
\n
"
,
error_
at
(
&
attr
->
where
,
"inapplicable attribute %s for module %s
\n
"
,
allowed_attr
[
attr
->
type
].
display_name
,
name
);
allowed_attr
[
attr
->
type
].
display_name
,
name
);
}
}
return
attrs
;
return
attrs
;
}
}
...
@@ -478,8 +480,8 @@ attr_list_t *check_runtimeclass_attrs( const char *name, attr_list_t *attrs )
...
@@ -478,8 +480,8 @@ attr_list_t *check_runtimeclass_attrs( const char *name, attr_list_t *attrs )
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
{
{
if
(
!
allowed_attr
[
attr
->
type
].
on_runtimeclass
)
if
(
!
allowed_attr
[
attr
->
type
].
on_runtimeclass
)
error_
loc
(
"inapplicable attribute %s for runtimeclass %s
\n
"
,
error_
at
(
&
attr
->
where
,
"inapplicable attribute %s for runtimeclass %s
\n
"
,
allowed_attr
[
attr
->
type
].
display_name
,
name
);
allowed_attr
[
attr
->
type
].
display_name
,
name
);
}
}
return
attrs
;
return
attrs
;
}
}
...
@@ -492,8 +494,8 @@ attr_list_t *check_struct_attrs( attr_list_t *attrs )
...
@@ -492,8 +494,8 @@ attr_list_t *check_struct_attrs( attr_list_t *attrs )
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
{
{
if
(
!
(
allowed_attr
[
attr
->
type
].
on_struct
&
mask
))
if
(
!
(
allowed_attr
[
attr
->
type
].
on_struct
&
mask
))
error_
loc
(
"inapplicable attribute %s for struct
\n
"
,
error_
at
(
&
attr
->
where
,
"inapplicable attribute %s for struct
\n
"
,
allowed_attr
[
attr
->
type
].
display_name
);
allowed_attr
[
attr
->
type
].
display_name
);
}
}
return
attrs
;
return
attrs
;
}
}
...
@@ -505,8 +507,8 @@ attr_list_t *check_typedef_attrs( attr_list_t *attrs )
...
@@ -505,8 +507,8 @@ attr_list_t *check_typedef_attrs( attr_list_t *attrs )
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
{
{
if
(
!
allowed_attr
[
attr
->
type
].
on_type
)
if
(
!
allowed_attr
[
attr
->
type
].
on_type
)
error_
loc
(
"inapplicable attribute %s for typedef
\n
"
,
error_
at
(
&
attr
->
where
,
"inapplicable attribute %s for typedef
\n
"
,
allowed_attr
[
attr
->
type
].
display_name
);
allowed_attr
[
attr
->
type
].
display_name
);
}
}
return
attrs
;
return
attrs
;
}
}
...
@@ -518,8 +520,8 @@ attr_list_t *check_union_attrs( attr_list_t *attrs )
...
@@ -518,8 +520,8 @@ attr_list_t *check_union_attrs( attr_list_t *attrs )
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
LIST_FOR_EACH_ENTRY
(
attr
,
attrs
,
const
attr_t
,
entry
)
{
{
if
(
!
allowed_attr
[
attr
->
type
].
on_union
)
if
(
!
allowed_attr
[
attr
->
type
].
on_union
)
error_
loc
(
"inapplicable attribute %s for union
\n
"
,
error_
at
(
&
attr
->
where
,
"inapplicable attribute %s for union
\n
"
,
allowed_attr
[
attr
->
type
].
display_name
);
allowed_attr
[
attr
->
type
].
display_name
);
}
}
return
attrs
;
return
attrs
;
}
}
...
@@ -531,7 +533,7 @@ void check_arg_attrs( const var_t *arg )
...
@@ -531,7 +533,7 @@ void check_arg_attrs( const var_t *arg )
LIST_FOR_EACH_ENTRY
(
attr
,
arg
->
attrs
,
const
attr_t
,
entry
)
LIST_FOR_EACH_ENTRY
(
attr
,
arg
->
attrs
,
const
attr_t
,
entry
)
{
{
if
(
!
allowed_attr
[
attr
->
type
].
on_arg
)
if
(
!
allowed_attr
[
attr
->
type
].
on_arg
)
error_
loc
(
"inapplicable attribute %s for argument %s
\n
"
,
error_
at
(
&
attr
->
where
,
"inapplicable attribute %s for argument %s
\n
"
,
allowed_attr
[
attr
->
type
].
display_name
,
arg
->
name
);
allowed_attr
[
attr
->
type
].
display_name
,
arg
->
name
);
}
}
}
}
tools/widl/parser.y
View file @
3d79c1f5
This diff is collapsed.
Click to expand it.
tools/widl/typetree.c
View file @
3d79c1f5
...
@@ -1268,7 +1268,7 @@ static void compute_interface_signature_uuid(type_t *iface)
...
@@ -1268,7 +1268,7 @@ static void compute_interface_signature_uuid(type_t *iface)
if
(
!
(
uuid
=
get_attrp
(
iface
->
attrs
,
ATTR_UUID
)))
if
(
!
(
uuid
=
get_attrp
(
iface
->
attrs
,
ATTR_UUID
)))
{
{
uuid
=
xmalloc
(
sizeof
(
*
uuid
));
uuid
=
xmalloc
(
sizeof
(
*
uuid
));
iface
->
attrs
=
append_attr
(
iface
->
attrs
,
attr_ptr
(
ATTR_UUID
,
uuid
)
);
iface
->
attrs
=
append_attr
(
iface
->
attrs
,
attr_ptr
(
iface
->
where
,
ATTR_UUID
,
uuid
)
);
}
}
sha1_init
(
&
ctx
);
sha1_init
(
&
ctx
);
...
...
tools/widl/widl.h
View file @
3d79c1f5
...
@@ -97,8 +97,8 @@ extern void end_cplusplus_guard(FILE *fp);
...
@@ -97,8 +97,8 @@ extern void end_cplusplus_guard(FILE *fp);
/* attribute.c */
/* attribute.c */
extern
attr_t
*
attr_int
(
enum
attr_type
attr_type
,
unsigned
int
val
);
extern
attr_t
*
attr_int
(
struct
location
where
,
enum
attr_type
attr_type
,
unsigned
int
val
);
extern
attr_t
*
attr_ptr
(
enum
attr_type
attr_type
,
void
*
val
);
extern
attr_t
*
attr_ptr
(
struct
location
where
,
enum
attr_type
attr_type
,
void
*
val
);
extern
int
is_attr
(
const
attr_list_t
*
list
,
enum
attr_type
attr_type
);
extern
int
is_attr
(
const
attr_list_t
*
list
,
enum
attr_type
attr_type
);
extern
int
is_ptrchain_attr
(
const
var_t
*
var
,
enum
attr_type
attr_type
);
extern
int
is_ptrchain_attr
(
const
var_t
*
var
,
enum
attr_type
attr_type
);
...
...
tools/widl/widltypes.h
View file @
3d79c1f5
...
@@ -341,6 +341,7 @@ struct _attr_t {
...
@@ -341,6 +341,7 @@ struct _attr_t {
}
u
;
}
u
;
/* parser-internal */
/* parser-internal */
struct
list
entry
;
struct
list
entry
;
struct
location
where
;
};
};
struct
_expr_t
{
struct
_expr_t
{
...
...
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