-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ir: Deal with name conflicts correctly in declaration type resolution.
So, basically, make opaque items last, and make previous names override them. Fixes #649
- Loading branch information
Showing
15 changed files
with
258 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <stdarg.h> | ||
#include <stdbool.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
|
||
enum BindingType { | ||
Buffer = 0, | ||
NotBuffer = 1, | ||
}; | ||
typedef uint32_t BindingType; | ||
|
||
typedef struct BindGroupLayoutEntry { | ||
BindingType ty; | ||
} BindGroupLayoutEntry; | ||
|
||
void root(struct BindGroupLayoutEntry entry); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include <stdarg.h> | ||
#include <stdbool.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
|
||
enum BindingType | ||
#ifdef __cplusplus | ||
: uint32_t | ||
#endif // __cplusplus | ||
{ | ||
Buffer = 0, | ||
NotBuffer = 1, | ||
}; | ||
#ifndef __cplusplus | ||
typedef uint32_t BindingType; | ||
#endif // __cplusplus | ||
|
||
typedef struct BindGroupLayoutEntry { | ||
BindingType ty; | ||
} BindGroupLayoutEntry; | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif // __cplusplus | ||
|
||
void root(struct BindGroupLayoutEntry entry); | ||
|
||
#ifdef __cplusplus | ||
} // extern "C" | ||
#endif // __cplusplus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <stdarg.h> | ||
#include <stdbool.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
|
||
enum BindingType { | ||
Buffer = 0, | ||
NotBuffer = 1, | ||
}; | ||
typedef uint32_t BindingType; | ||
|
||
typedef struct { | ||
BindingType ty; | ||
} BindGroupLayoutEntry; | ||
|
||
void root(BindGroupLayoutEntry entry); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include <stdarg.h> | ||
#include <stdbool.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
|
||
enum BindingType | ||
#ifdef __cplusplus | ||
: uint32_t | ||
#endif // __cplusplus | ||
{ | ||
Buffer = 0, | ||
NotBuffer = 1, | ||
}; | ||
#ifndef __cplusplus | ||
typedef uint32_t BindingType; | ||
#endif // __cplusplus | ||
|
||
typedef struct { | ||
BindingType ty; | ||
} BindGroupLayoutEntry; | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif // __cplusplus | ||
|
||
void root(BindGroupLayoutEntry entry); | ||
|
||
#ifdef __cplusplus | ||
} // extern "C" | ||
#endif // __cplusplus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <cstdarg> | ||
#include <cstdint> | ||
#include <cstdlib> | ||
#include <ostream> | ||
#include <new> | ||
|
||
enum class BindingType : uint32_t { | ||
Buffer = 0, | ||
NotBuffer = 1, | ||
}; | ||
|
||
struct BindGroupLayoutEntry { | ||
BindingType ty; | ||
}; | ||
|
||
extern "C" { | ||
|
||
void root(BindGroupLayoutEntry entry); | ||
|
||
} // extern "C" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from libc.stdint cimport int8_t, int16_t, int32_t, int64_t, intptr_t | ||
from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t, uintptr_t | ||
cdef extern from *: | ||
ctypedef bint bool | ||
ctypedef struct va_list | ||
|
||
cdef extern from *: | ||
|
||
cdef enum: | ||
Buffer # = 0, | ||
NotBuffer # = 1, | ||
ctypedef uint32_t BindingType; | ||
|
||
ctypedef struct BindGroupLayoutEntry: | ||
BindingType ty; | ||
|
||
void root(BindGroupLayoutEntry entry); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <stdarg.h> | ||
#include <stdbool.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
|
||
enum BindingType { | ||
Buffer = 0, | ||
NotBuffer = 1, | ||
}; | ||
typedef uint32_t BindingType; | ||
|
||
struct BindGroupLayoutEntry { | ||
BindingType ty; | ||
}; | ||
|
||
void root(struct BindGroupLayoutEntry entry); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include <stdarg.h> | ||
#include <stdbool.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
|
||
enum BindingType | ||
#ifdef __cplusplus | ||
: uint32_t | ||
#endif // __cplusplus | ||
{ | ||
Buffer = 0, | ||
NotBuffer = 1, | ||
}; | ||
#ifndef __cplusplus | ||
typedef uint32_t BindingType; | ||
#endif // __cplusplus | ||
|
||
struct BindGroupLayoutEntry { | ||
BindingType ty; | ||
}; | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif // __cplusplus | ||
|
||
void root(struct BindGroupLayoutEntry entry); | ||
|
||
#ifdef __cplusplus | ||
} // extern "C" | ||
#endif // __cplusplus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from libc.stdint cimport int8_t, int16_t, int32_t, int64_t, intptr_t | ||
from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t, uintptr_t | ||
cdef extern from *: | ||
ctypedef bint bool | ||
ctypedef struct va_list | ||
|
||
cdef extern from *: | ||
|
||
cdef enum: | ||
Buffer # = 0, | ||
NotBuffer # = 1, | ||
ctypedef uint32_t BindingType; | ||
|
||
cdef struct BindGroupLayoutEntry: | ||
BindingType ty; | ||
|
||
void root(BindGroupLayoutEntry entry); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
mod uhoh { | ||
enum BindingType { Buffer, NotBuffer } | ||
} | ||
|
||
#[repr(u32)] | ||
pub enum BindingType { Buffer = 0, NotBuffer = 1 } | ||
|
||
#[repr(C)] | ||
pub struct BindGroupLayoutEntry { | ||
pub ty: BindingType, // This is the repr(u32) enum | ||
} | ||
|
||
#[no_mangle] | ||
pub extern "C" fn root(entry: BindGroupLayoutEntry) {} |