Commit Graph

10 Commits

Author SHA1 Message Date
Zachary Turner 97206d5727 Rename Error -> Status.
This renames the LLDB error class to Status, as discussed
on the lldb-dev mailing list.

A change of this magnitude cannot easily be done without
find and replace, but that has potential to catch unwanted
occurrences of common strings such as "Error".  Every effort
was made to find all the obvious things such as the word "Error"
appearing in a string, etc, but it's possible there are still
some lingering occurences left around.  Hopefully nothing too
serious.

llvm-svn: 302872
2017-05-12 04:51:55 +00:00
Zachary Turner 6f9e690199 Move Log from Core -> Utility.
All references to Host and Core have been removed, so this
class can now safely be lowered into Utility.

Differential Revision: https://reviews.llvm.org/D30559

llvm-svn: 296909
2017-03-03 20:56:28 +00:00
Zachary Turner bf9a77305f Move classes from Core -> Utility.
This moves the following classes from Core -> Utility.

ConstString
Error
RegularExpression
Stream
StreamString

The goal here is to get lldbUtility into a state where it has
no dependendencies except on itself and LLVM, so it can be the
starting point at which to start untangling LLDB's dependencies.
These are all low level and very widely used classes, and
previously lldbUtility had dependencies up to lldbCore in order
to use these classes.  So moving then down to lldbUtility makes
sense from both the short term and long term perspective in
solving this problem.

Differential Revision: https://reviews.llvm.org/D29427

llvm-svn: 293941
2017-02-02 21:39:50 +00:00
Alexander Shaposhnikov 696bd63550 [lldb] Fix typos in file headers
This diff fixes typos in file headers (incorrect file names).

Test plan:

Under llvm/tools/lldb/source:
find ./* -type f | grep -e '\(cpp\|h\)$' | while read F; do B=$(basename $F); echo $F head -n 1 $F | grep -v $B | wc -l ; done

Differential revision: https://reviews.llvm.org/D27115

llvm-svn: 287966
2016-11-26 05:23:44 +00:00
Kate Stone b9c1b51e45 *** This commit represents a complete reformatting of the LLDB source code
*** 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
2016-09-06 20:57:50 +00:00
Jim Ingham dae50baf44 UtilityFunction::MakeFunctionCaller uses the Error to report failure,
but when there's was no process it was just returning an null pointer
and not setting the error.  I don't have a scenario where this might
go wrong, just code inspection...

llvm-svn: 267594
2016-04-26 19:46:39 +00:00
Jim Ingham 6896b35585 Compilation can end up calling functions (e.g. to resolve indirect functions) so I added
a way for compilation to take a "thread to use for compilation".  If it isn't set then the
compilation will use the currently selected thread.  This should help keep function execution
to the one thread intended.

llvm-svn: 263972
2016-03-21 19:21:13 +00:00
Sean Callanan 579e70c9b0 Add a DiagnosticManager replace error streams in the expression parser.
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
2016-03-19 00:03:59 +00:00
Bruce Mitchener 804f981fd0 Reduce header inclusion in Expression.
Reviewers: spyffe

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D13333

llvm-svn: 249570
2015-10-07 17:22:54 +00:00
Jim Ingham 151c032c86 This patch makes Clang-independent base classes for all the expression types that lldb currently vends.
Before we had:

ClangFunction
ClangUtilityFunction
ClangUserExpression

and code all over in lldb that explicitly made Clang-based expressions. This patch adds an Expression 
base class, and three pure virtual implementations for the Expression kinds:

FunctionCaller
UtilityFunction
UserExpression

You can request one of these expression types from the Target using the Get<ExpressionType>ForLanguage. 
The Target will then consult all the registered TypeSystem plugins, and if the type system that matches 
the language can make an expression of that kind, it will do so and return it.

Because all of the real expression types need to communicate with their ExpressionParser in a uniform way, 
I also added a ExpressionTypeSystemHelper class that expressions generically can vend, and a ClangExpressionHelper 
that encapsulates the operations that the ClangExpressionParser needs to perform on the ClangExpression types. 
Then each of the Clang* expression kinds constructs the appropriate helper to do what it needs.

The patch also fixes a wart in the UtilityFunction that to use it you had to create a parallel FunctionCaller 
to actually call the function made by the UtilityFunction. Now the UtilityFunction can be asked to vend a 
FunctionCaller that will run its function. This cleaned up a lot of boiler plate code using UtilityFunctions.

Note, in this patch all the expression types explicitly depend on the LLVM JIT and IR, and all the common 
JIT running code is in the FunctionCaller etc base classes. At some point we could also abstract that dependency 
but I don't see us adding another back end in the near term, so I'll leave that exercise till it is actually necessary.

llvm-svn: 247720
2015-09-15 21:13:50 +00:00