History log of /external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
52f792329be5db8e38961350589e97e8f2823acd 12-Jul-2013 Greg Clayton <gclayton@apple.com> Huge change to clean up types.

A long time ago we start with clang types that were created by the symbol files and there were many functions in lldb_private::ClangASTContext that helped. Later we create ClangASTType which contains a clang::ASTContext and an opauque QualType, but we didn't switch over to fully using it. There were a lot of places where we would pass around a raw clang_type_t and also pass along a clang::ASTContext separately. This left room for error.

This checkin change all type code over to use ClangASTType everywhere and I cleaned up the interfaces quite a bit. Any code that was in ClangASTContext that was type related, was moved over into ClangASTType. All code that used these types was switched over to use all of the new goodness.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@186130 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
2ce786d8238bbfb4f1cde19d5340d646631e499f 19-Apr-2013 Sean Callanan <scallanan@apple.com> Removed 2800+ lines of code that no longer do anything
now that the IR interpreter and the JIT share the same
materialization codepaths.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179842 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
102b2c2681c9a830afe25bfea35557421905e42c 19-Apr-2013 Greg Clayton <gclayton@apple.com> After discussing with Chris Lattner, we require C++11, so lets get rid of the macros and just use C++11.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179805 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
81a96aa6242f7b559770f5dc62316253cb8cb0d4 18-Apr-2013 Greg Clayton <gclayton@apple.com> Since we use C++11, we should switch over to using std::unique_ptr when C++11 is being used. To do this, we follow what we have done for shared pointers and we define a STD_UNIQUE_PTR macro that can be used and it will "do the right thing". Due to some API differences in std::unique_ptr and due to the fact that we need to be able to compile without C++11, we can't use move semantics so some code needed to change so that it can compile with either C++.

Anyone wanting to use a unique_ptr or auto_ptr should now use the "STD_UNIQUE_PTR(TYPE)" macro.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
13615cfef0435af28ccc1e93e13c6161e94585ed 17-Apr-2013 Sean Callanan <scallanan@apple.com> Updated the IRInterpreter to work with an
IRMemoryMap rather than through its own memory
abstraction. This considerably simplifies the
code, and makes it possible to run the
IRInterpreter multiple times on an already-parsed
expression in the absence of a ClangExpressionDeclMap.

Changes include:

- ClangExpressionDeclMap's interface methods
for the IRInterpreter now take IRMemoryMap
arguments. They are not long for this world,
however, since the IRInterpreter will soon be
working with materialized variables.

- As mentioned above, removed the Memory class
from the IR interpreter altogether. It had a
few functions that remain useful, such as
keeping track of Values that have been placed
in memory, so I moved those into methods on
InterpreterStackFrame.

- Changed IRInterpreter to work with lldb::addr_t
rather than Memory::Region as its primary
currency.

- Fixed a bug in the IRMemoryMap where it did not
report correct address byte size and byte order
if no process was present, because it was using
Target::GetDefaultArchitecture() rather than
Target::GetArchitecture().

- Made IRMemoryMap methods clear the Errors they
receive before running. Having to do this by
hand is just annoying.

The testsuite seems happy with these changes, but
please let me know if you see problems (especially
in use cases without a process).


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179675 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
a6686e36cd56843e594139324884585fb47b918b 17-Apr-2013 Sean Callanan <scallanan@apple.com> Flipped the big switch: LLDB now uses the new
Materializer for all expressions that need to
run in the target. This includes the following
changes:

- Removed a bunch of (de-)materialization code
from ClangExpressionDeclMap and assumed the
presence of a Materializer where we previously
had a fallback.

- Ensured that an IRMemoryMap is passed into
ClangExpressionDeclMap::Materialize().

- Fixed object ownership on LLVMContext; it is
now owned by the IRExecutionUnit, since the
Module and the ExecutionEngine both depend on
its existence.

- Fixed a few bugs in IRMemoryMap and the
Materializer that showed up during testing.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179649 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
3b16eb9d424068446fea9cd0e0fe5e7d435f5b6e 11-Apr-2013 Sean Callanan <scallanan@apple.com> Added a Materializer class that contains
information about each variable that needs to
be materialized for an expression to work. The
next step is to migrate all materialization code
from ClangExpressionDeclMap to Materializer, and
to use it for variable materialization.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179245 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
dbf2fb0d760631d86ab93cc70c3bb05a4c514263 01-Feb-2013 Sean Callanan <scallanan@apple.com> Modified the expression parser's class wrapper to
support reporting "this" as a templated class. The
expression parser wraps expressions in C++ methods
as methods with the signature

$__lldb_class::$__lldb_expr(...)

and previously responded to clang's queries about
$__lldb_class with the type of *this. This didn't
work if *this was a ClassTemplateSpecializationDecl
because ClassTemplateSpecializationDecls can't be
the result of simple name queries.

Instead what we do now is respond that $__lldb_class
is a typedef and that the target of the typedef is
the (potentially templated) type of *this. That is
much more robust.

Thanks to John McCall for key insights.

<rdar://problem/10987183>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@174153 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
c6bdc75b993e8e16c0c035e3c6a59891568f03a4 18-Jan-2013 Sean Callanan <scallanan@apple.com> Made the expression handle variables with
DW_AT_const_value instead of a location. Also
added a testcase covering "frame variable," "expr"
using the IR interpreter, and "expr" using the
LLVM JIT.

<rdar://problem/12978195>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@172848 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
31903318116cbd66801cd2a526cc5e5873d20e4c 16-Jan-2013 Sean Callanan <scallanan@apple.com> ClangExpressionVariable previously was not capable of
handling multiple clients. However, occasionally an
expression must be run in the service of another
expression, and in this case two parsers need to access
the same list of persistent variables.

To allow this, persistent variables now provide state
for multiple parsers, and parsers must allocate, access,
and deallocate this state by providing their own ID
(at the moment, simply the value of the "this" pointer).

<rdar://problem/12914539>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@172573 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
01e6a58b057676d5dc434876dbb2d54871bb962e 27-Nov-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/12106825>

