22 #include <unordered_set>
32 const std::string& ppfile,
34 const std::string& ppfunc)
66 for (
auto bb_it = func_it->begin(); bb_it != func_it->end(); ++bb_it) {
67 for (
auto instr_it = bb_it->begin(); instr_it != bb_it->end(); ++instr_it) {
82 for (
auto bb_it = func_it->begin(); bb_it != func_it->end(); ++bb_it) {
83 for (
auto instr_it = bb_it->begin(); instr_it != bb_it->end(); ++instr_it) {
86 llvm::Instruction* i = &*instr_it;
89 std::string footnote =
96 it->second.detailed_footnote_ =
97 footnote +
", " + it->second.detailed_footnote_;
110 for (
auto bb_it = func_it->begin(); bb_it != func_it->end(); ++bb_it) {
111 for (
auto instr_it = bb_it->begin(); instr_it != bb_it->end(); ++instr_it) {
118 auto value = llvm::MDNode::get(
123 our_it->first->setMetadata(kind_id, value);
132 if (!fnames.empty()) {
133 return fnames.back();
142 for (
auto n : fnames) {
143 if (copying && !n.empty()) {
149 if (n ==
"QueryEngine") {
153 if (f.empty() && fnames.size() > 0) {
155 }
else if (f.empty()) {
162 static const std::unordered_set<std::string::value_type> allowed_punct{
'_',
'.'};
163 for (
auto& ch : text) {
164 if (std::ispunct(ch) && !allowed_punct.count(ch)) {
190 inline static std::unordered_map<CgenState*, OurInstructions>
instructions_;
195 #define AUTOMATIC_IR_METADATA(CGENSTATE) \
196 AutomaticIRMetadataGuard automatic_ir_metadata_guard( \
197 CGENSTATE, __FILE__, __LINE__, __func__)
199 #define AUTOMATIC_IR_METADATA_DONE() automatic_ir_metadata_guard.done()
203 #define AUTOMATIC_IR_METADATA(CGENSTATE)
204 #define AUTOMATIC_IR_METADATA_DONE()
llvm::LLVMContext & context_
bool g_enable_watchdog false