Displaying 3 results from an estimated 3 matches for "addglobalvalu".
Did you mean:
addglobalvalue
2005 Apr 15
2
[LLVMdev] MachineInstr: external symbols problem
...tion, MachineOperand is
created with the char* argument, but the argument is not copied, it's just
stored in MachineOperand::symbolName. So, all long as string temporary is
destroyed, that pointer points to garbage.
I suppose I could handle this by adding function to LLVM module and
using .addGlobalValue, but still, is the non-copying behaviour of constructor
by design?
- Volodya
2005 Apr 15
0
[LLVMdev] MachineInstr: external symbols problem
...; is created with the char* argument, but the argument is not copied, it's
> just stored in MachineOperand::symbolName. So, all long as string
> temporary is destroyed, that pointer points to garbage. I suppose I
> could handle this by adding function to LLVM module and using
> .addGlobalValue, but still, is the non-copying behaviour of constructor
> by design?
Yes, this is by design. MachineOperand is supposed to be a very
light-weight union. We actually used to have it carry an std::string
around, but this required conditional code to make sure to free it and
copy it when ne...
2005 Apr 15
3
[LLVMdev] MachineInstr: external symbols problem
...h the char* argument, but the argument is not copied, it's
> > just stored in MachineOperand::symbolName. So, all long as string
> > temporary is destroyed, that pointer points to garbage. I suppose I
> > could handle this by adding function to LLVM module and using
> > .addGlobalValue, but still, is the non-copying behaviour of constructor
> > by design?
>
> Yes, this is by design. MachineOperand is supposed to be a very
> light-weight union. We actually used to have it carry an std::string
> around, but this required conditional code to make sure to free it...