309 Commits

Author SHA1 Message Date
Vassil Vassilev
6c74a386ba Enable ROOT to be built with prebuilt clang and llvm.
To do so one needs to pass -Dbuiltin_llvm=Off -Dbuiltin_clang=Off and the
PATH should contain the path to llvm-config.

Note this is not enabling ROOT to work with vanilla clang!

This patch allows ROOT to be built against a prebuilt clang and llvm from
https://root.cern.ch/git/{llvm.git,clang.git}. It allows to reduce ROOT's
build times (in cases when cmake decides to rebuild the in-tree llvm for
no good reason). It moves the common denominator of different ROOT builds
in one place to save space. It also allows easy switch between LLVM in
debug and release mode.

To build the external clang and llvm exactly in the same way as the
in-tree builds use:

CMAKE_FLAGS="\
            -DLLVM_ENABLE_WARNINGS=OFF                   \
            -DLLVM_INCLUDE_TESTS=OFF                     \
            -DCLANG_INCLUDE_TESTS=OFF                    \
            -DLLVM_INCLUDE_EXAMPLES=OFF                  \
            -DCLANG_BUILD_TOOLS=OFF                      \
            -DCLANG_TOOL_ARCMT_TEST_BUILD=OFF            \
            -DCLANG_TOOL_CLANG_CHECK_BUILD=OFF           \
            -DCLANG_TOOL_CLANG_FORMAT_BUILD=OFF          \
            -DCLANG_TOOL_CLANG_FORMAT_VS_BUILD=OFF       \
            -DCLANG_TOOL_CLANG_FUZZER_BUILD=OFF          \
            -DCLANG_TOOL_CLANG_IMPORT_TEST_BUILD=OFF     \
            -DCLANG_TOOL_CLANG_OFFLOAD_BUNDLER_BUILD=OFF \
            -DCLANG_TOOL_CLANG_RENAME_BUILD=OFF          \
            -DCLANG_TOOL_C_ARCMT_TEST_BUILD=OFF          \
            -DCLANG_TOOL_C_INDEX_TEST_BUILD=OFF          \
            -DCLANG_TOOL_DIAGTOOL_BUILD=OFF              \
            -DCLANG_TOOL_LIBCLANG_BUILD=OFF              \
            -DCLANG_TOOL_SCAN_BUILD_BUILD=OFF            \
            -DCLANG_TOOL_SCAN_VIEW_BUILD=OFF             \
            -DLLVM_BUILD_TOOLS=OFF                       \
            -DLLVM_TOOL_LLVM_AR_BUILD=OFF                \
            -DCLANG_TOOL_CLANG_OFFLOAD_BUNDLER_BUILD=OFF \
            -DLLVM_FORCE_USE_OLD_TOOLCHAIN=ON            \
            -DCLANG_ENABLE_STATIC_ANALYZER=OFF           \
            -DCLANG_ENABLE_ARCMT=OFF                     \
            -DCLANG_ENABLE_FORMAT=OFF                    \
            -DLLVM_TARGETS_TO_BUILD=host                 \
            -DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF         \
            -DLLVM_ENABLE_ABI_BREAKING_CHECKS=OFF        \
            -DCMAKE_INSTALL_PREFIX=..                    \
            -DCMAKE_BUILD_TYPE=Debug"

cmake "$CMAKE_FLAGS"   ../../../sources/root-llvm/
2018-03-28 19:29:10 +02:00
Simeon Ehrig
83e3eafc44 fix CMakeFiles to allow cling build with shared libraries 2018-03-22 15:59:06 +01:00
Bertrand Bellenot
619d59ca32 Add comment
Windows requires std::ifstream::binary to properly handle
 CRLF and LF line endings
2018-02-20 13:29:03 +01:00
Bertrand Bellenot
67fc6cba13 inconditionally provide the std::ifstream::binary flag 2018-02-20 13:29:03 +01:00
Bertrand Bellenot
7c3649035f Several fixes for Windows
in CIFactory:
- Add -fno-threadsafe-statics flag (for Windows only), to prevent potential unresolved symbols at run-time

in MetaProcessor::readInputFromFile:
- add required std::ifstream::binary flag when opening the std::ifstream
- add missing backslashes

