Updated LLVM/Clang to pick up a fix for imports of
C++ vtables, fixing a record layout problem in the
expression parser.
Also fixed various problems with the generation
and unpacking of llvm.zip given our new better
handling of multiple architectures in the LLVM
build.
(And added a log message that will hopefully catch
record layout problems in the future.)
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@143741 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lldb.xcodeproj/project.pbxproj b/lldb.xcodeproj/project.pbxproj
index 84c72d5..be1c5ce 100644
--- a/lldb.xcodeproj/project.pbxproj
+++ b/lldb.xcodeproj/project.pbxproj
@@ -3591,7 +3591,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
LLVM_BUILD_DIR = "$(SRCROOT)/llvm-build/$(LLVM_CONFIGURATION)";
LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/";
- LLVM_CONFIGURATION = "Release+Debug";
+ LLVM_CONFIGURATION = Release;
LLVM_SOURCE_DIR = "$(SRCROOT)/llvm";
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
@@ -3640,7 +3640,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
LLVM_BUILD_DIR = "$(SRCROOT)/llvm-build/$(LLVM_CONFIGURATION)";
LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/";
- LLVM_CONFIGURATION = "Release+Debug";
+ LLVM_CONFIGURATION = Release;
LLVM_SOURCE_DIR = "$(SRCROOT)/llvm";
OTHER_CFLAGS = (
"-flimit-debug-info",
@@ -3933,7 +3933,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
LLVM_BUILD_DIR = "$(OBJROOT)/llvm";
LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/";
- LLVM_CONFIGURATION = "Release+Debug";
+ LLVM_CONFIGURATION = Release;
LLVM_SOURCE_DIR = "$(SRCROOT)/llvm";
OTHER_CFLAGS = (
"-flimit-debug-info",
diff --git a/scripts/build-llvm.pl b/scripts/build-llvm.pl
index c903203..0fe878f 100644
--- a/scripts/build-llvm.pl
+++ b/scripts/build-llvm.pl
@@ -21,8 +21,8 @@
our $llvm_configuration = $ENV{LLVM_CONFIGURATION};
-our $llvm_revision = "143472";
-our $clang_revision = "143472";
+our $llvm_revision = "143631";
+our $clang_revision = "143631";
our $SRCROOT = "$ENV{SRCROOT}";
our $llvm_dstroot_zip = "$SRCROOT/llvm.zip";
@@ -125,6 +125,12 @@
}
my $arch_idx = 0;
+
+ if (!-d "${llvm_dstroot}")
+ {
+ do_command ("mkdir -p '${llvm_dstroot}'", "Creating directory '${llvm_dstroot}'", 1);
+ }
+
foreach my $arch (@archs)
{
my $llvm_dstroot_arch = "${llvm_dstroot}/${arch}";
@@ -137,15 +143,9 @@
# the .a file is a normal file which means it can't be from the
# zip file, we must remove the previous arch directory
do_command ("rm -rf '$llvm_dstroot_arch'", "Removing old '$llvm_dstroot_arch' directory", 1);
- }
- # Create the arch specific LLVM destination directory if needed
- if (!-d $llvm_dstroot_arch)
- {
- do_command ("mkdir -p '$llvm_dstroot_arch'", "making llvm build directory '$llvm_dstroot_arch'", 1);
- }
-
+ }
# Create a symlink to the .a file from the zip file
- do_command ("cd '$llvm_dstroot_arch' ; ln -s $ENV{SRCROOT}/llvm/$llvm_clang_basename", "making llvm archive symlink", 1);
+ do_command ("cd '$llvm_dstroot' ; ln -s $ENV{SRCROOT}/llvm/$arch", "making llvm archive symlink", 1);
}
}
exit 0;
diff --git a/scripts/checkpoint-llvm.pl b/scripts/checkpoint-llvm.pl
index 72d012c..f4c64d7 100755
--- a/scripts/checkpoint-llvm.pl
+++ b/scripts/checkpoint-llvm.pl
@@ -46,7 +46,35 @@
}
}
-if (@ARGV == 4)
+sub do_rsync_paths
+{
+ while (@_)
+ {
+ my $rsync_src = shift @_;
+ my $rsync_dst = shift @_;
+ print "rsync_src = '$rsync_src'\n";
+ print "rsync_dst = '$rsync_dst'\n";
+
+ if (!-d $rsync_dst)
+ {
+ mkdir $rsync_dst;
+ }
+
+ if (-e $rsync_src)
+ {
+ my ($rsync_dst_file, $rsync_dst_dir) = fileparse ($rsync_dst);
+ print "rsync_dst_dir = '$rsync_dst_dir'\n";
+ -e $rsync_dst_dir or do_command ("mkdir -p '$rsync_dst_dir'");
+ do_command ("rsync -amvC --exclude='*.tmp' --exclude='*.txt' --exclude='*.TXT' --exclude='*.td' --exclude='\.dir' --exclude=Makefile '$rsync_src' '$rsync_dst'");
+ }
+ else
+ {
+ die "$rsync_src does not exist!\n";
+ }
+ }
+}
+
+if (@ARGV > 4)
{
my $llvm_source_dir = abs_path(shift @ARGV); # The llvm source that contains full llvm and clang sources
my $llvm_build_dir = abs_path(shift @ARGV); # The llvm build directory that contains headers and
@@ -59,42 +87,40 @@
printf("LLVM zip file: '%s'\n", $llvm_zip_file);
-e $llvm_build_dir or die "LLVM build directory doesn't exist: '$llvm_build_dir': $!\n";
- -l "$llvm_build_dir/llvm" || die "Couldn't find llvm symlink '$llvm_build_dir/llvm': $!\n";
my $temp_dir = tempdir( CLEANUP => 1 );
print "temp dir = '$temp_dir'\n";
my $llvm_checkpoint_dir = "$temp_dir/llvm";
mkdir "$llvm_checkpoint_dir" or die "Couldn't make 'llvm' in '$temp_dir'\n";
- my @rsync_src_dst_paths =
+ my @generic_rsync_src_dst_paths =
(
"$llvm_source_dir/include", "$llvm_checkpoint_dir",
"$llvm_source_dir/tools/clang/include", "$llvm_checkpoint_dir/tools/clang",
- "$llvm_build_dir/llvm/include", "$llvm_checkpoint_dir",
- "$llvm_build_dir/llvm/tools/clang/include", "$llvm_checkpoint_dir/tools/clang",
);
-
- while (@rsync_src_dst_paths)
- {
- my $rsync_src = shift @rsync_src_dst_paths;
- my $rsync_dst = shift @rsync_src_dst_paths;
- print "rsync_src = '$rsync_src'\n";
- print "rsync_dst = '$rsync_dst'\n";
- if (-e $rsync_src)
- {
- my ($rsync_dst_file, $rsync_dst_dir) = fileparse ($rsync_dst);
- print "rsync_dst_dir = '$rsync_dst_dir'\n";
- -e $rsync_dst_dir or do_command ("mkdir -p '$rsync_dst_dir'");
- do_command ("rsync -amvC --exclude='*.tmp' --exclude='*.txt' --exclude='*.TXT' --exclude='*.td' --exclude='\.dir' --exclude=Makefile '$rsync_src' '$rsync_dst'");
- }
- }
+
+ do_rsync_paths (@generic_rsync_src_dst_paths);
- do_command ("cp '$llvm_build_dir/libllvmclang.a' '$llvm_checkpoint_dir'", "Copying libllvmclang.a", 1);
+ for my $arch (@ARGV)
+ {
+ my @specific_rsync_src_dst_paths =
+ (
+ "$llvm_build_dir/$arch/include", "$llvm_checkpoint_dir/$arch",
+ "$llvm_build_dir/$arch/tools/clang/include", "$llvm_checkpoint_dir/$arch/tools/clang",
+ );
+
+ do_rsync_paths (@specific_rsync_src_dst_paths);
+
+ do_command ("cp '$llvm_build_dir/$arch/libllvmclang.a' '$llvm_checkpoint_dir/$arch/libllvmclang.a'", "Copying .a file", 1);
+
+ }
+
+ #do_command ("cp '$llvm_build_dir/libllvmclang.a' '$llvm_checkpoint_dir'", "Copying libllvmclang.a", 1);
do_command ("rm -rf '$llvm_zip_file'", "Removing old llvm checkpoint file '$llvm_zip_file'", 1);
do_command ("(cd '$temp_dir' ; zip -r '$llvm_zip_file' 'llvm')", "Zipping llvm checkpoint directory '$llvm_checkpoint_dir' to '$llvm_zip_file'", 1);
}
else
{
- print "USAGE\n\tcheckpoint-llvm.pl <llvm-sources> <llvm-build> <lldb-build> <llvm-zip>\n\n";
- print "EXAMPLE\n\tcd lldb\n\t./scripts/checkpoint-llvm.pl llvm build/llvm build/BuildAndIntegration llvm.zip\n";
+ print "USAGE\n\tcheckpoint-llvm.pl <llvm-sources> <llvm-build> <lldb-build> <llvm-zip> <arch1> [<arch2> ...]\n\n";
+ print "EXAMPLE\n\tcd lldb\n\t./scripts/checkpoint-llvm.pl llvm build/llvm build/BuildAndIntegration llvm.zip x86_64 i386\n";
}
diff --git a/source/Core/ArchSpec.cpp b/source/Core/ArchSpec.cpp
index 089d2e9..5c179df 100644
--- a/source/Core/ArchSpec.cpp
+++ b/source/Core/ArchSpec.cpp
@@ -504,7 +504,7 @@
{
// No platform specified, fall back to the host system for
// the default vendor, os, and environment.
- llvm::Triple host_triple(llvm::sys::getHostTriple());
+ llvm::Triple host_triple(llvm::sys::getDefaultTargetTriple());
normalized_triple.setVendor(host_triple.getVendor());
normalized_triple.setOS(host_triple.getOS());
normalized_triple.setEnvironment(host_triple.getEnvironment());
diff --git a/source/Expression/ClangExpressionParser.cpp b/source/Expression/ClangExpressionParser.cpp
index 4a8f941..d040cd8 100644
--- a/source/Expression/ClangExpressionParser.cpp
+++ b/source/Expression/ClangExpressionParser.cpp
@@ -270,7 +270,7 @@
}
else
{
- m_compiler->getTargetOpts().Triple = llvm::sys::getHostTriple();
+ m_compiler->getTargetOpts().Triple = llvm::sys::getDefaultTargetTriple();
}
// 3. Set up various important bits of infrastructure.
diff --git a/source/Symbol/ClangASTImporter.cpp b/source/Symbol/ClangASTImporter.cpp
index 4ad6f54..783b873 100644
--- a/source/Symbol/ClangASTImporter.cpp
+++ b/source/Symbol/ClangASTImporter.cpp
@@ -42,7 +42,21 @@
minion_sp = GetMinion(src_ast, false);
if (minion_sp)
- return minion_sp->Import(decl);
+ {
+ clang::Decl *result = minion_sp->Import(decl);
+
+ if (!result)
+ {
+ lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
+
+ if (NamedDecl *named_decl = dyn_cast<NamedDecl>(decl))
+ log->Printf(" [ClangASTImporter] WARNING: Failed to import a %s '%s'", decl->getDeclKindName(), named_decl->getNameAsString().c_str());
+ else
+ log->Printf(" [ClangASTImporter] WARNING: Failed to import a %s", decl->getDeclKindName());
+ }
+
+ return result;
+ }
return NULL;
}