Displaying 20 results from an estimated 38 matches for "stringstreams".
Did you mean:
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
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 need
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
2005 Nov 23
2
[LLVMdev] llvm-ranlib: Bus Error in regressions + fix
Evan Jones wrote:
> On Nov 23, 2005, at 8:16, Evan Jones wrote:
>
>> (4) Write the foreignST 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.
Exactly.
>
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
2005 Nov 23
0
[LLVMdev] llvm-ranlib: Bus Error in regressions + fix
On Nov 23, 2005, at 8:16, Evan Jones wrote:
> (4) Write the foreignST 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
2011 Oct 13
0
[LLVMdev] Integer to string
So by now you have already seen this, but just in case you have not:
=============
Note that using the other stream headers (<sstream> for example) is not problematic in this regard — just <iostream>. However, raw_ostream provides various APIs that are better performing for almost every use than std::ostream style APIs. Therefore new code should always use raw_ostream for writing, or
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
2013 May 02
4
[LLVMdev] int to StringRed conversion
Hello everyone,
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?
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
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 =
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
2013 May 02
0
[LLVMdev] int to StringRed conversion
Hi,
I think you may try to use llvm::Twine(int). For example, to convert 30
to string, you can use:
Twine(30).str()
To convert the string back to integer, you can try the
StringRef::getAsInteger(unsigned, APInt &). For example:
APInt i;
str.getAsInteger(/*radix=*/ 10, /*output=*/ i);
Sincerely,
Logan
On Thu, May 2, 2013 at 9:53 PM, Alexandru Ionut Diaconescu <
2011 Jun 28
1
[LLVMdev] retrieve information from a macro inlined as x86_64 asm in LLVM IR
Hi LLVM devs,
I work on a pass that creates multiple versions of a code region and switches
between them. The decision about the version to be selected is taken by an
external runtime system. I insert callbacks to this system in my code to pass
the control of the execution. All callbacks are written in inline assembly, in
macros.
The problem comes when I need to send some information from
2010 Apr 18
0
[LLVMdev] create two Twine object
According to documentation Twines should be used only for temporary
values and not stored, so allocating the in heap sounds wrong.
I think all you need here is
static int varNum;
++varNum;
Instruction *sstatusInst = new AllocaInst(StatusTy, Twine("status") +
Twine(varNum), entry_inst);
Instruction *sreqInst = new AllocaInst(ReqTy, Twine("request") +
Twine(varNum),
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
2010 Apr 18
1
[LLVMdev] create two Twine object
On Sun, Apr 18, 2010 at 4:36 AM, Eugene Toder <eltoder at gmail.com> wrote:
> According to documentation Twines should be used only for temporary
> values and not stored, so allocating the in heap sounds wrong.
Yes, in general you should never be naming Twine directly, except in
the case where you need to make a Twine for an integer. All other uses
should be considered poor style, as
2013 May 02
2
[LLVMdev] int to StringRed conversion
I think the better solution should be:
LLVMContext& C = is->getContext();
Value *values[] = {
ConstantInt::getSigned(Type::getInt64Ty(C), *scsr*),
MDString::get(C, *"path"*)
};
lnstr.setMetadata(*"your_analysis_name"*, MDNode::get(C, values));
So that you can take advantage of the type system of LLVM bitcode, and
don't have to cast the integers from/to strings