[LLVMdev] Fw: Should the Constant* pointer be declared with "const" or not?
Samuel Crow
samuraileumas at yahoo.com
Wed Jan 18 11:54:03 PST 2012
Try to keep things on the mailing list, if possible. That usually means hitting "reply to all". (I forgot earlier, myself. Sorry.)
----- Forwarded Message -----
> From: Stepan Dyatkovskiy <STPWORLD at narod.ru>
> To: Samuel Crow <samuraileumas at yahoo.com>
> Cc:
> Sent: Wednesday, January 18, 2012 1:50 PM
> Subject: Re: [LLVMdev] Should the Constant* pointer be declared with "const" or not?
>
>T hanks! I bow to that decision too.
>
> -Stepan.
>
> 18.01.2012, 23:31, "Samuel Crow" <samuraileumas at yahoo.com>:
>> Hello Stepan,
>>
>> The LLVM source code uses a relaxed view of const correctness. The const
> keyword is only used when it is needed by outside code. At one time, the
> documentation to LLVM said that it was written in a "tasteful subset"
> of C++. Searching for those words doesn't hit anything any more at this
> time.
>>
>> I'd suggest you not use the const keyword for now.
>>
>> --Sam
>>
>> ----- Original Message -----
>>
>>> From: Stepan Dyatkovskiy <stpworld at narod.ru>
>>> To: llvmdev at cs.uiuc.edu
>>> Cc:
>>> Sent: Wednesday, January 18, 2012 12:51 PM
>>> Subject: [LLVMdev] Should the Constant* pointer be declared with
> "const" or not?
>>>
>>> Hi all.
>>> I'm working on patch and I'm using unchangable ConstantInt
> objects. So
>>> everywhere I'm using "const ConstantInt*". But this
> idea came to
>>> deadlock after I tried to create ConstantVector using my
> vector<const
>>> ConstantInt*> collection. All because of next form of
> ConstantVector::get:
>>>
>>> // Note: ArrayRef declared with non-constant Constant* object.
>>> Constant *ConstantVector::get(ArrayRef<Constant*> V);
>>>
>>> What should I do in this case? Make all my ConstantInt* pointers
>>> non-constant?
>>>
>>> -Stepan.
>>>
>>> _______________________________________________
>>> LLVM Developers mailing list
>>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
More information about the llvm-dev
mailing list