in PlatformWin:
- properly format error messages
- in IsDLL(): check and return false if the file size is 0
- fix _CxxThrowException symbol name (not fully understood - to be reviewed)
- filter out a couple of system dlls when looking for symbols
2018-02-20 13:29:03 +01:00
Vassil Vassilev
1a35776759 file_magic went into its own header file. 2017-11-02 17:59:24 +01:00
Axel Naumann
58614e53fd Coverity: add comment that fall-through is intentional. 2017-08-23 00:27:18 +02:00
Roman Zulak
4a8d300bb1 When looking for the end of a block comment, really don’t bother with nesting. Finding the first end is good enough, the real parser can warn about any balancing issues. 2017-07-13 10:21:58 +02:00
Roman Zulak
6f5594ab4d Fix block comments greedily looking for the next asterisk. 2017-07-13 10:21:58 +02:00
Axel Naumann
b675d42b6f Support shebang even outside cling driver, e.g. #!/usr/bin/env root -l -b. 2017-07-04 13:44:22 +02:00
Frederich Munch
df4aea2fb0 Add continuation support for comma and backslash characters. 2017-06-23 15:14:10 +02:00
Frederich Munch
499b522de5 Initialize Token fields on construction. 2017-06-23 15:14:10 +02:00
Frederich Munch
38c757e36d Have MetaProcessor::process take an llvm::StringRef. Remove unnecessary std::string -> const char* -> std::string conversions. 2017-06-21 11:29:07 +02:00
Axel Naumann
a3b7f8b2b5 Fix C comments with slash. By Roman Zulak! 2017-05-11 09:00:00 +02:00
Axel Naumann
675a67e57f Offer non-echoing process(). 2017-05-02 11:59:10 +02:00
Axel Naumann
909ce12929 Revert "Remove unused members of MetaProcessor in Release."
This reverts commit e7833174c491bb49a76739306f9f5108357ac149.
It causes problems if library clients have incompatible NDEBUG settings.
2017-04-27 08:14:47 +02:00
Axel Naumann
c30a28221c Implement .O and .O <N> to set the opt level. 2017-04-12 15:44:35 +02:00
Axel Naumann
fcfb52913c Whitespace. 2017-04-04 15:14:06 +02:00
Axel Naumann
b266e2e5fc Implement first ".trace" command. From Viktor Khristenko! 2017-04-04 15:14:05 +02:00
Frederich Munch
ae9b72cbb1 Remove useless assignment. 2017-03-24 13:44:12 +01:00
Axel Naumann
7c1fbfcf9f Require ">" after ".5" to accept it as redirection (ROOT-8696). 2017-03-22 21:14:29 +01:00
Frederich Munch
b3834b1dcf Add Interpreter::getDiagnostics method. 2017-02-09 16:59:38 +01:00
Frederich Munch
6054022ca3 Fix stdout being reopened without line buffering if redirection occurs before output has been written. 2017-02-08 15:29:11 +01:00
Frederich Munch
625ed58bba Add ‘asttree’ predicate to stats command, courtesy of vkhristenko. 2017-02-01 15:59:07 +01:00
Frederich Munch
e709fd898b Add 'decl’ and ‘undo’ as predicates to .stats command. Add Interpreter::dump method. 2017-02-01 15:59:07 +01:00
Axel Naumann
63482c499d Do not wait for a "*" if there is any other token after the "/" (ROOT-8529). 2017-01-13 11:59:10 +01:00
Axel Naumann
cfbf9ee8c8 Return whether there was a (non-punct) token between now and next (ROOT-8529). 2017-01-13 11:59:10 +01:00
Frederich Munch
f846990f8d Windows: Fix InterpreterException not being caught and terminating. 2016-12-20 12:59:08 +01:00
Axel Naumann
43fe0be0a0 From Roman Zulak: Flush stdout less (cling). 2016-12-19 13:59:11 +01:00
Frederich Munch
075f4ffa83 Add cling output streams to cling/Utils/Output.h 2016-12-19 13:59:11 +01:00
Axel Naumann
b6114f10e1 Fix logic precedence, as in sort of: if not assert-test then message. 2016-12-14 18:29:07 +01:00
Danilo Piparo
7d9d012893 Remove warning 2016-12-14 17:14:21 +01:00
Frederich Munch
4427d1a5c2 Have .> cmd expand env-vars. Fixes OutputRedirect test on Windows. 2016-12-14 09:29:10 +01:00
Frederich Munch
1bf0e16d7f Redirect to file properly when no space between > and filename. 2016-12-14 09:29:10 +01:00
Frederich Munch
e0ddb56b20 Fixes for output redirection.
Decouple redirection state from MetaProcessor and MaybeRedirectOutputRAII.
Only suspend redirection when writing to the prompt.
Allow user to redirect to files named 1, 2, &1, &2.
Allow stderr and stdout to be redirected to one another.
Don't create _IO_2_1_stdout_ file.
2016-12-14 09:29:10 +01:00
Frederich Munch
0fce2df9ed Only initialize redirection state if used. 2016-12-14 09:29:10 +01:00
Frederich Munch
73b7f6d911 MetaProcessor::process requires single line input. 2016-12-12 12:29:38 +01:00
Frederich Munch
9becb2a25c Remove unused members of MetaProcessor in Release. 2016-12-12 12:29:38 +01:00
Frederich Munch
b7bdd91739 Add error handling to MetaProcessor::readInputFromFile. 2016-12-12 12:29:38 +01:00
Frederich Munch
178c33e251 Optimize InputValidator to avoid unnecessary copy when retrieving the input directly before a reset, and to release memory when reset. 2016-12-12 12:29:38 +01:00
Frederich Munch
91c925632c Add template keyword support to InputValidator. 2016-12-12 12:29:38 +01:00
Frederich Munch
723bed09d5 Add preprocessor #if conditional support to InputValidator. 2016-12-12 12:29:38 +01:00
Frederich Munch
72c3eac1e1 Add block comment support to InputValidator. 2016-12-12 12:29:38 +01:00
Frederich Munch
a2fd30a8d5 Don't reallocate MetaLexer on the heap for every line. Its a waste of time for 24 bytes that will be needed for every line anyway. Remove bufferEnd field as it was entirely unused. 2016-12-12 12:29:38 +01:00
Axel Naumann
ef8d80dc57 Make .x file name mangling partial again; explain why. 2016-11-29 08:29:17 +01:00
Philippe Canal
7a682ff1d7 remove stray semi-colon 2016-11-28 17:59:50 +01:00
Philippe Canal
5fc745247f Reduce code duplication by using fall through 2016-11-28 17:44:16 +01:00
Philippe Canal
1d0c1e0156 Mangle all funny file names for .x function (ROOT-8467). 2016-11-28 17:44:15 +01:00
Axel Naumann
9be463964e Mangle funny file names for .x function (ROOT-8467). 2016-11-28 14:59:17 +01:00
Axel Naumann
781927af49 Spacing in error messages. 2016-10-17 12:13:14 +02:00