Skip to content

Commit

Permalink
Remove unnecessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadeeshan96 committed Jun 5, 2023
1 parent 4fa52bc commit a029002
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.wso2.ballerinalang.compiler.PackageCache;
import org.wso2.ballerinalang.compiler.bir.BIRGenUtils;
import org.wso2.ballerinalang.compiler.bir.codegen.optimizer.LargeMethodOptimizer;
import org.wso2.ballerinalang.compiler.bir.emit.BIREmitter;
import org.wso2.ballerinalang.compiler.diagnostic.BLangDiagnosticLog;
import org.wso2.ballerinalang.compiler.semantics.analyzer.Types;
import org.wso2.ballerinalang.compiler.semantics.model.SymbolTable;
Expand Down Expand Up @@ -83,8 +82,6 @@ private CompiledJarFile generate(BPackageSymbol packageSymbol) {
largeMethodOptimizer = new LargeMethodOptimizer(symbolTable);
largeMethodOptimizer.splitLargeBIRFunctions(packageSymbol.bir);

BIREmitter.emit(packageSymbol.bir);

// Desugar BIR to include the observations
JvmObservabilityGen jvmObservabilityGen = new JvmObservabilityGen(packageCache, symbolTable);
jvmObservabilityGen.instrumentPackage(packageSymbol.bir);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,6 @@ private void generateSplits(BIRFunction function, List<Split> possibleSplits,
}
function.errorTable.removeAll(currSplit.errorTableEntries);
startInsNum = currSplit.lastIns + 1;

List<BIROperand> args = new ArrayList<>();
for (BIRVariableDcl funcArg : currSplit.funcArgs) {
args.add(new BIROperand(funcArg));
Expand Down Expand Up @@ -595,8 +594,8 @@ private void setLocalVarStartEndBB(BIRFunction birFunction, List<BIRBasicBlock>
* @param currSplit ongoing split details
* @param newBBNum last BB id num of the parent function
* @param fromAttachedFunction flag which indicates an original attached function is being split
* @param changedErrorTableEndBB
* @param parentFuncNewBB
* @param changedErrorTableEndBB error tables end BBs which needs to be changed
* @param parentFuncNewBB new BIRBasicBlock being added to the parent function
* @return newly created BIR function
*/
private BIRFunction createNewBIRFunctionAcrossBB(BIRFunction parentFunc, Name funcName, BType retType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class BIREmitter {

private static final CompilerContext.Key<BIREmitter> BIR_EMITTER = new CompilerContext.Key<>();
private static final PrintStream console = System.out;
private static boolean dumbBIR;
private boolean dumbBIR;

public static BIREmitter getInstance(CompilerContext context) {

Expand All @@ -68,19 +68,13 @@ private BIREmitter(CompilerContext context) {
this.dumbBIR = getBooleanValueIfSet(compilerOptions, CompilerOptionName.DUMP_BIR);
}

public static BLangPackage emit(BLangPackage bLangPackage) {
public BLangPackage emit(BLangPackage bLangPackage) {
if (dumbBIR) {
console.println(emitModule(bLangPackage.symbol.bir));
}
return bLangPackage;
}

public static void emit(BIRNode.BIRPackage birPackage) {
if (dumbBIR) {
console.println(emitModule(birPackage));
}
}

public static String emitModule(BIRNode.BIRPackage mod) {

String modStr = "================ Emitting Module ================";
Expand Down

0 comments on commit a029002

Please sign in to comment.