Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
36a7534
[TCling] Use string,vector instead of std.
Axel-Naumann Jul 22, 2022
9670fe8
[test] Remove legacy using namespace std/stdext.
Axel-Naumann May 9, 2023
38a0341
[proof] Remove unnecessary `using namespace std` in header.
Axel-Naumann May 9, 2023
1395866
[foundation] Add doc to some TClassEdit functions (NFC).
Axel-Naumann May 9, 2023
7c7a1d5
[dictgen] Make gOptNoGlobalUsingStd the default and only way.
Axel-Naumann May 9, 2023
6a2a6a7
[dictgen] Remove unused var; add using decls for std types.
Axel-Naumann May 10, 2023
d9edba9
[core] In generated dict code, always prefix std classes with "std":
Axel-Naumann May 10, 2023
859bfeb
[mathcore] Do not generate a dict for vector<double> iters:
Axel-Naumann May 10, 2023
f1065cb
[foundation] TClassEdit::InsertStd: add PRNG types to std type list.
Axel-Naumann May 11, 2023
c6ec900
Do not generate dicts for iterators:
Axel-Naumann May 11, 2023
542e382
[foundation] Fix spelling of std types; add missing ones, rm auto_ptr.
Axel-Naumann May 11, 2023
cdc2a31
[io] Diagnose missing stdlib I/O support:
Axel-Naumann May 15, 2023
4503bd0
[geo] Do not generate dictionaries for thread::id:
Axel-Naumann May 15, 2023
52e9f32
[fumili] no dict for TFumiliMinimizer: not persistent and not a TObje…
Axel-Naumann May 15, 2023
430660e
[clingutils] Fwd decls must use "std::" where needed:
Axel-Naumann May 15, 2023
a316141
[dictgen] Inject using decls for common stdlib names in ACLiC dicts:
Axel-Naumann May 16, 2023
32f08fa
[core] Do not InspectMembers() for stdlib types:
Axel-Naumann May 16, 2023
353faaa
[core] Centralize using decls injected into cling, add more.
Axel-Naumann May 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[core] Centralize using decls injected into cling, add more.
  • Loading branch information
Axel-Naumann committed May 17, 2023
commit 353faaa61a66e8141dce44aa47859e4796beb6ac
3 changes: 3 additions & 0 deletions core/clingutils/res/TClingUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,9 @@ void SetPathsForRelocatability(std::vector<std::string>& clingArgs);
//______________________________________________________________________________
void ReplaceAll(std::string& str, const std::string& from, const std::string& to, bool recurse=false);

//______________________________________________________________________________
std::string GetInjectedUsingDecls();

// Functions for the printouts -------------------------------------------------

//______________________________________________________________________________
Expand Down
43 changes: 43 additions & 0 deletions core/clingutils/src/TClingUtils.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -5098,6 +5098,49 @@ bool ROOT::TMetaUtils::IsHeaderName(const std::string &filename)
llvm::sys::path::extension(filename) == "HXX";
}

////////////////////////////////////////////////////////////////////////////////
/// Get the using decls (and corresponding `#includes`) injected into cling for
/// backward compatibility with the earlier `using namespace std`.
std::string ROOT::TMetaUtils::GetInjectedUsingDecls() {
return R"CODE(#include <array>
#include <bitset>
#include <cmath>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using std::abs;
using std::fabs;
using std::array;
using std::bitset;
using std::cerr;
using std::cos;
using std::cout;
using std::endl;
using std::list;
using std::map;
using std::multimap;
using std::multiset;
using std::pair;
using std::round;
using std::set;
using std::sin;
using std::shared_ptr;
using std::string;
using std::tan;
using std::unique_ptr;
using std::unordered_map;
using std::unordered_set;
using std::vector;
)CODE";
}

////////////////////////////////////////////////////////////////////////////////

const std::string ROOT::TMetaUtils::AST2SourceTools::Decls2FwdDecls(const std::vector<const clang::Decl *> &decls,
Expand Down
19 changes: 2 additions & 17 deletions core/dictgen/src/rootcling_impl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2841,27 +2841,12 @@ void CreateDictHeader(std::ostream &dictStream, const std::string &main_dictname
<< "#include \"TDataMember.h\"\n\n"; // To set their transiency

if (main_dictname.length() > 11 && main_dictname.substr(main_dictname.length() - 11) == "_ACLiC_dict")
dictStream << "#include <bitset>\n"
"#include <forward_list>\n"
"#include <list>\n"
"#include <map>\n"
"#include <memory>\n"
"#include <set>\n"
"#include <string>\n"
"#include <unordered_map>\n"
"#include <unordered_set>\n"
"#include <utility>\n"
"#include <vector>\n"
"using std::allocator; using std::bitset; using std::default_delete; using "
"std::forward_list; using std::list; using std::map; using std::multimap; using "
"std::multiset; using std::pair; using std::set; using std::shared_ptr; using std::string; "
"using std::unique_ptr; using std::unordered_multimap; using std::unordered_map; using "
"std::unordered_multiset; using std::unordered_set; using std::vector;\n";
dictStream << ROOT::TMetaUtils::GetInjectedUsingDecls();
}

////////////////////////////////////////////////////////////////////////////////

void AddNamespaceSTDdeclaration(std::ostream &dictStream)
void AddNamespaceSTDdeclaration(std::ostream & dictStream)
{
}

Expand Down
5 changes: 2 additions & 3 deletions core/metacling/src/TCling.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1330,9 +1330,8 @@ static void RegisterPreIncludedHeaders(cling::Interpreter &clingInterp)
#ifndef R__WIN32
PreIncludes += "#include <cassert>\n";
#endif
PreIncludes += "#include <string>\n"
"#include <vector>\n"
"using std::string; using std::vector;\n";
PreIncludes += ROOT::TMetaUtils::GetInjectedUsingDecls();

clingInterp.declare(PreIncludes);
}

Expand Down