Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
rootcling_impl.cxx File Reference
#include "rootcling_impl.h"
#include "rootclingCommandLineOptionsHelp.h"
#include "RConfigure.h"
#include <ROOT/RConfig.hxx>
#include <ROOT/FoundationUtils.hxx>
#include "snprintf.h"
#include <iostream>
#include <iomanip>
#include <memory>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <errno.h>
#include <string>
#include <list>
#include <sstream>
#include <map>
#include <fstream>
#include <sys/stat.h>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <limits.h>
#include <unistd.h>
#include "cling/Interpreter/Interpreter.h"
#include "cling/Interpreter/InterpreterCallbacks.h"
#include "cling/Interpreter/LookupHelper.h"
#include "cling/Interpreter/Value.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Frontend/FrontendDiagnostic.h"
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Lex/ModuleMap.h"
#include "clang/Lex/Pragma.h"
#include "clang/Sema/Sema.h"
#include "clang/Serialization/ASTWriter.h"
#include "cling/Utils/AST.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Signals.h"
#include "RtypesCore.h"
#include "TModuleGenerator.h"
#include "TClassEdit.h"
#include "TClingUtils.h"
#include "RStl.h"
#include "XMLReader.h"
#include "LinkdefReader.h"
#include "DictSelectionReader.h"
#include "SelectionRules.h"
#include "Scanner.h"
#include "strlcpy.h"
#include "OptionParser.h"
#include "clang/Basic/LangOptions.def"
Include dependency graph for rootcling_impl.cxx:

Namespaces

namespace  genreflex
 

Macros

#define ENUM_LANGOPT(Name, Type, Bits, Default, Description)
 
#define LANGOPT(Name, Bits, Default, Description)    ROOT::TMetaUtils::Info(0, "%s = %d // %s\n", #Name, (int)LangOpts.Name, Description);
 

Typedefs

using HeadersDeclsMap_t = std::map< std::string, std::list< std::string > >
 

Enumerations

enum  VerboseLevel {
  v = ROOT::TMetaUtils::kError , v0 = ROOT::TMetaUtils::kFatal , v1 = v , v2 = ROOT::TMetaUtils::kWarning ,
  v3 = ROOT::TMetaUtils::kNote , v4 = ROOT::TMetaUtils::kInfo
}
 

Functions

void AddNamespaceSTDdeclaration (std::ostream &dictStream)
 
void AddPlatformDefines (std::vector< std::string > &clingArgs)
 
void genreflex::AddToArgVector (std::vector< char * > &argvVector, const std::vector< std::string > &argsToBeAdded, const std::string &optName="")
 
void genreflex::AddToArgVectorSplit (std::vector< char * > &argvVector, const std::vector< std::string > &argsToBeAdded, const std::string &optName="")
 
void AdjustRootMapNames (std::string &rootmapFileName, std::string &rootmapLibName)
 
void AnnotateAllDeclsForPCH (cling::Interpreter &interp, RScanner &scan)
 We need annotations even in the PCH: // !, // || etc.
 
void AnnotateDecl (clang::CXXRecordDecl &CXXRD, const RScanner::DeclsSelRulesMap_t &declSelRulesMap, cling::Interpreter &interpreter, bool isGenreflex)
 
static void AnnotateFieldDecl (clang::FieldDecl &decl, const std::list< VariableSelectionRule > &fieldSelRules)
 
void CallWriteStreamer (const ROOT::TMetaUtils::AnnotatedRecordDecl &cl, const cling::Interpreter &interp, const ROOT::TMetaUtils::TNormalizedCtxt &normCtxt, std::ostream &dictStream, bool isAutoStreamer)
 
void genreflex::changeExtension (std::string &filename, const std::string &newExtension)
 
bool CheckClassDef (const clang::RecordDecl &cl, const cling::Interpreter &interp)
 Return false if the class does not have ClassDef even-though it should.
 
int CheckClassesForInterpreterOnlyDicts (cling::Interpreter &interp, RScanner &scan)
 
void CheckClassNameForRootMap (const std::string &classname, map< string, string > &autoloads)
 
static void CheckForMinusW (std::string arg, std::list< std::string > &diagnosticPragmas)
 Transform -W statements in diagnostic pragmas for cling reacting on "-Wno-" For example -Wno-deprecated-declarations --> #pragma clang diagnostic ignored "-Wdeprecated-declarations".
 
int CheckForUnsupportedClasses (const RScanner::ClassColl_t &annotatedRcds)
 Check if the list of selected classes contains any class which is not supported.
 
unsigned int genreflex::checkHeadersNames (std::vector< std::string > &headersNames)
 Loop on arguments: stop at the first which starts with -.
 
bool CheckInputOperator (const char *what, const char *proto, const string &fullname, const clang::RecordDecl *cl, cling::Interpreter &interp)
 Check if the specified operator (what) has been properly declared if the user has requested a custom version.
 
bool CheckInputOperator (const clang::RecordDecl *cl, cling::Interpreter &interp)
 Check if the operator>> has been properly declared if the user has requested a custom version.
 
static bool CheckModuleValid (TModuleGenerator &modGen, const std::string &resourceDir, cling::Interpreter &interpreter, llvm::StringRef LinkdefPath, const std::string &moduleName)
 Check moduleName validity from modulemap. Check if this module is defined or not.
 
std::list< std::string > CollapseIdenticalNamespaces (const std::list< std::string > &fwdDeclarationsList)
 If two identical namespaces are there, just declare one only Example: namespace A { namespace B { fwd1; }} namespace A { namespace B { fwd2; }} get a namespace A { namespace B { fwd1; fwd2; }} line.
 
const char * CopyArg (const char *original)
 If the argument starts with MODULE/inc, strip it to make it the name we can use in #includes.
 
void CreateDictHeader (std::ostream &dictStream, const std::string &main_dictname)
 
