Mercurial > hg > graal-jvmci-8
comparison 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 |
comparison
equal
deleted
inserted
replaced
7849:268d3e74191e | 7850:85891f9c2197 |
---|---|
266 } | 266 } |
267 } | 267 } |
268 } else { | 268 } else { |
269 writeModifiers(f.getModifiers()); | 269 writeModifiers(f.getModifiers()); |
270 write(typeSimpleName(f.asType())); | 270 write(typeSimpleName(f.asType())); |
271 | |
272 if (f.getEnclosingElement().getKind() == ElementKind.METHOD) { | |
273 ExecutableElement method = (ExecutableElement) f.getEnclosingElement(); | |
274 if (method.isVarArgs() && method.getParameters().indexOf(f) == method.getParameters().size() - 1) { | |
275 write("..."); | |
276 } | |
277 } | |
278 | |
271 write(" "); | 279 write(" "); |
272 write(f.getSimpleName()); | 280 write(f.getSimpleName()); |
273 if (init != null) { | 281 if (init != null) { |
274 write(" = "); | 282 write(" = "); |
275 init.acceptCodeElementScanner(this, p); | 283 init.acceptCodeElementScanner(this, p); |