Author: zturner
Date: Fri Nov  9 09:08:26 2018
New Revision: 346517

URL: http://llvm.org/viewvc/llvm-project?rev=346517&view=rev
Log:
[NativePDB] Fix completion of enum types.

This was originally submitted in a patch which fixed two unrelated
bugs at the same time.  This portion of the fix was reverted because
it broke several other things.  However, the fix employed originally
was totally wrong, and attempted to change something in the ValueObject
printer when actually the bug was in the NativePDB plugin.  We need
to mark forward enum decls as having external storage, otherwise
we won't be asked to complete them when the time comes.  This patch
implements the proper fix, and updates tests accordingly.

Modified:
    lldb/trunk/lit/SymbolFile/NativePDB/ast-reconstruction.cpp
    lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp

Modified: lldb/trunk/lit/SymbolFile/NativePDB/ast-reconstruction.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/NativePDB/ast-reconstruction.cpp?rev=346517&r1=346516&r2=346517&view=diff
==============================================================================
--- lldb/trunk/lit/SymbolFile/NativePDB/ast-reconstruction.cpp (original)
+++ lldb/trunk/lit/SymbolFile/NativePDB/ast-reconstruction.cpp Fri Nov  9 
09:08:26 2018
@@ -89,7 +89,7 @@ Anonymous<A::B::C<int>>::D AnonABCVoidD;
 // CHECK: (TrivialC) TC = {}
 // CHECK: (TrivialS) TS = {}
 // CHECK: (TrivialU) TU = {}
-// CHECK: (TrivialE) TE = <Unable to determine byte size.>
+// CHECK: (TrivialE) TE = TE_A
 // CHECK: (A::B::C<int>) ABCInt = (ABCMember = 0)
 // CHECK: (A::B::C<float>) ABCFloat = (ABCMember = 0)
 // CHECK: (A::B::C<void>) ABCVoid = (ABCSpecializationMember = 
0x0000000000000000)
@@ -105,6 +105,7 @@ Anonymous<A::B::C<int>>::D AnonABCVoidD;
 // CHECK: |-CXXRecordDecl {{.*}} struct TrivialS definition
 // CHECK: |-CXXRecordDecl {{.*}} union TrivialU definition
 // CHECK: |-EnumDecl {{.*}} TrivialE
+// CHECK: | `-EnumConstantDecl {{.*}} TE_A 'TrivialE'
 // CHECK: |-NamespaceDecl {{.*}} A
 // CHECK: | |-NamespaceDecl {{.*}} B
 // CHECK: | | |-CXXRecordDecl {{.*}} struct C<int> definition

Modified: lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp?rev=346517&r1=346516&r2=346517&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp 
(original)
+++ lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp Fri 
Nov  9 09:08:26 2018
@@ -913,6 +913,7 @@ lldb::TypeSP SymbolFileNativePDB::Create
       underlying_type->GetFullCompilerType(), er.isScoped());
 
   ClangASTContext::StartTagDeclarationDefinition(enum_ct);
+  ClangASTContext::SetHasExternalStorage(enum_ct.GetOpaqueQualType(), true);
 
   // We're just going to forward resolve this for now.  We'll complete
   // it only if the user requests.


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to