This is an archive of the discontinued LLVM Phabricator instance.

[Analyzer][NFC] Remove the SubEngine interface
ClosedPublic

Authored by baloghadamsoftware on May 26 2020, 4:55 AM.

Details

Summary

The SubEngine interface is an interface with only one implementation EpxrEngine. Adding other implementations are difficult and very unlikely in the near future. Currently, if anything from ExprEngine is to be exposed to other classes it is moved to SubEngine which restricts the alternative implementations. The virtual methods are have a slight perofrmance impact. Furthermore, instead of the LLVM-style inheritance a native inheritance is used here, which renders LLVM functions like e.g. cast<T>() unusable here. This patch removes this interface and allows usage of ExprEngine directly.

Diff Detail

Event Timeline

NoQ accepted this revision.May 26 2020, 8:21 AM

I absolutely buy this. If somebody is to ever implement another ExprEngine, dealing with the lack of a convenient virtual interface will definitely be a negligible problem for them.

clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
650

What's the point of protected if we don't expect anybody to ever inherit from us?

This revision is now accepted and ready to land.May 26 2020, 8:21 AM
This revision was automatically updated to reflect the committed changes.
  • claps in excitement *
clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp