Updated to LLVM/Clang revision 127600.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@127634 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/ASTResultSynthesizer.cpp b/source/Expression/ASTResultSynthesizer.cpp
index dcb18f4..bae9276 100644
--- a/source/Expression/ASTResultSynthesizer.cpp
+++ b/source/Expression/ASTResultSynthesizer.cpp
@@ -320,6 +320,7 @@
result_decl = VarDecl::Create(Ctx,
DC,
SourceLocation(),
+ SourceLocation(),
&result_ptr_id,
ptr_qual_type,
NULL,
@@ -331,7 +332,7 @@
ExprResult address_of_expr = m_sema->CreateBuiltinUnaryOp(SourceLocation(), UO_AddrOf, last_expr);
- m_sema->AddInitializerToDecl(result_decl, address_of_expr.take());
+ m_sema->AddInitializerToDecl(result_decl, address_of_expr.take(), true, true);
}
else
{
@@ -339,7 +340,8 @@
result_decl = VarDecl::Create(Ctx,
DC,
- SourceLocation(),
+ SourceLocation(),
+ SourceLocation(),
&result_id,
expr_qual_type,
NULL,
@@ -349,7 +351,7 @@
if (!result_decl)
return false;
- m_sema->AddInitializerToDecl(result_decl, last_expr);
+ m_sema->AddInitializerToDecl(result_decl, last_expr, true, true);
}
DC->addDecl(result_decl);
diff --git a/source/Expression/ASTStructExtractor.cpp b/source/Expression/ASTStructExtractor.cpp
index 8635ffe..0375a97 100644
--- a/source/Expression/ASTStructExtractor.cpp
+++ b/source/Expression/ASTStructExtractor.cpp
@@ -75,9 +75,9 @@
if (!struct_layout)
return;
- m_function.m_struct_size = struct_layout->getSize() / 8; // Clang returns sizes in bits.
+ m_function.m_struct_size = struct_layout->getSize().getQuantity(); // TODO Store m_struct_size as CharUnits
m_function.m_return_offset = struct_layout->getFieldOffset(struct_layout->getFieldCount() - 1) / 8;
- m_function.m_return_size = (struct_layout->getDataSize() / 8) - m_function.m_return_offset;
+ m_function.m_return_size = struct_layout->getDataSize().getQuantity() - m_function.m_return_offset;
for (unsigned field_index = 0, num_fields = struct_layout->getFieldCount();
field_index < num_fields;
diff --git a/source/Expression/ClangASTSource.cpp b/source/Expression/ClangASTSource.cpp
index fa9d50e..f3526a7 100644
--- a/source/Expression/ClangASTSource.cpp
+++ b/source/Expression/ClangASTSource.cpp
@@ -159,6 +159,7 @@
clang::NamedDecl *Decl = VarDecl::Create(m_ast_source.m_ast_context,
const_cast<DeclContext*>(m_decl_context),
SourceLocation(),
+ SourceLocation(),
ii,
QualType::getFromOpaquePtr(type),
0,
@@ -175,6 +176,7 @@
clang::FunctionDecl *func_decl = FunctionDecl::Create (m_ast_source.m_ast_context,
const_cast<DeclContext*>(m_decl_context),
SourceLocation(),
+ SourceLocation(),
m_decl_name.getAsIdentifierInfo(),
QualType::getFromOpaquePtr(type),
NULL,
@@ -204,6 +206,7 @@
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,
diff --git a/source/Expression/ClangExpressionParser.cpp b/source/Expression/ClangExpressionParser.cpp
index 231924f..6830198 100644
--- a/source/Expression/ClangExpressionParser.cpp
+++ b/source/Expression/ClangExpressionParser.cpp
@@ -47,13 +47,13 @@
#include "clang/Parse/ParseAST.h"
#include "clang/Rewrite/FrontendActions.h"
#include "clang/Sema/SemaConsumer.h"
-#include "clang/StaticAnalyzer/FrontendActions.h"
+#include "clang/StaticAnalyzer/Frontend/FrontendActions.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/JIT.h"
-#include "llvm/Module.h"
#include "llvm/LLVMContext.h"
+#include "llvm/Module.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/DynamicLibrary.h"
@@ -112,7 +112,7 @@
case ASTDump: return new ASTDumpAction();
case ASTPrint: return new ASTPrintAction();
- case ASTPrintXML: return new ASTPrintXMLAction();
+ case ASTDumpXML: return new ASTDumpXMLAction();
case ASTView: return new ASTViewAction();
case BoostCon: return new BoostConAction();
case DumpRawTokens: return new DumpRawTokensAction();
@@ -127,7 +127,6 @@
case FixIt: return new FixItAction();
case GeneratePCH: return new GeneratePCHAction();
case GeneratePTH: return new GeneratePTHAction();
- case InheritanceView: return new InheritanceViewAction();
case InitOnly: return new InitOnlyAction();
case ParseSyntaxOnly: return new SyntaxOnlyAction();
@@ -196,7 +195,6 @@
// 1. Create a new compiler instance.
m_compiler.reset(new CompilerInstance());
- m_compiler->setLLVMContext(new LLVMContext());
// 2. Set options.
@@ -305,10 +303,11 @@
std::string module_name("$__lldb_module");
+ m_llvm_context.reset(new LLVMContext());
m_code_generator.reset(CreateLLVMCodeGen(m_compiler->getDiagnostics(),
module_name,
m_compiler->getCodeGenOpts(),
- m_compiler->getLLVMContext()));
+ *m_llvm_context));
}
ClangExpressionParser::~ClangExpressionParser()