173 Commits

Author SHA1 Message Date
Bertrand Bellenot
23d3c1669d Use simple LoadLibrary() function 2016-11-30 10:14:13 +01:00
Axel Naumann
c9ad1f4a41 Only skipToEOF if needed. 2016-11-10 18:14:07 +01:00
Axel Naumann
f5fe133410 Add clangParse needed by ParserStateRAII. 2016-11-08 08:44:16 +01:00
Axel Naumann
87585f78e0 Move -ldl to Utils, now that PlatformXYZ git moved. 2016-11-08 08:44:16 +01:00
Axel Naumann
58a6a94804 In the RAII ctor, set private Parser fields to default values. 2016-11-07 15:29:52 +01:00
Axel Naumann
3847e2560d Split ParserStateRAII into Utils/. We need it in other places. 2016-11-07 15:29:52 +01:00
Axel Naumann
8dcf1c8b46 Revert "Implement IsMemoryValid natively on OSX. 250% faster!"
This reverts commit 09d1e4d4b4246e3c738379188e1780522ba70ccf.
It is actually much much slower on MacOS 10.11 and 10.12.
2016-10-20 11:52:41 +02:00
Roman Zulak
3e765d8ac9 Add platform::POpen.
Fixes ClangInternalState::differentContent showing no differences when there
actually are, just less than 128 characters in length.

Invoking diff on Windows with --ignore-matching-lines arguments will fail because the command string is too long. Using Windows APIs to launch the process succeeds.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-10-18 17:53:22 +02:00
Roman Zulak
182954b87f Windows: Match UCRT Version from build environment if possible.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-10-18 17:53:22 +02:00
Roman Zulak
3acc9e577d OSX: Use MAC_OS_X_VERSION_MAX_ALLOWED to infer SDK compiled with.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-10-18 17:53:22 +02:00
Roman Zulak
508039082b OSX: Actually choose highest SDK version and fallback to lexical sort.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-10-18 17:53:22 +02:00
Roman Zulak
3d83bd70df Cleanup utils::SplitPaths.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-10-18 17:53:22 +02:00
Roman Zulak
37f86f9a4a Add platform::kEnvDelim to avoid having #ifdefs for calls to SplitPaths.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-10-18 17:53:22 +02:00
Roman Zulak
2bc6a5c66b Move windows::LookupSymbol to platform::DLSym
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-10-18 17:53:21 +02:00
Roman Zulak
0cf6aec6a7 Lookup Windows functions in process.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-10-18 17:53:21 +02:00
Roman Zulak
b2ab0a55e0 Make GetVisualStudioVersionCompiledWith private, and error out for untested versions.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-10-18 17:53:21 +02:00
Roman Zulak
2436242710 Fix windows::GetSystemRegistryString to get values of immediate children.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-10-18 17:53:21 +02:00
Roman Zulak
1e3509c5c4 Implement IsMemoryValid natively on OSX. 250% faster!
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-10-18 17:53:21 +02:00
Roman Zulak
caa8628784 Merge pointer checking statics into one object. One thread barrier is better than two.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-10-18 17:53:21 +02:00
Roman Zulak
2eae759f98 Add platform::IsMemoryValid.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-10-18 17:53:21 +02:00
Roman Zulak
ffadea2c21 Add platform::DLOpen and platform::DLClose.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-10-18 17:53:20 +02:00
Roman Zulak
fb4769cecb Add platform::NormalizePath.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-10-18 17:53:20 +02:00
Roman Zulak
6dc1c06512 Add platform::GetSystemLibraryPaths.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-10-18 17:53:20 +02:00
Roman Zulak
cce7d69844 Move platform specific code from CIFactory.cpp into separate modules.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-10-18 17:53:20 +02:00
Vassil Vassilev
fbd110fc67 When deciding not to wrap add the last token ';' we advanced to.
This fixes Github issue 113, breaking Jupiter notebooks.
2016-10-16 11:39:16 +02:00
Vassil Vassilev
e4f2dddf5a Fix author. 2016-10-16 11:39:16 +02:00
Frederich Munch
63ead8d92e Windows: Fix CMake generation of CLING_INCLUDE_PATHS. 2016-09-09 09:29:49 +02:00
Frederich Munch
f933a88800 Windows: Fix SplitPaths when delimiter is ':' 2016-09-09 09:29:49 +02:00
Frederich Munch
9c09a27481 Fix SplitPaths when pruning non-existent directories. 2016-09-09 09:29:49 +02:00
Frederich Munch
5bb4fc3e8d More complete function/class wrap detection.
Handle C++ class scoping for unwrapped function/method definitions.
Handle source that begins with a function/method that should't be wrapped and
is followed by statements that should be.
2016-09-05 12:44:13 +02:00
Frederich Munch
c86cd5bc6c Allow struct and class return types from function definitions. 2016-09-05 12:44:12 +02:00
Frederich Munch
1bb3b96d2f Don't wrap function, method, constructor, or destructor definitions. 2016-09-05 12:44:12 +02:00
Axel Naumann
1b81e23313 Wrapper must be a FunctionDecl. 2016-08-31 18:14:13 +02:00
Axel Naumann
62a6f08172 No need to wrap if EOF, possibly after preproc (ROOT-8325). 2016-08-26 13:14:08 +02:00
Frederich Munch
bbfd61d897 Share -v flag with clang, and use it during startup to log info about header search paths.
Also fix trying to report why compiler invocation failed when it was never attempted.
Add message about build being probably being configured incorrectly.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:18 +02:00
Frederich Munch
2142853de6 Don't call clang::ApplyHeaderSearchOptions from Interpreter::AddIncludePaths.
Instead call it at the end of cling::createCI (that should probably change too).

