search for: stringstream

Displaying 20 results from an estimated 38 matches for "stringstream".

2011 Oct 12
6
[LLVMdev] Integer to string
Hi, I need to convert an integer into a string. I would normally do that in C++ by using the StringStream class, but the LLVM coding standards discourage using that class. The same coding standards suggest to use llvm:StringStream instead, but I cannot find that class anywhere; furthermore, the header file where it was supposed to be (according to the coding standards) doesn't even exist. Is there...
2011 Oct 12
0
[LLVMdev] Integer to string
Hi Pablo, Can you provide a link to the document containing a reference to llvm::StringStream? I've looked in both the llvm coding standards, and llvm programming manual for versions: ToT (3.0), 2.9 (which seems to be the same as ToT), and 2.8. Obviously my search is missing something. Thanks in advance Garrison On Oct 12, 2011, at 8:18, Pablo Barrio wrote: > Hi, > > I...
2011 Oct 13
1
[LLVMdev] Integer to string
http://llvm.org/releases/2.0/docs/CodingStandards.html I just realized that the target version is LLVM 2.0, so most likely the llvm::StringStream is deprecated by now. Thanks for your response! On 12/10/2011, at 17:10, Garrison Venn wrote: > Hi Pablo, > > Can you provide a link to the document containing a reference to > llvm::StringStream? I've looked in both the llvm coding standards, > and llvm programming manual...
2005 Nov 23
2
[LLVMdev] llvm-ranlib: Bus Error in regressions + fix
...e any reason >> that this isn't possible? Then the final archive would be created in a >> single pass, and it could just be moved into place. > > > Ah. I see: It needs to be written in order to compute the offsets. Exactly. > However, it would be possible to use a stringstream for this. Aggg! No! Those perform horribly with anything more than a small amount of data. Some Archive files can be huge (e.g. not fit in memory). > > I think the best thing to do is to write the final archive to a > temporary file, and then move it into place. This has the advantage...
2005 Nov 23
0
[LLVMdev] llvm-ranlib: Bus Error in regressions + fix
On Nov 23, 2005, at 12:08, Reid Spencer wrote: >> However, it would be possible to use a stringstream for this. > Aggg! No! Those perform horribly with anything more than a small > amount of data. Some Archive files can be huge (e.g. not fit in > memory). An archive can be too big to fit in memory? That would be a BIG library. In that case, building a temporary in memory is a bad idea,...
2005 Nov 23
0
[LLVMdev] llvm-ranlib: Bus Error in regressions + fix
...eignST into the TmpArchive file. Is there any reason > that this isn't possible? Then the final archive would be created in a > single pass, and it could just be moved into place. Ah. I see: It needs to be written in order to compute the offsets. However, it would be possible to use a stringstream for this. I think the best thing to do is to write the final archive to a temporary file, and then move it into place. This has the advantage that if something goes wrong the original archive will not be corrupted. Additionally, all the members of the current archive object instance stay valid...
2011 Oct 13
0
[LLVMdev] Integer to string
...s from: http://llvm.org/docs/CodingStandards.html#ll_iostream Hope this helps Garrison On Oct 13, 2011, at 5:36, pablo barrio lópez-cortijo wrote: > http://llvm.org/releases/2.0/docs/CodingStandards.html > > I just realized that the target version is LLVM 2.0, so most likely the llvm::StringStream is deprecated by now. > > Thanks for your response! > > On 12/10/2011, at 17:10, Garrison Venn wrote: > >> Hi Pablo, >> >> Can you provide a link to the document containing a reference to >> llvm::StringStream? I've looked in both the llvm coding stan...
2005 Nov 23
2
[LLVMdev] llvm-ranlib: Bus Error in regressions + fix
On Nov 22, 2005, at 23:59, Reid Spencer wrote: >> = {0, >> 0, 4, 0}}} >> (gdb) p archPath >> $3 = {path = {static npos = 4294967295, >> _M_dataplus = {<allocator<char>> = {<No data fields>}, >> _M_p = 0x83545f4 "temp.GNU.a5\b"}, static _S_empty_rep_storage = > What's with the "5\b" at the end? Looks
2010 Apr 18
4
[LLVMdev] create two Twine object
I need to generate variables like status1, status2, status3, ...... request1, request2, request3, ...... this is my code, other unrelated detail are eliminated. static int varNum; static const char *getVarNum() { ++varNum; std::stringstream ss; ss << varNum; std::string *varname = new std::string(ss.str()); return varname->c_str(); } const char *VarNum = getVarNum(); Twine *x1 = new Twine(StringRef("status"), VarNum); // 1 Twine *x2 = new Twine(StringRef("request"), VarNum); // 2 Instruct...
2013 May 02
4
[LLVMdev] int to StringRed conversion
...ne, I have an integer and I want to convert it to StringRef in order to set metadata. setMetadata->(StringRef, MDNode*); It is there a native LLVM way to do it? 1. In the llvm::APSInt Class is toString() method, which seems it is not for this purpose 2. itoa and string are not part of LLVM 3. stringstream is not part of LLVM 4. to_string is not part of LLVM 5. any casting method? Also, I would like to get the metadata and convert it back to integer. Thank you ! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/2...
2011 Jun 10
1
[LLVMdev] Annotating resulting assembly code from an LLVM pass
Hello, I'm working on an LLVM IR pass and would like to insert comments into the generated .bc file during the pass. I've been having trouble finding documentation for this process, and was wondering if there is a simple way to do it. At the moment, I have a stringstream whose .str() I'd like to stick in this generated file every once in a while. Thanks, Griffin Wright
2011 Oct 12
0
[LLVMdev] Integer to string
On Oct 12, 2011, at 8:18 AM, Pablo Barrio wrote: > Hi, > > I need to convert an integer into a string. I would normally do that in C++ by using the StringStream class, but the LLVM coding standards discourage using that class. The same coding standards suggest to use llvm:StringStream instead, but I cannot find that class anywhere; furthermore, the header file where it was supposed to be (according to the coding standards) doesn't even exist. > &gt...
2010 Sep 28
1
How to convert SEXP to double
Hello All, A simple question. I get some return from the R in my C++ program (via Rcpp package). The result come, as SEXP and it should be a simple numeric variable. How to convert it to double? The code, what i use: stringstream ss; ss << "p <- predict(fit_ar11, n.ahead = 2, doplot=FALSE);" << "p$pred[1]"; SEXP ans; int iRet = R.parseEval(ss.str().c_str()); if (iRet == 0 && ans != NULL) { // ??? } Cheers, Dima [[alternative HTML version deleted]]
2013 Jul 25
2
[LLVMdev] Passing String to an external function in llvm
I did some computation through llvm pass, and store those computed values on string. eg. :- stringstream lhs; lhs << instr->getOperand(1); // 'instr' is some instruction string lhsvar=lhs.str(); Now I want to pass this 'lhsvar' to the external function, so how can i do this??? This is just the part of a code to make you understand. if you say I can even provide the link t...
2013 May 02
0
[LLVMdev] int to StringRed conversion
...t it to StringRef in order to set > metadata. > setMetadata->(StringRef, MDNode*); > > It is there a native LLVM way to do it? > > 1. In the llvm::APSInt Class is toString() method, which seems it is not > for this purpose > 2. itoa and string are not part of LLVM > 3. stringstream is not part of LLVM > 4. to_string is not part of LLVM > 5. any casting method? > > Also, I would like to get the metadata and convert it back to integer. > > Thank you ! > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs...
2011 Jun 28
1
[LLVMdev] retrieve information from a macro inlined as x86_64 asm in LLVM IR
...parameter the address of this variable, such that the runtime system can put the value it computes in this address, at runtime. (Similar to sending a parameter by reference. ) If I send the address of the Value* lim as a param to the macro, it puts the hardcoded address (as expected). std::stringstream out; out.str(std::string()); out << &lim; InlineAsm* IA = InlineAsm::get(asmFuncTy, "camus_macro_decision" + out.str() , "=r", true); CallInst* cmp = CallInst::Create(IA, ...); creates the call: camus_macro_decision 0x7fffdf3172f0 I tried also by creatin...
2010 Apr 18
0
[LLVMdev] create two Twine object
....adroit at gmail.com> wrote: > I need to generate variables like > status1, status2, status3, ...... > request1, request2, request3, ...... > this is my code, other unrelated detail are eliminated. > static int varNum; > static const char *getVarNum() { > ++varNum; > std::stringstream ss; > ss << varNum; > std::string *varname = new std::string(ss.str()); > return varname->c_str(); > } > const char *VarNum = getVarNum(); > Twine *x1 = new Twine(StringRef("status"), VarNum);     //      1 > Twine *x2 = new Twine(StringRef("request&quot...
2013 Nov 21
1
[LLVMdev] Replacing C-style function
Hi, I am trying to replace a c-style function with another function with same signature. Consider the following code: std::stringstream main_c; main_c <<"#include <stdio.h>\n" <<"extern \"C\" { \n" <<"int print1()\n" <<"{\n" <<" printf(\"Inside print1\\n\");\n" <<" return 0...
2010 Apr 18
1
[LLVMdev] create two Twine object
...>> I need to generate variables like >> status1, status2, status3, ...... >> request1, request2, request3, ...... >> this is my code, other unrelated detail are eliminated. >> static int varNum; >> static const char *getVarNum() { >> ++varNum; >> std::stringstream ss; >> ss << varNum; >> std::string *varname = new std::string(ss.str()); >> return varname->c_str(); >> } >> const char *VarNum = getVarNum(); >> Twine *x1 = new Twine(StringRef("status"), VarNum);     //      1 >> Twine *x2 = new Twine(...
2013 May 02
2
[LLVMdev] int to StringRed conversion
...>>>>> It is there a native LLVM way to do it? >>>>> >>>>> 1. In the llvm::APSInt Class is toString() method, which seems it is >>>>> not for this purpose >>>>> 2. itoa and string are not part of LLVM >>>>> 3. stringstream is not part of LLVM >>>>> 4. to_string is not part of LLVM >>>>> 5. any casting method? >>>>> >>>>> Also, I would like to get the metadata and convert it back to integer. >>>>> >>>>> Thank you ! >>>&g...