Updated to revision 123723 of LLVM, to bring in

support for minimal type import functionality.

llvm-svn: 123787
This commit is contained in:
Sean Callanan 2011-01-18 23:32:05 +00:00
parent dac7a0174e
commit 2c777c4afb
6 changed files with 34 additions and 28 deletions

View File

@ -25,7 +25,7 @@ our @llvm_clang_slices; # paths to the single architecture static libraries (arc
our $llvm_configuration = $ENV{LLVM_CONFIGURATION};
our $llvm_revision = "121655";
our $llvm_revision = "123723";
our $llvm_source_dir = "$ENV{SRCROOT}";
our $cc = "$ENV{DEVELOPER_BIN_DIR}/gcc-4.2";
our $cxx = "$ENV{DEVELOPER_BIN_DIR}/g++-4.2";
@ -74,7 +74,6 @@ our @archive_files = (
"$llvm_configuration/lib/libLLVMScalarOpts.a",
"$llvm_configuration/lib/libLLVMSelectionDAG.a",
"$llvm_configuration/lib/libLLVMSupport.a",
"$llvm_configuration/lib/libLLVMSystem.a",
"$llvm_configuration/lib/libLLVMTarget.a",
"$llvm_configuration/lib/libLLVMTransformUtils.a",
"$llvm_configuration/lib/libLLVMX86AsmParser.a",
@ -82,7 +81,6 @@ our @archive_files = (
"$llvm_configuration/lib/libLLVMX86CodeGen.a",
"$llvm_configuration/lib/libLLVMX86Disassembler.a",
"$llvm_configuration/lib/libLLVMX86Info.a",
"$llvm_configuration/lib/libclangChecker.a"
);
if (-l $llvm_dstroot)

View File

@ -499,7 +499,9 @@ FileSpec::ResolveExecutableLocation ()
{
const std::string file_str (m_filename.AsCString());
llvm::sys::Path path = llvm::sys::Program::FindProgramByName (file_str);
llvm::StringRef dir_ref = path.getDirname();
const std::string &path_str = path.str();
llvm::StringRef dir_ref = llvm::sys::path::parent_path(path_str);
//llvm::StringRef dir_ref = path.getDirname();
if (! dir_ref.empty())
{
// FindProgramByName returns "." if it can't find the file.

View File

@ -225,16 +225,14 @@ NameSearchContext::AddFunDecl (void *type)
clang::NamedDecl *
NameSearchContext::AddGenericFunDecl()
{
FunctionProtoType::ExtProtoInfo proto_info;
proto_info.Variadic = true;
QualType generic_function_type(m_ast_source.m_ast_context.getFunctionType (m_ast_source.m_ast_context.getSizeType(), // result
NULL, // argument types
0, // number of arguments
true, // variadic?
0, // type qualifiers
false, // has exception specification?
false, // has any exception specification?
0, // number of exceptions
NULL, // exceptions
FunctionType::ExtInfo())); // defaults for noreturn, regparm, calling convention
proto_info));
return AddFunDecl(generic_function_type.getAsOpaquePtr());
}

View File

@ -30,7 +30,6 @@
#include "clang/Basic/FileManager.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Basic/Version.h"
#include "clang/Checker/FrontendActions.h"
#include "clang/CodeGen/CodeGenAction.h"
#include "clang/CodeGen/ModuleBuilder.h"
#include "clang/Driver/CC1Options.h"
@ -47,6 +46,7 @@
#include "clang/Parse/ParseAST.h"
#include "clang/Rewrite/FrontendActions.h"
#include "clang/Sema/SemaConsumer.h"
#include "clang/StaticAnalyzer/FrontendActions.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
@ -153,7 +153,7 @@ static FrontendAction *CreateFrontendBaseAction(CompilerInstance &CI) {
case RewriteMacros: return new RewriteMacrosAction();
case RewriteObjC: return new RewriteObjCAction();
case RewriteTest: return new RewriteTestAction();
case RunAnalysis: return new AnalysisAction();
//case RunAnalysis: return new AnalysisAction();
case RunPreprocessorOnly: return new PreprocessOnlyAction();
}
}

View File

