[llvm-commits] [llvm] r117070 - /llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp

Duncan Sands baldrick at free.fr
Fri Oct 22 07:05:58 PDT 2010


Hi Dan,

>   // If the third field is present, it's an integer which if equal to 1
> -// indicates that the type is "constant" (meaning
> -// pointsToConstantMemory should return true; see
> +// indicates that the type is "constant" (meaning pointsToConstantMemory
> +// should return true; see
>   // http://llvm.org/docs/AliasAnalysis.html#OtherItfs).

is this "constant" field actually useful?  How are you imagining that it will
be used?  Even in Ada, which has a pretty strong type system and notions of
constantness, the fact that you have a view of an object via a constant type
doesn't mean that the object can't be altered, it just means it can't be
altered via this view.  In C, this is something like saying: suppose the
address of an int is held in a "const int*", then you can't alter the int via
this pointer; but you can always alter it by putting the address of the int in
a "int *" and using that instead.  So the fact that you have a "const int*"
doesn't mean you that it is valid for pointsToConstantMemory to return true.

Ciao,

Duncan.



More information about the llvm-commits mailing list