Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/codewriter/AbstractCodeWriter.java @ 7850:85891f9c2197
Support for varargs parameters in code writer.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 25 Feb 2013 12:43:18 +0100 |
parents | 4cbe062678ba |
children | 10d37f893471 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/codewriter/AbstractCodeWriter.java Tue Feb 19 17:41:10 2013 +0100 +++ b/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/codewriter/AbstractCodeWriter.java Mon Feb 25 12:43:18 2013 +0100 @@ -268,6 +268,14 @@ } else { writeModifiers(f.getModifiers()); write(typeSimpleName(f.asType())); + + if (f.getEnclosingElement().getKind() == ElementKind.METHOD) { + ExecutableElement method = (ExecutableElement) f.getEnclosingElement(); + if (method.isVarArgs() && method.getParameters().indexOf(f) == method.getParameters().size() - 1) { + write("..."); + } + } + write(" "); write(f.getSimpleName()); if (init != null) {