SPIR-V OpLines now contain filenames from HLSL-style #lines.
This commit is contained in:
parent
127cea5c9a
commit
5d43c4aac7
18 changed files with 754 additions and 39 deletions
|
|
@ -229,16 +229,28 @@ inline const TString String(const int i, const int /*base*/ = 10)
|
|||
#endif
|
||||
|
||||
struct TSourceLoc {
|
||||
void init() { name = nullptr; string = 0; line = 0; column = 0; }
|
||||
void init()
|
||||
{
|
||||
name = nullptr; string = 0; line = 0; column = 0;
|
||||
}
|
||||
void init(int stringNum) { init(); string = stringNum; }
|
||||
// Returns the name if it exists. Otherwise, returns the string number.
|
||||
std::string getStringNameOrNum(bool quoteStringName = true) const
|
||||
{
|
||||
if (name != nullptr)
|
||||
return quoteStringName ? ("\"" + std::string(name) + "\"") : name;
|
||||
if (name != nullptr) {
|
||||
TString qstr = quoteStringName ? ("\"" + *name + "\"") : *name;
|
||||
std::string ret_str(qstr.c_str());
|
||||
return ret_str;
|
||||
}
|
||||
return std::to_string((long long)string);
|
||||
}
|
||||
const char* name; // descriptive name for this string
|
||||
const char* getFilename() const
|
||||
{
|
||||
if (name == nullptr)
|
||||
return nullptr;
|
||||
return name->c_str();
|
||||
}
|
||||
TString* name; // descriptive name for this string
|
||||
int string;
|
||||
int line;
|
||||
int column;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue