[Lldb-commits] [lldb] r201737 - Emit a warning diagnostic if a symbol was promoted

Sean Callanan scallanan at apple.com
Wed Feb 19 15:37:26 PST 2014


Author: spyffe
Date: Wed Feb 19 17:37:25 2014
New Revision: 201737

URL: http://llvm.org/viewvc/llvm-project?rev=201737&view=rev
Log:
Emit a warning diagnostic if a symbol was promoted
to a variable.  This helps people figure out what
happened if they tried to do something to the variable
and it didn't work because we gave it the default type
of void*.

Modified:
    lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp

Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=201737&r1=201736&r2=201737&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Wed Feb 19 17:37:25 2014
@@ -1428,6 +1428,10 @@ ClangExpressionDeclMap::FindExternalVisi
                 
                 if (data_symbol)
                 {
+                    std::string warning("got name from symbols: ");
+                    warning.append(name.AsCString());
+                    const unsigned diag_id = m_ast_context->getDiagnostics().getCustomDiagID(clang::DiagnosticsEngine::Level::Warning, "%0");
+                    m_ast_context->getDiagnostics().Report(diag_id) << warning.c_str();
                     AddOneGenericVariable(context, *data_symbol, current_id);
                     context.m_found.variable = true;
                 }





More information about the lldb-commits mailing list