On Dec 15, 2007, at 2:10 AM, Duncan Sands wrote: > Hi Dale, > >> // Check for 'readnone' function attribute. >> - if (flags & ECF_CONST) >> + // Both PURE and CONST will be set if the user applied >> + // __attribute__((const)) to a function the compiler >> + // knows to be pure, such as log. A user or (more >> + // likely) libm implementor might know their local log >> + // is in fact const, so this should be valid (and gcc >> + // accepts it). But llvm IR does not allow both, so >> + // set only ReadNone. >> + if (flags & ECF_CONST && !(flags & ECF_PURE)) >> // Since they write the return value through a pointer, >> // 'sret' functions cannot be 'readnone'. >> if (!ABIConverter.isStructReturn()) > > if it is marked both pure and const, this logic seems to > mark it pure in LLVM (i.e. readonly). It would be better > to mark it readnone since that's stronger.
Right. Fixed, thanks. _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits