summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2011-10-07 23:18:13 +0000
committerSean Callanan <scallanan@apple.com>2011-10-07 23:18:13 +0000
commit880e680fa3ac5cb7c9d4a42ad69c5590b4cab0ac (patch)
tree1598270efe28fb84f765cd07d5bcfccb155975b9 /lldb
parent883ec9711530053a0f38e2cd3ef2b72af6e2ebea (diff)
downloadbcm5719-llvm-880e680fa3ac5cb7c9d4a42ad69c5590b4cab0ac.tar.gz
bcm5719-llvm-880e680fa3ac5cb7c9d4a42ad69c5590b4cab0ac.zip
Updated LLVM/Clang to pull in the latest ARM disassembler.
This involved minor changes to the way we report Objective-C methods, as well as cosmetic changes and added parameters for a variety of Clang APIs. llvm-svn: 141437
Diffstat (limited to 'lldb')
-rw-r--r--lldb/include/lldb/Core/ClangForward.h3
-rw-r--r--lldb/include/lldb/Symbol/ClangASTContext.h12
-rw-r--r--lldb/scripts/build-llvm.pl5
-rw-r--r--lldb/source/Expression/ASTDumper.cpp4
-rw-r--r--lldb/source/Expression/ASTResultSynthesizer.cpp4
-rw-r--r--lldb/source/Expression/ClangASTSource.cpp28
-rw-r--r--lldb/source/Expression/ClangExpressionDeclMap.cpp4
-rw-r--r--lldb/source/Expression/ClangExpressionParser.cpp14
-rw-r--r--lldb/source/Symbol/ClangASTContext.cpp62
-rw-r--r--lldb/source/Symbol/ClangASTType.cpp2
10 files changed, 76 insertions, 62 deletions
diff --git a/lldb/include/lldb/Core/ClangForward.h b/lldb/include/lldb/Core/ClangForward.h
index 3640124b4c2..d4b854925c8 100644
--- a/lldb/include/lldb/Core/ClangForward.h
+++ b/lldb/include/lldb/Core/ClangForward.h
@@ -52,7 +52,8 @@ namespace clang
class DeclStmt;
class DependencyOutputOptions;
class Diagnostic;
- class DiagnosticClient;
+ class DiagnosticConsumer;
+ class DiagnosticsEngine;
class DiagnosticOptions;
class EnumDecl;
class Expr;
diff --git a/lldb/include/lldb/Symbol/ClangASTContext.h b/lldb/include/lldb/Symbol/ClangASTContext.h
index 8fbd99cf1b6..630ca83ee93 100644
--- a/lldb/include/lldb/Symbol/ClangASTContext.h
+++ b/lldb/include/lldb/Symbol/ClangASTContext.h
@@ -84,11 +84,11 @@ public:
clang::SourceManager *
getSourceManager();
- clang::Diagnostic *
- getDiagnostic();
+ clang::DiagnosticsEngine *
+ getDiagnosticsEngine();
- clang::DiagnosticClient *
- getDiagnosticClient();
+ clang::DiagnosticConsumer *
+ getDiagnosticConsumer();
clang::TargetOptions *
getTargetOptions();
@@ -760,8 +760,8 @@ protected:
std::auto_ptr<clang::FileManager> m_file_manager_ap;
std::auto_ptr<clang::FileSystemOptions> m_file_system_options_ap;
std::auto_ptr<clang::SourceManager> m_source_manager_ap;
- std::auto_ptr<clang::Diagnostic> m_diagnostic_ap;
- std::auto_ptr<clang::DiagnosticClient> m_diagnostic_client_ap;
+ std::auto_ptr<clang::DiagnosticsEngine> m_diagnostics_engine_ap;
+ std::auto_ptr<clang::DiagnosticConsumer> m_diagnostic_consumer_ap;
std::auto_ptr<clang::TargetOptions> m_target_options_ap;
std::auto_ptr<clang::TargetInfo> m_target_info_ap;
std::auto_ptr<clang::IdentifierTable> m_identifier_table_ap;
diff --git a/lldb/scripts/build-llvm.pl b/lldb/scripts/build-llvm.pl
index fc5d96db9bb..fe081bd7133 100644
--- a/lldb/scripts/build-llvm.pl
+++ b/lldb/scripts/build-llvm.pl
@@ -22,8 +22,8 @@ our @llvm_clang_slices; # paths to the single architecture static libraries (arc
our $llvm_configuration = $ENV{LLVM_CONFIGURATION};
-our $llvm_revision = "137311";
-our $clang_revision = "137311";
+our $llvm_revision = "141418";
+our $clang_revision = "141418";
our $llvm_source_dir = "$ENV{SRCROOT}";
our @archs = split (/\s+/, $ENV{ARCHS});
@@ -42,7 +42,6 @@ our @archive_files = (
"$llvm_configuration/lib/libclangParse.a",
"$llvm_configuration/lib/libclangSema.a",
"$llvm_configuration/lib/libclangSerialization.a",
- "$llvm_configuration/lib/libCompilerDriver.a",
"$llvm_configuration/lib/libEnhancedDisassembly.a",
"$llvm_configuration/lib/libLLVMAnalysis.a",
"$llvm_configuration/lib/libLLVMArchive.a",
diff --git a/lldb/source/Expression/ASTDumper.cpp b/lldb/source/Expression/ASTDumper.cpp
index 8194233792e..3f6104b7fde 100644
--- a/lldb/source/Expression/ASTDumper.cpp
+++ b/lldb/source/Expression/ASTDumper.cpp
@@ -245,7 +245,7 @@ void ASTDumper::VisitTypeDecl (clang::TypeDecl *type_decl)
void ASTDumper::VisitTagDecl (clang::TagDecl *tag_decl)
{
m_stream.Indent(); m_stream.Printf("class : TagDecl\n");
- m_stream.Indent(); m_stream.Printf("isDefinition() : %s\n", SfB(tag_decl->isDefinition()));
+ m_stream.Indent(); m_stream.Printf("getDefinition() : %s\n", SfB((bool)tag_decl->getDefinition()));
m_stream.Indent(); m_stream.Printf("isBeingDefined() : %s\n", SfB(tag_decl->isBeingDefined()));
m_stream.Indent(); m_stream.Printf("isEmbeddedInDeclarator() : %s\n", SfB(tag_decl->isEmbeddedInDeclarator()));
m_stream.Indent(); m_stream.Printf("isDependentType() : %s\n", SfB(tag_decl->isDependentType()));
@@ -416,7 +416,7 @@ void ASTDumper::VisitType (const clang::Type *type)
switch (type->getScalarTypeKind())
{
default: m_stream.Printf("~\n"); break;
- case clang::Type::STK_Pointer: m_stream.Printf("STK_Pointer\n"); break;
+ case clang::Type::STK_CPointer: m_stream.Printf("STK_CPointer\n"); break;
case clang::Type::STK_MemberPointer: m_stream.Printf("STK_MemberPointer\n"); break;
case clang::Type::STK_Bool: m_stream.Printf("STK_Bool\n"); break;
case clang::Type::STK_Integral: m_stream.Printf("STK_Integral\n"); break;
diff --git a/lldb/source/Expression/ASTResultSynthesizer.cpp b/lldb/source/Expression/ASTResultSynthesizer.cpp
index b2b593bbed9..db0714e238b 100644
--- a/lldb/source/Expression/ASTResultSynthesizer.cpp
+++ b/lldb/source/Expression/ASTResultSynthesizer.cpp
@@ -200,6 +200,10 @@ ASTResultSynthesizer::SynthesizeObjCMethodResult (ObjCMethodDecl *MethodDecl)
}
Stmt *method_body = MethodDecl->getBody();
+
+ if (!method_body)
+ return false;
+
CompoundStmt *compound_stmt = dyn_cast<CompoundStmt>(method_body);
bool ret = SynthesizeBodyResult (compound_stmt,
diff --git a/lldb/source/Expression/ClangASTSource.cpp b/lldb/source/Expression/ClangASTSource.cpp
index 26bf0b95b22..854fcc880d9 100644
--- a/lldb/source/Expression/ClangASTSource.cpp
+++ b/lldb/source/Expression/ClangASTSource.cpp
@@ -197,27 +197,25 @@ NameSearchContext::AddFunDecl (void *type)
unsigned NumArgs = func_proto_type->getNumArgs();
unsigned ArgIndex;
- ParmVarDecl **param_var_decls = new ParmVarDecl*[NumArgs];
-
+ SmallVector<ParmVarDecl *, 5> parm_var_decls;
+
for (ArgIndex = 0; ArgIndex < NumArgs; ++ArgIndex)
{
QualType arg_qual_type (func_proto_type->getArgType(ArgIndex));
- param_var_decls[ArgIndex] = ParmVarDecl::Create (m_ast_source.m_ast_context,
- const_cast<DeclContext*>(m_decl_context),
- SourceLocation(),
- SourceLocation(),
- NULL,
- arg_qual_type,
- NULL,
- SC_Static,
- SC_Static,
- NULL);
+ parm_var_decls.push_back(ParmVarDecl::Create (m_ast_source.m_ast_context,
+ const_cast<DeclContext*>(m_decl_context),
+ SourceLocation(),
+ SourceLocation(),
+ NULL,
+ arg_qual_type,
+ NULL,
+ SC_Static,
+ SC_Static,
+ NULL));
}
- func_decl->setParams(param_var_decls, NumArgs);
-
- delete [] param_var_decls;
+ func_decl->setParams(ArrayRef<ParmVarDecl*>(parm_var_decls));
}
m_decls.push_back(func_decl);
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp
index 42c6f7a9d92..368bbe65f57 100644
--- a/lldb/source/Expression/ClangExpressionDeclMap.cpp
+++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp
@@ -2388,6 +2388,10 @@ ClangExpressionDeclMap::GetDecls (NameSearchContext &context, const ConstString
return;
}
+
+ // any other $__lldb names should be weeded out now
+ if (!::strncmp(name_unique_cstr, "$__lldb", sizeof("$__lldb") - 1))
+ return;
do
{
diff --git a/lldb/source/Expression/ClangExpressionParser.cpp b/lldb/source/Expression/ClangExpressionParser.cpp
index e674565558e..17cc5a84c0d 100644
--- a/lldb/source/Expression/ClangExpressionParser.cpp
+++ b/lldb/source/Expression/ClangExpressionParser.cpp
@@ -41,7 +41,6 @@
#include "clang/Frontend/FrontendPluginRegistry.h"
#include "clang/Frontend/TextDiagnosticBuffer.h"
#include "clang/Frontend/TextDiagnosticPrinter.h"
-#include "clang/Frontend/VerifyDiagnosticsClient.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Parse/ParseAST.h"
#include "clang/Rewrite/FrontendActions.h"
@@ -50,6 +49,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
+#include "llvm/Support/TargetSelect.h"
#if !defined(__APPLE__)
#define USE_STANDARD_JIT
@@ -67,8 +67,6 @@
#include "llvm/Support/DynamicLibrary.h"
#include "llvm/Support/Host.h"
#include "llvm/Support/Signals.h"
-#include "llvm/Target/TargetRegistry.h"
-#include "llvm/Target/TargetSelect.h"
using namespace clang;
using namespace llvm;
@@ -103,12 +101,12 @@ std::string GetBuiltinIncludePath(const char *Argv0) {
//===----------------------------------------------------------------------===//
static void LLVMErrorHandler(void *UserData, const std::string &Message) {
- Diagnostic &Diags = *static_cast<Diagnostic*>(UserData);
+ DiagnosticsEngine &Diags = *static_cast<DiagnosticsEngine*>(UserData);
Diags.Report(diag::err_fe_error_backend) << Message;
// We cannot recover from llvm errors.
- exit(1);
+ assert(0);
}
static FrontendAction *CreateFrontendBaseAction(CompilerInstance &CI) {
@@ -132,7 +130,7 @@ static FrontendAction *CreateFrontendBaseAction(CompilerInstance &CI) {
case EmitCodeGenOnly: return new EmitCodeGenOnlyAction();
case EmitObj: return new EmitObjAction();
case FixIt: return new FixItAction();
- case GeneratePCH: return new GeneratePCHAction();
+ case GeneratePCH: return new GeneratePCHAction(false);
case GeneratePTH: return new GeneratePTHAction();
case InitOnly: return new InitOnlyAction();
case ParseSyntaxOnly: return new SyntaxOnlyAction();
@@ -308,11 +306,11 @@ ClangExpressionParser::ClangExpressionParser (ExecutionContextScope *exe_scope,
// 6. Most of this we get from the CompilerInstance, but we
// also want to give the context an ExternalASTSource.
m_selector_table.reset(new SelectorTable());
- m_builtin_context.reset(new Builtin::Context(m_compiler->getTarget()));
+ m_builtin_context.reset(new Builtin::Context());
std::auto_ptr<clang::ASTContext> ast_context(new ASTContext(m_compiler->getLangOpts(),
m_compiler->getSourceManager(),
- m_compiler->getTarget(),
+ &m_compiler->getTarget(),
m_compiler->getPreprocessor().getIdentifierTable(),
*m_selector_table.get(),
*m_builtin_context.get(),
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index 43996398e1d..c069bd2e818 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -359,7 +359,7 @@ ClangASTContext::ClangASTContext (const char *target_triple) :
m_ast_ap(),
m_language_options_ap(),
m_source_manager_ap(),
- m_diagnostic_ap(),
+ m_diagnostics_engine_ap(),
m_target_options_ap(),
m_target_info_ap(),
m_identifier_table_ap(),
@@ -384,7 +384,7 @@ ClangASTContext::~ClangASTContext()
m_identifier_table_ap.reset();
m_target_info_ap.reset();
m_target_options_ap.reset();
- m_diagnostic_ap.reset();
+ m_diagnostics_engine_ap.reset();
m_source_manager_ap.reset();
m_language_options_ap.reset();
m_ast_ap.reset();
@@ -397,7 +397,7 @@ ClangASTContext::Clear()
m_ast_ap.reset();
m_language_options_ap.reset();
m_source_manager_ap.reset();
- m_diagnostic_ap.reset();
+ m_diagnostics_engine_ap.reset();
m_target_options_ap.reset();
m_target_info_ap.reset();
m_identifier_table_ap.reset();
@@ -468,7 +468,7 @@ ClangASTContext::getASTContext()
{
m_ast_ap.reset(new ASTContext (*getLanguageOptions(),
*getSourceManager(),
- *getTargetInfo(),
+ getTargetInfo(),
*getIdentifierTable(),
*getSelectorTable(),
*getBuiltinContext(),
@@ -480,7 +480,7 @@ ClangASTContext::getASTContext()
//m_ast_ap->getTranslationUnitDecl()->setHasExternalVisibleStorage();
}
- m_ast_ap->getDiagnostics().setClient(getDiagnosticClient(), false);
+ m_ast_ap->getDiagnostics().setClient(getDiagnosticConsumer(), false);
}
return m_ast_ap.get();
}
@@ -489,7 +489,7 @@ Builtin::Context *
ClangASTContext::getBuiltinContext()
{
if (m_builtins_ap.get() == NULL)
- m_builtins_ap.reset (new Builtin::Context(*getTargetInfo()));
+ m_builtins_ap.reset (new Builtin::Context());
return m_builtins_ap.get();
}
@@ -536,30 +536,30 @@ clang::SourceManager *
ClangASTContext::getSourceManager()
{
if (m_source_manager_ap.get() == NULL)
- m_source_manager_ap.reset(new clang::SourceManager(*getDiagnostic(), *getFileManager()));
+ m_source_manager_ap.reset(new clang::SourceManager(*getDiagnosticsEngine(), *getFileManager()));
return m_source_manager_ap.get();
}
-Diagnostic *
-ClangASTContext::getDiagnostic()
+clang::DiagnosticsEngine *
+ClangASTContext::getDiagnosticsEngine()
{
- if (m_diagnostic_ap.get() == NULL)
+ if (m_diagnostics_engine_ap.get() == NULL)
{
llvm::IntrusiveRefCntPtr<DiagnosticIDs> diag_id_sp(new DiagnosticIDs());
- m_diagnostic_ap.reset(new Diagnostic(diag_id_sp));
+ m_diagnostics_engine_ap.reset(new DiagnosticsEngine(diag_id_sp));
}
- return m_diagnostic_ap.get();
+ return m_diagnostics_engine_ap.get();
}
-class NullDiagnosticClient : public DiagnosticClient
+class NullDiagnosticConsumer : public DiagnosticConsumer
{
public:
- NullDiagnosticClient ()
+ NullDiagnosticConsumer ()
{
m_log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS);
}
- void HandleDiagnostic (Diagnostic::Level DiagLevel, const DiagnosticInfo &info)
+ void HandleDiagnostic (DiagnosticsEngine::Level DiagLevel, const Diagnostic &info)
{
if (m_log)
{
@@ -569,17 +569,22 @@ public:
m_log->Printf("Compiler diagnostic: %s\n", diag_str.data());
}
}
+
+ DiagnosticConsumer *clone (DiagnosticsEngine &Diags) const
+ {
+ return new NullDiagnosticConsumer ();
+ }
private:
LogSP m_log;
};
-DiagnosticClient *
-ClangASTContext::getDiagnosticClient()
+DiagnosticConsumer *
+ClangASTContext::getDiagnosticConsumer()
{
- if (m_diagnostic_client_ap.get() == NULL)
- m_diagnostic_client_ap.reset(new NullDiagnosticClient);
+ if (m_diagnostic_consumer_ap.get() == NULL)
+ m_diagnostic_consumer_ap.reset(new NullDiagnosticConsumer);
- return m_diagnostic_client_ap.get();
+ return m_diagnostic_consumer_ap.get();
}
TargetOptions *
@@ -600,7 +605,7 @@ ClangASTContext::getTargetInfo()
{
// target_triple should be something like "x86_64-apple-darwin10"
if (m_target_info_ap.get() == NULL && !m_target_triple.empty())
- m_target_info_ap.reset (TargetInfo::CreateTargetInfo(*getDiagnostic(), *getTargetOptions()));
+ m_target_info_ap.reset (TargetInfo::CreateTargetInfo(*getDiagnosticsEngine(), *getTargetOptions()));
return m_target_info_ap.get();
}
@@ -1466,7 +1471,8 @@ ClangASTContext::AddMethodToCXXRecordType
NULL, // TypeSourceInfo *
is_explicit,
is_inline,
- is_implicitly_declared);
+ is_implicitly_declared,
+ false /*is_constexpr*/);
}
else
{
@@ -1492,6 +1498,7 @@ ClangASTContext::AddMethodToCXXRecordType
is_static,
SC_None,
is_inline,
+ false /*is_constexpr*/,
SourceLocation());
}
else if (num_params == 0)
@@ -1505,6 +1512,7 @@ ClangASTContext::AddMethodToCXXRecordType
NULL, // TypeSourceInfo *
is_inline,
is_explicit,
+ false /*is_constexpr*/,
SourceLocation());
}
}
@@ -1520,6 +1528,7 @@ ClangASTContext::AddMethodToCXXRecordType
is_static,
SC_None,
is_inline,
+ false /*is_constexpr*/,
SourceLocation());
}
}
@@ -1549,7 +1558,7 @@ ClangASTContext::AddMethodToCXXRecordType
NULL));
}
- cxx_method_decl->setParams (params.data(), num_params);
+ cxx_method_decl->setParams (ArrayRef<ParmVarDecl*>(params));
cxx_record_decl->addDecl (cxx_method_decl);
@@ -2020,9 +2029,10 @@ ClangASTContext::AddMethodToObjCObjectType
name[0] == '-',
is_variadic,
is_synthesized,
+ true, // is_implicitly_declared
is_defined,
imp_control,
- num_args);
+ false /*has_related_result_type*/);
if (objc_method_decl == NULL)
@@ -2046,7 +2056,7 @@ ClangASTContext::AddMethodToObjCObjectType
NULL));
}
- objc_method_decl->setMethodParams(*ast, params.data(), params.size(), num_args);
+ objc_method_decl->setMethodParams(*ast, ArrayRef<ParmVarDecl*>(params), ArrayRef<SourceLocation>());
}
class_interface_decl->addDecl (objc_method_decl);
@@ -4208,7 +4218,7 @@ void
ClangASTContext::SetFunctionParameters (FunctionDecl *function_decl, ParmVarDecl **params, unsigned num_params)
{
if (function_decl)
- function_decl->setParams (params, num_params);
+ function_decl->setParams (ArrayRef<ParmVarDecl*>(params, num_params));
}
diff --git a/lldb/source/Symbol/ClangASTType.cpp b/lldb/source/Symbol/ClangASTType.cpp
index 6d9f6dfadad..deb88e23add 100644
--- a/lldb/source/Symbol/ClangASTType.cpp
+++ b/lldb/source/Symbol/ClangASTType.cpp
@@ -1286,7 +1286,7 @@ ClangASTType::DumpTypeDescription (clang::ASTContext *ast_context, clang_type_t
{
clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
if (class_interface_decl)
- class_interface_decl->print(llvm_ostrm, ast_context->PrintingPolicy, s->GetIndentLevel());
+ class_interface_decl->print(llvm_ostrm, ast_context->getPrintingPolicy(), s->GetIndentLevel());
}
}
break;
OpenPOWER on IntegriCloud