Files
codeql/swift/codegen/templates/cpp_traps.mustache
2022-05-04 18:20:06 +02:00

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}}
}