[ClavaAst] VarDecl.removeInit() receives a bool to remove const or not
@@ -204,7 +204,7 @@ public class VarDecl extends DeclaratorDecl {
}
- public void removeInit() {
+ public void removeInit(boolean removeConst) {
// If no init, do nothing
if (!hasInit()) {
return;
@@ -214,6 +214,7 @@ public class VarDecl extends DeclaratorDecl {
removeChild(0);
// If element type is const, remove const
+ if (removeConst) {
var declType = getType();
if (declType.isConst()) {
// Copy
@@ -224,6 +225,8 @@ public class VarDecl extends DeclaratorDecl {
}
+ }
+
/**
* In most cases, returns this VarDecl. In case of declaration of global variables, returns the VarDecl
* corresponding to its definition.
