Comments (1)
here is a patch that seems to work to show both the size of the class and the number of members in the class. I am not 100% sure that it works correctly, but my quick tests today show it being fine.
diff --git a/abi-compliance-checker.pl b/abi-compliance-checker.pl
index c07377d..be69015 100755
--- a/abi-compliance-checker.pl
+++ b/abi-compliance-checker.pl
@@ -6371,7 +6371,7 @@ sub getCheckedHeaders($)
sub getSourceInfo()
{
- my ($CheckedHeaders, $CheckedSources, $CheckedLibs) = ("", "");
+ my ($CheckedHeaders, $CheckedSources, $CheckedLibs, $Classes) = ("", "");
if(my @Headers = getCheckedHeaders(1))
{
@@ -6426,8 +6426,73 @@ sub getSourceInfo()
$CheckedLibs .= "</div>\n";
$CheckedLibs .= "<br/>$TOP_REF<br/>\n";
}
+
+ $Classes = "<a name='Classes'></a>";
+ if($In::Opt{"OldStyle"}) {
+ $Classes .= "<h2>Classes (".($#ClassNames+1).")</h2>";
+ }
+ else {
+ $Classes .= "<h2>Classes <span class='gray'> ".($#ClassNames+1)." </span></h2>";
+ }
+ $Classes .= "<hr/>\n";
+ $Classes .= "<table class='summary'>\n";
+ $Classes .= "<tr><th>Class Name</th><th>Old Size</th><th>New Size</th><th>Old Number Members</th><th>New Number Members</th></tr>\n";
+ foreach my $ClassName (sort keys(%{$ClassNames{1}}))
+ {
+ my $ClassId_Old = $TName_Tid{1}{$ClassName};
+ next if(not $ClassId_Old);
+
+ if(isPrivateABI($ClassId_Old, 1)) {
+ next;
+ }
+
+ if(index($ClassName, ">")!=-1)
+ { # skip affected template instances
+ next;
+ }
+
+ if(not isCreatable($ClassId_Old, 1))
+ { # skip classes without public constructors (including auto-generated)
+ # example: class has only a private exported or private inline constructor
+ next;
+ }
+
+ my %Class_Old = getType($ClassId_Old, 1);
+ my $ClassId_New = $TName_Tid{2}{$ClassName};
+ if(not $ClassId_New) {
+ next;
+ }
+ my %Class_New = getType($ClassId_New, 2);
+ if($Class_New{"Type"}!~/Class|Struct/)
+ { # became typedef
+ if($Level eq "Binary") {
+ next;
+ }
+ if($Level eq "Source")
+ {
+ %Class_New = getPureType($ClassId_New, 2);
+ if($Class_New{"Type"}!~/Class|Struct/) {
+ next;
+ }
+ $ClassId_New = $Class_New{"Tid"};
+ }
+ }
+
+ my $new_size = $Class_New{"Size"};
+ my $old_size = $Class_Old{"Size"};
+ my $new_num_members = keys(%{$Class_New{"Memb"}});
+ my $old_num_members = keys(%{$Class_Old{"Memb"}});
+ if(not $new_size){
+ $new_size=0;
+ }
+ if(not $old_size){
+ $old_size=0;
+ }
+ $Classes .= "<tr><td>$ClassName</td><td>$new_size</td><td>$old_size</td><td>$new_num_members</td><td>$old_num_members</td></tr>\n";
+ }
+ $Classes .= "</table>\n";
- return $CheckedHeaders.$CheckedSources.$CheckedLibs;
+ return $CheckedHeaders.$CheckedSources.$CheckedLibs.$Classes;
}
sub getObjTitle()
from abi-compliance-checker.
Related Issues (20)
- Website
- Support for GCC 9.x HOT 1
- abi-compliance-checker include directories HOT 1
- clang support HOT 2
- Could you tell me the schema of xml repoert of comparing .so
- Can I ignore changes of specific enum member? HOT 3
- When I run the test suite: cc1plus: error: unrecognized command line option β-fdump-translation-unitβ HOT 2
- macOS ARM64 Support
- rbx register instead of rbp - Applications will read the wrong memory block instead of the parameter value. HOT 1
- Docker Container? HOT 1
- Facing problem in using ABI Compliance Checker on windows 10 HOT 1
- Syntax error in MinGW header when using ABI-Compliance-Checker with Windows HOT 3
- Does C++export class support compatibility detection
- Will abi-compliance-checker support python project?
- Check inline functions
- Error on -sort option HOT 2
- Any maintenance and updating plan for this tool?
- Doesn't detect change to x64 ABI calling convention due to C++ struct definition change HOT 1
- [Question] Github Action support available?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abi-compliance-checker.