Python: CG trace: Autoformat

This commit is contained in:
Rasmus Wriedt Larsen
2020-07-22 13:52:41 +02:00
parent ccffa7d99d
commit ad2e336ead
3 changed files with 11 additions and 16 deletions

View File

@@ -1,32 +1,27 @@
import python
abstract class XMLBytecodeExpr extends XMLElement {
}
abstract class XMLBytecodeExpr extends XMLElement { }
class XMLBytecodeVariableName extends XMLBytecodeExpr {
XMLBytecodeVariableName() { this.hasName("BytecodeVariableName") }
XMLBytecodeVariableName() { this.hasName("BytecodeVariableName") }
string get_name_data() { result = this.getAChild("name").getTextValue() }
string get_name_data() { result = this.getAChild("name").getTextValue() }
}
class XMLBytecodeAttribute extends XMLBytecodeExpr {
XMLBytecodeAttribute() { this.hasName("BytecodeAttribute") }
XMLBytecodeAttribute() { this.hasName("BytecodeAttribute") }
string get_attr_name_data() { result = this.getAChild("attr_name").getTextValue() }
string get_attr_name_data() { result = this.getAChild("attr_name").getTextValue() }
XMLBytecodeExpr get_object_data() {
result.getParent() = this.getAChild("object")
}
XMLBytecodeExpr get_object_data() { result.getParent() = this.getAChild("object") }
}
class XMLBytecodeCall extends XMLBytecodeExpr {
XMLBytecodeCall() { this.hasName("BytecodeCall") }
XMLBytecodeCall() { this.hasName("BytecodeCall") }
XMLBytecodeExpr get_function_data() {
result.getParent() = this.getAChild("function")
}
XMLBytecodeExpr get_function_data() { result.getParent() = this.getAChild("function") }
}
class XMLBytecodeUnknown extends XMLBytecodeExpr {
XMLBytecodeUnknown() { this.hasName("BytecodeUnknown") }
XMLBytecodeUnknown() { this.hasName("BytecodeUnknown") }
}

View File

@@ -1,6 +1,5 @@
import RecordedCalls
from string text, float number, float ratio, int i
where
exists(int all_rcs | all_rcs = count(XMLRecordedCall rc) and ratio = number / all_rcs |

View File

@@ -2,4 +2,5 @@ import RecordedCalls
from UnidentifiedRecordedCall rc, XMLCall xml_call
select "Could not uniquely identify this recorded call (either call or callee was not uniquely identified)",
rc, rc.getXMLCall().get_filename_data(), rc.getXMLCall().get_linenum_data(), rc.getXMLCall().get_inst_index_data()
rc, rc.getXMLCall().get_filename_data(), rc.getXMLCall().get_linenum_data(),
rc.getXMLCall().get_inst_index_data()