Allow the expression parser to see more than just data symbols. We now accept any symbol that has an address. We take precautions to only accept symbols by their mangled or demangled names only if the demangled name was not synthesized. If the demangled name is synthesized, then we now mark symbols accordingly and only compare against the mangled original name.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@168668 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
d27e543e9c5f81ef1288afbc9e48de2da5976a8a 15-Nov-2012 Sean Callanan <scallanan@apple.com> In cases where the Objective-C ivar symbols are stripped out,
expressions that refer to ivars will not work because Clang
emits IR that refers to them to get the ivar offsets.
However, it is possible to search the runtime for these values.

I have added support for reading the relevant tables to the
Objective-C runtime, and extended ClangExpressionDeclMap to
query that information if and only if it doesn't find the symbols
in the binary.

Also added a testcase.

<rdar://problem/12628122>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@168018 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
39d1af981f6a76603356fd84b2e9372a9172297c 21-May-2012 Sean Callanan <scallanan@apple.com> Fixed a nasty bug where JIT expressions didn't work
when stopped in a const method. Also updated our
testsuite to ensure that JIT is forced in this case.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@157208 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
70c6cf4b614cd79a54cf1a8696f7b4c963229868 18-Feb-2012 Sean Callanan <scallanan@apple.com> Ignore the constness of the object pointer when
fetching it.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150861 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
52d0d027dd38518e4b0cfb135a5d50a6652c5daf 15-Feb-2012 Sean Callanan <scallanan@apple.com> Previoously the expression parser had to rely on the
JIT when printing the values of registers (e.g.,
"expr $pc"). Now the expression parser can do this
in the IR interpreter without running code in the
inferior process.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150554 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
dd1dcfdbad297562951169ad621f895daf32b382 10-Feb-2012 Sean Callanan <scallanan@apple.com> Fixed a bunch of ownership problems with the expression
parser. Specifically:

- ClangUserExpression now keeps weak pointers to the
structures it needs and then locks them when needed.
This ensures that they continue to be valid without
leaking memory if the ClangUserExpression is long
lived.

- ClangExpressionDeclMap, instead of keeping a pointer
to an ExecutionContext, now contains an
ExecutionContext. This prevents bugs if the pointer
or its contents somehow become stale. It also no
longer requires that ExecutionContexts be passed
into any function except its initialization function,
since it can count on the ExecutionContext still
being around.

There's a lot of room for improvement (specifically,
ClangExpressionDeclMap should also use weak pointers
insetad of shared pointers) but this is an important
first step that codifies assumptions that already
existed in the code.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
8f2e392e8937aaf66f91201dc5f4190d61902c67 04-Feb-2012 Sean Callanan <scallanan@apple.com> I have brought LLDB up-to-date with top of tree
LLVM/Clang. This brings in several fixes, including:

- Improvements in the Just-In-Time compiler's
allocation of memory: the JIT now allocates
memory in chunks of sections, improving its
ability to generate relocations. I have
revamped the RecordingMemoryManager to reflect
these changes, as well as to get the memory
allocation and data copying out fo the
ClangExpressionParser code. Jim Grosbach wrote
the updates to the JIT on the LLVM side.

- A new ExternalASTSource interface to allow LLDB to
report accurate structure layout information to
Clang. Previously we could only report the sizes
of fields, not their offsets. This meant that if
data structures included field alignment
directives, we could not communicate the necessary
alignment to Clang and accesses to the data would
fail. Now we can (and I have update the relevant
test case). Thanks to Doug Gregor for implementing
the Clang side of this fix.

- The way Objective-C interfaces are completed by
Clang has been made consistent with RecordDecls;
with help from Doug Gregor and Greg Clayton I have
ensured that this still works.

- I have eliminated all local LLVM and Clang patches,
committing the ones that are still relevant to LLVM
and Clang as needed.

I have tested the changes extensively locally, but
please let me know if they cause any trouble for you.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149775 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
21ef5bb658e4582339bedf5befc10c13953bdac0 01-Dec-2011 Sean Callanan <scallanan@apple.com> Made symbol lookup in the expression parser more
robust:

- Now a client can specify what kind of symbols
are needed; notably, this allows looking up
Objective-C class symbols specifically.

- In the class of symbols being looked up, if
one is non-NULL and others are NULL, LLDB now
prefers the non-NULL one.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@145554 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
89e7df3ebb2591e93a92913be4d483c30df777a3 29-Nov-2011 Sean Callanan <scallanan@apple.com> Modified ClangExpressionDeclMap to use existing
ValueObjects when creating variables referring to
live data rather than constructing
ValueObjectConstResults.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@145437 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
e9cd03af38f048f191425bdaf9f7cc2a7f936b9d 15-Nov-2011 Sean Callanan <scallanan@apple.com> Removed the ClangASTImporter pointer from
ClangExpressionDeclMap, which actually uses the
one it inherits from ClangASTSource.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@144702 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
97c8957257a3e0b3ce6f46f8e5a28c965e30f357 31-Oct-2011 Daniel Dunbar <daniel@zuster.org> warnings: Fix a bunch of -Wreorder problems.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@143381 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
9394b5aaa5aafcf95d21d27371fa0a6548790a57 29-Oct-2011 Sean Callanan <scallanan@apple.com> Cloned FindExternalVisibleDecls from
ClangExpressionDeclMap to ClangASTSource, and
moved all general type and namespace lookups
into ClangASTSource. Now ClangASTSource is ready
to complete types given nothing more than a target
and an AST context.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@143292 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
bb715f9c0a70d9e8763772d673ce0620cfbc2d34 29-Oct-2011 Sean Callanan <scallanan@apple.com> Moved FindExternalLexicalDecls and a few smaller
functions from ClangExpressionDeclMap to ClangASTSource.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@143276 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
73b520f4f60dca58e58e446c9504d45384ee677b 29-Oct-2011 Sean Callanan <scallanan@apple.com> I moved the responsibility for interacting with the
AST importer on completing namespace mappings from
ClangExpressionDeclMap to ClangASTSource.

ClangASTSource now contains a TargetSP which it
uses to lookup namespaces in all of a target's
modules. I will use the TargetSP in the future to
look up globals.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@143275 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
f76afff22617c3f632af58ffebe1f037ba935717 29-Oct-2011 Sean Callanan <scallanan@apple.com> As part of a general refactoring of ClangASTSource to
allow it to complete types on behalf of any AST context
(including the "scratch" AST context associated with
the target), I scrapped its role as intermediary between
the Clang parser and ClangExpressionDeclMap, and instead
made ClangExpressionDeclMap inherit from ClangASTSource.

After this, I will migrate the functions that complete
types and perform namespace lookups from
ClangExpressionDeclMap to ClangASTSource. Ultimately
ClangExpressionDeclMap's only responsiblity will be to
look up variables and ensure that they are materialized
and dematerialized correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@143253 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
4b3cef072258eb17bd387ca7c7be18b6451fe09a 26-Oct-2011 Sean Callanan <scallanan@apple.com> Extended the IR interpreter to handle the variables
"_cmd", "this", and "self". These variables are handled
differently from all other external variables used by
the expression. Other variables are used indirectly
through the $__lldb_arg operand; only _cmd, this, and
self are passed directly through the ABI.

There are two modifications:

- I added a function to ClangExpressionDeclMap that
retrives the value of one of these variables by name;
and

- I made IRInterpreter fetch these values when needed,
and ensured that the proper level of indirection is
used.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@143065 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
c7ca466fa99aea0e4e81530157bc8927682cae00 25-Oct-2011 Sean Callanan <scallanan@apple.com> Improved handling of static data in the expression
parser. Now expression like the following work as
expected:

-
(lldb) expr struct { int a; int b; } $blah = { 10, 20 }
<no result>
(lldb) expr $blah
(<anonymous struct at Parse:6:5>) $blah = {
(int) a = 10
(int) b = 20
}
-

Now the IRForTarget subsystem knows how to handle
static initializers of various composite types.

Also removed an unnecessary parameter from
ClangExpressionDeclMap::GetFunctionInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@142936 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
a7cb1fa9d7d9c71fc2a5d9946cbec8e928baa5b9 22-Oct-2011 Sean Callanan <scallanan@apple.com> Implemented an extension to the namespace map that
permits a namespace map to be created and populated
when the namespace is imported, not just when it is
requested via FindExternalVisibleDecls().


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@142690 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
557ccd6b47c5d4b3736e704e7f1e887a7fff6549 21-Oct-2011 Sean Callanan <scallanan@apple.com> Made the IR interpreter more robust in the presence
of arbitrary pointers, allowing direct dereferences
of literal addresses. Also disabled special-cased
generation of certain expression results (especially
casts), substituting the IR interpreter.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@142638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
e3737fdca55be5c078534cc49fb38db409d12e32 18-Oct-2011 Sean Callanan <scallanan@apple.com> Improved logging, replacing the old ASTDumper (which
we never used) with a much simpler class that wraps
the relevant dump functions in Clang. This class also
knows to disable external lookups on DeclContexts
being dumped so it should be safe to print incomplete
Decls.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@142359 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
67bbb1103c5a49b7c994750e90ae7ed130daa3ae 14-Oct-2011 Sean Callanan <scallanan@apple.com> Improved expression logging. Now all calls to
FindExternalVisibleDecls and FindExternalLexicalDecls
are marked and given unique IDs, so that all logging
done as part of their execution can be traced back to
the proper call.

Also there was some logging that really wasn't helpful
in most cases so I disabled it unless verbose logging
(log enable -v lldb expr) is enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
aa4a553d4b8cd37f13bd4946f504265000a7bcc4 13-Oct-2011 Sean Callanan <scallanan@apple.com> Removed namespace qualification from symbol queries.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
4a07832dc5028af55cacf247bedad9933bf8afdc 13-Oct-2011 Sean Callanan <scallanan@apple.com> Now that we know the values are going to stick around,
we don't need to look them up again when materializing.

Switched over the materialization mechanism (for JIT
expressions) and the lookup mechanism (for interpreted
expressions) to use the VariableSP/Symbol that were
found during parsing.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141839 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
0eca1a7136ec5a48d8cf97decf157dc04c93512a 12-Oct-2011 Sean Callanan <scallanan@apple.com> Added support to ClagnExpressionDeclMap for finding
data symbols in namespaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
94cd0cac9117f12cf05bab3e836029f15a62024b 12-Oct-2011 Sean Callanan <scallanan@apple.com> Made FindGlobalVariable() optionally search a specific
module and namespace. Also made it use FindGlobalVariables()
instead of the more heavyweight
GetVariablesForVariableExpressionPath().


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141783 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
03f64ca626d4dc0488e6acfe7023e4e376b4df30 12-Oct-2011 Sean Callanan <scallanan@apple.com> Cleanups in preparation for making FindExternalVisibleDecls
look in individual modules rather than globally.

Also some whitespace fixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141765 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
16b53ab189392cb30056ce1bbc24202cb935bf15 12-Oct-2011 Sean Callanan <scallanan@apple.com> Implemented a namespace map that allows searching
of namespaces (only in the modules where they've
been found) for entities inside those namespaces.

For each NamespaceDecl that has been imported into
the parser, we maintain a map containing
[ModuleSP, ClangNamespaceDecl] pairs in the ASTImporter.
This map has one entry for each module in which the
namespace has been found. When we later scan for an
entity inside a namespace, we search only the modules
in which that namespace was found.

Also made a small whitespace fix in
ClangExpressionParser.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141748 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
567e7f3ba16eb48cb9fd6a2f26f2f7269eb6983c 22-Sep-2011 Greg Clayton <gclayton@apple.com> Converted the lldb_private::Process over to use the intrusive
shared pointers.

Changed the ExecutionContext over to use shared pointers for
the target, process, thread and frame since these objects can
easily go away at any time and any object that was holding onto
an ExecutionContext was running the risk of using a bad object.

