File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -104,8 +104,15 @@ public Goal JLangConstFold(Job job) {
104
104
ExtensionInfo extInfo = job .extensionInfo ();
105
105
JLangTypeSystem ts = (JLangTypeSystem ) extInfo .typeSystem ();
106
106
JLangNodeFactory nf = (JLangNodeFactory ) extInfo .nodeFactory ();
107
- return new VisitorGoal (job , new StringLitFold (ts , nf ));
108
-
107
+ Goal constGoal = new VisitorGoal (job , new StringLitFold (ts , nf ));
108
+ try {
109
+ // ensure all desugaring is done for the file (might generate more constants)
110
+ constGoal .addPrerequisiteGoal (LLVMDesugared (job ), this );
111
+ } catch (CyclicDependencyException e ) {
112
+ throw new InternalCompilerError (e );
113
+ }
114
+ // intern goal to remove duplicate objects being created (explicit singleton)
115
+ return internGoal (constGoal );
109
116
}
110
117
111
118
@ Override
You can’t perform that action at this time.
0 commit comments