Axel Naumann
3918184d11
StartModule(), makeModuleName() do not need to be public.
2017-06-28 14:08:13 +02:00
Frederich Munch
f63f9bb61d
Remove dependency on sstream and iostream.
2017-06-28 14:08:13 +02:00
Frederich Munch
c0ccc621da
Refactor common code for creating modules in IncrementalParser.
2017-06-28 14:08:13 +02:00
Axel Naumann
3693489f3d
Handle also nested deduced templates, even those wrapped in a LocInfoType.
...
Fixes cling/test/Lookup/template.C in C++17.
2017-06-27 10:31:08 +02:00
Frederich Munch
8e41533e0a
Remove extra semicolon.
2017-06-27 10:14:05 +02:00
Axel Naumann
8fae026045
Missing "}"!
2017-06-26 22:15:16 +02:00
Axel Naumann
6ec06c0bd6
Use proper interface.
2017-06-26 22:00:28 +02:00
Axel Naumann
8e0dc09857
Turn gnu++ off if __float128 is unsupported in clang:
...
// clang currently supports native __float128 only on few targets, and
// this target does not have it. The most visible consequence of this is a
// specialization
// __is_floating_point_helper<__float128>
// in include/c++/6.3.0/type_traits:344 that clang then rejects. The
// specialization is protected by !if _GLIBCXX_USE_FLOAT128 (which is
// unconditionally set in c++config.h) and #if !__STRICT_ANSI__. Tweak the
// latter by disabling GNUMode.
2017-06-26 20:59:35 +02:00
Axel Naumann
07f42c7a51
Fist step towards fixing cling/test/Lookup/template.C for C++17.
2017-06-26 17:44:07 +02:00
Axel Naumann
c904524faa
Back out __float128
change until we know why it's happening.
...
Travis should be able to reproduce this, which should allow us to report it upstream.
2017-06-23 17:14:12 +02:00
Frederich Munch
a48a2803be
Add CxxStdCompiledWith function that will error if C++ standard is unknown. Fix __float128 error for gcc with -std=c++1z.
2017-06-23 17:14:12 +02:00
Axel Naumann
dc04fb555c
Show diagnostics of possible value print errors.
2017-06-23 17:14:12 +02:00
Axel Naumann
27aea4b5a0
Use proper function name.
2017-06-23 17:14:12 +02:00
Axel Naumann
640eb1d81d
Debug Travis GCC builds on MacOS - do they really pass -std=gnu++17?!
2017-06-23 16:44:06 +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
Axel Naumann
1b2a853b7d
Initialize pointer array (FWIW). Thanks, Coverity!
2017-06-23 12:59:10 +02:00
Axel Naumann
0b3c8e3acd
Fix clang warning "suggest braces around init of subobject".
2017-06-23 12:59:10 +02:00
Bertrand Bellenot
5665358dff
Add missing semicolon (Windows)
2017-06-23 11:14:04 +02:00
Axel Naumann
aae2870f62
Allow getStringType() to reset the cache.
2017-06-23 10:59:10 +02:00
Frederich Munch
522b5f491c
Add support for multiple arguments in one pragma call. Add support for multiple styles:
2017-06-23 10:44:12 +02:00
Frederich Munch
f0caa519e8
Save some memory and only create one ClingPragmaHandler to handle all pragmas. Use clang diagnostics for parsing errors.
2017-06-23 10:44:11 +02:00
Frederich Munch
955b5423e4
Make sure to declare gCling in C-mode. Skip failing test in AtExit.C.
2017-06-22 20:30:27 +02:00
Axel Naumann
deb1fcbc7d
Only emit definitions if !SyntaxOnly.
...
Fixes duplicate definition errors with PCH, where the first definition is in the PCH, and the
second one is injected at runtime, after attaching the PCH.
This patch still exposes as many declarations as possible to fSyntaxOnly to validate their syntax.
2017-06-22 16:39:14 +02:00
Frederich Munch
8f29132120
Fix -fsyntax-only flag which changed in 0d15357
and to allow usage of gCling.
...
0d15357
unintentionally blocked inclusion of RuntimeUniverse.h when using -fsyntax-only.
2017-06-22 16:39:14 +02:00
Frederich Munch
f1071b4f86
Only set -std=c++11 on Apple/GCC if language has not been explicitly set.
2017-06-22 16:39:14 +02:00
Axel Naumann
65b4cd2cc3
Avoid memset by using in-class member init.
2017-06-22 13:10:37 +02:00
Frederich Munch
7504234e21
Cache all string types.
2017-06-22 13:10:37 +02:00
Frederich Munch
8fab0d5be8
Fix caching of std::string type.
...
If the Transaction that holds std::string type is unloaded LookupHelper::m_StringTy will point to invalid memory.
LookupHelper::findType can return an invalid QualType causing dereference of null.
2017-06-22 13:10:37 +02:00
Frederich Munch
6753263bf4
Refactor specializations of executePrintValue. Having ExecutePrintValue templated codegens duplicate functions unneccessarily. Removes re-direction, duplicate signatures, and line count for executePrintValue.
2017-06-21 12:59:08 +02:00
Frederich Munch
c11b3fdecc
Enclose more stuff in anonymous namespaces.
2017-06-21 12:59:08 +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
Frederich Munch
14d88d2d86
Move wchar_t type branching out of runtime.
2017-06-21 08:29:11 +02:00
Frederich Munch
f241b59b68
Remove unnecessary include.
2017-06-21 08:29:11 +02:00
Frederich Munch
e8e203bc98
Add __CLING__GNUC_MINOR__ macro.
2017-06-21 08:29:10 +02:00
Frederich Munch
95c67cb818
Cleanup cruft from CreateHostTargetMachine.
2017-06-20 11:44:13 +02:00
Axel Naumann
2177d1d4e5
Rename cling_Evaluate to EvaluateDynamicExpression.
...
"cling" is already in the namespace, and this is about DynamicExprInfo.
Thanks to Roman Zulak for the suggestion!
2017-06-19 16:00:56 +02:00
Vassil Vassilev
01d6baa5a9
Silence unused var warning.
2017-06-14 18:29:10 +02:00
Frederich Munch
f84742e218
Fix buffer overflow.
2017-06-14 17:59:39 +02:00
Axel Naumann
2faf5c2400
Make sure we use the definition as lookup scope.
2017-06-14 09:30:01 +02:00
Axel Naumann
212ad1b7d1
Outline calls to Interpreter::Evaluate() to not #include "Interpreter.h" in the runtime.
2017-06-14 09:30:00 +02:00
Raphael Isemann
8bdca9bc29
Fixed formatting.
2017-06-13 14:30:47 +02:00
Raphael Isemann
ca887faea0
Fix Interpreter::getMacro returning 0 when using modules.
...
The old code didn't query the modules if the identifier
is updated. This caused some checks to fail such as
CheckABICompatibility().
2017-06-13 14:30:47 +02:00
Raphael Isemann
55702c056b
Don't overwrite the ExternalSemaSource in the modules case. ( #538 )
...
The modules implementation provides it's own sema source and
overwriting this confuses clang when we have -fmodules enabled.
2017-06-13 14:30:47 +02:00
Roman Zulak
2806ec0f61
Warn if lambdas in global scope use copy capture.
...
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2017-06-12 18:14:31 +02:00
Roman Zulak
6a8632d451
Fix trying to destruct C structs after printing on prompt. Don't bother destructing C++ objects who have trivial destructors.
...
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2017-06-12 18:14:30 +02:00
Axel Naumann
48aa4b9096
Remove hack, now that clang pulls the init symbol name from the Module!
...
This depends on the commit under review here: https://reviews.llvm.org/D34059
2017-06-10 10:29:06 +02:00
Axel Naumann
67cceed590
Do not only set the const char* but the whole StringRef of the MainFile.
...
Fixes a memory corruption seen after the llvm upgrade. This is still a terrible hack;
it will be replaced by a proper fix in clang::CodeGen (coming up).
2017-06-09 23:29:06 +02:00
Roman Zulak
aea1940093
Sort filenames before printing them in ClangInternalState. Cache entries being invalidated are causing the map order to change.
...
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2017-06-09 17:45:51 +02:00
Roman Zulak
70bf1a3e8b
Don’t invalidate the Transaction’s FileEntry if verifying diagnostics.
...
Remove check before insertion into set.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2017-06-09 17:45:51 +02:00
Vassil Vassilev
45209f520a
The llvm conversion routines went into namespace llvm.
2017-06-08 10:29:13 +02:00
Vassil Vassilev
289da02b9b
New version of StringRef brings a bunch of includes in etc.
...
Instead of copying over more includes, outline the only function in the
Interpreter which requires a full definition of llvm::StringRef.
2017-06-08 10:29:13 +02:00
Vassil Vassilev
8f257e74d3
Create a virtual file entry for each input line.
...
This is the only way not to confuse the diagnostics engine of upgraded clang.
Also, this gives us a few advantages:
* We can compare more precisely the source locations of diagnostics;
* We can merge the code completion code path which works with file entries;
* We can rely better when specifying //expected-note-s in different files.
2017-06-08 10:29:13 +02:00
Vassil Vassilev
a1bd767b6b
Adapt to interface changes due to upgrade to r302975.
2017-06-08 10:29:13 +02:00
Frederich Munch
77bda84fb2
Destroy elements in reverse order of construction.
...
Prevents possibility of last element referencing now invalid first element.
2017-06-06 13:59:18 +02:00
Axel Naumann
77781b886e
Fix doxygen warning.
2017-05-21 16:44:08 +02:00
Axel Naumann
8a439022aa
Use __STRICT_ANSI__ and __FAST_MATH__ as set during compilation of cling.
2017-05-18 08:59:50 +02:00
Axel Naumann
57e0eaee35
Remove duplicate setting.
2017-05-18 08:59:50 +02:00
Axel Naumann
a3b7f8b2b5
Fix C comments with slash. By Roman Zulak!
2017-05-11 09:00:00 +02:00
Axel Naumann
875a597aff
Move target init early.
2017-05-10 08:29:53 +02:00
Axel Naumann
053223229e
Enable all available targets, for instance for the cuda backend.
2017-05-08 14:59:05 +02:00
Axel Naumann
dec2b8aa60
Use LookupHelper cache instead of local static.
2017-05-08 11:44:07 +02:00
Axel Naumann
cb2384fc55
Buffer Interpreter-local std::string lookup; ValuePrinter needs it.
2017-05-08 11:44:07 +02:00
Axel Naumann
ec27958540
Fix unitialized member (Coverity 94184).
2017-05-08 09:44:08 +02:00
Axel Naumann
de06e519fd
Do not print std::string through Interpreter.
...
Increases performance for all printValue() calls that do go through the Interpreter.
2017-05-05 18:44:38 +02:00
Axel Naumann
e25880b49d
Do not allocate Values/strings for printing simple types.
...
Still missing is calling a printValue(std::string) overload from printUnpackedClingValue.
That is needed for optimizing the generic printValue() invocation through the interpreter:
it should not have to create a *second* Value for printing the string returned from printValue().
2017-05-05 18:44:38 +02:00
Axel Naumann
871b304f8c
Assemble array dimensions recursively (ROOT-7016).
2017-05-05 12:14:05 +02:00
Sebastian Uhl
6296dd2bc4
Re-enable C++14 for GCC 4.9 in Interpretator
...
GCC 4.9 only defines '__cplusplus' to the value 201300L and not to
201402L as expected for C++14. This makes the check for the available
C++ standards in the interpreter fail to enable C++14 (which in turn
means that ROOT cannot be compiled with GCC 4.9 if C++14 was enabled in
Cmake). Similarly, for C++17 apart from the proper value 201703L other
values seems to be floating around (e.g. 201406L as defined by the
version of LLVM included with ROOT). The requirement for '__cplusplus_'
to enable certain C++ standards in the interpreter is made less strict
and just needs to be larger than the previous final value.
This basically reinstates commit
0a62e34aa86b812651cfcf9526ba03b975adaa5c which was undone by commit
702298d9ad83866d0be62f0422c03ac8ea6687f1.
2017-05-04 15:59:08 +02:00
Axel Naumann
35915644ad
With the fix for llvm bug 19668: enable inlining also for GCC!
2017-05-04 10:14:19 +02:00
David Abdurachmanov
68d860707b
Enable C++17 (C++1z) in Interpreter
...
This is a must if everything else is compiled in C++17 mode. Not having
C++17 enabled within Interpreter caused errors in CMSSW.
Signed-off-by: David Abdurachmanov <davidlt@cern.ch>
2017-05-03 18:59:45 +02:00
Raphael Isemann
b2ed65dbbf
Remove unimplemented shouldIgnore from IncrementalParser. ( #545 )
...
The function implementation was moved to a static function in
the DeclCollector in commit 858120920f51a3ea8f689d19f2a2fa1cc3981eb1
about 'Emit Decls as DeclCollector sees them'.
2017-05-03 11:44:18 +02:00
Axel Naumann
675a67e57f
Offer non-echoing process().
2017-05-02 11:59:10 +02:00
Axel Naumann
fba944ebf7
Fix noexcept for __cxa_atexit.
2017-04-29 15:14:09 +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
86b3cfb1c4
Implement #pragma cling optimize(N) to set the opt level.
2017-04-12 15:44:35 +02:00
Axel Naumann
ebc4857766
Teach the pragma parser to parse non-string literals.
2017-04-12 15:44:35 +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
98b07031df
Use CompOpt from outer Transaction instead of default constructed.
2017-04-12 15:44:35 +02:00
Axel Naumann
711a136562
Add and use Interpreter::makeDefaultCompilationOpts().
2017-04-12 15:44:35 +02:00
Axel Naumann
a5db95b81b
Add the OptLevel to be used for new Transactions.
2017-04-12 15:44:35 +02:00
Axel Naumann
52100eb2f1
Pass OptLevel to addModule.
2017-04-12 15:44:35 +02:00
Axel Naumann
66b8d8535a
Keep one PassManager per opt level; runOnModule now takes an OptLevel.
...
Also inform the TargetMachine of the OptLevel to be used; this will be
picked up by OrcJIT's SimpleCompiler when constructing the MC passes.
2017-04-12 15:44:35 +02:00
Axel Naumann
f994d2652d
Force NormalInlining only for GCC.
2017-04-12 15:44:34 +02:00
Axel Naumann
f64d5472b3
Remove use of non-const CodeGenOpts.
2017-04-12 15:44:34 +02:00
Philippe Canal
e173a95fc1
With module (or pcm) even trivial lookup can lead to deserialization and thus need a transaction
2017-04-11 23:00:40 +02:00
Philippe Canal
f5c7037763
Fix ROOT-8739: Lookup of symbol inside of namespace shadowed by function (in another 'used' namespace).
...
This was happening when a namespace had the same as the function in a namespace that was 'used'. Namely,
in the issue report it was the 'next' namespace and the function std::next.
This required the quick search function in LookupHelper.cxx to properly handle the return value of utils::Lookup::Named.
2017-04-07 21:14:06 +02:00
Philippe Canal
3a1db539f6
Revert "Fix ROOT-8739: Lookup of symbol inside of namespace shadowed by function (in another 'used' namespace)."
...
This reverts commit 0728f30ead6c1cca74bf31b93dc9a1cb616a3e35.
2017-04-07 20:44:04 +02:00
Philippe Canal
68283cac47
Fix ROOT-8739: Lookup of symbol inside of namespace shadowed by function (in another 'used' namespace).
...
This was happening when a namespace had the same as the function in a namespace that was 'used'. Namely,
in the issue report it was the 'next' namespace and the function std::next.
This required the quick search function in LookupHelper.cxx to properly handle the return value of utils::Lookup::Named.
2017-04-07 20:29:17 +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
Axel Naumann
a811723cec
Missing member init (thanks, Valgrind!).
2017-04-04 11:14:05 +02:00
Axel Naumann
a52133126d
Also handle GlobalVariables. Fixes Recursion/RecursiveClingInstances.C.
2017-04-03 15:44:38 +02:00
Axel Naumann
91f23f3d4a
Only reset error count if there was no error before!
2017-03-31 16:14:27 +02:00
Frederich Munch
fa6d32fe73
Pass mangled name to CodeGenerator::forgetDecl. From Roman Zulak and me.
...
Ignore mangling errors on Windows; fixes -Xclang -verify on Windows.
2017-03-31 16:14:27 +02:00
Axel Naumann
c85f9a2c57
Do not mark decls used, just to prevent unloading!
...
This has the side effect that many symbols will need to be emitted.
It's much cheaper to not DeclUnload these decls instead.
2017-03-31 10:29:22 +02:00
Axel Naumann
7dc6a1be42
Definitions of static functions must be visible across Transactions.
...
Otherwise, subsequent calls cannot use them: they cannot resolve the symbol.
This is a side-effect of our never-ending translation unit versus intermediary
end-of-translation unit actions.
2017-03-31 10:29:22 +02:00
Axel Naumann
728c296cb0
Style.
2017-03-28 13:59:30 +02:00
Axel Naumann
3a0bd332e8
Turn optimizations on! (Except for full inlining...)
2017-03-28 13:59:30 +02:00
Axel Naumann
145e269e5b
Use default inliner but keep inlining to a minimum.
...
We cannot turn on inlining completely due to a clang /GCC ABI mismatch that
is visible with -O2, see https://bugs.llvm.org//show_bug.cgi?id=19668 .
2017-03-28 13:59:30 +02:00
Frederich Munch
7ab0d2ca97
Remove useless lines.
2017-03-24 13:44:13 +01:00
Frederich Munch
ae9b72cbb1
Remove useless assignment.
2017-03-24 13:44:12 +01:00
Frederich Munch
3aea7df3c0
Remove useless comparison.
2017-03-24 13:44:12 +01:00
Frederich Munch
3ea7fef180
Consolidate duplicate if statements.
2017-03-24 13:44:12 +01:00
Frederich Munch
f28c04c1a2
Add Interpreter::getMacroValue method.
2017-03-23 15:59:04 +01:00
Frederich Munch
9b3084f955
Add Interpreter::getMacro method.
2017-03-23 15:59:04 +01:00
Frederich Munch
5229194db4
Fix writing to freed memory if Interpreter::executeTransaction fails.
2017-03-23 15:14:04 +01:00
Frederich Munch
120ca522b0
Fix possible crash on CodeGen failure.
2017-03-23 15:14:04 +01:00
Frederich Munch
3eb05a2c20
Use #ifdefs for MANGLE_PREFIX.
2017-03-23 14:44:06 +01:00
Axel Naumann
7c1fbfcf9f
Require ">" after ".5" to accept it as redirection (ROOT-8696).
2017-03-22 21:14:29 +01:00
Axel Naumann
c901b585a1
Do not load libraries in syntax-only mode (e.g. rootcling).
2017-03-22 11:20:50 +01:00
Raphael Isemann
449c26d5f4
Fixed that we corrupt CLING_CXX_PATH
...
This will fix the issue that cling will try to invoke "OFF " to find headers.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2017-03-10 16:14:04 +01:00
Frederich Munch
29325e2987
Windows: Exception handling.
2017-03-08 17:29:08 +01:00
Frederich Munch
dee36dbaf8
Windows: Enable RTTI when cling was compiled with it on.
2017-03-08 17:29:08 +01:00
Frederich Munch
bd98283b8c
Don't make a path absolute, just check if it is.
2017-03-08 17:29:08 +01:00
Frederich Munch
eb32d6eae4
Add Interpreter::loadLibrary and Interpreter::loadHeader.
...
Refactor Interpreter::loadFile to call into these methods.
2017-03-08 17:29:08 +01:00
Frederich Munch
4b4fe0ec9e
Formatting.
2017-03-08 17:29:08 +01:00
Raphael Isemann
5f6bbb88e1
Fix ROOT nighly builds failing to configure with CMake
...
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2017-03-06 16:44:48 +01:00
Bertrand Bellenot
09369c4fd6
Remove the Windows ELF formatting from IncrementalExecutor, since it is now in CIFactory
2017-03-02 11:59:59 +01:00
Philippe Canal
92f970b519
Remove unnecessary overallocation in Azog::reserveAllocationSpace
...
Thanks to Roman mentioning: "My reading of the code that computes size and calls reserveAllocationSpace has already factored in the worst case scenarios due to alignment."
2017-03-01 22:33:09 +01:00
Bertrand Bellenot
ba0e49d295
Set ELF format for the clang driver on Windows
...
COFF format currently needs a few changes in LLVM to function properly
2017-03-01 17:29:11 +01:00
Frederich Munch
df47b1259a
Formatting.
2017-02-21 16:34:19 +01:00
Frederich Munch
097a4e3fbd
Only check DiagnosticsEngine::hasErrorOccurred, hasFatalErrorOccurred cannot be true without it.
2017-02-17 20:45:04 +01:00
Frederich Munch
de62978dad
Fix error from ParseTopLevelDecl not always being propagated to the current Transaction. Fix LangOpts.AccessControl not begin set in AccessCtrlRAII_t, a regression this exposed.
2017-02-17 20:45:03 +01:00
Frederich Munch
74ba44505a
Windows: Allow Windows.h to be included without warnings.
2017-02-17 15:14:06 +01:00
Frederich Munch
311a557be1
Windows: Interpret -nostdinc++ as -nostdinc which clang does not use on Windows backend. Fixes ABI and NoStdInc tests.
2017-02-17 15:14:06 +01:00
Frederich Munch
92f39fc75c
Windows: Don’t add INCLUDE paths clang will handle that as necessary.
2017-02-17 15:14:06 +01:00
Frederich Munch
15c1247a44
Windows: Fix byte dumping to non UTF-8 codepage and Strings.C test.
2017-02-17 15:14:06 +01:00
Frederich Munch
5c66b41851
Fix EscapeSequence::encode returning a StringRef pointing to stack memory.
2017-02-17 15:14:06 +01:00
Axel Naumann
40bc805952
Revert "Fix unloading of friend declarations."
...
This reverts commit 1cf955ae4504d8cdb6d87c70d4331806c9861255.
2017-02-10 08:44:05 +01:00
Axel Naumann
5bb7bcd372
Revert "Unlink FriendDecl from linked list in CXXRecordDecl."
...
This reverts commit a3f7f117f917e901701d48f03157ff580b67b779.
2017-02-10 08:44:05 +01:00
Axel Naumann
7bcbdf120b
Revert "Call VisitRedeclarable before VisitDeclContext to avoid any recursion that might occur."
...
This reverts commit 1d1d8fd511a4ec621a92628462142cb8d9356b70.
2017-02-10 08:44:05 +01:00
Axel Naumann
71187acfba
Revert "Fix unloading of using namespace declarations. Add test/CodeUnloading/UsingShadows.C"
...
This reverts commit f5287603e6502c07f76a7f5a599aa6faae005327.
2017-02-10 08:44:05 +01:00
Axel Naumann
86de616002
Revert "Fix unloading of types in a namespace declared as using. This fixes triggering an assert in clang caused by trying to remove a declaration too many times."
...
This reverts commit c1574e399ae2e46fd0400d49c45eb48875995775.
2017-02-10 08:44:05 +01:00
Axel Naumann
9f5820a693
Revert "Fix unloading declarations in std namespace that were declared in an inline namespace, but referenced in the std namespace itself. Cling would crash or complain about forward declarations not being the same later."
...
This reverts commit 200ac7c6e64923f42023cc7324cab6ea7ebd3616.
2017-02-10 08:44:05 +01:00
Axel Naumann
3addec52ea
Revert "Fix unloading from inline namespaces other than std."
...
This reverts commit 1e9984a65312b07f39760f6aec88b0b246fe3d94.
2017-02-10 08:44:05 +01:00
Frederich Munch
185b905525
Fix unloading from inline namespaces other than std.
2017-02-09 17:14:20 +01:00
Frederich Munch
87c97bab0d
Fix unloading declarations in std namespace that were declared in an inline namespace, but referenced in the std namespace itself. Cling would crash or complain about forward declarations not being the same later.
2017-02-09 17:14:20 +01:00
Frederich Munch
1cc55d32ea
Fix unloading of types in a namespace declared as using. This fixes triggering an assert in clang caused by trying to remove a declaration too many times.
2017-02-09 17:14:19 +01:00
Frederich Munch
14aaa3995e
Fix unloading of using namespace declarations. Add test/CodeUnloading/UsingShadows.C
2017-02-09 17:14:19 +01:00
Frederich Munch
8957d2b84e
Call VisitRedeclarable before VisitDeclContext to avoid any recursion that might occur.
...
This should have been included in the prior commit, but as it affects [ordering in] other DeclUnloader functions;
the ability to back it out separately is better.
Also exposes a bug/change necessary in clang when building in Debug mode to avoid an infinite loop.
2017-02-09 17:14:19 +01:00
Frederich Munch
7161f8660b
Unlink FriendDecl from linked list in CXXRecordDecl.
2017-02-09 17:14:19 +01:00
Frederich Munch
f87922659d
Fix unloading of friend declarations.
2017-02-09 17:14:19 +01:00
Frederich Munch
9f62199d73
Add ability to control cling output streams colorization. Default to colorize when running in a terminal.
2017-02-09 16:59:38 +01:00
Frederich Munch
a77d90911e
Refactor unique name generation and remove duplicate and unused methods.
2017-02-09 16:59:38 +01:00
Frederich Munch
b3834b1dcf
Add Interpreter::getDiagnostics method.
2017-02-09 16:59:38 +01:00
Frederich Munch
401bc7273e
Add argument to Interpreter::getSourceLocation to skip function wrapper.
...
This makes the source print at a better location for Value errors.
2017-02-09 16:59:38 +01:00
Frederich Munch
19ab07e86c
Add Interpreter::getSourceLocation method.
...
Accessor for the current or last executing line's SourceLocation to be used in error reporting.
2017-02-09 16:59:38 +01:00
Frederich Munch
1a0287a4dc
Add Transaction::getSourceLocation method.
2017-02-09 16:59:38 +01:00
Frederich Munch
eb40609ab2
Add -noruntime flag to force cling not load or use support for value-printing or null dereferencing. This makes it tons easier to debug DeclUnload and discover what isn't being unloaded.
2017-02-09 16:45:11 +01:00
Frederich Munch
630abbf855
Windows: Fix preprocessor output test.
2017-02-09 16:45:10 +01:00
Frederich Munch
49aacfc5e6
Revert "Must flush stdout, else a "lazy" stdout will not flush before prompt."
...
This reverts commit bd6cbaf3b6
.
2017-02-08 15:37:40 +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
d00a335350
Force __cxa_demangle to null terminate its output.
2017-02-08 12:29:14 +01:00
Frederich Munch
c86fa34e94
Fix unused variable warning.
2017-02-07 16:59:09 +01:00
Frederich Munch
a91b83632e
Use std::find_if when searching m_StoredStates.
2017-02-07 16:59:09 +01:00
Frederich Munch
4dd1ce8e56
Fix for Interpreter hanging on to states that can refer to a deleted llvm::Module.
2017-02-07 16:59:09 +01:00
Frederich Munch
5cfe0378ad
Don’t unload past first transaction.
...
That transaction holds the key to destructors working, so discarding it would
make the Interpreter non conformant.
2017-02-07 16:44:05 +01:00
Axel Naumann
bd6cbaf3b6
Must flush stdout, else a "lazy" stdout will not flush before prompt.
...
This situation can happen if stdout is redirected and back. stdout's FILE* has
now changed, and the prompt and stdout end up on different buffers, meaning that
stdout is not flushed before the next prompt.
2017-02-07 15:14:37 +01:00
Bertrand Bellenot
0c8be25ebe
Disable exceptions on Windows for the time being.
...
Enabling exceptions here makes 42 more tests failing. For example, CodeGeneration\RecursiveInit.C raises a unhandled exception in WinEHPrepare.cpp, at:
if (UserI->isEHPad())
report_fatal_error("Cleanup funclets for the MSVC++ personality cannot "
"contain exceptional actions");
2017-02-07 14:59:08 +01:00
Vassil Vassilev
28380b9f54
Add a fixme.
2017-02-03 14:24:58 +01:00
Vassil Vassilev
1f0cf5c847
Mount a stl modulemap for non libcxx implementations.
2017-02-03 14:24:58 +01:00
Frederich Munch
efd446871c
Fix LLVM API misuse when trying to replace and keep a DiagnosticConsumer.
2017-02-02 11:44:05 +01:00
Frederich Munch
f8dcefe9a4
Remove LLVM-4 version check, same behavior occurs in LLVM-3.9 (release).
2017-02-02 11:44:05 +01:00
Frederich Munch
439275025a
Use Preprocessor::getSpelling to retrieve a macro string.
2017-02-02 10:14:15 +01:00
Frederich Munch
49a1627272
Make sure that extraneous output cannot interrupt Value::print’s string on tty.
2017-02-02 10:14:15 +01:00
Frederich Munch
b6afe909f3
Use utils::FunctionToVoidPtr for casting unresolvedSymbol.
2017-02-02 10:14:15 +01:00
Frederich Munch
94672dd0d0
Fix unloading functions declared external "C". Refactor VisitRedeclarable.
2017-02-02 08:30:01 +01:00
Frederich Munch
afb2746b64
Fix unloading global variables declared extern "C". Add test that demonstrated failure.
2017-02-02 08:30:01 +01:00
Frederich Munch
976800d396
Fix return type from read and allow a debugger to be attached on OS X.
2017-02-02 08:20:41 +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
Philippe Canal
20c6abd155
Use cling::errs
2017-02-01 13:14:11 +01:00
Frederich Munch
e14c39ace8
Don’t let an invalid PCH file stop an interactive session from running.
2017-02-01 13:14:11 +01:00
Frederich Munch
e245220dff
Cleanup main and add InvocationOptions::IsInteractive method.
2017-02-01 13:14:11 +01:00
Frederich Munch
706b92f235
Setup Diagnostics earlier in initialization.
2017-02-01 13:14:11 +01:00
Frederich Munch
8aa8395cd6
Early out Interpreter initialization when invoked via '-v' or '-version'.
2017-02-01 13:14:11 +01:00
Frederich Munch
14437862ef
Handle -E flag to dump preprocessor definitions.
2017-02-01 13:14:11 +01:00
Frederich Munch
592e61ba1e
Feature to generate precompiled headers.
2017-02-01 13:14:11 +01:00
Frederich Munch
e33b02a0e7
Stop initialization if the PCH contained errors.
2017-02-01 13:14:11 +01:00
Frederich Munch
6aa837920e
Check initialization is proceeding as expecting.
...
Don't blindly run through initialization; make sure things are going according to plan.
If not handle it and run destructors without crashing.
Return standard error codes from main.
2017-02-01 13:14:11 +01:00
Frederich Munch
0e6023ed67
Add argument to IncrementalParser::commitTransaction to avoid clearing the DiagnosticsConsumer. Remove temporary variable.
2017-02-01 13:14:10 +01:00
Frederich Munch
c1f6db6f3c
Use llvm::sys::getProcessTriple, instead of getDefaultTargetTriple.
...
llvm/clang could be configured to output a default target not the same as the running
process.
2017-02-01 13:14:10 +01:00
Frederich Munch
f793f3ea1e
Diagnose startup issues a bit better and reorder unused argument.
2017-02-01 13:14:10 +01:00
Frederich Munch
e10447fe92
Support inclusion of precompiled header from header search paths.
2017-02-01 13:14:10 +01:00
Frederich Munch
a757a424a3
Fix return values from PCHListener, they were returning true indicating failure.
2017-02-01 13:14:10 +01:00
Axel Naumann
8cea8a4f1b
Revert "Enable GDB listener / obj registration."
...
This reverts commit ee994482a49d704931fb9232e17b8dfacaf4847e.
Breaks roottest with assertion "Second attempt to perform debug registration."
2017-02-01 08:29:15 +01:00
Philippe Canal
aad9a7a391
Implemenation a section level allocator in cling's RTDyldMemoryManager (Azog).
...
This allow for a single allocation at the beginning of the module and insure that
all the section of the module with be contiguous in memory.
This is a better fix for Fix ROOT-8523 and replace commit
3f7418269714e12d9fc4f17d197fde7199dbae7d (see more detail about
the problem it the log of that commit)
2017-01-31 22:59:25 +01:00
Philippe Canal
e7c289878a
Enable GDB listener / obj registration.
...
This allows debuggers to see the actual content of the JIT part of a stack trace.
This revert per se 9428c1f1907b3f01208dcc6095c5707011621310
2017-01-31 22:59:25 +01:00
Frederich Munch
13aad4bedd
Cast function pointers legally. Add Utils/Casting.h
2017-01-25 16:59:13 +01:00
Frederich Munch
728ac03921
Windows: Add compiler flags to ignore linkage spec errors.
2017-01-25 15:14:12 +01:00
Frederich Munch
990eed5dce
Remove unused member variable in ExternalInterpreterSource.
2017-01-25 12:14:06 +01:00
Frederich Munch
e4c24a133a
Move IncrementalExecutor::CreateHostTargetMachine into IncrementalExecutor.cpp.
2017-01-25 12:14:06 +01:00
Frederich Munch
14f41fefe2
Define NDEBUG on all platforms.
2017-01-25 11:14:13 +01:00
Frederich Munch
8689e14eb6
Fix assertion test for null terminated string.
2017-01-25 11:14:12 +01:00
Frederich Munch
7462509f7f
Don’t import UsingDecl or UsingShadowDecl. Fixes atexit test failure on gcc on OS X.
2017-01-25 11:14:11 +01:00
Frederich Munch
8daa5bcf11
Fix atexit function declarations for gcc and add test. Fix mangling issues for at_quick_exit and g++ headers.
2017-01-25 11:14:11 +01:00
Frederich Munch
af8e34dcaa
Fix exit functions when nullptr is not a keyword.
2017-01-25 11:14:11 +01:00
Frederich Munch
545d093af6
Windows: Remove function pointer typedef polluting global scope.
2017-01-25 11:14:11 +01:00
Frederich Munch
d2457c5c13
Windows: Remove managed at/on exit wrappers.
2017-01-25 11:14:11 +01:00
Frederich Munch
426bebc168
Windows: Add managed variants of at/on exit functions.
2017-01-25 11:14:11 +01:00
Frederich Munch
0d15357a12
Full implementation to override atexit and similar calls.
2017-01-25 11:14:11 +01:00
Frederich Munch
06ef061569
Implement atexit override. Windows uses atexit is to drive invoke static destructors, and using atexit on other platforms will cause cling to crash.
2017-01-25 11:14:11 +01:00
Frederich Munch
b012e3950c
Fix return value for __cxa_atexit.
2017-01-25 11:14:10 +01:00
Frederich Munch
4b1389bf38
Add platform::Demangle function.
2017-01-24 12:29:35 +01:00
Frederich Munch
2e2d44e995
Fix API usage error in LLVM unicode routines. Use reinterpret_cast to force compile time errors.
2017-01-20 20:59:08 +01:00
Frederich Munch
811840740d
Windows: Force console output to UTF-8.
2017-01-18 16:43:26 +01:00
Frederich Munch
de5363ee63
Fix UTF-8 output when using g++ on OS X.
2017-01-18 15:59:12 +01:00
Frederich Munch
5e0a4b1fb1
Use LLVM for Unicode conversion on gcc < 5. Force export of toUTF8 specializations otherwise.
2017-01-18 15:59:12 +01:00
Frederich Munch
b48d0c3779
Windows: Fix wchar_t and wstring_convert on MSVC.
2017-01-18 15:59:12 +01:00
Frederich Munch
08f8c4fa80
Move to UTF-8 string conversion into separate module. Support UTF-8 output on Windows.
2017-01-18 15:59:12 +01:00
Frederich Munch
7eea9235da
Have Value::dump write unicode and strings with embedded data properly.
2017-01-18 15:59:12 +01:00
Frederich Munch
f39f1f7318
Fix C-string printing for safety, speed, and data loss. Prior behavior assumed both pointer and pointer+10000 were valid memory. Add override for const char arrays so that they can be printed faster. Make cling::printValue a lossless operation. Previously strings with non-ASCII printable chars were transformed into an invalid c-string and the data could not be used to recreate the string.
2017-01-18 15:59:11 +01:00
Frederich Munch
fb96f9c040
Support unicode std::strings.
2017-01-18 15:59:11 +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
Vassil Vassilev
bb2de6d3b0
Disambiguate which TargetOptions class we need.
...
Improves readability and works around a subtle modules bug.
2017-01-12 17:14:07 +01:00
Axel Naumann
8579aea04d
Style.
2017-01-12 11:14:34 +01:00
Axel Naumann
bfe5e722e4
Grab the diag count from the target.
2017-01-12 11:14:34 +01:00
Axel Naumann
d02d88ac18
Turn on prompt diags if not raw input.
2017-01-12 11:14:34 +01:00
Axel Naumann
a5581de0fd
Fix warning: moving a temporary object prevents copy elision. Thanks, clang!
2017-01-10 16:14:10 +01:00
Axel Naumann
8c3e5b2e2b
Reset error count when hitting ext_return_has_expr.
2017-01-10 15:59:34 +01:00
Axel Naumann
4b78d08dfa
Use a filtering diagclient for prompt input.
...
Before, cling was thrashing the location specific diag map making any diag emission really slow.
2017-01-10 15:59:34 +01:00
Axel Naumann
2c0cad5b49
Whitespace.
2016-12-20 14:14:04 +01:00
Frederich Munch
dbb5aa6186
Remove ForceSymbolsAsUsed from Interpreter.h.
2016-12-20 14:14:04 +01:00
Frederich Munch
f846990f8d
Windows: Fix InterpreterException not being caught and terminating.
2016-12-20 12:59:08 +01:00
Frederich Munch
4d41bd315f
Make InterpreterException::diagnose virtual and return a boolean. Refactor inheritance chain for InterpreterException.
2016-12-20 12:59:08 +01:00
Frederich Munch
d68ef916ac
Use LLVM stream wrappers to reduce complexity and line counts.
2016-12-20 12:29:06 +01:00
Axel Naumann
c1e79e499d
From Roman Zulak: Flush stdout less (textinput part).
2016-12-19 15:04:23 +01:00
Axel Naumann
43fe0be0a0
From Roman Zulak: Flush stdout less (cling).
2016-12-19 13:59:11 +01:00
Frederich Munch
1aabc2dbe0
Add simple wrappers for buffered LLVM streams. Use them to control Value printing format.
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
Bertrand Bellenot
ddca7a12a2
Speling.
2016-12-19 12:14:26 +01:00
Vassil Vassilev
06704a97fb
Tabs.
2016-12-17 21:14:25 +01:00
Frederich Munch
2897531390
Windows: Fix crash on aliased globals
2016-12-15 14:29:09 +01:00
Frederich Munch
7ee942f14e
Windows: Avoid mangling Dtor_Comdat
2016-12-15 14:29:09 +01:00
Frederich Munch
8644c890f4
Windows: Fix crash on unloading of Dtor_Comdat destructors.
2016-12-15 14:29:09 +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
bedf4302e4
Avoid unnecessary string allocations.
2016-12-14 09:29:10 +01:00
Frederich Munch
f7e4bb2615
Add default for MetaProcessor::process Value argument.
2016-12-14 09:29:10 +01:00
Frederich Munch
d4aed2527d
Add CLING_EXPORT macro.
2016-12-12 12:44:09 +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