Now that the shared pointers for target, process, thread and
frame are just a single pointer (they all use the instrusive
shared pointers) the execution context is much safer and still
the same size.

Made the shared pointers in the the ExecutionContext class protected
and made accessors for all of the various ways to get at the pointers,
references, and shared pointers.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140298 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
a8428a458e779a64c8642fef5d29c7f6cc1b95f9 22-Sep-2011 Sean Callanan <scallanan@apple.com> Fixed a problem with the IR interpreter that caused
it to generate result variables that were not bound
to their underlying data. This allowed the SBValue
class to use the interpreter (if possible).

Also made sure that any result variables that point
to stack allocations in the stack frame of the
interpreted expressions do not get live data.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140285 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
47dc457387b690c5e4df1c0c7dd8c4337b92e630 15-Sep-2011 Sean Callanan <scallanan@apple.com> This patch modifies the expression parser to allow it
to execute expressions even in the absence of a process.
This allows expressions to run in situations where the
target cannot run -- e.g., to perform calculations based
on type information, or to inspect a binary's static
data.

This modification touches the following files:

lldb-private-enumerations.h
Introduce a new enum specifying the policy for
processing an expression. Some expressions should
always be JITted, for example if they are functions
that will be used over and over again. Some
expressions should always be interpreted, for
example if the target is unsafe to run. For most,
it is acceptable to JIT them, but interpretation
is preferable when possible.

Target.[h,cpp]
Have EvaluateExpression now accept the new enum.

ClangExpressionDeclMap.[cpp,h]
Add support for the IR interpreter and also make
the ClangExpressionDeclMap more robust in the
absence of a process.

ClangFunction.[cpp,h]
Add support for the new enum.

IRInterpreter.[cpp,h]
New implementation.

ClangUserExpression.[cpp,h]
Add support for the new enum, and for running
expressions in the absence of a process.

ClangExpression.h
Remove references to the old DWARF-based method
of evaluating expressions, because it has been
superseded for now.

ClangUtilityFunction.[cpp,h]
Add support for the new enum.

ClangExpressionParser.[cpp,h]
Add support for the new enum, remove references
to DWARF, and add support for checking whether
the expression could be evaluated statically.

IRForTarget.[h,cpp]
Add support for the new enum, and add utility
functions to support the interpreter.

IRToDWARF.cpp
Removed

CommandObjectExpression.cpp
Remove references to the obsolete -i option.

Process.cpp
Modify calls to ClangUserExpression::Evaluate
to pass the correct enum (for dlopen/dlclose)

SBValue.cpp
Add support for the new enum.

SBFrame.cpp
Add support for he new enum.

BreakpointOptions.cpp
Add support for the new enum.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139772 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
166ba106f9d8c377f2fda72112c821550d2e82d1 01-Aug-2011 Sean Callanan <scallanan@apple.com> Added checking to make sure that the target has a
scratch AST context before attempting to parse.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@136631 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
9b6898f3ec1dedbe1dfc8bd7cd1d82a5b10e1bb0 30-Jul-2011 Sean Callanan <scallanan@apple.com> This change brings in the latest LLVM/Clang, and
completes the support in the LLDB expression parser
for incomplete types. Clang now imports types
lazily, and we complete those types as necessary.

Changes include:

- ClangASTSource now supports three APIs which it
passes to ClangExpressionDeclMap. CompleteType
completes a TagDecl or an ObjCInterfaceDecl when
needed; FindExternalVisibleDecls finds named
entities that are visible in the expression's
scope; and FindExternalLexicalDecls performs a
(potentially restricted) search for entities
inside a lexical scope like a namespace. These
changes mean that entities in namespaces should
work normally.

- The SymbolFileDWARF code for searching a context
for a specific name is now more general, and can
search arbitrary contexts.

- We are continuing to adapt our calls into LLVM
from interfaces that take start and end iterators
when accepting multiple items to interfaces that
use ArrayRef.

- I have cleaned up some code, especially our use
of namespaces.

This change is neutral for our testsuite and greatly
improves correctness for large programs (like Clang)
with complicated type systems. It should also lay
the groundwork for improving the expression parser's
performance as we are lazier and lazier about
providing type information.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@136555 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
2bc9eb3ba78efc64a273729b480bafc3bbaa433a 19-Jul-2011 Johnny Chen <johnny.chen@apple.com> Patch by Matt Johnson to silence G++ warnings!
Used hand merge to apply the diffs. I did not apply the diffs for FormatManager.h and
the diffs for memberwise initialization for ValueObject.cpp because they changed since.
I will ask my colleague to apply them later.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@135508 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
e6d72ca9a6b22cd062136bbff039c3d8217f798a 25-Jun-2011 Greg Clayton <gclayton@apple.com> This commit adds broad architectural support for hierarchical
inspection of namespaces in the expression parser.

ClangExpressionDeclMap hitherto reported that namespaces had
been completely imported, even though the namespaces are
returned empty. To deal with this situation, ClangASTSource
was recently extended with an API to complete incomplete type
definitions, and, for greater efficiency, to complete these
definitions partially, returning only those objects that have
a given name.

This commit supports these APIs on LLDB's side, and uses it
to provide information on types resident in namespaces.
Namespaces are now imported as they were -- that is to say,
empty -- but with minimal import mode on. This means that
Clang will come back and request their contents by name as
needed. We now respond with information on the contained
types; this will be followed soon by information on functions
and variables.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@133852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
cbc07cfd435fb703d8feb69b97ca8590e6ee2fd8 23-Jun-2011 Greg Clayton <gclayton@apple.com> Fixed an issue for ARM where data symbols would alway return invalid addresses.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@133684 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
fb3058efeaacc2ced967e46842dfc4875b3daf14 13-May-2011 Sean Callanan <scallanan@apple.com> Introduced support for UnknownAnyTy, the Clang type
representing variables whose type must be inferred
from the way they are used. Functions without debug
information now return UnknownAnyTy and must be cast.