int CreateNewRootMapFile (const std::string &rootmapFileName, const std::string &rootmapLibName, const std::list< std::string > &classesDefsList, const std::list< std::string > &classesNames, const std::list< std::string > &nsNames, const std::list< std::string > &tdNames, const std::list< std::string > &enNames, const std::list< std::string > &varNames, const HeadersDeclsMap_t &headersClassesMap, const std::unordered_set< std::string > headersToIgnore)
 Generate a rootmap file in the new format, like { decls } namespace A { namespace B { template <typename T> class myTemplate; } } [libGpad.so libGraf.so libHist.so libMathCore.so] class TAttCanvas class TButton (header1.h header2.h .
 
std::ostream * CreateStreamPtrForSplitDict (const std::string &dictpathname, tempFileNamesCatalog &tmpCatalog)
 Transform name of dictionary.
 
static void EmitEnums (const std::vector< const clang::EnumDecl * > &enumvec)
 
void EmitStreamerInfo (const char *normName)
 
static void EmitTypedefs (const std::vector< const clang::TypedefNameDecl * > &tdvec)
 
unsigned int genreflex::extractArgs (int argc, char **argv, std::vector< std::string > &args)
 Extract the arguments from the command line.
 
template<class COLL >
int ExtractAutoloadKeys (std::list< std::string > &names, const COLL &decls, const cling::Interpreter &interp)
 
int ExtractClassesListAndDeclLines (RScanner &scan, std::list< std::string > &classesList, std::list< std::string > &classesListForRootmap, std::list< std::string > &fwdDeclarationsList, const cling::Interpreter &interpreter)
 
std::string ExtractFileName (const std::string &path)
 Extract the filename from a fullpath.
 
void ExtractFilePath (const std::string &path, std::string &dirname)
 Extract the path from a fullpath finding the last \ or / according to the content in gPathSeparator.
 
void ExtractHeadersForDecls (const RScanner::ClassColl_t &annotatedRcds, const RScanner::TypedefColl_t tDefDecls, const RScanner::FunctionColl_t funcDecls, const RScanner::VariableColl_t varDecls, const RScanner::EnumColl_t enumDecls, HeadersDeclsMap_t &headersClassesMap, HeadersDeclsMap_t &headersDeclsMap, const cling::Interpreter &interp)
 
int extractMultipleOptions (std::vector< ROOT::option::Option > &options, int oIndex, std::vector< std::string > &values)
 Extract from options multiple values with the same option.
 
void ExtractSelectedNamespaces (RScanner &scan, std::list< std::string > &nsList)
 Loop on selected classes and put them in a list.
 
int FinalizeStreamerInfoWriting (cling::Interpreter &interp, bool writeEmptyRootPCM=false)
 Make up for skipping RegisterModule, now that dictionary parsing is done and these headers cannot be selected anymore.
 
static llvm::cl::SubCommand gBareClingSubcommand ("bare-cling", "Call directly cling and exit.")
 
static bool GenerateAllDict (TModuleGenerator &modGen, clang::CompilerInstance *compilerInstance, const std::string &currentDirectory)
 Generates a PCH from the given ModuleGenerator and CompilerInstance.
 
int GenerateFullDict (std::ostream &dictStream, cling::Interpreter &interp, RScanner &scan, const ROOT::TMetaUtils::RConstructorTypes &ctorTypes, bool isSplit, bool isGenreflex, bool writeEmptyRootPCM)
 
static std::string GenerateFwdDeclString (const RScanner &scan, const cling::Interpreter &interp)
 Generate the fwd declarations of the selected entities.
 
void GenerateLinkdef (llvm::cl::list< std::string > &InputFiles, std::string &code_for_parser)
 
void GenerateNecessaryIncludes (std::ostream &dictStream, const std::string &includeForSource, const std::string &extraIncludes)
 
const std::string GenerateStringFromHeadersForClasses (const HeadersDeclsMap_t &headersClassesMap, const std::string &detectedUmbrella, bool payLoadOnly=false)
 Generate a string for the dictionary from the headers-classes map.
 
int GenReflexMain (int argc, char **argv)
 Translate the arguments of genreflex into rootcling ones and forward them to the RootCling function.
 
const char * GetExePath ()
 Returns the executable path name, used e.g. by SetRootSys().
 
std::pair< std::string, std::string > GetExternalNamespaceAndContainedEntities (const std::string line)
 Performance is not critical here.
 
size_t GetFullArrayLength (const clang::ConstantArrayType *arrayType)
 
std::string GetFwdDeclnArgsToKeepString (const ROOT::TMetaUtils::TNormalizedCtxt &normCtxt, cling::Interpreter &interp)
 
static llvm::StringRef GetModuleNameFromRdictName (llvm::StringRef rdictName)
 
void GetMostExternalEnclosingClassName (const clang::DeclContext &theContext, std::string &ctxtName, const cling::Interpreter &interpreter, bool treatParent=true)
 Extract the proper autoload key for nested classes The routine does not erase the name, just updates it.
 
void GetMostExternalEnclosingClassNameFromDecl (const clang::Decl &theDecl, std::string &ctxtName, const cling::Interpreter &interpreter)
 
string GetNonConstMemberName (const clang::FieldDecl &m, const string &prefix="")
 Return the name of the data member so that it can be used by non-const operation (so it includes a const_cast if necessary).
 
clang::QualType GetPointeeTypeIfPossible (const clang::QualType &qt)
 Get the pointee type if possible.
 
const std::string gLibraryExtension (".so")
 
static llvm::cl::list< std::string > gOptBareClingSink (llvm::cl::OneOrMore, llvm::cl::Sink, llvm::cl::desc("Consumes options and sends them to cling."), llvm::cl::cat(gRootclingOptions), llvm::cl::sub(gBareClingSubcommand))
 
static llvm::cl::opt< boolgOptC ("c", llvm::cl::desc("Deprecated, legacy flag which is ignored."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< boolgOptCheckSelectionSyntax ("selSyntaxOnly", llvm::cl::desc("Check the selection syntax only."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< boolgOptCint ("cint", llvm::cl::desc("Deprecated, legacy flag which is ignored."), llvm::cl::Hidden, llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< boolgOptCxxModule ("cxxmodule", llvm::cl::desc("Generate a C++ module."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< std::string > gOptDictionaryFileName (llvm::cl::Positional, llvm::cl::Required, llvm::cl::desc("<output dictionary file>"), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::list< std::string > gOptDictionaryHeaderFiles (llvm::cl::Positional, llvm::cl::OneOrMore, llvm::cl::desc("<list of dictionary header files> <LinkDef file>"), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::list< std::string > gOptExcludePaths ("excludePath", llvm::cl::ZeroOrMore, llvm::cl::desc("Do not store the <path> in the dictionary."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< boolgOptFailOnWarnings ("failOnWarnings", llvm::cl::desc("Fail if there are warnings."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< boolgOptForce ("f", llvm::cl::desc("Overwrite <file>s."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< boolgOptGccXml ("gccxml", llvm::cl::desc("Deprecated, legacy flag which is ignored."), llvm::cl::Hidden, llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< boolgOptGeneratePCH ("generate-pch", llvm::cl::desc("Generates a pch file from a predefined set of headers. See makepch.py."), llvm::cl::Hidden, llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< boolgOptIgnoreExistingDict ("r", llvm::cl::desc("Deprecated. Similar to -f but it ignores the dictionary generation. \ When -r is present rootcling becomes a tool to generate rootmaps (and capability files)."), llvm::cl::Hidden, llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::list< std::string > gOptIncludePaths ("I", llvm::cl::Prefix, llvm::cl::ZeroOrMore, llvm::cl::desc("Specify an include path."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< boolgOptInlineInput ("inlineInputHeader", llvm::cl::desc("Does not generate #include <header> but expands the header content."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< boolgOptInterpreterOnly ("interpreteronly", llvm::cl::desc("Generate minimal dictionary for interactivity (without IO information)."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< std::string > gOptISysRoot ("isysroot", llvm::cl::Prefix, llvm::cl::Hidden, llvm::cl::desc("Specify an isysroot."), llvm::cl::cat(gRootclingOptions), llvm::cl::init("-"))
 
static llvm::cl::opt< std::string > gOptLibListPrefix ("lib-list-prefix", llvm::cl::desc("An ACLiC feature which exports the list of dependent libraries."), llvm::cl::Hidden, llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::list< std::string > gOptModuleByproducts ("mByproduct", llvm::cl::ZeroOrMore, llvm::cl::Hidden, llvm::cl::desc("The list of the expected implicit modules build as part of building the current module."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::list< std::string > gOptModuleDependencies ("m", llvm::cl::desc("The list of dependent modules of the dictionary."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::list< std::string > gOptModuleMapFiles ("moduleMapFile", llvm::cl::desc("Specify a C++ modulemap file."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< boolgOptMultiDict ("multiDict", llvm::cl::desc("If this library has multiple separate LinkDef files."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< boolgOptNoDictSelection ("noDictSelection", llvm::cl::Hidden, llvm::cl::desc("Do not run the selection rules. Useful when in -onepcm mode."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< boolgOptNoGlobalUsingStd ("noGlobalUsingStd", llvm::cl::desc("Do not declare {using namespace std} in dictionary global scope."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< boolgOptNoIncludePaths ("noIncludePaths", llvm::cl::desc("Do not store include paths but rely on the env variable ROOT_INCLUDE_PATH."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< boolgOptP ("p", llvm::cl::desc("Deprecated, legacy flag which is ignored."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::list< std::string > gOptPPDefines ("D", llvm::cl::Prefix, llvm::cl::ZeroOrMore, llvm::cl::desc("Specify defined macros."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::list< std::string > gOptPPUndefines ("U", llvm::cl::Prefix, llvm::cl::ZeroOrMore, llvm::cl::desc("Specify undefined macros."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< boolgOptReflex ("reflex", llvm::cl::desc("Deprecated, legacy flag which is ignored."), llvm::cl::Hidden, llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< boolgOptRootBuild ("rootbuild", llvm::cl::desc("If we are building ROOT."), llvm::cl::Hidden, llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< std::string > gOptRootMapFileName ("rmf", llvm::cl::desc("Generate a rootmap file with the specified name."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::list< std::string > gOptRootmapLibNames ("rml", llvm::cl::ZeroOrMore, llvm::cl::desc("Generate rootmap file."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< std::string > gOptSharedLibFileName ("s", llvm::cl::desc("The path to the library of the built dictionary."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::list< std::string > gOptSink (llvm::cl::ZeroOrMore, llvm::cl::Sink, llvm::cl::desc("Consumes all unrecognized options."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< boolgOptSplit ("split", llvm::cl::desc("Split the dictionary into two parts: one containing the IO (ClassDef)\ information and another the interactivity support."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< boolgOptUmbrellaInput ("umbrellaHeader", llvm::cl::desc("A single header including all headers instead of specifying them on the command line."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< VerboseLevelgOptVerboseLevel (llvm::cl::desc("Choose verbosity level:"), llvm::cl::values(clEnumVal(v, "Show errors."), clEnumVal(v0, "Show only fatal errors."), clEnumVal(v1, "Show errors (the same as -v)."), clEnumVal(v2, "Show warnings (default)."), clEnumVal(v3, "Show notes."), clEnumVal(v4, "Show information.")), llvm::cl::init(v2), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::list< std::string > gOptWDiags ("W", llvm::cl::Prefix, llvm::cl::ZeroOrMore, llvm::cl::desc("Specify compiler diagnostics options."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< boolgOptWriteEmptyRootPCM ("writeEmptyRootPCM", llvm::cl::Hidden, llvm::cl::desc("Does not include the header files as it assumes they exist in the pch."), llvm::cl::cat(gRootclingOptions))
 
const std::string gPathSeparator (ROOT::TMetaUtils::GetPathSeparator())
 
llvm::StringRef GrabIndex (const clang::FieldDecl &member, int printError)
 GrabIndex returns a static string (so use it or copy it immediately, do not call GrabIndex twice in the same expression) containing the size of the array data member.
 
static llvm::cl::OptionCategory gRootclingOptions ("rootcling common options")
 
bool HasPath (const std::string &name)
 Check if file has a path.
 
void genreflex::header2outputName (std::string &fileName)
 Replace the extension with "_rflx.cpp".
 
void genreflex::headers2outputsNames (const std::vector< std::string > &headersNames, std::vector< std::string > &ofilesnames)
 Get a proper name for the output file.
 
static bool IncludeHeaders (const std::vector< std::string > &headers, cling::Interpreter &interpreter)
 Includes all given headers in the interpreter.
 
bool InheritsFromTObject (const clang::RecordDecl *cl, const cling::Interpreter &interp)
 
bool InheritsFromTSelector (const clang::RecordDecl *cl, const cling::Interpreter &interp)
 
static bool InjectModuleUtilHeader (const char *argv0, TModuleGenerator &modGen, cling::Interpreter &interp, bool umbrella)
 Write the extra header injected into the module: umbrella header if (umbrella) else content header.
 
int genreflex::invokeManyRootCling (const std::string &verbosity, const std::string &selectionFileName, const std::string &targetLibName, bool multiDict, const std::vector< std::string > &pcmsNames, const std::vector< std::string > &includes, const std::vector< std::string > &preprocDefines, const std::vector< std::string > &preprocUndefines, const std::vector< std::string > &warnings, const std::string &rootmapFileName, const std::string &rootmapLibName, bool interpreteronly, bool doSplit, bool isCxxmodule, bool writeEmptyRootPCM, bool selSyntaxOnly, bool noIncludePaths, bool noGlobalUsingStd, const std::vector< std::string > &headersNames, bool failOnWarnings, const std::string &outputDirName_const="")
 Get the right ofilenames and invoke several times rootcling One invokation per header.
 
int genreflex::invokeRootCling (const std::string &verbosity, const std::string &selectionFileName, const std::string &targetLibName, bool multiDict, const std::vector< std::string > &pcmsNames, const std::vector< std::string > &includes, const std::vector< std::string > &preprocDefines, const std::vector< std::string > &preprocUndefines, const std::vector< std::string > &warnings, const std::string &rootmapFileName, const std::string &rootmapLibName, bool interpreteronly, bool doSplit, bool isCxxmodule, bool writeEmptyRootPCM, bool selSyntaxOnly, bool noIncludePaths, bool noGlobalUsingStd, const std::vector< std::string > &headersNames, bool failOnWarnings, const std::string &ofilename)
 
bool IsCorrectClingArgument (const std::string &argument)
 Check if the argument is a sane cling argument.
 
bool IsGoodForAutoParseMap (const clang::RecordDecl &rcd)
 Check if the class good for being an autoparse key.
 
bool IsGoodLibraryName (const std::string &name)
 
bool IsImplementationName (const std::string &filename)
 
bool IsLinkdefFile (const clang::PresumedLoc &PLoc)
 
bool isPointerToPointer (const clang::FieldDecl &m)
 
bool IsSelectionFile (const char *filename)
 
bool IsSelectionXml (const char *filename)
 
bool IsSupportedClassName (const char *name)
 
void LoadLibraryMap (const std::string &fileListName, map< string, string > &autoloads)
 Fill the map of libraries to be loaded in presence of a class Transparently support the old and new rootmap file format.
 
static void MaybeSuppressWin32CrashDialogs ()
 
static bool ModuleContainsHeaders (TModuleGenerator &modGen, clang::Module *module, std::vector< std::string > &missingHeaders)
 Returns true iff a given module (and its submodules) contains all headers needed by the given ModuleGenerator.
 
bool Namespace__HasMethod (const clang::NamespaceDecl *cl, const char *name, const cling::Interpreter &interp)
 
bool NeedsSelection (const char *name)
 
bool ParsePragmaLine (const std::string &line, const char *expectedTokens[], size_t *end=0)
 Check whether the #pragma line contains expectedTokens (0-terminated array).
 
void ParseRootMapFile (ifstream &file, map< string, string > &autoloads)
 Parse the rootmap and add entries to the autoload map.
 
void ParseRootMapFileNewFormat (ifstream &file, map< string, string > &autoloads)
 Parse the rootmap and add entries to the autoload map, using the new format.
 
bool ProcessAndAppendIfNotThere (const std::string &el, std::list< std::string > &el_list, std::unordered_set< std::string > &el_set)
 Separate multiline strings.
 
std::list< std::string > RecordDecl2Headers (const clang::CXXRecordDecl &rcd, const cling::Interpreter &interp, std::set< const clang::CXXRecordDecl * > &visitedDecls)
 Extract the list of headers necessary for the Decl.
 
void RecordDeclCallback (const clang::RecordDecl *recordDecl)
 
void RiseWarningIfPresent (std::vector< ROOT::option::Option > &options, int optionIndex, const char *descriptor)
 
int ROOT_rootcling_Driver (int argc, char **argv, const ROOT::Internal::RootCling::DriverConfig &config)
 
int RootClingMain (int argc, char **argv, bool isGenreflex=false)
 
void SetRootSys ()
 Set the ROOTSYS env var based on the executable location.
 
int STLContainerStreamer (const clang::FieldDecl &m, int rwmode, const cling::Interpreter &interp, const ROOT::TMetaUtils::TNormalizedCtxt &normCtxt, std::ostream &dictStream)
 Create Streamer code for an STL container.
 
int STLStringStreamer (const clang::FieldDecl &m, int rwmode, std::ostream &dictStream)
 Create Streamer code for a standard string object.
 
void StrcpyArg (string &dest, const char *original)
 Copy the command line argument, stripping MODULE/inc if necessary.
 
char * genreflex::string2charptr (const std::string &str)
 The caller is responsible for deleting the string!
 
bool Which (cling::Interpreter &interp, const char *fname, string &pname)
 Find file name in path specified via -I statements to Cling.
 
void WriteArrayDimensions (const clang::QualType &type, std::ostream &dictStream)
 Write "[0]" for all but the 1st dimension.
 
static bool WriteAST (llvm::StringRef fileName, clang::CompilerInstance *compilerInstance, llvm::StringRef iSysRoot, clang::Module *module=nullptr)
 Write the AST of the given CompilerInstance to the given File while respecting the given isysroot.
 
void WriteAutoStreamer (const ROOT::TMetaUtils::AnnotatedRecordDecl &cl, const cling::Interpreter &interp, const ROOT::TMetaUtils::TNormalizedCtxt &normCtxt, std::ostream &dictStream)
 
void WriteClassFunctions (const clang::CXXRecordDecl *cl, std::ostream &dictStream, bool autoLoad=false)
 Write the code to set the class name and the initialization object.
 
void WriteNamespaceInit (const clang::NamespaceDecl *cl, cling::Interpreter &interp, std::ostream &dictStream)
 Write the code to initialize the namespace name and the initialization object.
 
void WriteStreamer (const ROOT::TMetaUtils::AnnotatedRecordDecl &cl, const cling::Interpreter &interp, const ROOT::TMetaUtils::TNormalizedCtxt &normCtxt, std::ostream &dictStream)
 

Variables

map< string, string > gAutoloads
 
bool gBuildingROOT = false
 
const ROOT::Internal::RootCling::DriverConfiggDriverConfig = nullptr
 
string gLibsNeeded
 
bool genreflex::verbose = false
 

Macro Definition Documentation

◆ ENUM_LANGOPT

#define ENUM_LANGOPT (   Name,
  Type,
  Bits,
  Default,
  Description 
)

◆ LANGOPT

#define LANGOPT (   Name,
  Bits,
  Default,
  Description 
)     ROOT::TMetaUtils::Info(0, "%s = %d // %s\n", #Name, (int)LangOpts.Name, Description);

Typedef Documentation

◆ HeadersDeclsMap_t

using HeadersDeclsMap_t = std::map<std::string, std::list<std::string> >

Definition at line 125 of file rootcling_impl.cxx.

Enumeration Type Documentation

◆ VerboseLevel

Enumerator
v0 
v1 
v2 
v3 
v4 

Definition at line 3648 of file rootcling_impl.cxx.

Function Documentation

◆ AddNamespaceSTDdeclaration()

void AddNamespaceSTDdeclaration ( std::ostream &  dictStream)

Definition at line 2820 of file rootcling_impl.cxx.

◆ AddPlatformDefines()

void AddPlatformDefines ( std::vector< std::string > &  clingArgs)

Definition at line 2054 of file rootcling_impl.cxx.

◆ AdjustRootMapNames()

void AdjustRootMapNames ( std::string &  rootmapFileName,
std::string &  rootmapLibName 
)

Definition at line 2158 of file rootcling_impl.cxx.

◆ AnnotateAllDeclsForPCH()

void AnnotateAllDeclsForPCH ( cling::Interpreter &  interp,
RScanner scan 
)

We need annotations even in the PCH: // !, // || etc.

Definition at line 2566 of file rootcling_impl.cxx.

◆ AnnotateDecl()

void AnnotateDecl ( clang::CXXRecordDecl &  CXXRD,
const RScanner::DeclsSelRulesMap_t declSelRulesMap,
cling::Interpreter &  interpreter,
bool  isGenreflex 
)

Definition at line 307 of file rootcling_impl.cxx.

◆ AnnotateFieldDecl()

static void AnnotateFieldDecl ( clang::FieldDecl &  decl,
const std::list< VariableSelectionRule > &  fieldSelRules 
)
static

Definition at line 231 of file rootcling_impl.cxx.

◆ CallWriteStreamer()

void CallWriteStreamer ( const ROOT::TMetaUtils::AnnotatedRecordDecl cl,
const cling::Interpreter &  interp,
const ROOT::TMetaUtils::TNormalizedCtxt normCtxt,
std::ostream &  dictStream,
bool  isAutoStreamer 
)

Definition at line 1819 of file rootcling_impl.cxx.

◆ CheckClassDef()

bool CheckClassDef ( const clang::RecordDecl &  cl,
const cling::Interpreter &  interp 
)

Return false if the class does not have ClassDef even-though it should.

Definition at line 787 of file rootcling_impl.cxx.

◆ CheckClassesForInterpreterOnlyDicts()

int CheckClassesForInterpreterOnlyDicts ( cling::Interpreter &  interp,
RScanner scan 
)

Definition at line 2581 of file rootcling_impl.cxx.

◆ CheckClassNameForRootMap()

void CheckClassNameForRootMap ( const std::string &  classname,
map< string, string > &  autoloads 
)

Definition at line 581 of file rootcling_impl.cxx.

◆ CheckForMinusW()

static void CheckForMinusW ( std::string  arg,
std::list< std::string > &  diagnosticPragmas 
)
static

Transform -W statements in diagnostic pragmas for cling reacting on "-Wno-" For example -Wno-deprecated-declarations --> #pragma clang diagnostic ignored "-Wdeprecated-declarations".

Definition at line 2993 of file rootcling_impl.cxx.

◆ CheckForUnsupportedClasses()

int CheckForUnsupportedClasses ( const RScanner::ClassColl_t annotatedRcds)

Check if the list of selected classes contains any class which is not supported.

Return the number of unsupported classes in the selection.

Definition at line 3424 of file rootcling_impl.cxx.

◆ CheckInputOperator() [1/2]

bool CheckInputOperator ( const char *  what,
const char *  proto,
const string &  fullname,
const clang::RecordDecl *  cl,
cling::Interpreter &  interp 
)

Check if the specified operator (what) has been properly declared if the user has requested a custom version.

Definition at line 714 of file rootcling_impl.cxx.

◆ CheckInputOperator() [2/2]

bool CheckInputOperator ( const clang::RecordDecl *  cl,
cling::Interpreter &  interp 
)

Check if the operator>> has been properly declared if the user has requested a custom version.

Definition at line 764 of file rootcling_impl.cxx.

◆ CheckModuleValid()

static bool CheckModuleValid ( TModuleGenerator modGen,
const std::string &  resourceDir,
cling::Interpreter &  interpreter,
llvm::StringRef  LinkdefPath,
const std::string &  moduleName 
)
static

Check moduleName validity from modulemap. Check if this module is defined or not.

Definition at line 3854 of file rootcling_impl.cxx.

◆ CollapseIdenticalNamespaces()

std::list< std::string > CollapseIdenticalNamespaces ( const std::list< std::string > &  fwdDeclarationsList)

If two identical namespaces are there, just declare one only Example: namespace A { namespace B { fwd1; }} namespace A { namespace B { fwd2; }} get a namespace A { namespace B { fwd1; fwd2; }} line.

Definition at line 2363 of file rootcling_impl.cxx.

◆ CopyArg()

const char * CopyArg ( const char *  original)

If the argument starts with MODULE/inc, strip it to make it the name we can use in #includes.

Definition at line 1930 of file rootcling_impl.cxx.

◆ CreateDictHeader()

void CreateDictHeader ( std::ostream &  dictStream,
const std::string &  main_dictname 
)

Definition at line 2778 of file rootcling_impl.cxx.

◆ CreateNewRootMapFile()

int CreateNewRootMapFile ( const std::string &  rootmapFileName,
const std::string &  rootmapLibName,
const std::list< std::string > &  classesDefsList,
const std::list< std::string > &  classesNames,
const std::list< std::string > &  nsNames,
const std::list< std::string > &  tdNames,
const std::list< std::string > &  enNames,
const std::list< std::string > &  varNames,
const HeadersDeclsMap_t headersClassesMap,
const std::unordered_set< std::string >  headersToIgnore 
)

Generate a rootmap file in the new format, like { decls } namespace A { namespace B { template <typename T> class myTemplate; } } [libGpad.so libGraf.so libHist.so libMathCore.so] class TAttCanvas class TButton (header1.h header2.h .

. headerN.h) class TMyClass

Definition at line 2234 of file rootcling_impl.cxx.

◆ CreateStreamPtrForSplitDict()

std::ostream * CreateStreamPtrForSplitDict ( const std::string &  dictpathname,
tempFileNamesCatalog &  tmpCatalog 
)

Transform name of dictionary.

Definition at line 2978 of file rootcling_impl.cxx.

◆ EmitEnums()

static void EmitEnums ( const std::vector< const clang::EnumDecl * > &  enumvec)
static

Definition at line 171 of file rootcling_impl.cxx.

◆ EmitStreamerInfo()

void EmitStreamerInfo ( const char *  normName)

Definition at line 159 of file rootcling_impl.cxx.

◆ EmitTypedefs()

static void EmitTypedefs ( const std::vector< const clang::TypedefNameDecl * > &  tdvec)
static

Definition at line 164 of file rootcling_impl.cxx.

◆ ExtractAutoloadKeys()

template<class COLL >
int ExtractAutoloadKeys ( std::list< std::string > &  names,
const COLL &  decls,
const cling::Interpreter &  interp 
)

Definition at line 2206 of file rootcling_impl.cxx.

◆ ExtractClassesListAndDeclLines()

int ExtractClassesListAndDeclLines ( RScanner scan,
std::list< std::string > &  classesList,
std::list< std::string > &  classesListForRootmap,
std::list< std::string > &  fwdDeclarationsList,
const cling::Interpreter &  interpreter 
)

Definition at line 2418 of file rootcling_impl.cxx.

◆ ExtractFileName()

std::string ExtractFileName ( const std::string &  path)

Extract the filename from a fullpath.

Definition at line 2127 of file rootcling_impl.cxx.

◆ ExtractFilePath()

void ExtractFilePath ( const std::string &  path,
std::string &  dirname 
)

Extract the path from a fullpath finding the last \ or / according to the content in gPathSeparator.

Definition at line 2136 of file rootcling_impl.cxx.

◆ ExtractHeadersForDecls()

void ExtractHeadersForDecls ( const RScanner::ClassColl_t annotatedRcds,
const RScanner::TypedefColl_t  tDefDecls,
const RScanner::FunctionColl_t  funcDecls,
const RScanner::VariableColl_t  varDecls,
const RScanner::EnumColl_t  enumDecls,
HeadersDeclsMap_t headersClassesMap,
HeadersDeclsMap_t headersDeclsMap,
const cling::Interpreter &  interp 
)

Definition at line 3184 of file rootcling_impl.cxx.

◆ extractMultipleOptions()

int extractMultipleOptions ( std::vector< ROOT::option::Option > &  options,
int  oIndex,
std::vector< std::string > &  values 
)

Extract from options multiple values with the same option.

Definition at line 5412 of file rootcling_impl.cxx.

◆ ExtractSelectedNamespaces()

void ExtractSelectedNamespaces ( RScanner scan,
std::list< std::string > &  nsList 
)

Loop on selected classes and put them in a list.

Definition at line 2555 of file rootcling_impl.cxx.

◆ FinalizeStreamerInfoWriting()

int FinalizeStreamerInfoWriting ( cling::Interpreter &  interp,
bool  writeEmptyRootPCM = false 
)

Make up for skipping RegisterModule, now that dictionary parsing is done and these headers cannot be selected anymore.

Definition at line 2602 of file rootcling_impl.cxx.

◆ gBareClingSubcommand()

static llvm::cl::SubCommand gBareClingSubcommand ( "bare-cling"  ,
"Call directly cling and exit."   
)
static

◆ GenerateAllDict()

static bool GenerateAllDict ( TModuleGenerator modGen,
clang::CompilerInstance *  compilerInstance,
const std::string &  currentDirectory 
)
static

Generates a PCH from the given ModuleGenerator and CompilerInstance.

Returns true iff the PCH was successfully generated.

Definition at line 2022 of file rootcling_impl.cxx.

◆ GenerateFullDict()

int GenerateFullDict ( std::ostream &  dictStream,
cling::Interpreter &  interp,
RScanner scan,
const ROOT::TMetaUtils::RConstructorTypes ctorTypes,
bool  isSplit,
bool  isGenreflex,
bool  writeEmptyRootPCM 
)

Definition at line 2635 of file rootcling_impl.cxx.

◆ GenerateFwdDeclString()

static std::string GenerateFwdDeclString ( const RScanner scan,
const cling::Interpreter &  interp 
)
static

Generate the fwd declarations of the selected entities.

Definition at line 3267 of file rootcling_impl.cxx.

◆ GenerateLinkdef()

void GenerateLinkdef ( llvm::cl::list< std::string > &  InputFiles,
std::string &  code_for_parser 
)

Definition at line 1834 of file rootcling_impl.cxx.

◆ GenerateNecessaryIncludes()

void GenerateNecessaryIncludes ( std::ostream &  dictStream,
const std::string &  includeForSource,
const std::string &  extraIncludes 
)

Definition at line 2828 of file rootcling_impl.cxx.

◆ GenerateStringFromHeadersForClasses()

const std::string GenerateStringFromHeadersForClasses ( const HeadersDeclsMap_t headersClassesMap,
const std::string &  detectedUmbrella,
bool  payLoadOnly = false 
)

Generate a string for the dictionary from the headers-classes map.

Definition at line 3343 of file rootcling_impl.cxx.

◆ GenReflexMain()

int GenReflexMain ( int  argc,
char **  argv 
)

Translate the arguments of genreflex into rootcling ones and forward them to the RootCling function.

These are two typical genreflex and rootcling commandlines 1) genreflex header1.h [header2.h ...] [options] [preprocessor options] 2) rootcling [-v] [-v0-4] [-f] [out.cxx] [-s sharedlib.so] [-m pcmfilename] header1.h[{+,-}][!] ..headerN.h[{+,-}][!] [{LinkDef.h,selectionRules.xml}] The rules with which the arguments are translated are (1st column genreflex): –debug -v4 –quiet -v0 -o ofile positional arg after -f -s selection file Last argument of the call –fail_on_warning Wrap ROOT::TMetaUtils::Warning and throw if selected

New arguments: -l –library targetLib name (new) -s targetLib name -m pcmname (can be many -m) (new) -m pcmname (can be many -m) –rootmap -rmf (new) –rootmap-lib -rml (new)

genreflex options which rise warnings (feedback is desirable) –no_membertypedefs (it should be irrelevant) –no_templatetypedefs (it should be irrelevant)

genreflex options which are ignored (know for sure they are not needed) –pool, –dataonly –interpreteronly –gccxml{path,opt,post}

Exceptions The –deep option of genreflex is passed as function parameter to rootcling since it's not needed at the moment there.

Definition at line 5493 of file rootcling_impl.cxx.

◆ GetExePath()

const char * GetExePath ( )

Returns the executable path name, used e.g. by SetRootSys().

Definition at line 187 of file rootcling_impl.cxx.

◆ GetExternalNamespaceAndContainedEntities()

std::pair< std::string, std::string > GetExternalNamespaceAndContainedEntities ( const std::string  line)

Performance is not critical here.

Definition at line 2339 of file rootcling_impl.cxx.

◆ GetFullArrayLength()

size_t GetFullArrayLength ( const clang::ConstantArrayType *  arrayType)

Definition at line 405 of file rootcling_impl.cxx.

◆ GetFwdDeclnArgsToKeepString()

std::string GetFwdDeclnArgsToKeepString ( const ROOT::TMetaUtils::TNormalizedCtxt normCtxt,
cling::Interpreter &  interp 
)

Definition at line 3012 of file rootcling_impl.cxx.

◆ GetModuleNameFromRdictName()

static llvm::StringRef GetModuleNameFromRdictName ( llvm::StringRef  rdictName)
static

Definition at line 3915 of file rootcling_impl.cxx.

◆ GetMostExternalEnclosingClassName()

void GetMostExternalEnclosingClassName ( const clang::DeclContext &  theContext,
std::string &  ctxtName,
const cling::Interpreter &  interpreter,
bool  treatParent = true 
)

Extract the proper autoload key for nested classes The routine does not erase the name, just updates it.

Definition at line 2178 of file rootcling_impl.cxx.

◆ GetMostExternalEnclosingClassNameFromDecl()

void GetMostExternalEnclosingClassNameFromDecl ( const clang::Decl &  theDecl,
std::string &  ctxtName,
const cling::Interpreter &  interpreter 
)

Definition at line 2196 of file rootcling_impl.cxx.

◆ GetNonConstMemberName()

string GetNonConstMemberName ( const clang::FieldDecl &  m,
const string &  prefix = "" 
)

Return the name of the data member so that it can be used by non-const operation (so it includes a const_cast if necessary).

Definition at line 816 of file rootcling_impl.cxx.

◆ GetPointeeTypeIfPossible()

clang::QualType GetPointeeTypeIfPossible ( const clang::QualType &  qt)

Get the pointee type if possible.

Definition at line 3036 of file rootcling_impl.cxx.

◆ gLibraryExtension()

const std::string gLibraryExtension ( ".so"  )

◆ gOptBareClingSink()

static llvm::cl::list< std::string > gOptBareClingSink ( llvm::cl::OneOrMore  ,
llvm::cl::Sink  ,
llvm::cl::desc("Consumes options and sends them to cling.")  ,
llvm::cl::cat(gRootclingOptions ,
llvm::cl::sub(gBareClingSubcommand  
)
static

◆ gOptC()

static llvm::cl::opt< bool > gOptC ( "c"  ,
llvm::cl::desc("Deprecated, legacy flag which is ignored.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptCheckSelectionSyntax()

static llvm::cl::opt< bool > gOptCheckSelectionSyntax ( "selSyntaxOnly"  ,
llvm::cl::desc("Check the selection syntax only.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptCint()

static llvm::cl::opt< bool > gOptCint ( "cint"  ,
llvm::cl::desc("Deprecated, legacy flag which is ignored.")  ,
llvm::cl::Hidden  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptCxxModule()

static llvm::cl::opt< bool > gOptCxxModule ( "cxxmodule"  ,
llvm::cl::desc("Generate a C++ module.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptDictionaryFileName()

static llvm::cl::opt< std::string > gOptDictionaryFileName ( llvm::cl::Positional  ,
llvm::cl::Required  ,
llvm::cl::desc("<output dictionary file>")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptDictionaryHeaderFiles()

static llvm::cl::list< std::string > gOptDictionaryHeaderFiles ( llvm::cl::Positional  ,
llvm::cl::OneOrMore  ,
llvm::cl::desc("<list of dictionary header files> <LinkDef file>")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptExcludePaths()

static llvm::cl::list< std::string > gOptExcludePaths ( "excludePath"  ,
llvm::cl::ZeroOrMore  ,
llvm::cl::desc("Do not store the <path> in the dictionary.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptFailOnWarnings()

static llvm::cl::opt< bool > gOptFailOnWarnings ( "failOnWarnings"  ,
llvm::cl::desc("Fail if there are warnings.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptForce()

static llvm::cl::opt< bool > gOptForce ( "f"  ,
llvm::cl::desc("Overwrite <file>s.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptGccXml()

static llvm::cl::opt< bool > gOptGccXml ( "gccxml"  ,
llvm::cl::desc("Deprecated, legacy flag which is ignored.")  ,
llvm::cl::Hidden  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptGeneratePCH()

static llvm::cl::opt< bool > gOptGeneratePCH ( "generate-pch"  ,
llvm::cl::desc("Generates a pch file from a predefined set of headers. See makepch.py.")  ,
llvm::cl::Hidden  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptIgnoreExistingDict()

static llvm::cl::opt< bool > gOptIgnoreExistingDict ( "r"  ,
llvm::cl::desc("Deprecated. Similar to -f but it ignores the dictionary generation. \When -r is present rootcling becomes a tool to generate rootmaps (and capability files).")  ,
llvm::cl::Hidden  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptIncludePaths()

static llvm::cl::list< std::string > gOptIncludePaths ( "I"  ,
llvm::cl::Prefix  ,
llvm::cl::ZeroOrMore  ,
llvm::cl::desc("Specify an include path.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptInlineInput()

static llvm::cl::opt< bool > gOptInlineInput ( "inlineInputHeader"  ,
llvm::cl::desc("Does not generate #include <header> but expands the header content.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptInterpreterOnly()

static llvm::cl::opt< bool > gOptInterpreterOnly ( "interpreteronly"  ,
llvm::cl::desc("Generate minimal dictionary for interactivity (without IO information).")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptISysRoot()

static llvm::cl::opt< std::string > gOptISysRoot ( "isysroot"  ,
llvm::cl::Prefix  ,
llvm::cl::Hidden  ,
llvm::cl::desc("Specify an isysroot.")  ,
llvm::cl::cat(gRootclingOptions ,
llvm::cl::init("-")   
)
static

◆ gOptLibListPrefix()

static llvm::cl::opt< std::string > gOptLibListPrefix ( "lib-list-prefix"  ,
llvm::cl::desc("An ACLiC feature which exports the list of dependent libraries.")  ,
llvm::cl::Hidden  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptModuleByproducts()

static llvm::cl::list< std::string > gOptModuleByproducts ( "mByproduct"  ,
llvm::cl::ZeroOrMore  ,
llvm::cl::Hidden  ,
llvm::cl::desc("The list of the expected implicit modules build as part of building the current module.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptModuleDependencies()

static llvm::cl::list< std::string > gOptModuleDependencies ( "m"  ,
llvm::cl::desc("The list of dependent modules of the dictionary.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptModuleMapFiles()

static llvm::cl::list< std::string > gOptModuleMapFiles ( "moduleMapFile"  ,
llvm::cl::desc("Specify a C++ modulemap file.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptMultiDict()

static llvm::cl::opt< bool > gOptMultiDict ( "multiDict"  ,
llvm::cl::desc("If this library has multiple separate LinkDef files.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptNoDictSelection()

static llvm::cl::opt< bool > gOptNoDictSelection ( "noDictSelection"  ,
llvm::cl::Hidden  ,
llvm::cl::desc("Do not run the selection rules. Useful when in -onepcm mode.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptNoGlobalUsingStd()

static llvm::cl::opt< bool > gOptNoGlobalUsingStd ( "noGlobalUsingStd"  ,
llvm::cl::desc("Do not declare {using namespace std} in dictionary global scope.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptNoIncludePaths()

static llvm::cl::opt< bool > gOptNoIncludePaths ( "noIncludePaths"  ,
llvm::cl::desc("Do not store include paths but rely on the env variable ROOT_INCLUDE_PATH.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptP()

static llvm::cl::opt< bool > gOptP ( "p"  ,
llvm::cl::desc("Deprecated, legacy flag which is ignored.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptPPDefines()

static llvm::cl::list< std::string > gOptPPDefines ( "D"  ,
llvm::cl::Prefix  ,
llvm::cl::ZeroOrMore  ,
llvm::cl::desc("Specify defined macros.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptPPUndefines()

static llvm::cl::list< std::string > gOptPPUndefines ( "U"  ,
llvm::cl::Prefix  ,
llvm::cl::ZeroOrMore  ,
llvm::cl::desc("Specify undefined macros.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptReflex()

static llvm::cl::opt< bool > gOptReflex ( "reflex"  ,
llvm::cl::desc("Deprecated, legacy flag which is ignored.")  ,
llvm::cl::Hidden  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptRootBuild()

static llvm::cl::opt< bool > gOptRootBuild ( "rootbuild"  ,
llvm::cl::desc("If we are building ROOT.")  ,
llvm::cl::Hidden  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptRootMapFileName()

static llvm::cl::opt< std::string > gOptRootMapFileName ( "rmf"  ,
llvm::cl::desc("Generate a rootmap file with the specified name.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptRootmapLibNames()

static llvm::cl::list< std::string > gOptRootmapLibNames ( "rml"  ,
llvm::cl::ZeroOrMore  ,
llvm::cl::desc("Generate rootmap file.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptSharedLibFileName()

static llvm::cl::opt< std::string > gOptSharedLibFileName ( "s"  ,
llvm::cl::desc("The path to the library of the built dictionary.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptSink()

static llvm::cl::list< std::string > gOptSink ( llvm::cl::ZeroOrMore  ,
llvm::cl::Sink  ,
llvm::cl::desc("Consumes all unrecognized options.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptSplit()

static llvm::cl::opt< bool > gOptSplit ( "split"  ,
llvm::cl::desc("Split the dictionary into two parts: one containing the IO (ClassDef)\information and another the interactivity support.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptUmbrellaInput()

static llvm::cl::opt< bool > gOptUmbrellaInput ( "umbrellaHeader"  ,
llvm::cl::desc("A single header including all headers instead of specifying them on the command line.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptVerboseLevel()

static llvm::cl::opt< VerboseLevel > gOptVerboseLevel ( llvm::cl::desc("Choose verbosity level:")  ,
llvm::cl::values(clEnumVal(v, "Show errors."), clEnumVal(v0, "Show only fatal errors."), clEnumVal(v1, "Show errors (the same as -v)."), clEnumVal(v2, "Show warnings (default)."), clEnumVal(v3, "Show notes."), clEnumVal(v4, "Show information."))  ,
llvm::cl::init(v2 ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptWDiags()

static llvm::cl::list< std::string > gOptWDiags ( "W"  ,
llvm::cl::Prefix  ,
llvm::cl::ZeroOrMore  ,
llvm::cl::desc("Specify compiler diagnostics options.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gOptWriteEmptyRootPCM()

static llvm::cl::opt< bool > gOptWriteEmptyRootPCM ( "writeEmptyRootPCM"  ,
llvm::cl::Hidden  ,
llvm::cl::desc("Does not include the header files as it assumes they exist in the pch.")  ,
llvm::cl::cat(gRootclingOptions  
)
static

◆ gPathSeparator()

const std::string gPathSeparator ( ROOT::TMetaUtils::GetPathSeparator()  )

◆ GrabIndex()

llvm::StringRef GrabIndex ( const clang::FieldDecl &  member,
int  printError 
)

GrabIndex returns a static string (so use it or copy it immediately, do not call GrabIndex twice in the same expression) containing the size of the array data member.

In case of error, or if the size is not specified, GrabIndex returns 0.

Definition at line 1339 of file rootcling_impl.cxx.

◆ gRootclingOptions()

static llvm::cl::OptionCategory gRootclingOptions ( "rootcling common options"  )
static

◆ HasPath()

bool HasPath ( const std::string &  name)

Check if file has a path.

Definition at line 2149 of file rootcling_impl.cxx.

◆ IncludeHeaders()

static bool IncludeHeaders ( const std::vector< std::string > &  headers,
cling::Interpreter &  interpreter 
)
static

Includes all given headers in the interpreter.

Returns true when we could include the headers and otherwise false on an error when including.

Definition at line 2035 of file rootcling_impl.cxx.

◆ InheritsFromTObject()

bool InheritsFromTObject ( const clang::RecordDecl *  cl,
const cling::Interpreter &  interp 
)

Definition at line 417 of file rootcling_impl.cxx.

◆ InheritsFromTSelector()

bool InheritsFromTSelector ( const clang::RecordDecl *  cl,
const cling::Interpreter &  interp 
)

Definition at line 429 of file rootcling_impl.cxx.

◆ InjectModuleUtilHeader()

static bool InjectModuleUtilHeader ( const char *  argv0,
TModuleGenerator modGen,
cling::Interpreter &  interp,
bool  umbrella 
)
static

Write the extra header injected into the module: umbrella header if (umbrella) else content header.

Definition at line 1959 of file rootcling_impl.cxx.

◆ IsCorrectClingArgument()

bool IsCorrectClingArgument ( const std::string &  argument)

Check if the argument is a sane cling argument.

Performing the following checks: 1) It does not start with "--" and is not the –param option.

Definition at line 3384 of file rootcling_impl.cxx.

◆ IsGoodForAutoParseMap()

bool IsGoodForAutoParseMap ( const clang::RecordDecl &  rcd)

Check if the class good for being an autoparse key.

We exclude from this set stl containers of pods/strings TODO: we may use also __gnu_cxx::

Definition at line 3134 of file rootcling_impl.cxx.

◆ IsGoodLibraryName()

bool IsGoodLibraryName ( const std::string &  name)

Definition at line 5448 of file rootcling_impl.cxx.

◆ IsImplementationName()

bool IsImplementationName ( const std::string &  filename)

Definition at line 3375 of file rootcling_impl.cxx.

◆ IsLinkdefFile()

bool IsLinkdefFile ( const clang::PresumedLoc &  PLoc)

Definition at line 453 of file rootcling_impl.cxx.

◆ isPointerToPointer()

bool isPointerToPointer ( const clang::FieldDecl &  m)

Definition at line 1139 of file rootcling_impl.cxx.

◆ IsSelectionFile()

bool IsSelectionFile ( const char *  filename)

Definition at line 460 of file rootcling_impl.cxx.

◆ IsSelectionXml()

bool IsSelectionXml ( const char *  filename)

Definition at line 440 of file rootcling_impl.cxx.

◆ IsSupportedClassName()

bool IsSupportedClassName ( const char *  name)

Definition at line 3404 of file rootcling_impl.cxx.

◆ LoadLibraryMap()

void LoadLibraryMap ( const std::string &  fileListName,
map< string, string > &  autoloads 
)

Fill the map of libraries to be loaded in presence of a class Transparently support the old and new rootmap file format.

Definition at line 678 of file rootcling_impl.cxx.

◆ MaybeSuppressWin32CrashDialogs()

static void MaybeSuppressWin32CrashDialogs ( )
static

Definition at line 3625 of file rootcling_impl.cxx.

◆ ModuleContainsHeaders()

static bool ModuleContainsHeaders ( TModuleGenerator modGen,
clang::Module *  module,
std::vector< std::string > &  missingHeaders 
)
static

Returns true iff a given module (and its submodules) contains all headers needed by the given ModuleGenerator.

The names of all header files that are needed by the ModuleGenerator but are not in the given module will be inserted into the MissingHeader variable. Returns true iff the PCH was successfully generated.

Definition at line 3823 of file rootcling_impl.cxx.

◆ Namespace__HasMethod()

bool Namespace__HasMethod ( const clang::NamespaceDecl *  cl,
const char *  name,
const cling::Interpreter &  interp 
)

Definition at line 223 of file rootcling_impl.cxx.

◆ NeedsSelection()

bool NeedsSelection ( const char *  name)

Definition at line 3391 of file rootcling_impl.cxx.

◆ ParsePragmaLine()

bool ParsePragmaLine ( const std::string &  line,
const char *  expectedTokens[],
size_t *  end = 0 
)

Check whether the #pragma line contains expectedTokens (0-terminated array).

Definition at line 535 of file rootcling_impl.cxx.

◆ ParseRootMapFile()

void ParseRootMapFile ( ifstream &  file,
map< string, string > &  autoloads 
)

Parse the rootmap and add entries to the autoload map.

Definition at line 613 of file rootcling_impl.cxx.

◆ ParseRootMapFileNewFormat()

void ParseRootMapFileNewFormat ( ifstream &  file,
map< string, string > &  autoloads 
)

Parse the rootmap and add entries to the autoload map, using the new format.

Definition at line 644 of file rootcling_impl.cxx.

◆ ProcessAndAppendIfNotThere()

bool ProcessAndAppendIfNotThere ( const std::string &  el,
std::list< std::string > &  el_list,
std::unordered_set< std::string > &  el_set 
)

Separate multiline strings.

Definition at line 2398 of file rootcling_impl.cxx.

◆ RecordDecl2Headers()

std::list< std::string > RecordDecl2Headers ( const clang::CXXRecordDecl &  rcd,
const cling::Interpreter &  interp,
std::set< const clang::CXXRecordDecl * > &  visitedDecls 
)

Extract the list of headers necessary for the Decl.

Definition at line 3051 of file rootcling_impl.cxx.

◆ RecordDeclCallback()

void RecordDeclCallback ( const clang::RecordDecl *  recordDecl)

Definition at line 561 of file rootcling_impl.cxx.

◆ RiseWarningIfPresent()

void RiseWarningIfPresent ( std::vector< ROOT::option::Option > &  options,
int  optionIndex,
const char *  descriptor 
)

Definition at line 5435 of file rootcling_impl.cxx.

◆ ROOT_rootcling_Driver()

int ROOT_rootcling_Driver ( int  argc,
char **  argv,
const ROOT::Internal::RootCling::DriverConfig config 
)

Definition at line 6079 of file rootcling_impl.cxx.

◆ RootClingMain()

int RootClingMain ( int  argc,
char **  argv,
bool  isGenreflex = false 
)

Definition at line 3927 of file rootcling_impl.cxx.

◆ SetRootSys()

void SetRootSys ( )

Set the ROOTSYS env var based on the executable location.

Definition at line 468 of file rootcling_impl.cxx.

◆ STLContainerStreamer()

int STLContainerStreamer ( const clang::FieldDecl &  m,
int  rwmode,
const cling::Interpreter &  interp,
const ROOT::TMetaUtils::TNormalizedCtxt normCtxt,
std::ostream &  dictStream 
)

Create Streamer code for an STL container.

Returns 1 if data member was an STL container and if Streamer code has been created, 0 otherwise.

Definition at line 841 of file rootcling_impl.cxx.

◆ STLStringStreamer()

int STLStringStreamer ( const clang::FieldDecl &  m,
int  rwmode,
std::ostream &  dictStream 
)

Create Streamer code for a standard string object.

Returns 1 if data member was a standard string and if Streamer code has been created, 0 otherwise.

Definition at line 1076 of file rootcling_impl.cxx.

◆ StrcpyArg()

void StrcpyArg ( string &  dest,
const char *  original 
)

Copy the command line argument, stripping MODULE/inc if necessary.

Definition at line 1950 of file rootcling_impl.cxx.

◆ Which()

bool Which ( cling::Interpreter &  interp,
const char *  fname,
string &  pname 
)

Find file name in path specified via -I statements to Cling.

Return false if the file can not be found. If the file is found, set pname to the full path name and return true.

Definition at line 1890 of file rootcling_impl.cxx.

◆ WriteArrayDimensions()

void WriteArrayDimensions ( const clang::QualType &  type,
std::ostream &  dictStream 
)

Write "[0]" for all but the 1st dimension.

Definition at line 1152 of file rootcling_impl.cxx.

◆ WriteAST()

static bool WriteAST ( llvm::StringRef  fileName,
clang::CompilerInstance *  compilerInstance,
llvm::StringRef  iSysRoot,
clang::Module *  module = nullptr 
)
static

Write the AST of the given CompilerInstance to the given File while respecting the given isysroot.

If module is not a null pointer, we only write the given module to the given file and not the whole AST. Returns true if the AST was successfully written.

Definition at line 1988 of file rootcling_impl.cxx.

◆ WriteAutoStreamer()

void WriteAutoStreamer ( const ROOT::TMetaUtils::AnnotatedRecordDecl cl,
const cling::Interpreter &  interp,
const ROOT::TMetaUtils::TNormalizedCtxt normCtxt,
std::ostream &  dictStream 
)

Definition at line 1767 of file rootcling_impl.cxx.

◆ WriteClassFunctions()

void WriteClassFunctions ( const clang::CXXRecordDecl *  cl,
std::ostream &  dictStream,
bool  autoLoad = false 
)

Write the code to set the class name and the initialization object.

Definition at line 1167 of file rootcling_impl.cxx.

◆ WriteNamespaceInit()

void WriteNamespaceInit ( const clang::NamespaceDecl *  cl,
cling::Interpreter &  interp,
std::ostream &  dictStream 
)

Write the code to initialize the namespace name and the initialization object.

Definition at line 1244 of file rootcling_impl.cxx.

◆ WriteStreamer()

void WriteStreamer ( const ROOT::TMetaUtils::AnnotatedRecordDecl cl,
const cling::Interpreter &  interp,
const ROOT::TMetaUtils::TNormalizedCtxt normCtxt,
std::ostream &  dictStream 
)

Definition at line 1377 of file rootcling_impl.cxx.

Variable Documentation

◆ gAutoloads

map<string, string> gAutoloads

Definition at line 556 of file rootcling_impl.cxx.

◆ gBuildingROOT

bool gBuildingROOT = false

Definition at line 120 of file rootcling_impl.cxx.

◆ gDriverConfig

const ROOT::Internal::RootCling::DriverConfig* gDriverConfig = nullptr

Definition at line 121 of file rootcling_impl.cxx.

◆ gLibsNeeded

string gLibsNeeded

Definition at line 557 of file rootcling_impl.cxx.