@ -912,7 +912,8 @@ ClangASTContext::CopyType (ASTContext *dst_ast,
FileSystemOptions file_system_options;
FileManager file_manager (file_system_options);
ASTImporter importer(*dst_ast, file_manager,
*src_ast, file_manager);
*src_ast, file_manager,
false);
QualType src (QualType::getFromOpaquePtr(clang_type));
QualType dst (importer.Import(src));
@ -929,7 +930,8 @@ ClangASTContext::CopyDecl (ASTContext *dst_ast,
FileSystemOptions file_system_options;
FileManager file_manager (file_system_options);
ASTImporter importer(*dst_ast, file_manager,
*src_ast, file_manager);
*src_ast, file_manager,
false);
return importer.Import(source_decl);
}
@ -1629,7 +1631,8 @@ ClangASTContext::CreateBaseClassSpecifier (clang_type_t base_class_type, AccessT
is_virtual,
base_of_class,
ConvertAccessTypeToAccessSpecifier (access),
getASTContext()->CreateTypeSourceInfo (QualType::getFromOpaquePtr(base_class_type)));
getASTContext()->CreateTypeSourceInfo (QualType::getFromOpaquePtr(base_class_type)),
SourceLocation());
return NULL;
}
@ -2278,6 +2281,7 @@ ClangASTContext::GetNumPointeeChildren (clang_type_t clang_type)
case clang::BuiltinType::Bool:
case clang::BuiltinType::Char_U:
case clang::BuiltinType::UChar:
case clang::BuiltinType::WChar_U:
case clang::BuiltinType::Char16:
case clang::BuiltinType::Char32:
case clang::BuiltinType::UShort:
@ -2287,7 +2291,7 @@ ClangASTContext::GetNumPointeeChildren (clang_type_t clang_type)
case clang::BuiltinType::UInt128:
case clang::BuiltinType::Char_S:
case clang::BuiltinType::SChar:
case clang::BuiltinType::WChar:
case clang::BuiltinType::WChar_S:
case clang::BuiltinType::Short:
case clang::BuiltinType::Int:
case clang::BuiltinType::Long:
@ -3562,16 +3566,18 @@ ClangASTContext::CreateFunctionType (ASTContext *ast,
qual_type_args.push_back (QualType::getFromOpaquePtr(args[i]));
// TODO: Detect calling convention in DWARF?
FunctionProtoType::ExtProtoInfo proto_info;
proto_info.Variadic = is_variadic;
proto_info.HasExceptionSpec = false;
proto_info.HasAnyExceptionSpec = false;
proto_info.TypeQuals = type_quals;
proto_info.NumExceptions = 0;
proto_info.Exceptions = NULL;
return ast->getFunctionType(QualType::getFromOpaquePtr(result_type),
qual_type_args.empty() ? NULL : &qual_type_args.front(),
qual_type_args.size(),
is_variadic,
type_quals,
false, // hasExceptionSpec
false, // hasAnyExceptionSpec,
0, // NumExs
0, // const QualType *ExArray
FunctionType::ExtInfo ()).getAsOpaquePtr(); // NoReturn);
proto_info).getAsOpaquePtr(); // NoReturn);
}
ParmVarDecl *

View File

@ -140,7 +140,7 @@ ClangASTType::GetEncoding (clang_type_t clang_type, uint32_t &count)
case clang::BuiltinType::Bool:
case clang::BuiltinType::Char_S:
case clang::BuiltinType::SChar:
case clang::BuiltinType::WChar:
case clang::BuiltinType::WChar_S:
case clang::BuiltinType::Char16:
case clang::BuiltinType::Char32:
case clang::BuiltinType::Short:
@ -151,6 +151,7 @@ ClangASTType::GetEncoding (clang_type_t clang_type, uint32_t &count)
case clang::BuiltinType::Char_U:
case clang::BuiltinType::UChar:
case clang::BuiltinType::WChar_U:
case clang::BuiltinType::UShort:
case clang::BuiltinType::UInt:
case clang::BuiltinType::ULong:
@ -249,9 +250,10 @@ ClangASTType::GetFormat (clang_type_t clang_type)
case clang::BuiltinType::Bool: return lldb::eFormatBoolean;
case clang::BuiltinType::Char_S:
case clang::BuiltinType::SChar:
case clang::BuiltinType::WChar_S:
case clang::BuiltinType::Char_U:
case clang::BuiltinType::UChar:
case clang::BuiltinType::WChar: return lldb::eFormatChar;
case clang::BuiltinType::WChar_U: return lldb::eFormatChar;
case clang::BuiltinType::Char16: return lldb::eFormatUnicode16;
case clang::BuiltinType::Char32: return lldb::eFormatUnicode32;
case clang::BuiltinType::UShort: return lldb::eFormatUnsigned;