Variables with no debug information are not yet using
UnknownAnyTy; instead they are assumed to be void*.
Support for variables of unknown type is coming (and,
in fact, some relevant support functions are included
in this commit) but will take a bit of extra effort.

The testsuite has also been updated to reflect the new
requirement that the result of printf be cast, i.e.

expr (int) printf("Hello world!")


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@131263 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
0ddf806dd9e71637846bf0ad46e1b2df7d02cbce 10-May-2011 Sean Callanan <scallanan@apple.com> Fixed a bug in which expression-local variables were
treated as being permanently resident in target
memory. In fact, since the expression's stack frame
is deleted and potentially re-used after the
expression completes, the variables need to be treated
as being freeze-dried.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@131104 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
819749647b1605f75753f625050cb240292c08b0 08-May-2011 Sean Callanan <scallanan@apple.com> Added support for reading untyped symbols. Right now
they are treated as pointers of type (void*). This
allows reading of environ, for instance.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@131063 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
696cf5f6f2a77b87a4b06cdf0f697749b494665f 07-May-2011 Sean Callanan <scallanan@apple.com> Made expressions that are just casts of pointer
variables be evaluated statically.

Also fixed a bug that caused the results of
statically-evaluated expressions to be materialized
improperly.

This bug also removes some duplicate code.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@131042 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
d7d3af7201c7aed2ddd0ade31ae5d3543994c55b 11-Apr-2011 Stephen Wilson <wilsons@start.ca> Fix struct vs. class warning.

ParserVars is declared using the class keyword. This solves the warning.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@129289 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
f15996eea072cdaa8a092f22d3a1212b3d95f0ec 08-Apr-2011 Greg Clayton <gclayton@apple.com> Modified the ArchSpec to take an optional "Platform *" when setting the triple.
This allows you to have a platform selected, then specify a triple using
"i386" and have the remaining triple items (vendor, os, and environment) set
automatically.

Many interpreter commands take the "--arch" option to specify an architecture
triple, so now the command options needed to be able to get to the current
platform, so the Options class now take a reference to the interpreter on
construction.

Modified the build LLVM building in the Xcode project to use the new
Xcode project level user definitions:

LLVM_BUILD_DIR - a path to the llvm build directory
LLVM_SOURCE_DIR - a path to the llvm sources for the llvm that will be used to build lldb
LLVM_CONFIGURATION - the configuration that lldb is built for (Release,
Release+Asserts, Debug, Debug+Asserts).

I also changed the LLVM build to not check if "lldb/llvm" is a symlink and
then assume it is a real llvm build directory versus the unzipped llvm.zip
package, so now you can actually have a "lldb/llvm" directory in your lldb
sources.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@129112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
b344843f75ef893762c93fd0a22d2d45712ce74d 24-Mar-2011 Greg Clayton <gclayton@apple.com> Fixed the LLDB build so that we can have private types, private enums and
public types and public enums. This was done to keep the SWIG stuff from
parsing all sorts of enums and types that weren't needed, and allows us to
abstract our API better.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@128239 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
bdcb6abaa287df2c5f312c51d993c1d0b0cb120c 26-Jan-2011 Greg Clayton <gclayton@apple.com> Enabled extra warnings and fixed a bunch of small issues.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124250 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
c7674af9458fbad6f07fa73609c354abf93af2dc 18-Jan-2011 Sean Callanan <scallanan@apple.com> Added support for the fragile ivars provided by
Apple's Objective-C 2.0 runtime. They are enabled
if the Objective-C runtime has the proper version.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123694 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
b01000fd063629facd45044f137446fb748ee179 17-Jan-2011 Greg Clayton <gclayton@apple.com> A few of the issue I have been trying to track down and fix have been due to
the way LLDB lazily gets complete definitions for types within the debug info.
When we run across a class/struct/union definition in the DWARF, we will only
parse the full definition if we need to. This works fine for top level types
that are assigned directly to variables and arguments, but when we have a
variable with a class, lets say "A" for this example, that has a member:
"B *m_b". Initially we don't need to hunt down a definition for this class
unless we are ever asked to do something with it ("expr m_b->getDecl()" for
example). With my previous approach to lazy type completion, we would be able
to take a "A *a" and get a complete type for it, but we wouldn't be able to
then do an "a->m_b->getDecl()" unless we always expanded all types within a
class prior to handing out the type. Expanding everything is very costly and
it would be great if there were a better way.

A few months ago I worked with the llvm/clang folks to have the
ExternalASTSource class be able to complete classes if there weren't completed
yet:

class ExternalASTSource {
....

virtual void
CompleteType (clang::TagDecl *Tag);

virtual void
CompleteType (clang::ObjCInterfaceDecl *Class);
};

This was great, because we can now have the class that is producing the AST
(SymbolFileDWARF and SymbolFileDWARFDebugMap) sign up as external AST sources
and the object that creates the forward declaration types can now also
complete them anywhere within the clang type system.

This patch makes a few major changes:
- lldb_private::Module classes now own the AST context. Previously the TypeList
objects did.
- The DWARF parsers now sign up as an external AST sources so they can complete
types.
- All of the pure clang type system wrapper code we have in LLDB (ClangASTContext,
ClangASTType, and more) can now be iterating through children of any type,
and if a class/union/struct type (clang::RecordType or ObjC interface)
is found that is incomplete, we can ask the AST to get the definition.
- The SymbolFileDWARFDebugMap class now will create and use a single AST that
all child SymbolFileDWARF classes will share (much like what happens when
we have a complete linked DWARF for an executable).

We will need to modify some of the ClangUserExpression code to take more
advantage of this completion ability in the near future. Meanwhile we should
be better off now that we can be accessing any children of variables through
pointers and always be able to resolve the clang type if needed.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123613 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
6a92553d2cc2b7a3b853fcb6da101583435c2dc0 13-Jan-2011 Sean Callanan <scallanan@apple.com> Implemented a major overhaul of the way variables are handled
by LLDB. Instead of being materialized into the input structure
passed to the expression, variables are left in place and pointers
to them are materialzied into the structure. Variables not resident
in memory (notably, registers) get temporary memory regions allocated
for them.

