Skip to content

Commit

Permalink
[GR-19150] Do not store language home in LLVMContext.
Browse files Browse the repository at this point in the history
PullRequest: graal/4709
  • Loading branch information
fangerer committed Oct 25, 2019
2 parents e3d6b17 + 5534f85 commit a679e02
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ public final class LLVMContext {
private final ArrayList<LLVMPointer> globalsReadOnlyStore = new ArrayList<>();
private final Object globalsStoreLock = new Object();

private final String languageHome;

private final List<LLVMThread> runningThreads = new ArrayList<>();
@CompilationFinal private LLVMThreadingStack threadingStack;
private final Object[] mainArguments;
Expand Down Expand Up @@ -181,7 +179,7 @@ synchronized LLVMFunctionDescriptor create(String name, FunctionType type, LLVMF
}
}

LLVMContext(LLVMLanguage language, Env env, String languageHome, Toolchain toolchain) {
LLVMContext(LLVMLanguage language, Env env, Toolchain toolchain) {
this.language = language;
this.libsulongDatalayout = null;
this.datalayoutInitialised = false;
Expand Down Expand Up @@ -210,7 +208,6 @@ synchronized LLVMFunctionDescriptor create(String name, FunctionType type, LLVMF
Object mainArgs = env.getConfig().get(LLVMLanguage.MAIN_ARGS_KEY);
this.mainArguments = mainArgs == null ? env.getApplicationArguments() : (Object[]) mainArgs;
this.environment = System.getenv();
this.languageHome = languageHome;

addLibraryPaths(SulongEngineOption.getPolyglotOptionSearchPaths(env));

Expand Down Expand Up @@ -267,6 +264,7 @@ void initialize() {
for (ContextExtension ext : language.getLanguageContextExtension()) {
ext.initialize();
}
String languageHome = language.getLLVMLanguageHome();
if (languageHome != null) {
PlatformCapability<?> sysContextExt = language.getCapability(PlatformCapability.class);
internalLibraryPath = Paths.get(languageHome).resolve(sysContextExt.getSulongLibrariesPath());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ protected LLVMContext createContext(Env env) {
env.registerService(toolchain);
this.contextExtensions = activeConfiguration.createContextExtensions(env);

LLVMContext context = new LLVMContext(this, env, getLanguageHome(), toolchain);
LLVMContext context = new LLVMContext(this, env, toolchain);
return context;
}

Expand Down

0 comments on commit a679e02

Please sign in to comment.