| 1604 | } |
| 1605 | |
| 1606 | void LlvmCodeGen::CodegenDebugTrace( |
| 1607 | LlvmBuilder* builder, const char* str, llvm::Value* v1) { |
| 1608 | LOG(ERROR) << "Remove IR codegen debug traces before checking in."; |
| 1609 | |
| 1610 | // Call printf by embedding the string into the module and getting a pointer to it. |
| 1611 | llvm::Value* const llvm_str = |
| 1612 | GetStringConstant(builder, Substitute("LLVM Trace: $0", str)); |
| 1613 | |
| 1614 | llvm::Function* printf = module_->getFunction("printf"); |
| 1615 | DCHECK(printf != nullptr); |
| 1616 | |
| 1617 | vector<llvm::Value*> calling_args; |
| 1618 | calling_args.push_back(llvm_str); |
| 1619 | if (v1 != NULL) calling_args.push_back(v1); |
| 1620 | builder->CreateCall(printf, calling_args); |
| 1621 | } |
| 1622 | |
| 1623 | Status LlvmCodeGen::GetSymbols(const string& file, const string& module_id, |
| 1624 | unordered_set<string>* symbols) { |