Commit caa0aa3b authored by Vassil Vassilev's avatar Vassil Vassilev Committed by Lynn Garren
Browse files

Enable C++ modules for CLHEP

The C++ modules feature as described in https://clang.llvm.org/docs/Modules.html
allow producing a binary header representation to avoid redundant header
reparsing.

This feature is used in ROOT's dictionary system since ROOT v6.20:
https://github.com/root-project/root/blob/master/README/README.CXXMODULES.md

CMSSW and other experiment migrate their dictionaries to use the provided by
ROOT C++ modules support: https://github.com/cms-sw/cmssw/issues/15248

Dictionaries which transiently include clhep can be further optimized by
building a separate module for CLHEP which this MR aims for.

The current patch introduces a module.modulemap file containing a mapping between
a binary artifact (a module or a pcm file) and a set of header files. The C++
modules are more picky on translation unit encapsulation and thus require all
headers which a translation unit uses to be included. In addition to the
missing include we outline a few virtual destructors to avoid pollution of .o
files w...
parent 07002739
......@@ -103,7 +103,7 @@ public:
ZMhandleTo<ZMexHandlerBehavior>( behaviorWanted )
{ }
virtual ~ZMexHandler() { }
virtual ~ZMexHandler();
std::string name() const {
return rep_->name();
......
......@@ -26,6 +26,7 @@
#include "CLHEP/Exceptions/ZMexception.h"
#include <string>
namespace zmex {
......
......@@ -16,6 +16,9 @@
#include "CLHEP/Exceptions/ZMexClassInfo.h"
#include "CLHEP/Exceptions/ZMexSeverity.h"
#include <string>
namespace zmex {
......
......@@ -17,11 +17,17 @@
#include "CLHEP/Exceptions/ZMexHandler.h"
#include "CLHEP/Exceptions/ZMexAction.h"
#include "CLHEP/Exceptions/ZMexception.h"
#include "CLHEP/Exceptions/ZMexLogResult.h"
#include "CLHEP/Exceptions/ZMexSeverity.h"
#include <string>
namespace zmex {
ZMexHandler::~ZMexHandler() { }
//******************************************
//
......
......@@ -22,7 +22,10 @@
#include "CLHEP/Exceptions/ZMexLogger.h"
#include "CLHEP/Exceptions/ZMexception.h"
#include "CLHEP/RefCount/ZMhandleTo.h"
#include <iostream>
#include <string>
// ----------------------------------------------------------------------
......
......@@ -12,6 +12,10 @@
#include "CLHEP/Exceptions/ZMexSeverity.h"
#include "CLHEP/Exceptions/ZMerrno.h"
#include <string>
namespace zmex {
......
......@@ -34,9 +34,11 @@
#include "CLHEP/Exceptions/defs.h"
#include "CLHEP/Exceptions/ZMexception.h"
#include "CLHEP/Exceptions/ZMexAction.h"
#include "CLHEP/Exceptions/ZMexClassInfo.h"
#include "CLHEP/Exceptions/ZMexHandler.h"
#include "CLHEP/Exceptions/ZMexLogger.h"
#include "CLHEP/Exceptions/ZMexLogResult.h"
#include "CLHEP/Exceptions/ZMexSeverity.h"
#include <sstream>
#include <ctime>
......
......@@ -15,10 +15,12 @@
#include "CLHEP/Exceptions/ZMthrow.h"
#include "CLHEP/Exceptions/ZMexSeverity.h"
#include "CLHEP/Exceptions/ZMexception.h"
#include "CLHEP/Exceptions/ZMerrno.h"
#include "CLHEP/Exceptions/ZMexAction.h"
#include "CLHEP/Exceptions/ZMexception.h"
#include "CLHEP/Exceptions/ZMexSeverity.h"
#include <string>
namespace zmex {
......
......@@ -4,6 +4,9 @@ using std::endl;
#include "CLHEP/Exceptions/ZMexception.h"
#include "CLHEP/Exceptions/ZMexAction.h"
#include "CLHEP/Exceptions/ZMexClassInfo.h"
#include "CLHEP/Exceptions/ZMexSeverity.h"
#include "CLHEP/Exceptions/ZMthrow.h"
using namespace zmex;
......
......@@ -4,6 +4,9 @@ using std::endl;
#include "CLHEP/Exceptions/ZMexception.h"
#include "CLHEP/Exceptions/ZMexAction.h"
#include "CLHEP/Exceptions/ZMexClassInfo.h"
#include "CLHEP/Exceptions/ZMexSeverity.h"
#include "CLHEP/Exceptions/ZMthrow.h"
using namespace zmex;
......
......@@ -8,10 +8,16 @@
#include "CLHEP/Exceptions/ZMthrow.h"
#include "CLHEP/Exceptions/ZMexception.h"
#include "CLHEP/Exceptions/ZMexAction.h"
#include "CLHEP/Exceptions/ZMexClassInfo.h"
#include "CLHEP/Exceptions/ZMexSeverity.h"
#include "CLHEP/Exceptions/ZMerrno.h"
using namespace zmex;
#include <iostream>
#include <fstream>
using namespace std;
......
......@@ -20,8 +20,13 @@
#include "CLHEP/Exceptions/defs.h"
#include "CLHEP/Cast/itos.h"
#include "CLHEP/Exceptions/ZMthrow.h"
#include "CLHEP/Exceptions/ZMexception.h"
#include "CLHEP/Exceptions/ZMexAction.h"
#include "CLHEP/Exceptions/ZMexClassInfo.h"
#include "CLHEP/Exceptions/ZMexSeverity.h"
#include "CLHEP/Exceptions/ZMerrno.h"
#include "CLHEP/Exceptions/ZMexception.h"
#include <iostream>
using namespace zmex;
......
......@@ -14,7 +14,11 @@
#include "CLHEP/Exceptions/ZMthrow.h"
#include "CLHEP/Exceptions/ZMexception.h"
#include "CLHEP/Exceptions/ZMexAction.h"
#include "CLHEP/Exceptions/ZMexClassInfo.h"
#include "CLHEP/Exceptions/ZMexSeverity.h"
#include <iostream>
using namespace zmex;
ZMexStandardDefinition( ZMexception, ZMxTest );
......
......@@ -20,6 +20,9 @@
#include "CLHEP/Exceptions/ZMthrow.h"
#include "CLHEP/Exceptions/ZMexception.h"
#include "CLHEP/Exceptions/ZMexAction.h"
#include "CLHEP/Exceptions/ZMexClassInfo.h"
#include "CLHEP/Exceptions/ZMexSeverity.h"
#include "CLHEP/Exceptions/ZMerrno.h"
......
#include <ostream> // for std::endl
namespace Genfun {
ButcherTableau::ButcherTableau(const std::string &xname, unsigned int xorder):_name(xname),_order(xorder){
}
......
#include <ostream> // for std::endl
namespace Genfun {
ExtendedButcherTableau::ExtendedButcherTableau(const std::string &mname,
unsigned int xorder,
......
......@@ -12,6 +12,7 @@
#include "CLHEP/GenericFunctions/AbsFunction.hh"
namespace Genfun {
class Argument;
/**
* @author
......
// -*- C++ -*-
// $Id: ASin.cc,v 1.4 2003/10/10 17:40:39 garren Exp $
#include "CLHEP/GenericFunctions/AbsFunction.hh"
#include "CLHEP/GenericFunctions/ASin.hh"
#include "CLHEP/GenericFunctions/Sqrt.hh"
#include "CLHEP/GenericFunctions/Square.hh"
......
#include "CLHEP/GenericFunctions/AdaptiveRKStepper.hh"
#include "CLHEP/GenericFunctions/EmbeddedRKStepper.hh"
#include <cmath>
#include <stdexcept>
#include <vector>
namespace Genfun {
AdaptiveRKStepper::AdaptiveRKStepper(const EEStepper *stepper):
......
// -*- C++ -*-
// $Id: AnalyticConvolution.cc,v 1.8 2010/07/22 21:55:10 garren Exp $
#include "CLHEP/GenericFunctions/AbsFunction.hh"
#include "CLHEP/GenericFunctions/AnalyticConvolution.hh"
#include "CLHEP/GenericFunctions/Gaussian.hh"
#include "CLHEP/GenericFunctions/Exponential.hh"
......@@ -7,6 +8,8 @@
#if (defined _WIN32)
#include <float.h> // Visual C++ _finite
#endif
#include <iostream>
namespace Genfun {
FUNCTION_OBJECT_IMP(AnalyticConvolution)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment