Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ROOT's llvm to llvm13. #10294

Merged
merged 154 commits into from Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
680a1dc
Revert "Accept only true values for CLING_PROFILE and CLING_DEBUG"
vgvassilev Nov 11, 2022
bd5d1c4
Revert "Disable optimizations and keep frame pointer when debugging"
vgvassilev Nov 11, 2022
8dab1ca
Revert "PR44540: Prefer an inherited default constructor over an init…
Axel-Naumann Sep 15, 2022
4e09a7b
Revert "Add support for profiling/debugging interpreted/JITted code"
hahnjo Jun 13, 2022
ab2b972
Import llvm13.
vgvassilev Apr 1, 2022
8901c3c
Add getSizeExpr parameter.
vgvassilev Sep 11, 2021
659e946
llvm::StringRef does not support automatic conversion to string anymore.
vgvassilev Sep 11, 2021
99753bf
Color handling moved from raw_fd_ostream to raw_ostream.
vgvassilev Sep 11, 2021
c0537a6
The mangler accepts GlobalDecls and we don't need special cases ctors…
vgvassilev Sep 11, 2021
8c9aeef
Preprocessor::LookupFile returns FileEntryRef.
vgvassilev Sep 11, 2021
9695067
getName returns now Expected<StringRef>
vgvassilev Sep 11, 2021
f052ec0
CPlusPlus2a was renamed to CPlusPlus20.
vgvassilev Sep 11, 2021
df8be7e
llvm::sys::fs went into a separate header.
vgvassilev Sep 11, 2021
e437d2f
CreateFromArgs takes now an ArrayRef.
vgvassilev Sep 11, 2021
eeaa511
ShowTimers went in CodeGenOptions.
vgvassilev Sep 11, 2021
81d582b
OmitFramePointer flag became an enum.
vgvassilev Sep 11, 2021
a58013d
The BuiltinContext is in a separate header.
vgvassilev Sep 11, 2021
fb02de5
getFlags returns llvm::Expected.
vgvassilev Sep 11, 2021
0008ca6
FileManager::getFile returns an llvm::ErrorOr which needs to be checked.
vgvassilev Sep 11, 2021
86d58b2
Qualify DestroyTemplateIdAnnotationsRAIIObj.
vgvassilev Sep 11, 2021
d87fab7
ContentCache::getRawBuffer is replaced with getBufferDataIfLoaded
vgvassilev Sep 11, 2021
6d72b4d
FileInfo always has content cache and replaceBuffer became setBuffer.
vgvassilev Sep 11, 2021
2491e9e
createOutputFile was simplified.
vgvassilev Sep 11, 2021
12f4cd1
stripPointerCastsNoFollowAliases got renamed to stripPointerCasts
vgvassilev Sep 11, 2021
f1685d8
Expr dependence was reworked and made protected.
vgvassilev Sep 12, 2021
30781f3
dump() takes an ASTContext now.
vgvassilev Sep 12, 2021
34474dc
CGFT_AssemblyFile was moved to the llvm namespace.
vgvassilev Dec 9, 2021
58251bc
The StoredDeclsList is reworked and more user-friendly.
vgvassilev Dec 17, 2021
6675734
createDriverOptTable became a singleton.
vgvassilev Dec 17, 2021
3a1d108
llvm::make_unique -> std::make_unique
vgvassilev Dec 17, 2021
786206e
Add an include to TargetInfo.h
vgvassilev Dec 17, 2021
bb48d94
Use the real name not it's synonym.
vgvassilev Dec 17, 2021
5c84515
Rework the cling JIT to use the ORCv2 interface.
weliveindetail Dec 17, 2021
0fe3edb
Dropped compatibility flags F_{Text,None} -> OF_{Text,None}
vgvassilev Feb 7, 2022
b47e32c
TemplateArgument::print takes one more argument.
vgvassilev Feb 7, 2022
e1dd160
Add the override qualifier to suppress warnings
vgvassilev Feb 7, 2022
5adc69c
VK_RValue -> VK_PRValue
vgvassilev Feb 7, 2022
3535c5c
createModuleManager and friends was renamed to *ASTReader.
vgvassilev Feb 7, 2022
70948dd
Use the synonym interface getBuffer->getBufferData
vgvassilev Feb 7, 2022
f0c0b5b
TypeNameContext was renamed to TypeName.
vgvassilev Feb 7, 2022
d5dc5ce
getTypeAnnotation returns now TypeResult.
vgvassilev Feb 7, 2022
537efd8
APSInt::toString returning std::string was removed.
vgvassilev Feb 8, 2022
451fb89
setSuppressAllDiagnostics has no default anymore.
vgvassilev Feb 8, 2022
ea36464
ParseUnqualifiedId has new set of params.
vgvassilev Feb 8, 2022
71f3dd3
DisablePCHValidation became an enum
vgvassilev Feb 8, 2022
c2afed6
DirectoryLookup takes a DirectoryRef.
vgvassilev Feb 8, 2022
e6945b3
CreateASTDumper takes another bool arg.
vgvassilev Feb 8, 2022
541cbb5
Target::adjust takes DiagnosticsEngine
vgvassilev Feb 9, 2022
3f38a7d
LookupFile returns FileEntryRef.
vgvassilev Feb 9, 2022
6478455
OPT_fmodule_name was dropped.
vgvassilev Feb 9, 2022
93bdb2e
Use AnnotateAttr::CreateImplicit function which is now available.
vgvassilev Feb 9, 2022
0e15e32
PrintHelp is now lower case.
vgvassilev Feb 9, 2022
52447a6
llvm::StringRef::*lower became insensitive.
vgvassilev Feb 9, 2022
aa4c10c
The new API requires the address of the files
vgvassilev Feb 10, 2022
6460e95
Connect the JIT with the lazy symbol creation infrastructure.
vgvassilev Feb 13, 2022
29f97bf
Implement --debug-only option in order to easily dump LLVM debug output
weliveindetail Nov 5, 2021
d1eb04f
OrcV2 is more strict with linkage.
vgvassilev Mar 19, 2022
ce004ba
Drop the unused Interpreter::addSymbol function.
vgvassilev Mar 20, 2022
d5fee48
Implement a solution to the JIT-owned llvm::Modules.
vgvassilev Mar 20, 2022
bfed0c8
IncrementalJIT::getSymbolAddress is expected to return 0 and never co…
vgvassilev Mar 20, 2022
56f94cc
Jitlink does not support all necessary platfroms, switch to RuntimeDyld.
vgvassilev Mar 20, 2022
c927ad0
Rework the symbol injection mechanism to also allow symbol replacement.
vgvassilev Mar 20, 2022
01f6cda
The OrcV2 now can iterate over the globals and run the static init fo…
vgvassilev Mar 20, 2022
a8af0ec
Update the comment, we still need this if g++ > 5
vgvassilev Mar 22, 2022
df9346f
Print a<b<c> >' rather than 'a<b<c>>' in the Transform.C test.
vgvassilev Mar 22, 2022
748ba08
LLVM now requires C++14.
vgvassilev Mar 24, 2022
3841843
Rename addSymbol to match what it does and remove redundant params.
vgvassilev Mar 25, 2022
1fc9b2a
Diagnostic text changed
vgvassilev Mar 25, 2022
25b174b
Re-teach getAddressOfGlobal to tell if something came from the JIT.
vgvassilev Mar 25, 2022
6f4ef66
Unconditionally install ClingTargets.cmake, required by ClingConfig.c…
vgvassilev Mar 27, 2022
ce19b68
Complete the upgrade to LLVM/Clang 13 for cling.
vgvassilev Mar 28, 2022
59a34cd
APInt/APSInt toString() std::string variants were removed for llvm::t…
vgvassilev Apr 1, 2022
159b2c7
isIntegerConstantExpression was refactored to getIntegerConstantExpre…
vgvassilev Apr 1, 2022
9d20a0a
Improve the builtin_cling=Off feature.
vgvassilev Apr 1, 2022
99fadca
ASTContext::getConstantArrayType has a new param called SizeExpr.
vgvassilev Apr 1, 2022
20ccba3
IsMissingRequirement was renamed to IsUnimportable.
vgvassilev Apr 1, 2022
a02057c
getClangToolFullVersion doesn't show empty space anymore.
vgvassilev Apr 1, 2022
01468cd
raw_string_ostream:: takes an ASTContext.
vgvassilev Apr 1, 2022
50ae2eb
[llvm13] -fmodule-name requires now `=`.
vgvassilev Apr 1, 2022
5fafa1e
Spell out correctly the forward decl
vgvassilev Apr 1, 2022
22bda48
getContentCache() returns a reference not a pointer.
vgvassilev Apr 1, 2022
a50544d
FileManager::getDirectory returns llvm::Error, use getOptionalDirecto…
vgvassilev Apr 1, 2022
3ed1815
Use consistent TUKind for the Preproocessor and Sema.
vgvassilev Apr 1, 2022
3dcc1d6
Remove redundant header include.
vgvassilev Apr 1, 2022
d428df2
Move handling of the help option alias after hinding all irrelevant o…
vgvassilev Apr 1, 2022
c6956cb
Add another symbol generator to resolve the generated lazy symbol.
vgvassilev Apr 1, 2022
71e6ed3
Complete the llvm13 upgrade for ROOT.
vgvassilev Apr 1, 2022
10e0b01
[cmake] Force-set the ZLIB_LIBRARY
vgvassilev Apr 2, 2022
2b283cc
Do not install {Clang,Cling}Config.cmake in the project lib dir.
vgvassilev Apr 2, 2022
5c3652a
Try fixing the multicore
vgvassilev Apr 2, 2022
3c11c24
Use the header fullpath to fix a new diagnostic.
vgvassilev Apr 2, 2022
e4beb9a
Fix build with C++17
hahnjo Apr 6, 2022
de84bfc
Fix CUDA architecture selection
hahnjo Apr 6, 2022
7a4c266
[CUDA/HIP] Remove argument from module ctor/dtor signatures
hahnjo Apr 8, 2022
4f26cf7
[cling] Do not externalize unnamed GlobalValues
hahnjo Apr 8, 2022
c4cf8b5
[cling] Fix some trivial compiler warnings
hahnjo Apr 12, 2022
e0d8ff5
[cling] Move Autoload annotation after scope keyword
hahnjo May 9, 2022
959fe3a
[cling] Print 'a<b<c> >' rather than 'a<b<c>>' in ValuePrinter
hahnjo May 13, 2022
d307fb8
[cling] The JIT now is more consistent on OSX with the linker-level m…
vgvassilev May 16, 2022
56dd0ba
Fix the special case for Windows. FIXE: Try remove ifdef
vgvassilev May 17, 2022
e770ce4
[cling] Fix emission of vtables
hahnjo May 18, 2022
a5e3551
Print 'a<b<c> >' rather than 'a<b<c>>' in TCling.
vgvassilev May 20, 2022
34e445d
[cling] Ignore duplicate kept GlobalValues
hahnjo May 23, 2022
1501c97
TClingMethodInfoTests: Delete unwanted constructor
hahnjo May 23, 2022
8688a92
[cling] Print default template arguments
hahnjo May 23, 2022
19bd6d2
[cling] Avoid duplicate symbols from RuntimeUniverse.h
hahnjo May 23, 2022
c8653bf
TCling: Print default template arguments
hahnjo May 24, 2022
e83e150
[D126620][clang] AST/Print: honor AlwaysIncludeTypeForTemplateArgumen…
vgvassilev May 31, 2022
67da5f5
[cling] Weaken definitions of typeinfos and vtables
hahnjo May 31, 2022
3edc949
LLVM has now unnamed for enums and anonymous for everything else.
vgvassilev Jun 1, 2022
2894a82
Revert "Reland another version of "The Sema::LookupConstructor is not…
vgvassilev Jun 2, 2022
81086e6
[clang] Bring back code lost during upgrade.
Axel-Naumann Jun 16, 2022
4c7b512
[cling] Remove duplicate / impossible condition.
Axel-Naumann Jun 22, 2022
b3c0401
[cling] Fix spelling of "we do not have a valid buffer":
Axel-Naumann Jun 22, 2022
8deb57c
[clang] Mark ContentCache as invalid if !Buffer:
Axel-Naumann Jun 23, 2022
6d08128
[cmake] Prevent race creating `lib/`:
Axel-Naumann Jul 6, 2022
5c5fa8a
[cling] Silence Orc missing symbols message:
Axel-Naumann Jul 6, 2022
d207867
[clang] Revert interface (and use) to upstream llvm13:
Axel-Naumann Jun 22, 2022
9b2041e
TCling: Re-implement autoload via MaterializationUnits
hahnjo Jul 7, 2022
a5b68d6
[TClingUtils] Remove leading underscore also for C symbols
hahnjo Jul 15, 2022
c327f48
Fixed bug in symbol linking for CUDA kernel registration with LLVM 13.
SimeonEhrig Jul 27, 2022
5f60424
Explicitly instantiate pending instantiations.
vgvassilev Jul 30, 2022
ed7ed96
[llvm] Fix win32 mangling in OrcJIT v2:
Axel-Naumann Sep 12, 2022
d558473
[TCling] Never autoload libCling: we hide it.
Axel-Naumann Sep 15, 2022
7963d75
[TCling] Fix assert on autoloading libNew:
Axel-Naumann Sep 15, 2022
1843584
[TCling] Remove useless constructor: nobody should call this.
Axel-Naumann Sep 15, 2022
b5ceff2
[cling] weak symbol re-emission veto: only consider in-process symbols:
Axel-Naumann Sep 15, 2022
6a145b3
[cling] Make in-process sym lookup configurable.
Axel-Naumann Sep 15, 2022
274c1d5
[cling] Pass libCling handle at construction time, resolve from it:
Axel-Naumann Sep 15, 2022
29597d6
[cling] Formatting (80cols).
Axel-Naumann Sep 20, 2022
10ba5c3
[cling] Remove unused data members, parameters, includes.
Axel-Naumann Sep 20, 2022
728c2e1
[cling] Delete globals before JIT deletes the module:
Axel-Naumann Sep 23, 2022
8640238
D129175: [ORC] Fix weak hidden symbols failure on PPC with runtimedyld
vgvassilev Nov 7, 2022
57399b6
[cling] Add an absolute symbol pointing to _CxxThrowException on Windows
vgvassilev Nov 14, 2022
8bd8fb1
Backport D138264: [COFF] Improve JIT support of weak symbols.
vgvassilev Nov 13, 2022
a886646
FIXME: Comment asserts, they happen upstream but we believe they are …
vgvassilev Nov 16, 2022
e9d264e
[cling] Mark __dso_handle a "far" pointer:
hahnjo Nov 18, 2022
cd4e143
[cling] Make IncrementalExecutor::replaceSymbol() take IR names:
Axel-Naumann Nov 18, 2022
8feb2f4
[rootcling] State which module a header already belongs to:
Axel-Naumann Nov 20, 2022
1aa5500
[cmake,thread,core] Move ThreadLocalStorage.h to foundation/:
Axel-Naumann Nov 20, 2022
0813a83
[cling] Reintroduce custom memory manager
hahnjo Nov 23, 2022
dc607f1
[cling] Disable release of code and data sections
hahnjo Nov 23, 2022
ffe8679
[clang] Relax assertion on generating destructor call
hahnjo Nov 23, 2022
0907382
Disable ASan check for initialization order
hahnjo Nov 23, 2022
ff25aa0
[cmake] Prevent Clang from finding CUDA
hahnjo Nov 24, 2022
182424b
[cling] Remove spurrious string generation.
Axel-Naumann Nov 23, 2022
8286508
[TCling] Reduce nesting (NFC, hopefully).
Axel-Naumann Nov 24, 2022
1fdf170
[TCling] Do not resolve weak or GCC/libstdc++ versioned symbols:
Axel-Naumann Nov 24, 2022
8c8f97d
[cling] Remove unused data members.
Axel-Naumann Nov 24, 2022
cbf04fb
[cling] Track (and unload) symbols from dylibs:
Axel-Naumann Nov 24, 2022
5b67d38
Bring back root-project/root@ca5eb992f43
vgvassilev Nov 24, 2022
41c6af5
[cmake] Disable tests failing on Windows with llvm13 (to be reverted).
bellenot Nov 25, 2022
587f7eb
[cling] Fix bug in handling EXTRA_CLING_ARGS:
Axel-Naumann Dec 2, 2022
20ee9be
[clang] Reinstate also decls with internal linkage as deferred:
Axel-Naumann Dec 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -41,6 +41,7 @@ project(ROOT)
set(ENV{LANG} C)

#---Set paths where to put the libraries, executables and headers------------------------------
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/lib) # prevent mkdir races
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
Expand Down
4 changes: 2 additions & 2 deletions bindings/pyroot/cppyy/CPyCppyy/src/ProxyWrappers.cxx
Expand Up @@ -364,9 +364,9 @@ static int BuildScopeProxyDict(Cppyy::TCppScope_t scope, PyObject* pyclass)

PyErr_Clear();

// it could still be that this is an anonymous enum, which is not in the list
// it could still be that this is an unnamed enum, which is not in the list
// provided by the class
if (strstr(Cppyy::GetDatamemberType(scope, idata).c_str(), "(anonymous)") != 0) {
if (strstr(Cppyy::GetDatamemberType(scope, idata).c_str(), "(unnamed)") != 0) {
AddPropertyToClass(pyclass, scope, idata);
continue;
}
Expand Down
Expand Up @@ -448,7 +448,7 @@ std::string Cppyy::ResolveEnum(const std::string& enum_type)

// desugar the type before resolving
std::string et_short = TClassEdit::ShortType(enum_type.c_str(), 1);
if (et_short.find("(anonymous") == std::string::npos) {
if (et_short.find("(unnamed") == std::string::npos) {
std::ostringstream decl;
// TODO: now presumed fixed with https://sft.its.cern.ch/jira/browse/ROOT-6988
for (auto& itype : {"unsigned int"}) {
Expand Down Expand Up @@ -2123,7 +2123,7 @@ bool Cppyy::IsEnumData(TCppScope_t scope, TCppIndex_t idata)
std::string ti = m->GetTypeName();

// can't check anonymous enums by type name, so just accept them as enums
if (ti.rfind("(anonymous)") != std::string::npos)
if (ti.rfind("(unnamed)") != std::string::npos)
return m->Property() & kIsEnum;

// since there seems to be no distinction between data of enum type and enum values,
Expand Down
4 changes: 3 additions & 1 deletion bindings/pyroot/pythonizations/test/CMakeLists.txt
Expand Up @@ -113,7 +113,9 @@ if (dataframe)
ROOT_ADD_PYUNITTEST(pyroot_pyz_rdataframe_makenumpy rdataframe_makenumpy.py PYTHON_DEPS numpy)
endif()
if(NOT MSVC OR win_broken_tests OR CMAKE_CXX_STANDARD GREATER 14)
ROOT_ADD_PYUNITTEST(pyroot_pyz_rdataframe_asnumpy rdataframe_asnumpy.py PYTHON_DEPS numpy)
if(NOT MSVC OR ${LLVM_VERSION} VERSION_LESS 13.0.0 OR llvm13_broken_tests)
ROOT_ADD_PYUNITTEST(pyroot_pyz_rdataframe_asnumpy rdataframe_asnumpy.py PYTHON_DEPS numpy)
endif()
ROOT_ADD_PYUNITTEST(pyroot_pyz_rdataframe_histo_profile rdataframe_histo_profile.py)
endif()
endif()
Expand Down
4 changes: 2 additions & 2 deletions bindings/pyroot_legacy/src/RootWrapper.cxx
Expand Up @@ -398,9 +398,9 @@ static int BuildScopeProxyDict( Cppyy::TCppScope_t scope, PyObject* pyclass ) {

PyErr_Clear();

// it could still be that this is an anonymous enum, which is not in the list
// it could still be that this is an unnamed enum, which is not in the list
// provided by the class
if ( strstr( Cppyy::GetDatamemberType( scope, idata ).c_str(), "(anonymous)" ) != 0 ) {
if ( strstr( Cppyy::GetDatamemberType( scope, idata ).c_str(), "(unnamed)" ) != 0 ) {
AddPropertyToClass( pyclass, scope, idata );
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion builtins/zlib/CMakeLists.txt
Expand Up @@ -126,7 +126,7 @@ endif()

add_library(ZLIB::ZLIB ALIAS ZLIB)

set(ZLIB_LIBRARY $<TARGET_FILE:ZLIB> CACHE INTERNAL "")
set(ZLIB_LIBRARY $<TARGET_FILE:ZLIB::ZLIB> CACHE INTERNAL FORCE "")
set(ZLIB_LIBRARIES ZLIB::ZLIB CACHE INTERNAL "")

if(DEFINED ZLIB_LIBRARY_DEBUG)
Expand Down
1 change: 1 addition & 0 deletions cmake/modules/RootBuildOptions.cmake
Expand Up @@ -191,6 +191,7 @@ ROOT_BUILD_OPTION(vdt ON "Enable support for VDT (fast and vectorisable mathemat
ROOT_BUILD_OPTION(veccore OFF "Enable support for VecCore SIMD abstraction library")
ROOT_BUILD_OPTION(vecgeom OFF "Enable support for VecGeom vectorized geometry library")
ROOT_BUILD_OPTION(win_broken_tests OFF "Enable broken tests on Windows")
ROOT_BUILD_OPTION(llvm13_broken_tests OFF "Enable broken tests with LLVM 13 on Windows")
ROOT_BUILD_OPTION(winrtdebug OFF "Link against the Windows debug runtime library")
ROOT_BUILD_OPTION(x11 ON "Enable support for X11/Xft")
ROOT_BUILD_OPTION(xml ON "Enable support for XML (requires libxml2)")
Expand Down
3 changes: 3 additions & 0 deletions cmake/modules/SetUpWindows.cmake
Expand Up @@ -45,6 +45,9 @@ elseif(MSVC)
if(win_broken_tests)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DR__ENABLE_BROKEN_WIN_TESTS")
endif()
if(llvm13_broken_tests)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DR__ENABLE_LLVM13_BROKEN_TESTS")
endif()
else()
set(CMAKE_CXX_FLAGS "-nologo -FIw32pragma.h -FIsehmap.h ${BLDCXXFLAGS} -EHsc- -W3 -wd4244 -D_WIN32 ${ARCH}")
set(CMAKE_C_FLAGS "-nologo -FIw32pragma.h -FIsehmap.h ${BLDCFLAGS} -EHsc- -W3 -D_WIN32 ${ARCH}")
Expand Down
2 changes: 1 addition & 1 deletion core/base/src/TApplication.cxx
Expand Up @@ -823,7 +823,7 @@ GetUrlForDataMember(const TString &scopeName, const TString &dataMemberName, TDa
// We create a TString with the name of the scope and the enumeration from which the enumerator is.
TString scopeEnumeration = dataMember->GetTrueTypeName();
TString md5EnumClass;
if (scopeEnumeration.Contains("(anonymous)")) {
if (scopeEnumeration.Contains("(unnamed)")) {
// FIXME: need to investigate the numbering scheme.
md5EnumClass.Append(scopeName);
md5EnumClass.Append("::@1@1");
Expand Down
18 changes: 18 additions & 0 deletions core/clingutils/res/TClingUtils.h
Expand Up @@ -569,6 +569,24 @@ std::string GetModuleFileName(const char* moduleName);
// that can be used in C++ as a variable name.
void GetCppName(std::string &output, const char *input);

//______________________________________________________________________________
// Demangle the input symbol name for dlsym.
static inline std::string DemangleNameForDlsym(const std::string& name)
{
std::string nameForDlsym = name;

#ifdef R__MACOSX
// The JIT gives us a mangled name which has an additional leading underscore
// macOS, for instance __ZN8TRandom34RndmEv. However, dlsym requires us to
// remove it.
// FIXME: get this information from the DataLayout via getGlobalPrefix()!
if (nameForDlsym[0] == '_')
nameForDlsym.erase(0, 1);
#endif //R__MACOSX

return nameForDlsym;
}

//______________________________________________________________________________
// Return the type with all parts fully qualified (most typedefs),
// including template arguments, appended to name.
Expand Down
32 changes: 16 additions & 16 deletions core/clingutils/src/TClingUtils.cxx
Expand Up @@ -1380,7 +1380,7 @@ void ROOT::TMetaUtils::GetQualifiedName(std::string &qual_name, const clang::Nam
cl.getNameForDiagnostic(stream,policy,true);
stream.flush(); // flush to string.

if ( qual_name == "(anonymous " ) {
if ( qual_name == "(anonymous " || qual_name == "(unnamed" ) {
size_t pos = qual_name.find(':');
qual_name.erase(0,pos+2);
}
Expand Down Expand Up @@ -1622,7 +1622,7 @@ int ROOT::TMetaUtils::extractAttrString(clang::Attr* attribute, std::string& att
//TMetaUtils::Error(0,"Could not cast Attribute to AnnotatedAttribute\n");
return 1;
}
attrString = annAttr->getAnnotation();
attrString = annAttr->getAnnotation().str();
return 0;
}

Expand Down Expand Up @@ -1669,7 +1669,7 @@ bool ROOT::TMetaUtils::ExtractAttrPropertyFromName(const clang::Decl& decl,
std::pair<llvm::StringRef,llvm::StringRef> split = attribute.split(propNames::separator.c_str());
if (split.first != propName.c_str()) continue;
else {
propValue = split.second;
propValue = split.second.str();
return true;
}
}
Expand Down Expand Up @@ -2590,14 +2590,12 @@ ROOT::TMetaUtils::GetTrivialIntegralReturnValue(const clang::FunctionDecl *funcC
// ClassDef argument. It's usually just be an integer literal but it could
// also be an enum or a variable template for all we know.
// Go through ICE to be more general.
llvm::APSInt RetRes;
if (!RetExpr->isIntegerConstantExpr(RetRes, funcCV->getASTContext()))
return res_t{false, -1};
if (RetRes.isSigned()) {
return res_t{true, (Version_t)RetRes.getSExtValue()};
if (auto RetRes = RetExpr->getIntegerConstantExpr(funcCV->getASTContext())) {
if (RetRes->isSigned())
return res_t{true, (Version_t)RetRes->getSExtValue()};
return res_t{true, (Version_t)RetRes->getZExtValue()};
}
// else
return res_t{true, (Version_t)RetRes.getZExtValue()};
return res_t{false, -1};
}

////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -3347,7 +3345,7 @@ std::string ROOT::TMetaUtils::GetFileName(const clang::Decl& decl,
// use HeaderSearch on the basename, to make sure it takes a header from
// the include path (e.g. not from /usr/include/bits/)
assert(headerFE && "Couldn't find FileEntry from FID!");
const FileEntry *FEhdr
auto FEhdr
= HdrSearch.LookupFile(llvm::sys::path::filename(headerFE->getName()),
SourceLocation(),
true /*isAngled*/, 0/*FromDir*/, foundDir,
Expand Down Expand Up @@ -3392,7 +3390,7 @@ std::string ROOT::TMetaUtils::GetFileName(const clang::Decl& decl,
// points to the same file as the long version. If such a short version
// exists it will be returned. If it doesn't the long version is returned.
bool isAbsolute = llvm::sys::path::is_absolute(headerFileName);
const FileEntry* FELong = 0;
llvm::Optional<clang::FileEntryRef> FELong;
// Find the longest available match.
for (llvm::sys::path::const_iterator
IDir = llvm::sys::path::begin(headerFileName),
Expand Down Expand Up @@ -3441,7 +3439,7 @@ std::string ROOT::TMetaUtils::GetFileName(const clang::Decl& decl,
0/*Searchpath*/, 0/*RelPath*/,
0/*SuggestedModule*/, 0/*RequestingModule*/,
0/*IsMapped*/, nullptr /*IsFrameworkFound*/) == FELong) {
return trailingPart;
return trailingPart.str();
}
}

Expand Down Expand Up @@ -3675,7 +3673,8 @@ static bool areEqualValues(const clang::TemplateArgument& tArg,
llvm::APSInt defaultValueAPSInt(64, false);
if (Expr* defArgExpr = nttpd.getDefaultArgument()) {
const ASTContext& astCtxt = nttpdPtr->getASTContext();
defArgExpr->isIntegerConstantExpr(defaultValueAPSInt, astCtxt);
if (auto Value = defArgExpr->getIntegerConstantExpr(astCtxt))
defaultValueAPSInt = *Value;
}

const int value = tArg.getAsIntegral().getLimitedValue();
Expand Down Expand Up @@ -4609,8 +4608,9 @@ clang::QualType ROOT::TMetaUtils::ReSubstTemplateArg(clang::QualType input, cons
QualType newQT= ReSubstTemplateArg(arr->getElementType(),instance);

if (newQT == arr->getElementType()) return QT;
QT = Ctxt.getConstantArrayType (newQT,
QT = Ctxt.getConstantArrayType(newQT,
arr->getSize(),
arr->getSizeExpr(),
arr->getSizeModifier(),
arr->getIndexTypeCVRQualifiers());

Expand Down Expand Up @@ -4723,7 +4723,7 @@ clang::QualType ROOT::TMetaUtils::ReSubstTemplateArg(clang::QualType input, cons
} else {
std::string astDump;
llvm::raw_string_ostream ostream(astDump);
instance->dump(ostream);
instance->dump(ostream, Ctxt);
ostream.flush();
ROOT::TMetaUtils::Warning("ReSubstTemplateArg","Unexpected type of declaration context for template parameter: %s.\n\tThe responsible class is:\n\t%s\n",
replacedDeclCtxt->getDeclKindName(), astDump.c_str());
Expand Down
6 changes: 6 additions & 0 deletions core/dictgen/CMakeLists.txt
Expand Up @@ -29,6 +29,12 @@ ROOT_OBJECT_LIBRARY(Dictgen

add_dependencies(Dictgen CLING)

if(NOT builtin_cling)
# FIXME: Resolve this once the ClangTargets.cmake allows us to specify the
# targets we need.
add_dependencies(Dictgen clang-tablegen-targets)
endif()

target_include_directories(Dictgen PRIVATE
${CMAKE_SOURCE_DIR}/core/dictgen/src
${CMAKE_SOURCE_DIR}/core/dictgen/res
Expand Down
3 changes: 1 addition & 2 deletions core/dictgen/src/DictSelectionReader.cxx
Expand Up @@ -359,7 +359,6 @@ bool DictSelectionReader::SecondPass(const clang::RecordDecl &recordDecl)
// Now we take care of the transient and unsplittable members
if (tInfo.fTransientMembers.empty() && tInfo.fUnsplittableMembers.empty()) continue;
clang::ASTContext &C = recordDecl.getASTContext();
clang::SourceRange commentRange; // Empty: this is a fake comment
std::string userDefinedProperty;
userDefinedProperty.reserve(100);
for (auto fieldPtr : recordDecl.fields()) {
Expand All @@ -370,7 +369,7 @@ bool DictSelectionReader::SecondPass(const clang::RecordDecl &recordDecl)
userDefinedProperty = propNames::comment + propNames::separator + "||";
}
if (!userDefinedProperty.empty()) {
fieldPtr->addAttr(new(C) clang::AnnotateAttr(commentRange, C, userDefinedProperty, 0));
fieldPtr->addAttr(clang::AnnotateAttr::CreateImplicit(C, userDefinedProperty));
userDefinedProperty = "";
}
}
Expand Down
6 changes: 3 additions & 3 deletions core/dictgen/src/LinkdefReader.cxx
Expand Up @@ -768,7 +768,7 @@ class PragmaExtraInclude : public LinkdefReaderPragmaHandler {
} else {
llvm::StringRef include(start, fSourceManager.getCharacterData(end.getLocation()) - start + end.getLength());

if (!fOwner.AddInclude(include)) {
if (!fOwner.AddInclude(include.str())) {
Error("", tok);
}
}
Expand Down Expand Up @@ -926,7 +926,7 @@ class PragmaLinkCollector : public LinkdefReaderPragmaHandler {
} else {
llvm::StringRef identifier(start, fSourceManager.getCharacterData(end.getLocation()) - start + end.getLength());

if (!fOwner.AddRule(type, identifier, linkOn, false, options.get())) {
if (!fOwner.AddRule(type.str(), identifier.str(), linkOn, false, options.get())) {
Error(type.data(), tok, false);
}
}
Expand Down Expand Up @@ -985,7 +985,7 @@ class PragmaCreateCollector : public LinkdefReaderPragmaHandler {

llvm::StringRef identifier(start, fSourceManager.getCharacterData(end.getLocation()) - start + end.getLength());

if (!fOwner.AddRule("class", identifier, true, true)) {
if (!fOwner.AddRule("class", identifier.str(), true, true)) {
Error("", tok);
}

Expand Down
4 changes: 2 additions & 2 deletions core/dictgen/src/Scanner.cxx
Expand Up @@ -152,7 +152,7 @@ inline long APIntToLong(const llvm::APInt& num)

inline std::string APIntToStr(const llvm::APInt& num)
{
return num.toString(10, true);
return llvm::toString(num, /*radix*/10, /*signed*/true);
}

////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -742,7 +742,7 @@ bool RScanner::TreatRecordDeclOrTypedefNameDecl(clang::TypeDecl* typeDecl)
auto previouslyMatchingRule = (const ClassSelectionRule*)declSelRuleMapIt->second;
int previouslineno = previouslyMatchingRule->GetLineNumber();

std::string cleanFileName = llvm::sys::path::filename(selected->GetSelFileName());
std::string cleanFileName = llvm::sys::path::filename(selected->GetSelFileName()).str();
auto lineno = selected->GetLineNumber();
auto rulesAreCompatible = SelectionRulesUtils::areEqual<ClassSelectionRule>(selected, previouslyMatchingRule, true /*moduloNameOrPattern*/);
if (!rulesAreCompatible){
Expand Down
6 changes: 3 additions & 3 deletions core/dictgen/src/TModuleGenerator.cxx
Expand Up @@ -116,7 +116,7 @@ TModuleGenerator::GetSourceFileKind(const char *filename) const
clang::Preprocessor &PP = fCI->getPreprocessor();
clang::HeaderSearch &HdrSearch = PP.getHeaderSearchInfo();
const clang::DirectoryLookup *CurDir = nullptr;
const clang::FileEntry *hdrFileEntry
auto hdrFileEntry
= HdrSearch.LookupFile(filename, clang::SourceLocation(),
true /*isAngled*/, nullptr /*FromDir*/, CurDir,
clang::ArrayRef<std::pair<const clang::FileEntry*,
Expand Down Expand Up @@ -578,15 +578,15 @@ bool TModuleGenerator::FindHeader(const std::string &hdrName, std::string &hdrFu
clang::Preprocessor &PP = fCI->getPreprocessor();
clang::HeaderSearch &HdrSearch = PP.getHeaderSearchInfo();
const clang::DirectoryLookup *CurDir = nullptr;
if (const clang::FileEntry *hdrFileEntry
if (auto hdrFileEntry
= HdrSearch.LookupFile(hdrName, clang::SourceLocation(),
true /*isAngled*/, nullptr /*FromDir*/, CurDir,
clang::ArrayRef<std::pair<const clang::FileEntry*,
const clang::DirectoryEntry*>>(),
nullptr /*SearchPath*/, nullptr /*RelativePath*/,
nullptr /*RequestingModule*/, nullptr/*SuggestedModule*/,
nullptr /*IsMapped*/, nullptr /*IsFrameworkFound*/)) {
hdrFullPath = hdrFileEntry->getName();
hdrFullPath = hdrFileEntry->getName().str();
return true;
}

Expand Down