[Lldb-commits] [lldb] r368620 - [CompilerType] Pass an ExecutionContextScope to GetTypeBitAlign.

Davide Italiano via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 12 14:49:54 PDT 2019


Author: davide
Date: Mon Aug 12 14:49:54 2019
New Revision: 368620

URL: http://llvm.org/viewvc/llvm-project?rev=368620&view=rev
Log:
[CompilerType] Pass an ExecutionContextScope to GetTypeBitAlign.

Modified:
    lldb/trunk/include/lldb/Symbol/ClangASTContext.h
    lldb/trunk/include/lldb/Symbol/CompilerType.h
    lldb/trunk/include/lldb/Symbol/TypeSystem.h
    lldb/trunk/source/Expression/Materializer.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
    lldb/trunk/source/Symbol/ClangASTContext.cpp
    lldb/trunk/source/Symbol/CompilerType.cpp

Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=368620&r1=368619&r2=368620&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Mon Aug 12 14:49:54 2019
@@ -709,7 +709,8 @@ public:
   lldb::Format GetFormat(lldb::opaque_compiler_type_t type) override;
 
   llvm::Optional<size_t>
-  GetTypeBitAlign(lldb::opaque_compiler_type_t type) override;
+  GetTypeBitAlign(lldb::opaque_compiler_type_t type,
+                  ExecutionContextScope *exe_scope) override;
 
   uint32_t GetNumChildren(lldb::opaque_compiler_type_t type,
                           bool omit_empty_base_classes,

Modified: lldb/trunk/include/lldb/Symbol/CompilerType.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/CompilerType.h?rev=368620&r1=368619&r2=368620&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/CompilerType.h (original)
+++ lldb/trunk/include/lldb/Symbol/CompilerType.h Mon Aug 12 14:49:54 2019
@@ -257,7 +257,7 @@ public:
 
   lldb::Format GetFormat() const;
 
-  llvm::Optional<size_t> GetTypeBitAlign() const;
+  llvm::Optional<size_t> GetTypeBitAlign(ExecutionContextScope *exe_scope) const;
 
   uint32_t GetNumChildren(bool omit_empty_base_classes,
                           const ExecutionContext *exe_ctx) const;

Modified: lldb/trunk/include/lldb/Symbol/TypeSystem.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/TypeSystem.h?rev=368620&r1=368619&r2=368620&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/TypeSystem.h (original)
+++ lldb/trunk/include/lldb/Symbol/TypeSystem.h Mon Aug 12 14:49:54 2019
@@ -387,7 +387,8 @@ public:
                              uint32_t &length) = 0;
 
   virtual llvm::Optional<size_t>
-  GetTypeBitAlign(lldb::opaque_compiler_type_t type) = 0;
+  GetTypeBitAlign(lldb::opaque_compiler_type_t type,
+                  ExecutionContextScope *exe_scope) = 0;
 
   virtual CompilerType GetBasicTypeFromAST(lldb::BasicType basic_type) = 0;
 

Modified: lldb/trunk/source/Expression/Materializer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/Materializer.cpp?rev=368620&r1=368619&r2=368620&view=diff
==============================================================================
--- lldb/trunk/source/Expression/Materializer.cpp (original)
+++ lldb/trunk/source/Expression/Materializer.cpp Mon Aug 12 14:49:54 2019
@@ -531,7 +531,7 @@ public:
         }
 
         llvm::Optional<size_t> opt_bit_align =
-            m_variable_sp->GetType()->GetLayoutCompilerType().GetTypeBitAlign();
+            m_variable_sp->GetType()->GetLayoutCompilerType().GetTypeBitAlign(scope);
         if (!opt_bit_align) {
           err.SetErrorStringWithFormat("can't get the type alignment for %s",
                                        m_variable_sp->GetName().AsCString());
@@ -792,7 +792,7 @@ public:
         return;
       }
 
-      llvm::Optional<size_t> opt_bit_align = m_type.GetTypeBitAlign();
+      llvm::Optional<size_t> opt_bit_align = m_type.GetTypeBitAlign(exe_scope);
       if (!opt_bit_align) {
         err.SetErrorStringWithFormat("can't get the type alignment");
         return;

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp?rev=368620&r1=368619&r2=368620&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp (original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp Mon Aug 12 14:49:54 2019
@@ -1302,7 +1302,7 @@ bool IRForTarget::MaybeHandleVariable(Va
     llvm::Optional<uint64_t> value_size = compiler_type.GetByteSize(nullptr);
     if (!value_size)
       return false;
-    llvm::Optional<size_t> opt_alignment = compiler_type.GetTypeBitAlign();
+    llvm::Optional<size_t> opt_alignment = compiler_type.GetTypeBitAlign(nullptr);
     if (!opt_alignment)
       return false;
     lldb::offset_t value_alignment = (*opt_alignment + 7ull) / 8ull;

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=368620&r1=368619&r2=368620&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Mon Aug 12 14:49:54 2019
@@ -5088,7 +5088,8 @@ ClangASTContext::GetBitSize(lldb::opaque
 }
 
 llvm::Optional<size_t>
-ClangASTContext::GetTypeBitAlign(lldb::opaque_compiler_type_t type) {
+ClangASTContext::GetTypeBitAlign(lldb::opaque_compiler_type_t type,
+                                 ExecutionContextScope *exe_scope) {
   if (GetCompleteType(type))
     return getASTContext()->getTypeAlign(GetQualType(type));
   return {};

Modified: lldb/trunk/source/Symbol/CompilerType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/CompilerType.cpp?rev=368620&r1=368619&r2=368620&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/CompilerType.cpp (original)
+++ lldb/trunk/source/Symbol/CompilerType.cpp Mon Aug 12 14:49:54 2019
@@ -503,9 +503,9 @@ CompilerType::GetByteSize(ExecutionConte
   return {};
 }
 
-llvm::Optional<size_t> CompilerType::GetTypeBitAlign() const {
+llvm::Optional<size_t> CompilerType::GetTypeBitAlign(ExecutionContextScope *exe_scope) const {
   if (IsValid())
-    return m_type_system->GetTypeBitAlign(m_type);
+    return m_type_system->GetTypeBitAlign(m_type, exe_scope);
   return {};
 }
 




More information about the lldb-commits mailing list