Persistent variables are the most complex part of this, because they
are made in various ways and there are different expectations about
their lifetime. Persistent variables now have flags indicating their
status and what the expectations for longevity are. They can be
marked as residing in target memory permanently -- this is the
default for result variables from expressions entered on the command
line and for explicitly declared persistent variables (but more on
that below). Other result variables have their memory freed.

Some major improvements resulting from this include being able to
properly take the address of variables, better and cleaner support
for functions that return references, and cleaner C++ support in
general. One problem that remains is the problem of explicitly
declared persistent variables; I have not yet implemented the code
that makes references to them into indirect references, so currently
materialization and dematerialization of these variables is broken.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123371 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
05a5a1bcbed5c0f31fed29153bb2912d71836e91 16-Dec-2010 Sean Callanan <scallanan@apple.com> Implemented a feature where the expression parser
can avoid running the code in the target if the
expression's result is known and the expression
has no side effects.

Right now this feature is quite conservative in
its guess about side effects, and it only computes
integer results, but the machinery to make it more
sophisticated is there.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
427f290ff96f3ab9f2cf3a1af7001d2c560424c7 14-Dec-2010 Greg Clayton <gclayton@apple.com> Modified LLDB expressions to not have to JIT and run code just to see variable
values or persistent expression variables. Now if an expression consists of
a value that is a child of a variable, or of a persistent variable only, we
will create a value object for it and make a ValueObjectConstResult from it to
freeze the value (for program variables only, not persistent variables) and
avoid running JITed code. For everything else we still parse up and JIT code
and run it in the inferior.

There was also a lot of clean up in the expression code. I made the
ClangExpressionVariables be stored in collections of shared pointers instead
of in collections of objects. This will help stop a lot of copy constructors on
these large objects and also cleans up the code considerably. The persistent
clang expression variables were moved over to the Target to ensure they persist
across process executions.

Added the ability for lldb_private::Target objects to evaluate expressions.
We want to evaluate expressions at the target level in case we aren't running
yet, or we have just completed running. We still want to be able to access the
persistent expression variables between runs, and also evaluate constant
expressions.

Added extra logging to the dynamic loader plug-in for MacOSX. ModuleList objects
can now dump their contents with the UUID, arch and full paths being logged with
appropriate prefix values.

Thread hardened the Communication class a bit by making the connection auto_ptr
member into a shared pointer member and then making a local copy of the shared
pointer in each method that uses it to make sure another thread can't nuke the
connection object while it is being used by another thread.

Added a new file to the lldb/test/load_unload test that causes the test a.out file
to link to the libd.dylib file all the time. This will allow us to test using
the DYLD_LIBRARY_PATH environment variable after moving libd.dylib somewhere else.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121745 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
047923c7bc90275f29c2e179d2385df26b8d81a1 14-Dec-2010 Sean Callanan <scallanan@apple.com> Bugfixes for the new "self" pointer handling. Specifically,
the code to pass the _cmd pointer has been improved, and _cmd
is now set to the value of _cmd for the current context, as
opposed to being simply NULL.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121739 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
3aa7da5cb3327792415de44405e0896c6bdc305b 13-Dec-2010 Sean Callanan <scallanan@apple.com> Added support for generating expressions that have
access to the members of the Objective-C self object.

The approach we take is to generate the method as a
@category on top of the self object, and to pass the
"self" pointer to it. (_cmd is currently NULL.)

Most changes are in ClangExpressionDeclMap, but the
change that adds support to the ABIs to pass _cmd
touches a fair amount of code.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
aa301c49e8b31f01c551cffbaa74c8ba82851a79 03-Dec-2010 Sean Callanan <scallanan@apple.com> Fixed object lifetimes in ClangExpressionDeclMap
so that it is not referring to potentially stale
state during IR execution.

This was done by introducing modular state (like
ClangExpressionVariable) where groups of state
variables have well-defined lifetimes:

- m_parser_vars are specific to parsing, and only
exist between calls to WillParse() and DidParse().

- m_struct_vars survive for the entire execution
of the ClangExpressionDeclMap because they
provide the template for a materialized set of
expression variables.

- m_material_vars are specific to a single
instance of materialization, and only exist
between calls to Materialize() and
Dematerialize().

I also removed unnecessary references to long-
lived state that really didn't need to be referred
to at all, and also introduced several assert()s
that helped me diagnose a few bugs (fixed too).


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@120778 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
1ddd9fe72bd9e22f40ad28f25b3a139a9326ae98 30-Nov-2010 Sean Callanan <scallanan@apple.com> Added a feature where registers can be referred to
using special $-variables from expressions.

(lldb) expr $rip

These variables are available for reading and
writing.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@120367 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
ee8fc726f2eff9c3b3db7f00f9fddbaa9735e045 19-Nov-2010 Sean Callanan <scallanan@apple.com> Modifications to type handling logic. We no longer
perform recursive type lookups, because these are not
required for full type fidelity. We also make the
SelectorTable last for the full lifetime of the Clang
compiler; this was the source of many bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@119835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
6916e358c9725b75ed91f31236c147f26c9af10e 13-Nov-2010 Greg Clayton <gclayton@apple.com> Modified the lldb_private::Type clang type resolving code to handle three
cases when getting the clang type:
- need only a forward declaration
- need a clang type that can be used for layout (members and args/return types)
- need a full clang type

This allows us to partially parse the clang types and be as lazy as possible.
The first case is when we just need to declare a type and we will complete it
later. The forward declaration happens only for class/union/structs and enums.
The layout type allows us to resolve the full clang type _except_ if we have
any modifiers on a pointer or reference (both R and L value). In this case
when we are adding members or function args or return types, we only need to
know how the type will be laid out and we can defer completing the pointee
type until we later need it. The last type means we need a full definition for
the clang type.

Did some renaming of some enumerations to get rid of the old "DC" prefix (which
stands for DebugCore which is no longer around).

