[llvm-commits] [llvm] r70790 - /llvm/trunk/docs/LangRef.html

Eli Friedman eli.friedman at gmail.com
Mon May 4 02:22:04 PDT 2009


2009/5/4 Duncan Sands <baldrick at free.fr>:
>> However most people use this as a 'logical' const, i.e. the object may
>> be modified, but the new object is equivalent to the old one.
>> Can this be modeled via an LLVM attribute?
>
> You could always cheat and mark it readonly/readnone anyway.  This
> might work in some circumstances if no-one can tell that these modifications
> are going on.

That would get to be extremely nasty... for example, take an class
which caches the results of queries in a hashtable.  Suppose only some
of the hashtable queries get inlined: then the compiler could end up
reusing the saved hashtable even though it moved because the hashtable
grew.

-Eli




More information about the llvm-commits mailing list