3184 Commits

Author SHA1 Message Date
Vassil Vassilev
99a5da9134 Fix weird whitespace. 2021-02-25 20:44:16 +01:00
Vassil Vassilev
172fcc4c42 The member was hidden in favor of an accessor.
See llvm-mirror/clang@672ad52
2021-02-25 20:44:16 +01:00
Vassil Vassilev
355e9bcfe5 PragmaIntroducerKind was renamed to PragmaIntroducer.
See llvm-mirror/clang@6333880.
2021-02-25 20:44:16 +01:00
Vassil Vassilev
adb3a16dff The PCHGenerator was enhanced to protect against build races.
See llvm-mirror/clang@d28cf14 and llvm-mirror/clang@2d59837.
2021-02-25 20:44:16 +01:00
Vassil Vassilev
0e04207ce2 setBuffer was renamed to replaceBuffer.
See llvm-mirror/clang@5fa94c9
2021-02-25 20:44:16 +01:00
Vassil Vassilev
e1368fcfbc getLocStart was renamed to getBeginLoc and getLocEnd to getEndLoc. 2021-02-25 20:44:16 +01:00
Vassil Vassilev
a498073ef8 Replace the statements only if they differ. 2021-02-25 20:44:16 +01:00
Vassil Vassilev
60bed9429d CompoundStmt::setStmts was reimplemented to save a pointer.
Unfortunately this break external tools such as cling which alters CompoundStmts
to implement its interactive extensions.

We have implemented a patch in clang which brings the old facilities only when
the new interface CompoundStmt::replaceStmts is called.

See llvm-mirror/clang@d0ee47a
2021-02-25 20:44:16 +01:00
Vassil Vassilev
ab1ea2bb02 driver::ArgStringList moved to llvm::opt. 2021-02-25 20:44:16 +01:00
Vassil Vassilev
62891a2537 clang::vfs::getVFSFromYAML moved to llvm. 2021-02-25 20:44:15 +01:00
Vassil Vassilev
14c4b6c575 Add support for c++2a. 2021-02-25 20:44:15 +01:00
Vassil Vassilev
b3238e5f1c LookupFile takes an extra optional argument. 2021-02-25 20:44:15 +01:00
Vassil Vassilev
f960a3520d Various ASTImporter import interfaces return llvm::Expected. 2021-02-25 20:44:15 +01:00
Vassil Vassilev
8d3b178cca Import does not have a return result anymore.
See llvm-mirror/clang@1e1ffe5
2021-02-25 20:44:15 +01:00
Vassil Vassilev
1a5b0a95f3 ForRedeclaration is split in two: {ForVisible,ForExternal}Redeclaration.
ForVisibleRedeclaration does not try to deserialize content from module files.
It should be used for efficiency and when we are sure that what we look up is
in the present TU and it does not make sense to ask the module files.

See llvm-mirror/clang@6bbe311
2021-02-25 20:44:15 +01:00
Vassil Vassilev
71218c74c1 CudaGpuBinaryFileNames was renamed to CudaGpuBinaryFileName.
llvm-mirror/clang@f828172bcf tells it is a NFC.
2021-02-25 20:44:15 +01:00
Vassil Vassilev
419d51346c EmitSummaryIndex was renamed to PrepareForThinLTO 2021-02-25 20:44:15 +01:00
Vassil Vassilev
7f30da6043 createAddDiscriminatorsPass went into llvm/Transforms/Utils.h 2021-02-25 20:44:15 +01:00
Vassil Vassilev
a16da5735b BuildDeclRefExpr returns a DeclRefExpr instead of StmtResult. 2021-02-25 20:44:15 +01:00
Vassil Vassilev
f6e74124ea CodeGenOptions.h moved from Frontend to Basic. 2021-02-25 20:44:15 +01:00
Simeon Ehrig
da1bb78f3d Apply Axel's suggestion for PR "Fixed cling argumenent --cuda-path"
- see: https://github.com/root-project/root/pull/6707
2021-02-10 15:18:14 +01:00
Simeon Ehrig
d00b927467 cling interpreter: add prefix to error messages, only in CUDA mode 2021-02-10 15:18:14 +01:00
Simeon Ehrig
fde7a55926 Bugfix for argument --cuda-path in ptx compiler
- now the custom path of `--cuda-path` is correctly set in the ptx
compiler, allowing the use of CUDA SDK's which are not installed on
in the default location
2021-02-10 15:18:14 +01:00
Simeon Ehrig
d08ecbd65b Make Incremental CUDA Device Compiler Interface public
- make public that it is accessible via gCling object during the Cling
runtime.
2021-02-10 15:18:14 +01:00
Simeon Ehrig
b8e245ac4f Add prefix to the diagnostic engine
- add the prefix "cling" (normal interpreter error) or
"cling-ptx" (ptx interpreter -> just in CUDA mode) to every
interpreter error message

