search for: raw_string_ostream

Displaying 20 results from an estimated 60 matches for "raw_string_ostream".

2020 Apr 15
3
Backend emitting to string instead of file
...                                      DwoOut ? &DwoOut->os() : nullptr,                                       FileType, NoVerify, MMIWP)) Now, with this tiny change I was hoping to write to a string instead of the output stream defined by the command line parameters: std::string outStr; raw_string_ostream stream(outStr); buffer_ostream pstream(stream); if (Target->addPassesToEmitFile(PM, pstream,                                     DwoOut ? &DwoOut->os() : nullptr,                                     FileType, NoVerify, MMIWP)) later, e.g., after PM.run(*M), I check the string for cont...
2017 Jul 27
2
llvm 5.0 release rc1 : ExecutionEngine fatal error on MCJIT::getFunctionAddress
Hi everyone, In llvm 4.0 the MCJIT::getFunctionAddress function return 0 (a null address) when the symbol is not found : *uint64_t MCJIT::getSymbolAddress(const std::string &Name, bool CheckFunctionsOnly) { std::string MangledName; { raw_string_ostream MangledNameStream(MangledName); Mangler::getNameWithPrefix(MangledNameStream, Name, getDataLayout()); } return findSymbol(MangledName, CheckFunctionsOnly).getAddress();}* Now with the current implementation (llvm 5.0 rc1 tag) : *uint64_t MCJIT::getSymbolAddress(const std::string...
2018 Dec 12
2
How to get the destination in a LoadInst
Thanks Joshua and Michael, Just to to clarify, I'm experimenting with the Interpreter class and observing the instructions that are executed by it. Just for becoming more confident with LLVM in general I'd like for each instruction to access to the various parts of it. In this instance I would like to access to the %Name that is shown in the textual representation. When I call
2017 Oct 05
2
Conversion of const llvm::MCExpr * to string
Hello, I need the expression in string. How can i convert llvm::MCExpr * to string? Please help. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171005/50817330/attachment.html>
2013 Jul 23
0
[LLVMdev] Analysis of polly-detect overhead in oggenc
...\ >> do { \ >> if (GraphViewMode) { \ >> std::string Buf; \ >> raw_string_ostream fmt(Buf); \ >> fmt << MESSAGE; \ >> fmt.flush(); \ >> LastFailure = Buf;...
2019 Jan 16
5
How to get the string representation of an instruction?
Hi, I don't see a way to convert an Instruction to a string or const char *, although '<<' works on it. http://llvm.org/doxygen/classllvm_1_1Instruction.html How to figure this out? Thanks. -- Regards, Peng
2013 Jul 22
2
[LLVMdev] Analysis of polly-detect overhead in oggenc
...\ > do { \ > if (GraphViewMode) { \ > std::string Buf; \ > raw_string_ostream fmt(Buf); \ > fmt << MESSAGE; \ > fmt.flush(); \ > LastFailure = Buf;...
2013 Jul 23
2
[LLVMdev] Analysis of polly-detect overhead in oggenc
...From 448482106e8d815afa40e4ce8543ba3f6f0237f1 Mon Sep 17 00:00:00 2001 > From: Star Tan <tanmx_star at yeah.net> > Date: Mon, 22 Jul 2013 23:48:45 -0700 > Subject: [PATCH] ScopDetect: Optimize compile-time cost for log string > operations. > > String operatioins resulted by raw_string_ostream in the INVALID macro can lead > to significant compile-time overhead when compiling large size source code. > This is because raw_string_ostream relies on TypeFinder class, whose > compile-time cost increases as the size of the module increases. This patch > targets to avoid calling Typ...
2015 Nov 28
2
Need help with windows build error and std::to_string
I need to build a Twine with a double value, so I was using std::to_string, but I'm getting "error: 'to_string' is not a member of 'std'" from a windows buildbot. What's the canonical way to create a Twine() out of a double? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL:
2015 Nov 28
2
Need help with windows build error and std::to_string
...double value, so I was using > std::to_string, > > but I'm getting "error: 'to_string' is not a member of 'std'" from a > windows > > buildbot. What's the canonical way to create a Twine() out of a double? > > via raw_ostream. Create a new raw_string_ostream or > raw_svector_ostream, << the double into it and take the string. I > don't think we have a more convenient way for that currently and > to_string is still not universally available. > Thanks. I suppose there's no easy way to format them? I tried the standard io mani...
2016 Jul 28
2
[ORC JIT] Exposing IndirectStubsManager from CompileOnDemandLayer.h
...ude "llvm/IR/Mangler.h" +#include "llvm/Support/raw_ostream.h" namespace llvm { namespace orc { @@ -77,6 +79,24 @@ public: return LMH->Resources; } + static std::string mangle(StringRef Name, const DataLayout &DL) { + std::string MangledName; + { + raw_string_ostream MangledNameStream(MangledName); + Mangler::getNameWithPrefix(MangledNameStream, Name, DL); + } + return MangledName; + } + + LogicalModuleResources* getLogicalModuleResourcesForSymbol(const std::string &Name, bool ExportedSymbolsOnly) { + for (auto LMI = LogicalModules.begin(),...
2015 May 30
2
[LLVMdev] Linking modules across contexts crashes
...m/IR/Module.h" #include "llvm/Linker/Linker.h" #include "llvm/Support/raw_ostream.h" #include "llvm/IR/DiagnosticPrinter.h" #include <string> #include <iostream> using namespace llvm; using namespace std; int main() { // vars string Message; raw_string_ostream Stream(Message); DiagnosticPrinterRawOStream DP(Stream); LLVMBool Result; // create blank modules and contexts LLVMContext *ctx1 = new LLVMContext; Module* module1 = new Module("module1", *ctx1); LLVMContext *ctx2 = new LLVMContext; Module* module2 = new Module("...
2019 Apr 06
2
Can we do atomic write to a file by using raw_fd_ostream?
Hi all, In a pass I’m using raw_fd_ostream to write a string to a file. Does raw_fd_ostream guarantee the write is atomic when I do parallel compilation (currently I’m using -j8)? I have some errs() to print information for debugging purposes and I saw that the printed information gets messed up sometime. If I’m writing a string with the format of “A:B:C”, is it possible that I got “A1:B2:C1” and
2012 Jul 05
0
[LLVMdev] Accessing Return Variable Names
...ore) { return getName((dyn_cast<StoreInst>(&*i))->getPointerOperand()); } else if(i->getOpcode() == Instruction::Ret) { return "Return"; } std::string name; raw_string_ostream s(name); s << *i; // string representation of an instruction size_t var_start = name.find('%'); // var starts with a % size_t var_end = name.find(" ", var_start+1); // till space size_t var_comma = name.find(",", va...
2012 May 31
2
[LLVMdev] DFG of machine functions
...tic std::string getGraphName(MCDFGraph<MachineFunction *> F) { return "DFG for the function"; } static std::string getSimpleNodeLabel(Value *Node, const MCDFGraph<MachineFunction *> &F) { std::string Str; raw_string_ostream OS(Str); WriteAsOperand(OS, Node, false); return OS.str(); } static std::string getCompleteNodeLabel(Value *Node, const MCDFGraph<MachineFunction *> &F) { std::string Str; raw_string_ostream OS(Str); if (...
2019 Aug 16
2
[ORC] [mlir] Dump assembly from OrcJit
...OrcJit: http://lists.llvm.org/pipermail/llvm-dev/2014-June/074145.html I’m also aware of the alternative approach below, but I’m not sure if the output will be the same as the assembly generated by OrcJit. Probably not. std::string outStr; { llvm::legacy::PassManager pm; llvm::raw_string_ostream stream(outStr); llvm::buffer_ostream pstream(stream); targetMachine->addPassesToEmitFile(pm, pstream, nullptr, llvm::TargetMachine::CGFT_AssemblyFile); pm.run(*m); } llvm::errs() << "Assembly:\n" << outStr &...
2016 Jul 29
0
[ORC JIT] Exposing IndirectStubsManager from CompileOnDemandLayer.h
...m/Support/raw_ostream.h" > > namespace llvm { > namespace orc { > @@ -77,6 +79,24 @@ public: > return LMH->Resources; > } > > + static std::string mangle(StringRef Name, const DataLayout &DL) { > + std::string MangledName; > + { > + raw_string_ostream MangledNameStream(MangledName); > + Mangler::getNameWithPrefix(MangledNameStream, Name, DL); > + } > + return MangledName; > + } > + > + LogicalModuleResources* getLogicalModuleResourcesForSymbol(const > std::string &Name, bool ExportedSymbolsOnly) { > +...
2013 Nov 05
1
[LLVMdev] Thread-safe cloning
...{ // Otherwise, round trip the module to a stream and then back // into the new context. This approach allows for duplication // and optimization to proceed in parallel for different // modules. std::string str; raw_string_ostream stream(str); WriteBitcodeToFile(other.myModule, stream); StringRef ref(stream.str()); UT_ScopedPtr<MemoryBuffer> buf(MemoryBuffer::getMemBuffer(ref)); myModule = ParseBitcodeFile(buf.get(), myContext); UT_...
2016 Jul 29
2
[ORC JIT] Exposing IndirectStubsManager from CompileOnDemandLayer.h
...gt; namespace llvm { >> namespace orc { >> @@ -77,6 +79,24 @@ public: >> return LMH->Resources; >> } >> >> + static std::string mangle(StringRef Name, const DataLayout &DL) { >> + std::string MangledName; >> + { >> + raw_string_ostream MangledNameStream(MangledName); >> + Mangler::getNameWithPrefix(MangledNameStream, Name, DL); >> + } >> + return MangledName; >> + } >> + >> + LogicalModuleResources* getLogicalModuleResourcesForSymbol(const >> std::string &Name, bool Expor...
2012 Jun 02
0
[LLVMdev] DFG of machine functions
...lt;MachineFunction *> F) { > return "DFG for the function"; > } > > static std::string getSimpleNodeLabel(Value *Node, > const MCDFGraph<MachineFunction > *> &F) { > std::string Str; > raw_string_ostream OS(Str); > > WriteAsOperand(OS, Node, false); > return OS.str(); > } > > static std::string getCompleteNodeLabel(Value *Node, > const > MCDFGraph<MachineFunction *> &F) { > std::string Str; &g...