Modified the clang namespace support to be almost ready to be fed to the
expression parser. I made a new ClangNamespaceDecl class that can carry around
the AST and the namespace decl so we can copy it into the expression AST. I
modified the symbol vendor and symbol file plug-ins to use this new class.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118976 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
8de27c761a22187ef63fb60000894be163e7285f 16-Oct-2010 Greg Clayton <gclayton@apple.com> Made many ConstString functions inlined in the header file.

Changed all of our synthesized "___clang" functions, types and variables
that get used in expressions over to have a prefix of "$_lldb". Now when we
do name lookups we can easily switch off of the first '$' character to know
if we should look through only our internal (when first char is '$') stuff,
or when we should look through program variables, functions and types.

Converted all of the clang expression code over to using "const ConstString&"
values for names instead of "const char *" since there were many places that
were converting the "const char *" names into ConstString names and them
throwing them away. We now avoid making a lot of ConstString conversions and
benefit from the quick comparisons in a few extra spots.

Converted a lot of code from LLVM coding conventions into LLDB coding
conventions.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
6df0840c87be29724055716db951aa6d494ddabc 28-Sep-2010 Sean Callanan <scallanan@apple.com> Added type lookup, so variables with user-defined types
can be allocated and manipulated.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114928 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
3c9c5eb466869ede185e879d14a47335fb43194d 21-Sep-2010 Sean Callanan <scallanan@apple.com> Removed the hacky "#define this ___clang_this" handler
for C++ classes. Replaced it with a less hacky approach:

- If an expression is defined in the context of a
method of class A, then that expression is wrapped as
___clang_class::___clang_expr(void*) { ... }
instead of ___clang_expr(void*) { ... }.

- ___clang_class is resolved as the type of the target
of the "this" pointer in the method the expression
is defined in.

- When reporting the type of ___clang_class, a method
with the signature ___clang_expr(void*) is added to
that class, so that Clang doesn't complain about a
method being defined without a corresponding
declaration.

- Whenever the expression gets called, "this" gets
looked up, type-checked, and then passed in as the
first argument.

This required the following changes:

- The ABIs were changed to support passing of the "this"
pointer as part of trivial calls.

- ThreadPlanCallFunction and ClangFunction were changed
to support passing of an optional "this" pointer.

- ClangUserExpression was extended to perform the
wrapping described above.

- ClangASTSource was changed to revert the changes
required by the hack.

- ClangExpressionParser, IRForTarget, and
ClangExpressionDeclMap were changed to handle
different manglings of ___clang_expr flexibly. This
meant no longer searching for a function called
___clang_expr, but rather looking for a function whose
name *contains* ___clang_expr.

- ClangExpressionParser and ClangExpressionDeclMap now
remember whether "this" is required, and know how to
look it up as necessary.

A few inheritance bugs remain, and I'm trying to resolve
these. But it is now possible to use "this" as well as
refer implicitly to member variables, when in the proper
context.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114384 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
cc0746247880e9c87711031ce8a535544f4499d7 14-Sep-2010 Sean Callanan <scallanan@apple.com> Added code to support use of "this" and "self" in
expressions. This involved three main changes:

- In ClangUserExpression::ClangUserExpression(),
we now insert the following lines into the
expression:
#define this ___clang_this
#define self ___clang_self

- In ClangExpressionDeclMap::GetDecls(), we
special-case ___clang_(this|self) and instead
look up "this" or "self"

- In ClangASTSource, we introduce the capability
to generate Decls with a different, overridden,
name from the one that was requested, e.g.
this for ___clang_this.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
45690fe3b8b4efb101dd31085413381021a69c2f 31-Aug-2010 Sean Callanan <scallanan@apple.com> Fixed a bug where the parser-specific members of
persistent variables were staying around too long.
This caused the following problem:

- A persistent result variable is created for the
result of an expression. The pointer to the
corresponding Decl is stored in the variable.

- The persistent variable is looked up during
struct generation (correctly) using its Decl.

- Another expression defines a new result variable
which happens to have a Decl in the same place
as the original result variable.

- The persistent variable is looked up during
struct generation using its Decl, but the old
result variable appears first in the list and
has the same Decl pointer.

The fix is to destroy parser-specific data when
it is no longer valid.

Also improved some logging as I diagnosed the
bug.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@112540 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
8c12720c108cd5e7ed792596749218d8400f647e 24-Aug-2010 Sean Callanan <scallanan@apple.com> Refactored ClangExpressionDeclMap to use
ClangExpressionVariables for found external variables
as well as for struct members, replacing the Tuple
and StructMember data structures.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@111859 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
a6223431cf44c6c1e885d2f04cc78cb4155375e5 20-Aug-2010 Sean Callanan <scallanan@apple.com> First step of refactoring variable handling in the
expression parser. There shouldn't be four separate
classes encapsulating a variable.

ClangExpressionVariable is now meant to be the
container for all variable information. It has
several optional components that hold data for
different subsystems.

ClangPersistentVariable has been removed; we now
use ClangExpressionVariable instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@111600 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
a386e05ea6d20cdcedc80c23cf771d5030db43d6 14-Aug-2010 Sean Callanan <scallanan@apple.com> Added documentation to ClangExpressionDeclMap.
Also cleaned up its API a tiny bit (but not the
extensive amount that is actually needed. That's
still coming.)


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@111049 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
82b74c85f719be67b78f9284a6a1341d47f7ac9c 12-Aug-2010 Sean Callanan <scallanan@apple.com> Added automatically generated result variables for each
expression. It is now possible to do things like this:

(lldb) expr int $i = 5; $i + 1
$0 = (int) 6
(lldb) expr $i + 3
$1 = (int) 8
(lldb) expr $1 + $0
$2 = (int) 14

As a bonus, this allowed us to move printing of
expression results into the ClangPersistentVariable
class. This code needs a bit of refactoring -- in
particular, ClangExpressionDeclMap has eaten one too
many bacteria and needs to undergo mitosis -- but the
infrastructure appears to be holding up nicely.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@110896 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
a48fe1637ec6a381e500633c087f76662e364c20 11-Aug-2010 Sean Callanan <scallanan@apple.com> Added support for persistent variables to the
expression parser. It is now possible to type:

