summaryrefslogtreecommitdiffstats
path: root/lldb/source/Symbol/ClangASTContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [lldb][NFC] Remove ClangASTContext::FieldIsBitfield overloadRaphael Isemann2019-11-201-11/+4
|
* [lldb][NFC] Remove ClangASTContext::GetUniqueNamespaceDeclaration overloadRaphael Isemann2019-11-201-10/+0
| | | | | | This overload is only used in one place and having static overloads for all methods that only do an additional clang::ASTContext -> ClangASTContext conversion is just not sustainable.
* Properly propagate is_variadic.Adrian Prantl2019-11-081-1/+1
| | | | | This fixes a copy&paste error made when adapting to new clang API which was promptly caught by the bots.
* Adapt LLDB to clang API change in ObjCMethodDecl::create().Adrian Prantl2019-11-081-12/+20
|
* [lldb][NFC] Refactor some IsClangType checks in ClangASTContextRaphael Isemann2019-11-081-2/+2
| | | | | | | | | | | | | | | Summary: All type in these functions need be valid and Clang types, so we might as well replace these checks with IsClangType. Also lets IsClangType explicitly check for validity instead of assuming that the TypeSystem is a nullptr. Subscribers: abidh, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70001
* [Symbol] Change ClangASTContext::GetCXXClassName return typeAlex Langford2019-10-311-14/+14
| | | | | | | | | Summary: Instead of filling out a std::string and returning a bool to indicate success, returning a std::string directly and testing to see if it's empty seems like a cleaner solution overall. Differential Revision: https://reviews.llvm.org/D69641
* Add support for DW_AT_export_symbols for anonymous structsshafik2019-10-281-10/+5
| | | | | | | | | Summary: We add support for DW_AT_export_symbols to detect anonymous struct on top of the heuristics implemented in D66175 This should allow us to differentiate anonymous structs and unnamed structs. We also fix TestTypeList.py which was incorrectly detecting an unnamed struct as an anonymous struct. Differential Revision: https://reviews.llvm.org/D68961
* Add arm64_32 support to lldb, an ILP32 codegen Jason Molenda2019-10-161-0/+1
| | | | | | | | | | that runs on arm64 ISA targets, specifically Apple watches. Differential Revision: https://reviews.llvm.org/D68858 llvm-svn: 375032
* [lldb-test] Modify lldb-test to print out ASTs from symbol fileShafik Yaghmour2019-10-111-0/+33
| | | | | | | | | | | Summary: Currently when invoking lldb-test symbols -dump-ast it parses all the debug symbols and calls print(...) on the TranslationUnitDecl. While useful the TranslationUnitDecl::print(...) method gives us a higher level view then the dump from ASTDumper which is what we get when we invoke dump() on a specific AST node. The main motivation for this change is allow us to verify that the AST nodes we create when we parse DWARF. For example in order to verify we are correctly using DIFlagExportSymbols added by D66667 Differential Revision: https://reviews.llvm.org/D67994 llvm-svn: 374570
* Add test coverage to printing of enums and fix display of unsigned valuesFrederic Riss2019-10-081-6/+9
| | | | | | | | | | | | | | | TestCPP11EnumTypes.py should have covered all our bases when it comes to typed enums, but it missed the regression introduced in r374066. The reason it didn't catch it is somewhat funny: the test was copied over from another test that recompiled a source file with a different base type every time, but neither the test source nor the python code was adapted for testing enums. As a result, this test was just running 8 times the exact same checks on the exact same binary. This commit fixes the coverage and addresses the issue revealed by the new tests. llvm-svn: 374108
* Fix sign extension handling in DumpEnumValueFrederic Riss2019-10-081-0/+1
| | | | | | | | | | | | When an enumerator has an unsigned type and its high bit set, the code introduced in r374067 would fail to match it due to a sign extension snafu. This commit fixes this aspec of the code and should fix the bots. I think it's not a complete fix though, I'll add more test coverage and additional tweaks in a follow-up commit. llvm-svn: 374095
* Add pretty printing of Clang "bitfield" enumsFrederic Riss2019-10-081-8/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Using enumerators as flags is standard practice. This patch adds support to LLDB to display such enum values symbolically, eg: (E) e1 = A | B If enumerators don't cover the whole value, the remaining bits are displayed as hexadecimal: (E) e4 = A | 0x10 Detecting whether an enum is used as a bitfield or not is complicated. This patch implements a heuristic that assumes that such enumerators will either have only 1 bit set or will be a combination of previous values. This patch doesn't change the way we currently display enums which the above heuristic would not consider as bitfields. Reviewers: jingham, labath Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D67520 llvm-svn: 374067
* Extract and simplify DumpEnumValueFrederic Riss2019-10-081-39/+29
| | | | llvm-svn: 374066
* [Symbol] Remove unused method ClangASTContext::GetObjCClassNameAlex Langford2019-10-071-19/+0
| | | | llvm-svn: 373990
* Properly handle instantiation-dependent array bounds.Richard Smith2019-10-041-2/+2
| | | | | | | | | We previously failed to treat an array with an instantiation-dependent but not value-dependent bound as being an instantiation-dependent type. We now track the array bound expression as part of a constant array type if it's an instantiation-dependent expression. llvm-svn: 373685
* [lldb][NFC] Remove ClangASTContext::ClearRaphael Isemann2019-10-021-13/+0
| | | | | | | | | | We now only use this function directly after initialization. As Clear() resets the ASTContext back to its initial state, this is just a no-op. There are no other users for this and we no longer can set the ASTContext after construction, so Clear has no useful purpose anymore. It's also mostly copy-pasted from Finalize(). llvm-svn: 373460
* [lldb][NFC] Create the ASTContext in ClangASTContext exactly once.Raphael Isemann2019-10-021-56/+58
| | | | | | | | | | | | | | | Reason for this patch is the Ssame reason as for the previous patches: Having a ClangASTContext and being able to switch the associated ASTContext isn't a use case we have (or should have), so let's simplify all this code. This way it becomes clearer in what order we initialize data structures. The DWARFASTParserClangTests changes are necessary as the test is using a ClangASTContext but relied on the fact that no called function ever calls getASTContext() on our ClangASTContext (as that would create the ASTContext). As we now always create the ASTContext the fact that we had an uninitialized FileSystem made the test crash. llvm-svn: 373457
* [lldb][NFC] Remove unused ClangASTContext::GetHasExternalStorageRaphael Isemann2019-10-011-68/+0
| | | | | | This code isn't used nor tested. llvm-svn: 373337
* [lldb][NFC] Remove unused ClangASTContext functions for checking/removing ↵Raphael Isemann2019-10-011-17/+0
| | | | | | the ExternalASTSource llvm-svn: 373334
* [lldb][NFC] Disallow changing the ASTContext of an ClangASTContext after ↵Raphael Isemann2019-10-011-9/+8
| | | | | | | | | | | construction. We have no use case in LLDB where we actually do want to change the ASTContext after it the ClangASTContext has been constructed. All callers of setASTContext are just setting the ASTContext directly after construction, so we might as well make this a Constructor instead of supporting this tricky use case. llvm-svn: 373330
* [lldb][NFC] Modernize ClangASTContext constructorRaphael Isemann2019-10-011-11/+6
| | | | | | | | | Now using default initializers and StringRef. Also formats the member list that we excluded from clang-format at some point and still hangs around with the old LLDB code style. llvm-svn: 373329
* Use llvm for dumping DWARF expressionsPavel Labath2019-09-301-1/+1
| | | | | | | | | | | | | | | Summary: It uses the new ability of ABI plugins to vend llvm::MCRegisterInfo structs (which is what is needed to turn dwarf register numbers into strings). Reviewers: JDevlieghere, aprantl, jasonmolenda Subscribers: tatyana-krasnukha, lldb-commits Differential Revision: https://reviews.llvm.org/D67966 llvm-svn: 373208
* [Mangle] Add flag to asm labels to disable '\01' prefixingVedant Kumar2019-09-251-2/+2
| | | | | | | | | | | | | | LLDB synthesizes decls using asm labels. These decls cannot have a mangle different than the one specified in the label name. I.e., the '\01' prefix should not be added. Fixes an expression evaluation failure in lldb's TestVirtual.py on iOS. rdar://45827323 Differential Revision: https://reviews.llvm.org/D67774 llvm-svn: 372903
* [lldb] Fix LLDB build after r372538Raphael Isemann2019-09-231-1/+2
| | | | llvm-svn: 372548
* For PR17164: split -fno-lax-vector-conversion into three differentRichard Smith2019-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | | levels: -- none: no lax vector conversions [new GCC default] -- integer: only conversions between integer vectors [old GCC default] -- all: all conversions between same-size vectors [Clang default] For now, Clang still defaults to "all" mode, but per my proposal on cfe-dev (2019-04-10) the default will be changed to "integer" as soon as that doesn't break lots of testcases. (Eventually I'd like to change the default to "none" to match GCC and general sanity.) Following GCC's behavior, the driver flag -flax-vector-conversions is translated to -flax-vector-conversions=integer. This reinstates r371805, reverted in r371813, with an additional fix for lldb. llvm-svn: 371817
* [Symbol] Give ClangASTContext a PersistentExpressionState instead of a ↵Alex Langford2019-09-091-0/+1
| | | | | | | | | | | | | | | ClangPersistentVariables ClangASTContext doesn't use m_persistent_variables in a way specific to ClangPersistentVariables. Therefore, it should hold a unique pointer to PersistentExpressionState instead of a ClangPersistentVariablesUP. This also prevents you from pulling in a plugin header when including ClangASTContext.h Doing this exposed an implicit dependency in ObjCLanguage that was corrected by including ClangModulesDeclVendor.h llvm-svn: 371470
* [Core] Remove use of ClangASTContext in DumpDataExtractorAlex Langford2019-09-061-0/+16
| | | | | | | | | | | | | Summary: DumpDataExtractor uses ClangASTContext in order to get the proper llvm fltSemantics for the type it needs so that it can dump floats in a more precise way. However, there's no reason that this behavior needs to be specific ClangASTContext. Instead, I think it makes sense to ask TypeSystems for the float semantics for a type of a given size. Differential Revision: https://reviews.llvm.org/D67239 llvm-svn: 371258
* [lldb][NFC] Refactor and document ClangASTContext::IsOperatorRaphael Isemann2019-08-281-209/+72
| | | | | | Should make it clearer what actually is going on in there. llvm-svn: 370201
* [Symbol] Decouple clang from DeclVendorAlex Langford2019-08-231-0/+10
| | | | | | | | | | Summary: This removes DeclVendor's dependency on clang (and ClangASTContext). DeclVendor has no need to know about specific TypeSystems. Differential Revision: https://reviews.llvm.org/D66628 llvm-svn: 369735
* [LLDB] Address post-commit code review feedback.Jonas Devlieghere2019-08-231-2/+2
| | | | | | | This patch addresses Adrian McCarthy's code review feedback in https://reviews.llvm.org/D66447 llvm-svn: 369731
* Extend FindTypes with CompilerContext to allow filtering by language.Adrian Prantl2019-08-221-23/+27
| | | | | | | | | | | | | | | | | | | This patch is also motivated by the Swift branch and is effectively NFC for the single-TypeSystem llvm.org branch. In multi-language projects it is extremely common to have, e.g., a Clang type and a similarly-named rendition of that same type in another language. When searching for a type It is much cheaper to pass a set of supported languages to the SymbolFile than having it materialize every result and then rejecting the materialized types that have the wrong language. Differential Revision: https://reviews.llvm.org/D66546 <rdar://problem/54471165> This reapplies r369690 with a previously missing constructor for LanguageSet. llvm-svn: 369710
* Revert Extend FindTypes with CompilerContext to allow filtering by language.Adrian Prantl2019-08-221-27/+23
| | | | | | This reverts r369690 (git commit aa3a564efa6b5fff2129f81a4041069a0233168f) llvm-svn: 369702
* Extend FindTypes with CompilerContext to allow filtering by language.Adrian Prantl2019-08-221-23/+27
| | | | | | | | | | | | | | | | | This patch is also motivated by the Swift branch and is effectively NFC for the single-TypeSystem llvm.org branch. In multi-language projects it is extremely common to have, e.g., a Clang type and a similarly-named rendition of that same type in another language. When searching for a type It is much cheaper to pass a set of supported languages to the SymbolFile than having it materialize every result and then rejecting the materialized types that have the wrong language. Differential Revision: https://reviews.llvm.org/D66546 <rdar://problem/54471165> llvm-svn: 369690
* Add char8_t support (C++20)Jonas Devlieghere2019-08-211-3/+4
| | | | | | | | | | | | This patch adds support for the char8_t type introduced in C++20 char8_t. The original patch was submitted by James Blachly on the LLDB mailing list [1]. I modified the patch a bit and added a test. [1] http://lists.llvm.org/pipermail/lldb-dev/2019-August/015393.html Differential revision: https://reviews.llvm.org/D66447 llvm-svn: 369582
* Fix two compiler warningsPavel Labath2019-08-211-0/+2
| | | | llvm-svn: 369522
* Fix an unused variable warning in ClangASTContext.cppPavel Labath2019-08-211-2/+1
| | | | llvm-svn: 369503
* [Symbol] Move VerifyDecl to ClangASTContextAlex Langford2019-08-201-1/+5
| | | | | | VerifyDecl is specific to clang and is only used in ClangASTContext. llvm-svn: 369456
* Improve anonymous class heuristic in ClangASTContext::CreateRecordTypeShafik Yaghmour2019-08-141-4/+34
| | | | | | | | | Summary: Currently the heuristic used in ClangASTContext::CreateRecordType to identify an anonymous class is that there is that name is a nullptr or simply a null terminator. This heuristic is not accurate since it will also sweep up unnamed classes and lambdas. The improved heuristic relies on the requirement that an anonymous class must be contained within a class. Differential Revision: https://reviews.llvm.org/D66175 llvm-svn: 368937
* [LLDB] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-141-1/+1
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368933
* [Symbol] Decouple clang from CompilerTypeAlex Langford2019-08-131-441/+528
| | | | | | | | | | Summary: Ideally CompilerType would have no knowledge of clang or any individual TypeSystem. Decoupling clang is relatively straightforward. Differential Revision: https://reviews.llvm.org/D66102 llvm-svn: 368741
* [Symbol] Remove redundant includeAlex Langford2019-08-131-1/+0
| | | | llvm-svn: 368638
* [CompilerType] Pass an ExecutionContextScope to GetTypeBitAlign.Davide Italiano2019-08-121-1/+2
| | | | llvm-svn: 368620
* [Symbol] GetTypeBitAlign() should return None in case of failure.Davide Italiano2019-08-121-2/+3
| | | | | | | | | | | | | | | | Summary: And not `zero`. This is the last API needed to be converted to an Optional<T>. Reviewers: xiaobai, compnerd Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D66093 llvm-svn: 368614
* [lldb][NFC] Fix warning about missing switch casesRaphael Isemann2019-08-091-0/+14
| | | | | | | | | | These types were recently added in D62960 but it seems the patch didn't consider LLDB which causes a bunch of compiler warnings about missing enum values. It seems this feature isn't fully implemented yet, so I don't think we can write any test for this. For now lets just add the missing types to our usual list of unsupported types. llvm-svn: 368424
* [lldb][NFC] Remove commented out code in ↵Raphael Isemann2019-08-071-18/+0
| | | | | | ClangASTContext::AddMethodToCXXRecordType llvm-svn: 368150
* [CompilerType] Remove an unused function.Davide Italiano2019-08-051-33/+0
| | | | | | | | | | | | | | | | | | Summary: This simplifies the interface, as I'm trying to understand how we can upstream swift support. <rdar://problem/36377967> Reviewers: teemperor, JDevlieghere, xiaobai, compnerd, friss Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D65781 llvm-svn: 367946
* [lldb][clang] Reflect LangStandard.h move to clang/BasicRainer Orth2019-08-051-19/+20
| | | | | | | | | | | D65562 <https://reviews.llvm.org/D65562> moves LangStandard.h from clang/Frontend to clang/Basic. This patch adjusts the single file in lldb that uses it to match. Tested on x86_64-pc-linux-gnu. Differential Revision: https://reviews.llvm.org/D65717 llvm-svn: 367865
* Fix ClangASTContext::CreateParameterDeclaration to not call addDeclShafik Yaghmour2019-08-021-2/+4
| | | | | | | | | Summary: The change https://reviews.llvm.org/D55575 modified ClangASTContext::CreateParameterDeclaration to call decl_ctx->addDecl(decl); this caused a regression since the existing code in DWARFASTParserClang::ParseChildParameters is called with the containing DeclContext. So when end up with cases where we are parsing a parameter for a member function and the parameter is added to the CXXRecordDecl as opposed to the CXXMethodDecl. This example is given in the regression test TestBreakpointInMemberFuncWNonPrimitiveParams.py which without this fix in a modules build leads to assert on setting a breakpoint in a member function with non primitive parameters. This scenario would be common when debugging LLDB or clang. Differential Revision: https://reviews.llvm.org/D65414 llvm-svn: 367726
* [Logging] Replace Log::Printf with LLDB_LOG macro (NFC)Jonas Devlieghere2019-07-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces explicit calls to log::Printf with the new LLDB_LOGF macro. The macro is similar to LLDB_LOG but supports printf-style format strings, instead of formatv-style format strings. So instead of writing: if (log) log->Printf("%s\n", str); You'd write: LLDB_LOG(log, "%s\n", str); This change was done mechanically with the command below. I replaced the spurious if-checks with vim, since I know how to do multi-line replacements with it. find . -type f -name '*.cpp' -exec \ sed -i '' -E 's/log->Printf\(/LLDB_LOGF\(log, /g' "{}" + Differential revision: https://reviews.llvm.org/D65128 llvm-svn: 366936
* Fix CreateFunctionTemplateSpecialization to prevent dangling poiner to stack ↵Shafik Yaghmour2019-07-171-3/+4
| | | | | | | | | | memory In ClangASTContext::CreateFunctionTemplateSpecializationInfo a TemplateArgumentList is allocated on the stack but is treated as if it is persistent in subsequent calls. When we exit the function func_decl will still point to the stack allocated memory. We will use TemplateArgumentList::CreateCopy instead which will allocate memory out of the DeclContext. Differential Revision: https://reviews.llvm.org/D64777 llvm-svn: 366365
OpenPOWER on IntegriCloud