Skip to content

Commit

Permalink
Updates for Quarkus and Qbicc
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlloyd committed Apr 8, 2024
1 parent d62c07c commit ff98ca6
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 28 deletions.
1 change: 1 addition & 0 deletions deployment/src/main/java/org/qbicc/quarkus/config/Gc.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* The GC to use.
*/
public enum Gc {
semi,
none,
;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@ public interface LlvmConfiguration {
@WithDefault("false")
boolean emitIr();

/**
* Set to enable LLVM opaque pointers (the default in LLVM 16 and later).
*
* @return {@code true} if opaque pointers are enabled
*/
@WithDefault("false")
boolean opaquePointers();

/**
* Optional extra options for {@code llc}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ public interface QbiccConfiguration {
*
* @return the GC to use
*/
@WithDefault("none")
@WithDefault("semi")
Gc gc();
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.repository.RemoteRepository;
import org.jboss.logging.Logger;
import org.qbicc.context.DiagnosticContext;
import org.qbicc.driver.ClassPathItem;
import org.qbicc.machine.arch.Platform;
Expand All @@ -55,6 +56,7 @@
import org.qbicc.quarkus.spi.QbiccResultBuildItem;

class QbiccProcessor {
private static final Logger log = Logger.getLogger("org.qbicc.quarkus.deployment");

private static final String FEATURE = "qbicc";

Expand Down Expand Up @@ -115,45 +117,43 @@ QbiccFeatureBuildItem generateFeature(List<RuntimeInitializedClassBuildItem> run
}

for (RuntimeReinitializedClassBuildItem rc : runtimeReinitializedClassBuildItems) {
System.out.printf("TODO: QbiccProcessor: ignored runtime reinitialized class %s\n", rc.getClassName());
log.warnf("TODO: QbiccProcessor: ignored runtime reinitialized class %s\n", rc.getClassName());
}

if (proxies.size() > 0) {
System.out.printf("TODO: QbiccProcessor: ignored %d proxies\n", proxies.size());
if (! proxies.isEmpty()) {
log.warnf("TODO: QbiccProcessor: ignored %d proxies\n", proxies.size());
}

for (NativeImageResourcePatternsBuildItem rp : resourcePatterns) {
for (String ip : rp.getIncludePatterns()) {
System.out.printf("TODO: QbiccProcessor: ignored resource include pattern: %s\n", ip);
log.warnf("TODO: QbiccProcessor: ignored resource include pattern: %s\n", ip);
}
for (String xp : rp.getExcludePatterns()) {
System.out.printf("TODO: QbiccProcessor: ignored resource exclude pattern: %s\n", xp);
log.warnf("TODO: QbiccProcessor: ignored resource exclude pattern: %s\n", xp);
}
}

for (NativeImageResourceBuildItem ri : resourceItems) {
for (String r : ri.getResources()) {
qfRuntimeResources.add(r);
}
qfRuntimeResources.addAll(ri.getResources());
}

for (NativeImageResourceBundleBuildItem rb: resourceBundles) {
System.out.printf("TODO: QbiccProcessor: ignored resource bundle %s\n", rb.getBundleName());
log.warnf("TODO: QbiccProcessor: ignored resource bundle %s\n", rb.getBundleName());
}

for (NativeImageResourceDirectoryBuildItem rd: resourceDirs) {
System.out.printf("TODO: QbiccProcessor: ignored resource directory %s\n", rd.getPath());
log.warnf("TODO: QbiccProcessor: ignored resource directory %s\n", rd.getPath());
}

if (reflectiveMethods.size() > 0) {
if (! reflectiveMethods.isEmpty()) {
ArrayList<QbiccFeature.Method> refMethods = new ArrayList<>();
for (ReflectiveMethodBuildItem rm: reflectiveMethods) {
refMethods.add(new QbiccFeature.Method(rm.getDeclaringClass(), rm.getName(), rm.getParams()));
}
qf.reflectiveMethods = refMethods.toArray(QbiccFeature.Method[]::new);
}

if (reflectiveFields.size() > 0) {
if (! reflectiveFields.isEmpty()) {
ArrayList<QbiccFeature.Field> refFields = new ArrayList<>();
for (ReflectiveFieldBuildItem rf : reflectiveFields) {
refFields.add(new QbiccFeature.Field(rf.getDeclaringClass(), rf.getName()));
Expand Down Expand Up @@ -205,6 +205,9 @@ QbiccResultBuildItem build(
}
final Platform platform = configuration.platform().orElse(Platform.HOST_PLATFORM);
URL defaultFeature = QbiccProcessor.class.getResource("/qbicc-feature.yaml");
if (defaultFeature == null) {
throw new IllegalStateException("Missing internal resource");
}
mainBuilder.addQbiccYamlFeatures(List.of(defaultFeature));
mainBuilder.addQbiccFeature((QbiccFeature)dynamicQbiccFeature.getFeature());
mainBuilder.setPlatform(platform);
Expand All @@ -216,7 +219,6 @@ QbiccResultBuildItem build(
.setEmitAssembly(configuration.emitAsm())
.setPlatform(platform)
.setCompileOutput(true)