summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add a DiagnosticManager replace error streams in the expression parser.Sean Callanan2016-03-191-25/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to do a better job presenting errors that occur when evaluating expressions. Key to this effort is getting away from a model where all errors are spat out onto a stream where the client has to take or leave all of them. To this end, this patch adds a new class, DiagnosticManager, which contains errors produced by the compiler or by LLDB as an expression is created. The DiagnosticManager can dump itself to a log as well as to a string. Clients will (in the future) be able to filter out the errors they're interested in by ID or present subsets of these errors to the user. This patch is not intended to change the *users* of errors - only to thread DiagnosticManagers to all the places where streams are used. I also attempt to standardize our use of errors a bit, removing trailing newlines and making clients omit 'error:', 'warning:' etc. and instead pass the Severity flag. The patch is testsuite-neutral, with modifications to one part of the MI tests because it relied on "error: error:" being erroneously printed. This patch fixes the MI variable handling and the testcase. <rdar://problem/22864976> llvm-svn: 263859
* Revert "Track expression language from one place in ClangExpressionParser"Ewan Crawford2016-03-101-7/+9
| | | | | | r263099 seems to have broken some OSX tests llvm-svn: 263107
* Track expression language from one place in ClangExpressionParserEwan Crawford2016-03-101-9/+7
| | | | | | | | | | The current expression language is currently tracked in a few places within the ClangExpressionParser constructor. This patch adds a private lldb::LanguageType attribute to the ClangExpressionParser class and tracks the expression language from that one place. Author: Luke Drummond <luke.drummond@codeplay.com> Differential Revision: http://reviews.llvm.org/D17719 llvm-svn: 263099
* Update after r262737 in clang changed the accessor.James Y Knight2016-03-041-1/+1
| | | | llvm-svn: 262739
* Improve readability and performance of ↵Aidan Dodds2016-02-251-5/+4
| | | | | | | | | | ClangExpressionParser::FindFunctionInModule Committed on behalf of: Luke Drummond Differential Revision: http://reviews.llvm.org/D17274 llvm-svn: 261861
* refactor/cleanup ClangExpressionParser::ParseEwan Crawford2016-02-191-33/+20
| | | | | | | | | | | | | | | This patches does the following: + fix return type: ClangExpressionParser::Parse returns unsigned, but was actually returning a signed value, num_errors. + use helper clang::TextDiagnosticBuffer::getNumErrors() instead of counting the errors ourself. + limit scoping of block-level automatic variables as much as practical. + remove reused multipurpose TextDiagnosticBuffer::const_iterator in favour of loop-scoped err, warn, and note variables in the diagnostic printing code. + refactor diagnostic printing loops to use a proper loop invariant. Author: Luke Drummond <luke.drummond@codeplay.com> Differential Revision: http://reviews.llvm.org/D17273 llvm-svn: 261345
* Delete unused function in ClangExpressionParserEwan Crawford2016-02-191-15/+0
| | | | | | | | | | | | [git 65dafa83] introduced the GetBuiltinIncludePath function copied from cfe/lib/Driver/CC1Options.cpp This function is no longer used in lldb's expression parser and I believe it is safe to remove it. Author: Luke Drummond <luke.drummond@codeplay.com> Differential Revision: http://reviews.llvm.org/D17266 llvm-svn: 261328
* [LLDB][MIPS] Provide CPU string to compiler for appropriate code generation ↵Bhushan D. Attarde2016-02-181-4/+14
| | | | | | | | | | | | | | | for MIPS SUMMARY: This patch implements ArchSpec::GetClangTargetCPU() that provides string representing current architecture as a target CPU. This string is then passed to tools like clang so that they generate correct code for that target. Reviewers: clayborg, zturner Subscribers: mohit.bhakkad, sagar, jaydeep, lldb-commits Differential Revision: http://reviews.llvm.org/D17022 llvm-svn: 261206
* Add -Wimplicit-fallthrough command line option to clang inJason Molenda2016-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the xcode project file to catch switch statements that have a case that falls through unintentionally. Define LLVM_FALLTHROUGH to indicate instances where a case has code and intends to fall through. This should be in llvm/Support/Compiler.h; Peter Collingbourne originally checked in there (r237766), then reverted (r237941) because he didn't have time to mark up all the 'case' statements that were intended to fall through. I put together a patch to get this back in llvm http://reviews.llvm.org/D17063 but it hasn't been approved in the past week. I added a new lldb-private-defines.h to hold the definition for now. Every place in lldb where there is a comment that the fall-through is intentional, I added LLVM_FALLTHROUGH to silence the warning. I haven't tried to identify whether the fallthrough is a bug or not in the other places. I haven't tried to add this to the cmake option build flags. This warning will only work for clang. This build cleanly (with some new warnings) on macosx with clang under xcodebuild, but if this causes problems for people on other configurations, I'll back it out. llvm-svn: 260930
* Centralized symbol lookup in IRExecutionUnit, and fixed the code model.Sean Callanan2016-02-121-0/+12
| | | | | | | | | | | | | I'm preparing to remove symbol lookup from IRForTarget, where it constitutes a dreadful hack working around no-longer-existing JIT bugs. Thanks to our contributors, IRForTarget has a lot of smarts that IRExecutionUnit doesn't have, so I've cleaned them up a bit and moved them over to IRExecutionUnit. Also for historical reasons, IRExecutionUnit used the "Small" code model on non- ELF platforms (namely, OS X). That's no longer necessary, and we can use the same code model as everyone else on OS X. I've fixed that. llvm-svn: 260734
* Add ability to override JIT expr compiler options.Aidan Dodds2016-02-031-25/+78
| | | | | | | | | Runtimes should be able to pass custom compilation options to the JIT for their stack frame. This patch adds a custom expression options member class to LanguageOptions, and modifies the clang expression evaluator to check the current runtime for those options. If those options are available on the runtime, they are passed to the clang compiler. Committed for Luke Drummond. Differential Revision: http://reviews.llvm.org/D15527 llvm-svn: 259644
* Fix build after clang interface change in r259489Pavel Labath2016-02-021-3/+3
| | | | llvm-svn: 259494
* Add IRExecutionUnitSP to lldb-forward and use it instead of hand-rolling in ↵Jim Ingham2015-11-051-1/+1
| | | | | | place. llvm-svn: 252129
* Fix Clang-tidy modernize-use-override warnings in some files in ↵Eugene Zelenko2015-10-211-33/+39
| | | | | | | | source/Plugins; other minor fixes. Differential Revision: http://reviews.llvm.org/D13916 llvm-svn: 250872
* Reduce header inclusion in Expression.Bruce Mitchener2015-10-071-0/+1
| | | | | | | | | | Reviewers: spyffe Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13333 llvm-svn: 249570
* Made Target hold a map of languages to TypeSystems, and added some accessors.Sean Callanan2015-10-011-1/+1
| | | | | | | | Also added some target-level search functions so that persistent variables and symbols can be searched for without hand-iterating across the map of TypeSystems. llvm-svn: 249027
* Now persistent expression data no longer lives with the Target, but rather withSean Callanan2015-09-301-1/+2
| | | | | | | | | | the corresponding TypeSystem. This makes sense because what kind of data there is -- and how it can be looked up -- depends on the language. Functionality that is common to all type systems is factored out into PersistentExpressionState. llvm-svn: 248934
* Moved more Clang-specific parts of the expression parser into the Clang plugin.Sean Callanan2015-09-251-0/+649
There are still a bunch of dependencies on the plug-in, but this helps to identify them. There are also a few more bits we need to move (and abstract, for example the ClangPersistentVariables). llvm-svn: 248612
OpenPOWER on IntegriCloud