- example before:
error: cannot find CUDA installation.  Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes.
error: cannot find libdevice for sm_20. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.
error: cannot find CUDA installation.  Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes.

- example after:
cling: error: cannot find CUDA installation.  Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes.
cling-ptx: error: cannot find libdevice for sm_20. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.
cling-ptx: error: cannot find CUDA installation.  Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes.
2021-02-10 15:18:14 +01:00
Jonas Hahnfeld
c7558a2c0d Reset function sections before JITting
This makes all functions end up in the same text section, which is
important for TCling on macOS to catch exceptions from constructors:
Stack unwinding requires information about program addresses to find
out which objects to destroy and what code should be called to handle
the exception. These addresses are relocated against a single __text
section when loading the produced MachO binary, which breaks if the
call sites of global constructors end up in a separate init section.

Fixes ROOT-10703 and ROOT-10962
2021-02-10 15:18:14 +01:00
Vassil Vassilev
ad5bcb1ce5 Fix memory leaks when resolving symbols.
This was seen in an experimental branch of cmssw.
2020-12-15 16:59:06 +01:00
Javier Lopez-Gomez
904796d2bb New interface to export Cling run-time configuration bits.
This commit allows the user to enable/disable specific interpreter capabilities
without requiring to `#include` the heavier weight `Interpreter.h` (that also
has dependencies on llvm).

The only feature covered at the moment is definition shadowing.

Closes cling issue #360.
2020-12-14 10:29:04 +01:00
Javier Lopez-Gomez
0bc89e8172 DynamicLookup: avoid printing internal expression representation for non-debug builds
As discussed in the associated JIRA ticket, this information is of no utility for the end user and will only be included in Debug builds.

