summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
Commit message (Collapse)AuthorAgeFilesLines
* [lldb][NFC] Remove GetASTContext call in ClangPersistentVariablesRaphael Isemann2019-12-281-2/+10
| | | | | | | | We try to build a CompilerType from the persistent decls so we need a ClangASTContext. With this patch the ClangPersistentVariables store the associated ClangASTContext of the persistent decls (which is always the scratch ClangASTContext) and no longer call GetASTContext to map back from clang::ASTContext to ClangASTContext.
* [lldb] Print better diagnostics for user expressions and modulesRaphael Isemann2019-09-181-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently our expression evaluators only prints very basic errors that are not very useful when writing complex expressions. For example, in the expression below the user made a type error, but it's not clear from the diagnostic what went wrong: ``` (lldb) expr printf("Modulos are:", foobar%mo1, foobar%mo2, foobar%mo3) error: invalid operands to binary expression ('int' and 'double') ``` This patch enables full Clang diagnostics in our expression evaluator. After this patch the diagnostics for the expression look like this: ``` (lldb) expr printf("Modulos are:", foobar%mo1, foobar%mo2, foobar%mo3) error: <user expression 1>:1:54: invalid operands to binary expression ('int' and 'float') printf("Modulos are:", foobar%mo1, foobar%mo2, foobar%mo3) ~~~~~~^~~~ ``` To make this possible, we now emulate a user expression file within our diagnostics. This prevents that the user is exposed to our internal wrapper code we inject. Note that the diagnostics that refer to declarations from the debug information (e.g. 'note' diagnostics pointing to a called function) will not be improved by this as they don't have any source locations associated with them, so caret or line printing isn't possible. We instead just suppress these diagnostics as we already do with warnings as they would otherwise just be a context message without any context (and the original diagnostic in the user expression should be enough to explain the issue). Fixes rdar://24306342 Reviewers: JDevlieghere, aprantl, shafik, #lldb Reviewed By: JDevlieghere, #lldb Subscribers: usaxena95, davide, jingham, aprantl, arphaman, kadircet, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D65646 llvm-svn: 372203
* Revert "[lldb] Move redundant persistent variable counter to ↵Adrian Prantl2019-08-271-10/+0
| | | | | | | | | | | | ClangPersistentVariables" This reverts commit r367842 since it wasn't quite as NFC as advertised and broke Swift support. See https://reviews.llvm.org/D46083 for the rationale behind the original functionality. rdar://problem/54619322 llvm-svn: 370126
* [lldb][NFC] Fix documentation for ↵Raphael Isemann2019-08-051-2/+2
| | | | | | ClangPersistentVariables::m_next_persistent_variable_id llvm-svn: 367857
* [lldb][NFC] Clang format GetNextPersistentVariableName signatureRaphael Isemann2019-08-051-1/+1
| | | | llvm-svn: 367843
* [lldb] Move redundant persistent variable counter to ClangPersistentVariablesRaphael Isemann2019-08-051-2/+12
| | | | | | | | | | | | | | | | | Currently Target::m_next_persistent_variable_index is counting up for our persistent variables ($0, $1, ...) but we also have a unused counter that is supposed to do this in ClangPersistentVariables but that stays always at 0 (because we currently increase the target counter when we should increase that unused counter). This patch removes the counter in Target and lets the documented counter in ClangPersistentVariables do the variable counting. Patch *should* be NFC, but it might unexpectedly bring LLDB to new code paths that could contain exciting new bugs to fix. llvm-svn: 367842
* [Expression] Add PersistentExpressionState::GetCompilerTypeFromPersistentDeclAlex Langford2019-06-121-0/+3
| | | | | | | | | | | | | | | | Summary: PersistentStateExpressions (e.g. ClangPersistentVariables) have the ability to define types using expressions that persist throughout the debugging session. GetCompilerTypeFromPersistentDecl is a useful operation to have if you need to use any of those persistently declared types, like in CommandObjectMemory. This decouples clang from CommandObjectMemory and decouples Plugins from Commands in general. Differential Revision: https://reviews.llvm.org/D62797 llvm-svn: 363183
* [NFC] Remove ASCII lines from commentsJonas Devlieghere2019-04-101-4/+0
| | | | | | | | | | | | | | | | | | | | | | | A lot of comments in LLDB are surrounded by an ASCII line to delimit the begging and end of the comment. Its use is not really consistent across the code base, sometimes the lines are longer, sometimes they are shorter and sometimes they are omitted. Furthermore, it looks kind of weird with the 80 column limit, where the comment actually extends past the line, but not by much. Furthermore, when /// is used for Doxygen comments, it looks particularly odd. And when // is used, it incorrectly gives the impression that it's actually a Doxygen comment. I assume these lines were added to improve distinguishing between comments and code. However, given that todays editors and IDEs do a great job at highlighting comments, I think it's worth to drop this for the sake of consistency. The alternative is fixing all the inconsistencies, which would create a lot more churn. Differential revision: https://reviews.llvm.org/D60508 llvm-svn: 358135
* Bring Doxygen comment syntax in sync with LLVM coding style.Adrian Prantl2019-03-111-1/+1
| | | | | | This changes '@' prefix to '\'. llvm-svn: 355841
* Pass ConstString by value (NFC)Adrian Prantl2019-03-061-3/+3
| | | | | | | | | | | | | | | | | My apologies for the large patch. With the exception of ConstString.h itself it was entirely produced by sed. ConstString has exactly one const char * data member, so passing a ConstString by reference is not any more efficient than copying it by value. In both cases a single pointer is passed. But passing it by value makes it harder to accidentally return the address of a local object. (This fixes rdar://problem/48640859 for the Apple folks) Differential Revision: https://reviews.llvm.org/D59030 llvm-svn: 355553
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Remove header grouping comments.Jonas Devlieghere2018-11-111-4/+0
| | | | | | | | This patch removes the comments grouping header includes. They were added after running IWYU over the LLDB codebase. However they add little value, are often outdates and burdensome to maintain. llvm-svn: 346626
* Enable AUTOBRIEF in doxygen configuration.Adrian Prantl2018-05-021-3/+2
| | | | | | | | | | | | | | This brings the LLDB configuration closer to LLVM's and removes visual clutter in the source code by removing the @brief commands from comments. This patch also reflows the paragraphs in all doxygen comments. See also https://reviews.llvm.org/D46290. Differential Revision: https://reviews.llvm.org/D46321 llvm-svn: 331373
* Refactor GetNextPersistentVariableName into a non-virtual methodAdrian Prantl2018-04-301-9/+4
| | | | | | | | | | | | that takes a prefix string. This simplifies the implementation and allows plugins such as the Swift plugin to supply different prefixes for return and error variables. rdar://problem/39299889 Differential Revision: https://reviews.llvm.org/D46088 llvm-svn: 331235
* Move the persistent variable counter into TargetAdrian Prantl2018-04-301-1/+1
| | | | | | | | | | | | | | | | | so it can be shared across multiple language plugins. In a multi-language project it is counterintuitive to have a result variables reuse numbers just because they are using a different language plugin in LLDB (but not for example, when they are Objective-C versus C++, since they are both handled by Clang). This is NFC on llvm.org except for the Go plugin. rdar://problem/39299889 Differential Revision: https://reviews.llvm.org/D46083 llvm-svn: 331234
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-67/+60
| | | | | | | | | | | | | | | | | | | | | | | *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
* Removed an override of LookupSymbol that mistakenly disabled it for Clang.Sean Callanan2016-03-281-3/+0
| | | | llvm-svn: 264659
* Handle any persistent Decl in the Clang expression parser, not just types.Sean Callanan2016-03-191-6/+6
| | | | | | | | | | Persistent decls have traditionally only been types. However, we want to be able to persist more things, like functions and global variables. This changes some of the nomenclature and the lookup rules to make this possible. <rdar://problem/22864976> llvm-svn: 263864
* Fix Clang-tidy modernize-use-override warnings in some files in ↵Eugene Zelenko2015-10-211-12/+12
| | | | | | | | source/Plugins; other minor fixes. Differential Revision: http://reviews.llvm.org/D13916 llvm-svn: 250872
* Eliminated redundant "constructors" for ClangExpressionVariable. ↵Sean Callanan2015-10-011-4/+4
| | | | | | | | | | | | | The ClangExpressionVariable::CreateVariableInList functions looked cute, but caused more confusion than they solved. I removed them, and instead made sure that there are adequate facilities for easily adding newly-constructed ExpressionVariables to lists. I also made some of the constructors that are common be generic, so that it's possible to construct expression variables from generic places (like the ABI and ValueObject) without having to know the specifics about the class. llvm-svn: 249095
* Changed PersistentExpressionState to allow symbol lookups. Clang doesn'tSean Callanan2015-10-011-0/+3
| | | | | | report any (yet). llvm-svn: 248970
* Now persistent expression data no longer lives with the Target, but rather withSean Callanan2015-09-301-3/+15
| | | | | | | | | | 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/+91
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