mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
34 lines
717 B
Plaintext
34 lines
717 B
Plaintext
// generated by {{generator}}
|
|
// clang-format off
|
|
#pragma once
|
|
|
|
#include <iostream>
|
|
#include <string>
|
|
|
|
#include "swift/extractor/trap/TrapLabel.h"
|
|
#include "swift/extractor/trap/TrapTags.h"
|
|
|
|
namespace codeql {
|
|
{{#traps}}
|
|
|
|
// {{table_name}}
|
|
struct {{name}}Trap {
|
|
static constexpr bool is_binding = {{#id}}true{{/id}}{{^id}}false{{/id}};
|
|
{{#id}}
|
|
{{type}} getBoundLabel() const { return {{cpp_name}}; }
|
|
{{/id}}
|
|
|
|
{{#fields}}
|
|
{{type}} {{cpp_name}}{};
|
|
{{/fields}}
|
|
};
|
|
|
|
inline std::ostream &operator<<(std::ostream &out, const {{name}}Trap &e) {
|
|
out << "{{table_name}}("{{#fields}}{{^first}} << ", "{{/first}}
|
|
<< {{#get_streamer}}e.{{cpp_name}}{{/get_streamer}}{{/fields}} << ")";
|
|
return out;
|
|
}
|
|
{{/traps}}
|
|
|
|
}
|