Fixes ROOT-7199.
2020-12-14 09:14:07 +01:00
Javier Lopez-Gomez
e84dc544fc DefinitionShadower: allow shadowing of non-user-defined declarations (#6571)
* [cling] DefinitionShadower: allow shadowing of non-user-defined declarations

These changes allow the DefinitionShadower to shadow declarations
whose first definition was possibly in a system header.
This solves the problem of declaring a variable 'data' that might conflict
with 'std::data' (by allowing std::data to be shadowed).

* [cling] DefinitionShadower: fix handling of variable templates
2020-11-10 12:29:06 +01:00
Axel Naumann
e0ec1c7f85 Force char-signedness of host. Fixes #6465. 2020-10-22 21:14:08 +02:00
Axel Naumann
856f8e92f8 Survive NNS not being a namespace. 2020-10-07 17:44:10 +02:00
Sylvain Corlay
dcc486834b Add missing windows-include.
Fixes https://github.com/root-project/cling/issues/352
2020-09-09 09:59:06 +02:00
Axel Naumann
4203690c46 Adjust to changed clang::ExceptionSpecificationType. 2020-09-08 17:44:06 +02:00
Bertrand Bellenot
d01c183b0f Move the workaround for latest VS2019 from rootcling_impl.cxx to CIFactory.cpp
Following the discussion [on GitHub](df0e84968a#), move back the workaround for Visual Studio 2019 v16.7.0 from `rootcling_impl.cxx` to `CIFactory.cpp`
2020-08-21 09:59:06 +02:00
Frederich Munch
06afb308e4 Report ValueExtractionSynthesizer errors with DiagnosticsEngine. 2020-08-20 09:44:06 +02:00
Frederich Munch
89fb4566ab Fix crash in ValueExtractionSynthesizer::FindAndCacheRuntimeDecls() and report errors. 2020-08-20 09:44:05 +02:00
Frederich Munch
1d20335456 Propagate errors and report them a bit better in ValueExtractionSynthesizer::Transform. 2020-08-20 09:44:05 +02:00
Axel Naumann
a28b92c121 clingInterpreter needs -ldl for DynamicLibraryManagerSymbol. 2020-08-19 18:44:09 +02:00
Axel Naumann
266fcb7b42 Fix warnings:
- default argument specified for lambda parameter [-Wpedantic];
- will be initialized after [-Wreorder]
2020-08-19 18:44:09 +02:00
Enrico Guiraud
9969d52ace Do not segfault when root_hist has zero lines
Pressing ctrl-r when no ~/.root_hist file is present or possibly
when it contains 0 lines used to cause a segfault. The culprit
if an out-of-bound access in History::GetLine, as the case in which
the history has zero entries was not taken into account.

With this patch, Histoy::GetLine returns an empty string instead.
This fixes ROOT-10917.

Co-authored-by: Axel Naumann <Axel.Naumann@cern.ch>
2020-08-18 16:09:42 +02:00
Bertrand Bellenot
d0e77739a7 Fix redirection (.> blah.txt) on Windows
Fix output redirection (`.> blah.txt`) which is curently freezing the console input on Windows
When a file (or console) has been created without the `FILE_SHARE_READ | FILE_SHARE_WRITE` flags, there is no way to change this, but by closing it and re-opening it (or a new one) . And I suspect that a standard console doesn't have those flags, so when redirecting the output to a file with `.> blah.txt`, all the output is going to the file, without any echo on the console, and when typing `.>` to suppress the redirection, the file contains this kind of errors:
```
Error 6 in textinput::TerminalDisplayWin attaching to console output: The handle is invalid.

Error 6 in textinput::TerminalDisplayWin attaching / getting console info: The handle is invalid.

Error 6 in textinput::TerminalDisplayWin writing to output: The handle is invalid.
```
This patch solves those issues, even if I'm not sure if it is the root of the problem (it might be something else deep in the `MetaSema::actOnRedirectCommand` function).
NB I don't know if this can have any side effect, but I didn't see any so far...

And for info, one could Enable Console Virtual Terminal Sequences (ANSI escape code) that can control cursor movement, color/font mode, and other operations when written to the output stream by adding the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag, but then it breaks the WRAP_AT_EOL_OUTPUT. With this feature, the escape sequences like `\033[39m` would work in the Windows 10 command prompt as well.
This is a known issue, see https://github.com/microsoft/terminal/issues/349
2020-08-18 16:09:42 +02:00
Philippe Canal
6c1d592420 Fix array index in assignment.
V519 The 'Line[Cursor]' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 352, 353. Editor.cpp 353
2020-08-18 16:09:42 +02:00
Vassil Vassilev
0ce064ae6f Enable the semantic global module index to boost performance.
The global module index (GMI) is an optimization which hides the introduced by
clang overhead when pre-loading the C++ modules at startup.

The GMI represents a mapping between an identifier and a set of modules which
contain this indentifier. This mean that if we TH1 is undeclared the GMI will
load all modules which contain this identifier which is usually suboptimal, too.

The semantic GMI maps identifiers only to modules which contain a definition of
the entity behind the identifier. For cases such as typedefs where the entity
introduces a synonym (rather than declaration) we map the first module we
encounter. For namespaces we add all modules which has a namespace partition.
The namespace case is still suboptimal and further improved by inspecting
what exactly is being looked up in the namespace by the qualified lookup facilities.
2020-08-13 19:44:06 +02:00
Vaibhav Garg
e4e18fb9b4 Teach DLM to recognise symbols in COFF Object Files.
On Windows, the .dll files contain symbol information in COFF Format
which DLM currently fails to understand properly. This leads to
unrecognized symbol errors while starting ROOT with modules.

This commit teaches DLM to correctly read symbols when the Object File
is in COFF executable format.
2020-08-13 16:59:06 +02:00
Bertrand Bellenot
cf7aa69c52 Move the workaround from CIFactory.cpp to rootcling_impl.cxx 2020-08-11 12:14:07 +02:00
Bertrand Bellenot
df0e84968a Fix for Visual Studio 2019 v16.7.0
Silly workaround for rootcling not being able to parse the STL headers anymore after the update of Visual Studio to the version 16.7.0:
```
  Generating G__Core.cxx, ../bin/libCore.rootmap
  In file included from input_line_5:1:
  In file included from C:/Users/sftnight/build/release/include\Rtypes.h:191:
  In file included from C:/Users/sftnight/build/release/include/TGenericClassInfo.h:21:
  In file included from C:/Users/sftnight/build/release/include/TSchemaHelper.h:17:
  In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.291  10\\include\string:11:
  In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.291  10\\include\xstring:14:
  In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.291  10\\include\xmemory:16:
  In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.291  10\\include\xutility:15:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\utility(137,9): error G08EB1F86: expected member name or ';' after declaration specifiers [C:\Users\sftnight\build\release\core\G__Core.vcxproj]
          !_Is_implicitly_default_constructible<_Uty1>::value || !_Is_implicitly_default_constructible<_Uty2>::value)
          ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\utility(137,9): error GC66A3811: expected ')' [C:\Users\sftnight\build\release\core\G__Core.vcxproj]
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\utility:136:23: note: to match this '('
      constexpr explicit(
                        ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\utility(218,24): error G08EB1F86: expected member name or ';' after declaration specifiers [C:\Users\sftnight\build\release\core\G__Core.vcxproj]
      constexpr explicit(!is_convertible_v<const _Other1&, _Ty1> || !is_convertible_v<const _Other2&, _Ty2>)
      ~~~~~~~~~~~~~~~~~~ ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\utility(218,24): error GC66A3811: expected ')' [C:\Users\sftnight\build\release\core\G__Core.vcxproj]
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\utility:218:23: note: to match this '('
      constexpr explicit(!is_convertible_v<const _Other1&, _Ty1> || !is_convertible_v<const _Other2&, _Ty2>)
                        ^
  In file included from input_line_5:1:
  In file included from C:/Users/sftnight/build/release/include\Rtypes.h:191:
  In file included from C:/Users/sftnight/build/release/include/TGenericClassInfo.h:21:
  In file included from C:/Users/sftnight/build/release/include/TSchemaHelper.h:17:
  In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\string:11:
  In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\xstring:14:
  In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\xmemory:16:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\xutility(63,31): error G959205E0: '_To' does not refer to a value [C:\Users\sftnight\build\release\core\G__Core.vcxproj]
      return __builtin_bit_cast(_To, _Val);
                                ^
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\xutility:51:17: note: declared here
  template <class _To, class _From,
                  ^
CUSTOMBUILD : error : Error loading the default header files. [C:\Users\sftnight\build\release\core\G__Core.vcxproj]
```
To be checked/removed after the upgrade of LLVM & Clang
2020-08-11 12:14:07 +02:00
Axel Naumann
33be2c79c0 Help llvm5 find ARM Mac triple. 2020-08-05 14:44:07 +02:00
Axel Naumann
722a6f6b97 Explicitly resolve symbols also from injected libs:
Some platforms respect RTLD_LOCAL: symbols from libraries loaded with
this flag cannot be resolved by dlsym through the process. They should
instead be exposed to the JIT by calling ExposeHiddenSharedLibrarySymbols().
But then the JIT needs to actually make use of these libraries from
symbol resolution. That is done by setting SearchOrder to SO_LoadedLast, as
nicely documented in that flag.

Fixes ROOT not finding libCling symbols on some platforms, e.g. CentOS7,
Ubuntu 16 and 18.
2020-08-05 14:44:07 +02:00
Vassil Vassilev
964ad807c5 Allow only the system modulemaps to be overriden by already present ones.
This patch is a workaround once again for the poor LCG design where we have
all header files (and modulemaps) installed in the same folder.
2020-08-05 11:14:09 +02:00