Logo ROOT   6.19/01
Reference Guide
rootcling_impl.cxx File Reference
#include "rootcling_impl.h"
#include "rootclingCommandLineOptionsHelp.h"
#include "RConfigure.h"
#include <ROOT/RConfig.hxx>
#include <ROOT/FoundationUtils.hxx>
#include <iostream>
#include <iomanip>
#include <memory>
#include <vector>
#include <algorithm>
#include <stdio.h>
#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/AST/Mangle.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/MemoryBufferCache.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/Bitcode/BitstreamWriter.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

 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 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. More...
 
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. More...
 
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". More...
 
int CheckForUnsupportedClasses (const RScanner::ClassColl_t &annotatedRcds)
 Check if the list of selected classes contains any class which is not supported. More...
 
unsigned int genreflex::checkHeadersNames (std::vector< std::string > &headersNames)
 Loop on arguments: stop at the first which starts with -. More...
 
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. More...
 
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. More...
 
static bool CheckModuleValid (TModuleGenerator &modGen, const std::string &resourceDir, cling::Interpreter &interpreter, StringRef LinkdefPath, const std::string &moduleName)
 Check moduleName validity from modulemap. Check if this module is defined or not. More...
 
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. More...
 
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. More...
 
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 . More...
 
std::ostream * CreateStreamPtrForSplitDict (const std::string &dictpathname, tempFileNamesCatalog &tmpCatalog)
 Transform name of dictionary. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void ExtractSelectedNamespaces (RScanner &scan, std::list< std::string > &nsList)
 Loop on selected classes and put them in a list. More...
 
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. More...
 
static bool GenerateAllDict (TModuleGenerator &modGen, clang::CompilerInstance *compilerInstance, const std::string &currentDirectory)
 Generates a PCH from the given ModuleGenerator and CompilerInstance. More...
 
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. More...
 
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. More...
 
int GenReflexMain (int argc, char **argv)
 Translate the arguments of genreflex into rootcling ones and forward them to the RootCling function. More...
 
const char * GetExePath ()
 Returns the executable path name, used e.g. by SetRootSys(). More...
 
std::pair< std::string, std::string > GetExternalNamespaceAndContainedEntities (const std::string line)
 Performance is not critical here. More...
 
size_t GetFullArrayLength (const clang::ConstantArrayType *arrayType)
 
std::string GetFwdDeclnArgsToKeepString (const ROOT::TMetaUtils::TNormalizedCtxt &normCtxt, cling::Interpreter &interp)
 
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. More...
 
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). More...
 
clang::QualType GetPointeeTypeIfPossible (const clang::QualType &qt)
 Get the pointee type if possible. More...
 
const std::string gLibraryExtension (".so")
 
