It appears the syntax for returning multiple values has changed since 2.9. Previous to that: ret i32 %a, i32 %b worked. The new syntax is something like: ret { i32, i32 }{i32 %a, i32 %b} but this yields an error: mrv-bug.ll:5:24: error: invalid use of function-local name ret { i32, i32 }{i32 %a, i32 %b} ^ If %a and %b are replaced by constants, things work. Am I doing something wrong, or should I file a bug report?
On Fri, Jun 24, 2011 at 9:29 AM, Bagel <bagel99 at gmail.com> wrote:> It appears the syntax for returning multiple values has changed since 2.9. > Previous to that: > ret i32 %a, i32 %b > worked. The new syntax is something like: > ret { i32, i32 }{i32 %a, i32 %b} > but this yields an error: > mrv-bug.ll:5:24: error: invalid use of function-local name > ret { i32, i32 }{i32 %a, i32 %b} > ^ > If %a and %b are replaced by constants, things work. > > Am I doing something wrong, or should I file a bug report?You need to use insertvalue to build a struct with non-constant values.. -Eli
On Jun 24, 2011, at 9:29 AM, Bagel wrote:> It appears the syntax for returning multiple values has changed since 2.9. > Previous to that: > ret i32 %a, i32 %b > worked. The new syntax is something like: > ret { i32, i32 }{i32 %a, i32 %b} > but this yields an error: > mrv-bug.ll:5:24: error: invalid use of function-local name > ret { i32, i32 }{i32 %a, i32 %b} > ^ > If %a and %b are replaced by constants, things work.This is obsolete and deprecated syntax that is dropped in "llvm 3.0" (and thus on mainline right now). If you run that through llvm-as|llvm-dis from llvm 2.9, you'll see the preferred syntax. -Chris
On 06/24/2011 03:45 PM, Chris Lattner wrote:> > On Jun 24, 2011, at 9:29 AM, Bagel wrote: > >> It appears the syntax for returning multiple values has changed since 2.9. >> Previous to that: >> ret i32 %a, i32 %b >> worked. The new syntax is something like: >> ret { i32, i32 }{i32 %a, i32 %b} >> but this yields an error: >> mrv-bug.ll:5:24: error: invalid use of function-local name >> ret { i32, i32 }{i32 %a, i32 %b} >> ^ >> If %a and %b are replaced by constants, things work. > > This is obsolete and deprecated syntax that is dropped in "llvm 3.0" (and thus on mainline right now). If you run that through llvm-as|llvm-dis from llvm 2.9, you'll see the preferred syntax. > > -ChrisOK, I guess I missed the announcement that it was obsolete. The new mechanism is quite wordy when compared with the old. Sigh. Are there any other languages other than mine (http://code.google.com/p/esl/) which return multiple scalars that have LLVM frontends? bagel