clang::ApplyHeaderSearchOptions is a very heavy-weight function that does a lot
of work to determine and add system headers. More importantly it can also wind
up invalidating clangs internal cache making inclusion of files later impossible.

By using the lighter HeaderSearchOptions::AddSearchPath we not only avoid redoing
a lot of work that has been done, but can adjust the method in clang to avoid
cache invalidation so that calling Interpreter::AddIncludePath will actually
make the files in that path accessible to clang.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:18 +02:00
Frederich Munch
998ca7af13 Move core of Interpreter::GetIncludePaths into Utils library.
Add optional stream for Interpreter::DumpIncludePath.
This allows for easier debugging of include path during different stages of startup.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:18 +02:00
Frederich Munch
ea25014f1f Add -DCLING_INCLUDE_PATHS to CMake.
This allows a user to prepend to CLING_INCLUDE_PATHS any additional include paths
they want to add on startup.

Refactor common path splitting code into Utils/Paths

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:18 +02:00
Frederich Munch
afe23db9d4 Fix cling when built for 32 bit architectures.
Use uintptr_t as void* and uint64_t are not guaranteed to be the same size.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-15 15:29:11 +02:00
Axel Naumann
40b24434be Do not return early if the "{" is in a CPP macro! 2016-07-29 16:59:08 +02:00
Axel Naumann
928983b710 If a macro has an #if we cannot tell wether it is unnnamed. Reverts to previous behavior (named macro). 2016-07-29 15:59:08 +02:00
Axel Naumann
0b4ee9eefc Treat tok::eod as part of the PP directive. 2016-07-29 10:29:24 +02:00
Axel Naumann
c378fe7289 Return first offset of token that needs wrapping; fixes cling test suite. 2016-07-28 12:46:24 +02:00
Axel Naumann
40e6b501a4 Handle last token, too. 2016-07-28 11:09:24 +02:00
Axel Naumann
93edfaeec2 Move shouldWrap / isUnnamedMacro; use Lexer. Prerequisite for improving wrapInput(). 2016-07-28 11:09:24 +02:00
Axel Naumann
39dd90e183 Use LLVM_LINK_COMPONENTS; add_dependencies superseded by cling/CMakeLists.txt depending on tablegen-ed files. Cleanup linked libs. 2016-07-19 17:59:14 +02:00
Frederich Munch
a054b253d8 Fix CMake projects to link to proper libraries when built as shared library. 2016-07-19 17:59:14 +02:00
Axel Naumann
2e08275916 Build libcling.so based on OBJECT "library" in CMake. 2016-07-19 10:59:32 +02:00
Axel Naumann
7e9a74f3e4 Remove remnants of llvm configure/make build system. 2016-07-13 17:16:13 +02:00
Axel Naumann
92b021279c From Bertrand: fix for MSVC. 2016-06-15 14:14:34 +02:00