(lldb) expr int $i = 5; $i + 1
(int) 6
(lldb) expr $i + 2
(int) 7

The skeleton for automatic result variables is
also implemented. The changes affect:

- the process, which now contains a
ClangPersistentVariables object that holds
persistent variables associated with it
- the expression parser, which now uses
the persistent variables during variable
lookup
- TaggedASTType, where I loaded some commonly
used tags into a header so that they are
interchangeable between different clients of
the class


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@110777 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
e562a073bba53fa46161feb51d1b1e36f9af9666 06-Aug-2010 Sean Callanan <scallanan@apple.com> Removed the -i option from the expr command, and
made IR-based expression evaluation the default.

Also added a new class to hold persistent variables.
The class is empty as yet while I write up a design
document for what it will do. Also the place where
it is currently created (by the Expression command)
is certainly wrong.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@110415 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
93a4b1a8d6ad9a5d1e18a38b5ec55de5b7f6e724 04-Aug-2010 Sean Callanan <scallanan@apple.com> Added support for accessing members of C++ objects,
including superclass members. This involved ensuring
that access control was ignored, and ensuring that
the operands of BitCasts were properly scanned for
variables that needed importing.

Also laid the groundwork for declaring objects of
custom types; however, this functionality is disabled
for now because of a potential loop in ASTImporter.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@110174 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
f5857a002d1e0c5fe29b8af9f9e2fe4fac0298d8 31-Jul-2010 Sean Callanan <scallanan@apple.com> Added support for rewriting objc_msgSend so we can
call Objective-C methods from expressions. Also added
some more logging to the function-calling thread plan
so that we can see the registers when a function
finishes.

Also documented things maybe a bit better.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@109938 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
02fbafa1bf2bb77bf8f25af3403d7d8721a3f8b1 27-Jul-2010 Sean Callanan <scallanan@apple.com> Added support for calling functions from expressions.
Right now we mock up the function as a variadic
function when generating the IR for the call; we need
to eventually make the function be the right type if
the type is available.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@109543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
ba992c58b25ec0a67ef430024dc3dca154982dc9 27-Jul-2010 Sean Callanan <scallanan@apple.com> Added support for locating a function that is
referenced in the IR. We don't yet support updating
the call to that function.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@109483 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
0fc7358d61218ba5d5abb5c2ea489a9ef936bbf7 27-Jul-2010 Sean Callanan <scallanan@apple.com> Changed SymbolContext so when you search for functions
it returns a list of functions as a SymbolContextList.

Rewrote the clients of SymbolContext to use this
SymbolContextList.

Rewrote some of the providers of the data to SymbolContext
to make them respect preferences as to whether the list
should be cleared first; propagated that change out.

ClangExpressionDeclMap and ClangASTSource use this new
function list to properly generate function definitions -
even for functions that don't have a prototype in the
debug information.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@109476 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
32824aa43fdc8393d829c16f126f32ca8d3582ad 24-Jul-2010 Sean Callanan <scallanan@apple.com> Added logging:
- When we JIT an expression, we print the disassembly
of the generated code
- When we put the structure into the target, we print
the individual entries in the structure byte for
byte.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@109278 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
841026fc8d1cc22bd3b9e74623b413a3e6aa9d38 23-Jul-2010 Sean Callanan <scallanan@apple.com> Modified TaggedASTType to inherit from ClangASTType
and moved it to its own header file for cleanliness.

Added more logging to ClangFunction so that we can
diagnose crashes in the executing expression.

Added code to extract the result of the expression
from the struct that is passed to the JIT-compiled
code.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@109199 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
1674b12bbc3dae7b9543b8c5f958e90ddc767fa4 22-Jul-2010 Greg Clayton <gclayton@apple.com> Change over to using the definitions for mach-o types and defines to the
defines that are in "llvm/Support/MachO.h". This should allow ObjectFileMachO
and ObjectContainerUniversalMachO to be able to be cross compiled in Linux.

Also did some cleanup on the ASTType by renaming it to ClangASTType and
renaming the header file. Moved a lot of "AST * + opaque clang type *"
functionality from lldb_private::Type over into ClangASTType.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@109046 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
f328c9ffe0bb00f48601027ec86dbdf238b42c2a 21-Jul-2010 Sean Callanan <scallanan@apple.com> Added functionality to dematerialize values that were
used by the JIT compiled expression, including the
result of the expression.

Also added a new class, ASTType, which encapsulates an
opaque Clang type and its associated AST context.

Refactored ClangExpressionDeclMap to use ASTTypes,
significantly reducing the possibility of mixups of
types from different AST contexts.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@108965 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
336a0002b94c7f23573ec613c4d4ac89a67fd299 17-Jul-2010 Sean Callanan <scallanan@apple.com> Added the necessary code to copy variables used by
an expression into the struct prepared for the JIT
compiled code to use.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@108596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
810f22d18ca8f9d31f49d79bb4b51a9f2fd96dea 16-Jul-2010 Sean Callanan <scallanan@apple.com> Wrote the code that looks at a context to see
if the variables in that context allow a particular
JIT compiled expression to run in that context.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@108485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
8bce665569ea08dd43d9ff21e23f14ebbc191d12 13-Jul-2010 Sean Callanan <scallanan@apple.com> "expr -i" now performs the required transforms to
prepare the IR for JIT compilation. We still need
to do the JIT compilation and move the arguments
in/out of target memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@108279 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
8f0dc34f45576dfb719f879b6d3ea5f61de0e918 23-Jun-2010 Sean Callanan <scallanan@apple.com> Added support to the expression parser for locating
externally-defined functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@106606 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h
24943d2ee8bfaa7cf5893e4709143924157a5c1e 08-Jun-2010 Chris Lattner <sabre@nondot.org> Initial checkin of lldb code from internal Apple repo.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@105619 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Expression/ClangExpressionDeclMap.h