static llvm::cl::opt< bool > gOptC ("c", llvm::cl::desc("Deprecated, legacy flag which is ignored."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< bool > gOptCheckSelectionSyntax ("selSyntaxOnly", llvm::cl::desc("Check the selection syntax only."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< bool > gOptCint ("cint", llvm::cl::desc("Deprecated, legacy flag which is ignored."), llvm::cl::Hidden, llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< bool > gOptCxxModule ("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< bool > gOptFailOnWarnings ("failOnWarnings", llvm::cl::desc("Fail if there are warnings."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< bool > gOptForce ("f", llvm::cl::desc("Overwrite <file>s."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< bool > gOptGccXml ("gccxml", llvm::cl::desc("Deprecated, legacy flag which is ignored."), llvm::cl::Hidden, llvm::cl::cat(gRootclingOptions))
 
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 llvm::cl::opt< bool > gOptIgnoreExistingDict ("r", llvm::cl::desc("Similar to -f but it ignores the dictionary generation. \hen -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< bool > gOptInlineInput ("inlineInputHeader", llvm::cl::desc("Does not generate #include <header> but expands the header content."), llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< bool > gOptInterpreterOnly ("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 > 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< bool > gOptMultiDict ("multiDict", llvm::cl::desc("If this library has multiple separate LinkDef files."), llvm::cl::cat(gRootclingOptions))
 
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 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 llvm::cl::opt< bool > gOptP ("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< bool > gOptReflex ("reflex", llvm::cl::desc("Deprecated, legacy flag which is ignored."), llvm::cl::Hidden, llvm::cl::cat(gRootclingOptions))
 
static llvm::cl::opt< bool > gOptRootBuild ("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< bool > gOptSplit ("split", llvm::cl::desc("Split the dictionary into two parts: one containing the IO (ClassDef)\nformation and another the interactivity support."), llvm::cl::cat(gRootclingOptions))
 
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 llvm::cl::opt< VerboseLevelgOptVerboseLevel (llvm::cl::desc("Choose verbosity level:"), llvm::cl::values(clEnumVal(v, "Show errors (default)."), clEnumVal(v0, "Show only fatal errors."), clEnumVal(v1, "Show errors (the same as -v)."), clEnumVal(v2, "Show warnings."), clEnumVal(v3, "Show notes."), clEnumVal(v4, "Show information.")), llvm::cl::init(v), 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< 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))
 
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. More...
 
static llvm::cl::OptionCategory gRootclingOptions ("rootcling common options")
 
bool HasPath (const std::string &name)
 Check if file has a path. More...
 
void genreflex::header2outputName (std::string &fileName)
 Replace the extension with "_rflx.cpp". More...
 
void genreflex::headers2outputsNames (const std::vector< std::string > &headersNames, std::vector< std::string > &ofilesnames)
 Get a proper name for the output file. More...
 
static bool IncludeHeaders (const std::vector< std::string > &headers, cling::Interpreter &interpreter)
 Includes all given headers in the interpreter. More...
 
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. More...
 
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, 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. More...
 
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, 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. More...
 
bool IsGoodForAutoParseMap (const clang::RecordDecl &rcd)
 Check if the class good for being an autoparse key. More...
 
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. More...
 
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. More...
 
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). More...
 
void ParseRootMapFile (ifstream &file, map< string, string > &autoloads)
 Parse the rootmap and add entries to the autoload map. More...
 
void ParseRootMapFileNewFormat (ifstream &file, map< string, string > &autoloads)
 Parse the rootmap and add entries to the autoload map, using the new format. More...
 
bool ProcessAndAppendIfNotThere (const std::string &el, std::list< std::string > &el_list, std::unordered_set< std::string > &el_set)
 Separate multiline strings. More...
 
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. More...
 
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. More...
 
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. More...
 
int STLStringStreamer (const clang::FieldDecl &m, int rwmode, std::ostream &dictStream)
 Create Streamer code for a standard string object. More...
 
void StrcpyArg (string &dest, const char *original)
 Copy the command line argument, stripping MODULE/inc if necessary. More...
 
char * genreflex::string2charptr (const std::string &str)
 The caller is responsible for deleting the string! More...
 
bool Which (cling::Interpreter &interp, const char *fname, string &pname)
 Find file name in path specified via -I statements to Cling. More...
 
void WriteArrayDimensions (const clang::QualType &type, std::ostream &dictStream)
 Write "[0]" for all but the 1st dimension. More...
 
static bool WriteAST (StringRef fileName, clang::CompilerInstance *compilerInstance, StringRef iSysRoot, clang::Module *module=nullptr)
 Write the AST of the given CompilerInstance to the given File while respecting the given isysroot. More...
 
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. More...
 
void WriteNamespaceInit (const clang::NamespaceDecl *cl, cling::Interpreter &interp, std::ostream &dictStream)
 Write the code to initialize the namespace name and the initialization object. More...
 
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
 
const char * shortHelp
 
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 132 of file rootcling_impl.cxx.

Enumeration Type Documentation

◆ VerboseLevel

Enumerator
v0 
v1 
v2 
v3 
v4 

Definition at line 3640 of file rootcling_impl.cxx.

Function Documentation

◆ AddPlatformDefines()

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

Definition at line 2047 of file rootcling_impl.cxx.

◆ AdjustRootMapNames()

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

Definition at line 2151 of file rootcling_impl.cxx.

◆ AnnotateAllDeclsForPCH()

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

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

Definition at line 2595 of file rootcling_impl.cxx.

◆ AnnotateDecl()

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

Definition at line 303 of file rootcling_impl.cxx.

◆ AnnotateFieldDecl()

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

Definition at line 227 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 1811 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 779 of file rootcling_impl.cxx.

◆ CheckClassesForInterpreterOnlyDicts()

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

Definition at line 2610 of file rootcling_impl.cxx.

◆ CheckClassNameForRootMap()

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

Definition at line 573 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 3007 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 3432 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 706 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 756 of file rootcling_impl.cxx.

◆ CheckModuleValid()

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

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

Definition at line 3845 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 2356 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 1922 of file rootcling_impl.cxx.

◆ CreateDictHeader()

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

Definition at line 2796 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 2227 of file rootcling_impl.cxx.

◆ CreateStreamPtrForSplitDict()

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

Transform name of dictionary.

Definition at line 2992 of file rootcling_impl.cxx.

◆ EmitEnums()

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

Definition at line 167 of file rootcling_impl.cxx.

◆ EmitStreamerInfo()

void EmitStreamerInfo ( const char *  normName)

Definition at line 155 of file rootcling_impl.cxx.

◆ EmitTypedefs()

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

Definition at line 160 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 2199 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 2411 of file rootcling_impl.cxx.

◆ ExtractFileName()

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

Extract the filename from a fullpath.

Definition at line 2120 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 2129 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 3198 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 5350 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 2584 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 2631 of file rootcling_impl.cxx.

◆ 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 2015 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 2664 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 3281 of file rootcling_impl.cxx.

◆ GenerateLinkdef()

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

Definition at line 1826 of file rootcling_impl.cxx.

◆ GenerateNecessaryIncludes()

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

Definition at line 2842 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 3351 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 5431 of file rootcling_impl.cxx.

◆ GetExePath()

const char* GetExePath ( )

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

Definition at line 183 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 2332 of file rootcling_impl.cxx.

◆ GetFullArrayLength()

size_t GetFullArrayLength ( const clang::ConstantArrayType *  arrayType)

Definition at line 401 of file rootcling_impl.cxx.

◆ GetFwdDeclnArgsToKeepString()

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

Definition at line 3026 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 2171 of file rootcling_impl.cxx.

◆ GetMostExternalEnclosingClassNameFromDecl()

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

Definition at line 2189 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 808 of file rootcling_impl.cxx.

◆ GetPointeeTypeIfPossible()

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

Get the pointee type if possible.

Definition at line 3050 of file rootcling_impl.cxx.

◆ gLibraryExtension()

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

◆ 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("Similar to -f but it ignores the dictionary generation. \en -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

◆ 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

◆ 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)\formation 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 (default)."), clEnumVal(v0, "Show only fatal errors."), clEnumVal(v1, "Show errors (the same as -v)."), clEnumVal(v2, "Show warnings."), clEnumVal(v3, "Show notes."), clEnumVal(v4, "Show information."))  ,
llvm::cl::init(v ,
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 1331 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 2142 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 2028 of file rootcling_impl.cxx.

◆ InheritsFromTObject()

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

Definition at line 413 of file rootcling_impl.cxx.

◆ InheritsFromTSelector()

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

Definition at line 425 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 1951 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 3392 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 3148 of file rootcling_impl.cxx.

◆ IsGoodLibraryName()

bool IsGoodLibraryName ( const std::string &  name)

Definition at line 5386 of file rootcling_impl.cxx.

◆ IsImplementationName()

bool IsImplementationName ( const std::string &  filename)

Definition at line 3383 of file rootcling_impl.cxx.

◆ IsLinkdefFile()

bool IsLinkdefFile ( const clang::PresumedLoc &  PLoc)

Definition at line 449 of file rootcling_impl.cxx.

◆ isPointerToPointer()

bool isPointerToPointer ( const clang::FieldDecl &  m)

Definition at line 1131 of file rootcling_impl.cxx.

◆ IsSelectionFile()

bool IsSelectionFile ( const char *  filename)

Definition at line 456 of file rootcling_impl.cxx.

◆ IsSelectionXml()

bool IsSelectionXml ( const char *  filename)

Definition at line 436 of file rootcling_impl.cxx.

◆ IsSupportedClassName()

bool IsSupportedClassName ( const char *  name)

Definition at line 3412 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 670 of file rootcling_impl.cxx.

◆ MaybeSuppressWin32CrashDialogs()

static void MaybeSuppressWin32CrashDialogs ( )
static

Definition at line 3616 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 3814 of file rootcling_impl.cxx.

◆ Namespace__HasMethod()

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

Definition at line 219 of file rootcling_impl.cxx.

◆ NeedsSelection()

bool NeedsSelection ( const char *  name)

Definition at line 3399 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 527 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 605 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 636 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 2391 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 3065 of file rootcling_impl.cxx.

◆ RecordDeclCallback()

void RecordDeclCallback ( const clang::RecordDecl *  recordDecl)

Definition at line 553 of file rootcling_impl.cxx.

◆ RiseWarningIfPresent()

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

Definition at line 5373 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 6013 of file rootcling_impl.cxx.

◆ RootClingMain()

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

Definition at line 3915 of file rootcling_impl.cxx.

◆ SetRootSys()

void SetRootSys ( )

Set the ROOTSYS env var based on the executable location.

Definition at line 464 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 833 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 1068 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 1942 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 1882 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 1144 of file rootcling_impl.cxx.

◆ WriteAST()

static bool WriteAST ( StringRef  fileName,
clang::CompilerInstance *  compilerInstance,
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 1980 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 1759 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 1159 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 1236 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 1369 of file rootcling_impl.cxx.

Variable Documentation

◆ gAutoloads

map<string, string> gAutoloads

Definition at line 548 of file rootcling_impl.cxx.

◆ gBuildingROOT

bool gBuildingROOT = false

Definition at line 127 of file rootcling_impl.cxx.

◆ gDriverConfig

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

Definition at line 128 of file rootcling_impl.cxx.

◆ gLibsNeeded

string gLibsNeeded

Definition at line 549 of file rootcling_impl.cxx.

◆ shortHelp

const char* shortHelp
Initial value:
=
"Usage: rootcling [-v][-v0-4] [-f] [out.cxx] [opts] "
"file1.h[+][-][!] file2.h[+][-][!] ...[LinkDef.h]\n"

Definition at line 11 of file rootcling_impl.cxx.