summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/IRForTarget.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Moved more Clang-specific parts of the expression parser into the Clang plugin.Sean Callanan2015-09-251-2819/+0
| | | | | | | | | 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
* Rename clang_type -> compiler_type for variables.Bruce Mitchener2015-09-241-5/+5
| | | | | | | | | | Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13102 llvm-svn: 248461
* ClangASTType is now CompilerType.Greg Clayton2015-08-111-2/+2
| | | | | | This is more preparation for multiple different kinds of types from different compilers (clang, Pascal, Go, RenderScript, Swift, etc). llvm-svn: 244689
* First step in getting LLDB ready to support multiple different type systems.Greg Clayton2015-08-111-5/+5
| | | | | | | | This is the work done by Ryan Brown from http://reviews.llvm.org/D8712 that makes a TypeSystem class and abstracts types to be able to use a type system. All tests pass on MacOSX and passed on linux the last time this was submitted. llvm-svn: 244679
* Make many mangled functions that might demangle a name be allowed to specify ↵Greg Clayton2015-07-081-2/+2
| | | | | | a language to use in order to soon support Pascal and Java demangling. Dawn Perchik will take care of making this so. llvm-svn: 241751
* Fix a variety of typos.Bruce Mitchener2015-06-181-1/+1
| | | | | | No functional change. llvm-svn: 239995
* Revert "Introduce a TypeSystem interface to support adding non-clang languages."Pavel Labath2015-06-081-5/+5
| | | | | | This seems to break expression evaluation on the linux build. llvm-svn: 239366
* Introduce a TypeSystem interface to support adding non-clang languages.Pavel Labath2015-06-081-5/+5
| | | | | | | | | | | | | Reviewers: clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8712 Original Author: Ryan Brown <ribrdb@google.com> llvm-svn: 239360
* Don't crash if we don't have a process and needSean Callanan2015-05-281-10/+13
| | | | | | to check for alternate manglings. llvm-svn: 238475
* Updated IRForTarget to change the way we generateSean Callanan2015-04-141-2/+4
| | | | | | | | | | | | relocations. We used to do GEP on a pointer to the result type, which is wrong. We should be doing GEP on a pointer to char, which allows us to offset correctly. This fixes the C modules testcase, so it's no longer ExpectFail. llvm-svn: 234918
* [IRForTarget] Strenghten handling of alternate mangling.Siva Chandra2015-04-091-26/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This fixes an issue with GCC generated binaries wherein an expression with method invocations on std::string variables was failing. Such use cases are tested in TestSTL (albeit, in a test marked with @unittest2.expectedFailure because of other reasons). The reason for this particular failure with GCC is that the generated DWARF for std::basic_string<...> is incomplete, which makes clang not to use the alternate mangling scheme. GCC correctly generates the name of basic_string<...>: DW_AT_name "basic_string<char, std::char_traits<char>, std::allocator<char> >" It also lists the template parameters of basic_string correctly: DW_TAG_template_type_parameter DW_AT_name "_CharT" DW_AT_type <0x0000009c> DW_TAG_template_type_parameter DW_AT_name "_Traits" DW_AT_type <0x00000609> DW_TAG_template_type_parameter DW_AT_name "_Alloc" DW_AT_type <0x000007fb> However, it does not list the template parameters of std::char_traits<>. This makes Clang feel (while parsing the expression) that the string variable is not actually a basic_string instance, and consequently does not use the alternate mangling scheme. Test Plan: dotest.py -C gcc -p TestSTL -- See it go past the "for" loop expression successfully. Reviewers: clayborg, spyffe Reviewed By: clayborg, spyffe Subscribers: tberghammer, zturner, lldb-commits Differential Revision: http://reviews.llvm.org/D8846 llvm-svn: 234522
* Fix -Wformat-pedantic warningsDavid Blaikie2015-04-081-1/+1
| | | | llvm-svn: 234429
* Fixed a crash because we weren't generatingSean Callanan2015-04-061-3/+4
| | | | | | | | type-safe relocations against @reloc_placeholder. <rdar://problem/20438754> llvm-svn: 234260
* Fix error resulting from llvm r233938.Zachary Turner2015-04-021-1/+1
| | | | llvm-svn: 233942
* Added nullptr to fix buildVince Harron2015-03-161-2/+3
| | | | llvm-svn: 232345
* Fixed an infinite recursion bug that could happen when using python ↵Greg Clayton2015-02-271-1/+1
| | | | | | | | operating system plug-ins where we would ask the operating system plug-in to update its threads and this would cause the plugin to run an expression which would eventually run IRForTarget::CreateResultVariable() which would try to get the selected thread and cause re-entrant bug. <rdar://problem/19924734> llvm-svn: 230711
* Fix build after r229094: replace llvm/PassManager.h -> ↵Ilia K2015-02-131-1/+1
| | | | | | llvm/IR/LegacyPassManager.h llvm-svn: 229100
* Make a more complete fix for always supplying an execution context when ↵Greg Clayton2015-02-121-4/+16
| | | | | | | | | | getting byte sizes from types. There was a test in the test suite that was triggering the backtrace logging output that requested that the client pass an execution context. Sometimes we need the process for Objective C types because our static notion of the type might not align with the reality when being run in a live runtime. Switched from an "ExecutionContext *" to an "ExecutionContextScope *" for greater ease of use. llvm-svn: 228892
* Preparatory infrastructural work to support dynamically determining sizes of ↵Enrico Granata2015-01-281-3/+3
| | | | | | | | | | | | ObjC types via the runtime This is necessary because the byte size of an ObjC class type is not reliably statically knowable (e.g. because superclasses sit deep in frameworks that we have no debug info for) The lack of reliable size info is a problem when trying to freeze-dry an ObjC instance (not the pointer, the pointee) This commit lays the foundation for having language runtimes help in figuring out byte sizes, and having ClangASTType ask for runtime help No feature change as no runtime actually implements the logic, and nowhere is an ExecutionContext passed in yet llvm-svn: 227274
* Fix issues with LLDB's interpreter and MS ABI guard variables.Zachary Turner2015-01-091-15/+7
| | | | | | | | | | | MS ABI guard variables end with @4IA, so this patch teaches the interpreter about that. Additionally, there was an issue with TurnGuardLoadIntoZero which was causing some guard uses of a variable to be missed. This fixes that by calling Instruction::replaceAllUsesWith() instead of trying to replicate that function. llvm-svn: 225547
* Fix compilation failures resulting from the llvm Metadata refactor.Zachary Turner2014-12-091-11/+12
| | | | | | Patch by Duncan P. N. Exon Smith llvm-svn: 223844
* Revert "Update for LLVM API change in r221024"Duncan P. N. Exon Smith2014-11-121-1/+1
| | | | | | This reverts commit r221073 to match upstream revert in r221711. llvm-svn: 221749
* Fix comments to match the current reality.Greg Clayton2014-11-101-2/+2
| | | | llvm-svn: 221633
* Fix selectors not being objc-uniquified in the expression parser after a ↵Greg Clayton2014-11-101-1/+1
| | | | | | recent renaming in clang (clang change for revision 221451). This broke all objective C expressions in LLDB. llvm-svn: 221632
* Fix LLDB build as a result of upstream LLVM changes.Zachary Turner2014-11-051-2/+1
| | | | llvm-svn: 221378
* Update for LLVM API change in r221024Ed Maste2014-11-021-1/+1
| | | | llvm-svn: 221073
* Correct indentation level for one line.Jason Molenda2014-07-091-1/+1
| | | | llvm-svn: 212582
* remove trailing whitespace + remove some useless commentsSylvestre Ledru2014-07-061-602/+602
| | | | llvm-svn: 212411
* Start converting usages of off_t to other types.Zachary Turner2014-07-021-5/+5
| | | | | | | | | | | | | | | | | | | | | | | off_t is a type which is used for file offsets. Even more specifically, it is only used by a limited number of C APIs that deal with files. Any usage of off_t where the variable is not intended to be used with one of these APIs is a bug, by definition. This patch corrects some easy mis-uses of off_t, generally by converting them to lldb::offset_t, but sometimes by using other types such as size_t, when appropriate. The use of off_t to represent these offsets has worked fine in practice on linux-y platforms, since we used _FILE_OFFSET_64 to guarantee that off_t was a uint64. On Windows, however, _FILE_OFFSET_64 is unrecognized, and off_t will always be 32-bit. So the usage of off_t on Windows actually leads to legitimate bugs. Reviewed by: Greg Clayton Differential Revision: http://reviews.llvm.org/D4358 llvm-svn: 212192
* Fixed a problem where IRForTarget wasn't ignoringSean Callanan2014-04-091-0/+1
| | | | | | | | dbg_value intrinsics appropriately. <rdar://problem/16504649> llvm-svn: 205825
* sweep up -Wformat warnings from gccSaleem Abdulrasool2014-04-041-10/+10
| | | | | | | This is a purely mechanical change explicitly casting any parameters for printf style conversion. This cleans up the warnings emitted by gcc 4.8 on Linux. llvm-svn: 205607
* JITed functions can now have debug info and be debugged with debug and ↵Greg Clayton2014-03-241-29/+43
| | | | | | | | | | | | | | | | | | | source info: (lldb) b puts (lldb) expr -g -i0 -- (int)puts("hello") First we will stop at the entry point of the expression before it runs, then we can step over a few times and hit the breakpoint in "puts", then we can continue and finishing stepping and fininsh the expression. Main features: - New ObjectFileJIT class that can be easily created for JIT functions - debug info can now be enabled when parsing expressions - source for any function that is run throught the JIT is now saved in LLDB process specific temp directory and cleaned up on exit - "expr -g --" allows you to single step through your expression function with source code <rdar://problem/16382881> llvm-svn: 204682
* Cleanup some dead assignements reported by scan-buildArnaud A. de Grandmaison2014-03-221-1/+0
| | | | | | No functionnal change. llvm-svn: 204545
* cleanup unreferenced functionsSaleem Abdulrasool2014-03-201-21/+0
| | | | | | | | | | | | | This is a mechanical cleanup of unused functions. In the case where the functions are referenced (in comment form), I've simply commented out the functions. A second pass to clean that up is warranted. The functions which are otherwise unused have been removed. Some of these were introduced in the initial commit and not in use prior to that point! NFC llvm-svn: 204310
* Followed up on Ed Maste's patch with a few moreSean Callanan2014-03-111-51/+23
| | | | | | | | User fixes. Also changed our iterations across global variables and instruction operands to reflect the new C++11 approach. llvm-svn: 203599
* Fix #if 0'd code after range-based for loop changeEd Maste2014-03-101-2/+2
| | | | llvm-svn: 203487
* Update LLDB for LLVM iterator change in r203364Ed Maste2014-03-101-24/+14
| | | | | | | | | | | What was use_iterator is now user_iterator. Also switch to range-based APIs, as in Clang r203365. (This part of the change was missed in r203463) Differential Revision: http://llvm-reviews.chandlerc.com/D3030 llvm-svn: 203475
* Update LLDB for LLVM iterator change in r203364Ed Maste2014-03-101-13/+5
| | | | | | | What was use_iterator is now user_iterator. Also switch to range-based APIs, as in Clang r203365. llvm-svn: 203463
* "size_t" isn't always 64 bit, it is 32 bit on 32 bit systems. All printf ↵Greg Clayton2014-03-031-2/+2
| | | | | | | | style statements that were assuming size_t were 64 bit were changed, and they were also changed to display them as unsigned values as "size_t" isn't signed. If you print anything with 'size_t', please cast it to "uint64_t" in the printf and use PRIu64 or PRIx64. llvm-svn: 202738
* Fix Windows build using portable types for formatting the log outputsDeepak Panickal2014-03-031-2/+2
| | | | llvm-svn: 202723
* Updated our IR processing to reflect best practicesSean Callanan2013-12-201-22/+14
| | | | | | for making pointer-valued constants. llvm-svn: 197829
* Adjust to the new way LLVM emits modules: it doesn'tSean Callanan2013-12-201-16/+7
| | | | | | | | specify a pointer size until code gen. So we just make all our pointer-sized integer literals 64-bit. That doesn't seem to hurt anything. llvm-svn: 197774
* Fix the format warnings.Sylvestre Ledru2013-10-311-2/+2
| | | | | | | | | | In almost all cases, the misuse is about "%lu" being used instead of the correct "%zu" (even though these are compatible on 64-bit platforms in practice). There are even a couple of cases where "%ld" (ie., signed int) is used instead of "%zu", and one where "%lu" is used instead of "%" PRIu64. Fixes bug #17551. Patch by "/dev/humancontroller" llvm-svn: 193832
* Update ResolveFunctionPointers to build after the changesJason Molenda2013-10-221-2/+2
| | | | | | of llvm r193091. Thanks to Ed Maste for narrowing it down. llvm-svn: 193140
* This reverts r192484, which I really shouldn't have checked in. Apologies.Richard Mitton2013-10-111-1/+1
| | | | llvm-svn: 192488
* Fixed bad return code, which would cause invalid expressions to silently fail.Richard Mitton2013-10-111-1/+1
| | | | llvm-svn: 192484
* Remove builtin attribute from calls whose targets we replaceStefanus Du Toit2013-07-231-0/+14
| | | | | | | | | | | If we are replacing a function with the nobuiltin attribute, it may be called with the builtin attribute on call sites. Remove any such attributes since it's illegal to have a builtin call to something other than a nobuiltin function. This fixes the current buildbot breakage (where LLDB crashes on "expression new foo(42)"). llvm-svn: 186990
* Fixed a problem in IRForTarget where we would notSean Callanan2013-07-151-2/+9
| | | | | | | | | | | delete a constant after we replaced it with a dynamically-computed value. Also ensured that we replace all users of the constant if there are multiple ones. Added a testcase. <rdar://problem/14379043> llvm-svn: 186363
* Huge change to clean up types.Greg Clayton2013-07-111-24/+17
| | | | | | | | 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. llvm-svn: 186130
* Hitherto the IRForTarget infrastructure has mainlySean Callanan2013-06-281-178/+252
| | | | | | | | | | | | | | | | | | | | | been suitable for preparing a single IR function for operation in the target. However, using blocks and lambdas creates other IR functions that also need to be processed. I have audited IRForTarget to make it process multiple functions. Where IRForTarget would add new instructions at the beginning of the main expression function, it now adds them on-demand in the function where they are needed. This is enabled by a system of FunctionValueCaches, which invoke a lambda to create or derive the values as needed, or report the result of that lambda if it has already been called for the given function. <rdar://problem/14180236> llvm-svn: 185224
OpenPOWER on IntegriCloud