mirror of
https://github.com/github/codeql.git
synced 2026-04-18 05:24:01 +02:00
46 lines
824 B
Plaintext
46 lines
824 B
Plaintext
// generated by {{generator}} from {{source}}
|
|
// clang-format off
|
|
#pragma once
|
|
|
|
#include <iostream>
|
|
#include <string>
|
|
|
|
#include "swift/extractor/trap/TrapLabel.h"
|
|
#include "swift/extractor/trap/TrapTagTraits.h"
|
|
#include "swift/extractor/trap/generated/TrapTags.h"
|
|
|
|
namespace codeql {
|
|
{{#traps}}
|
|
|
|
// {{table_name}}
|
|
struct {{name}}Trap {
|
|
static constexpr const char* NAME = "{{name}}Trap";
|
|
|
|
{{#fields}}
|
|
{{type}} {{field_name}}{};
|
|
{{/fields}}
|
|
|
|
template <typename F>
|
|
void forEachLabel(F f) {
|
|
{{#fields}}
|
|
{{#is_label}}
|
|
f("{{field_name}}", -1, {{field_name}});
|
|
{{/is_label}}
|
|
{{/fields}}
|
|
}
|
|
};
|
|
|
|
std::ostream &operator<<(std::ostream &out, const {{name}}Trap &e);
|
|
|
|
{{#id}}
|
|
|
|
namespace detail {
|
|
template<>
|
|
struct ToBindingTrapFunctor<{{type}}> {
|
|
using type = {{name}}Trap;
|
|
};
|
|
}
|
|
{{/id}}
|
|
{{/traps}}
|
|
}
|