summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rwxr-xr-xutils/NewNightlyTest.pl131
-rw-r--r--utils/TableGen/CodeGenDAGPatterns.cpp4
-rw-r--r--utils/TableGen/LLVMCConfigurationEmitter.cpp31
3 files changed, 98 insertions, 68 deletions
diff --git a/utils/NewNightlyTest.pl b/utils/NewNightlyTest.pl
index 00d4038..c005bcb 100755
--- a/utils/NewNightlyTest.pl
+++ b/utils/NewNightlyTest.pl
@@ -109,6 +109,13 @@ $BuildDir = "$HOME/buildtest" unless $BuildDir;
my $WebDir = $ENV{'WEBDIR'};
$WebDir = "$HOME/cvs/testresults-X86" unless $WebDir;
+my $LLVMSrcDir = $ENV{'LLVMSRCDIR'};
+$LLVMSrcDir = "$BuildDir/llvm" unless $LLVMSrcDir;
+my $LLVMObjDir = $ENV{'LLVMOBJDIR'};
+$LLVMObjDir = "$BuildDir/llvm" unless $LLVMObjDir;
+my $LLVMTestDir = $ENV{'LLVMTESTDIR'};
+$LLVMTestDir = "$BuildDir/llvm/projects/llvm-test" unless $LLVMTestDir;
+
##############################################################
#
# Calculate the date prefix...
@@ -168,6 +175,7 @@ while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
if (/^-disable-lto$/) { $PROGTESTOPTS .= " DISABLE_LTO=1"; next; }
if (/^-test-opts$/) { $PROGTESTOPTS .= " $ARGV[0]"; shift; next; }
if (/^-verbose$/) { $VERBOSE = 1; next; }
+ if (/^-teelogs$/) { $TEELOGS = 1; next; }
if (/^-debug$/) { $DEBUG = 1; next; }
if (/^-nice$/) { $NICE = "nice "; next; }
if (/^-f2c$/) { $CONFIGUREARGS .= " --with-f2c=$ARGV[0]";
@@ -293,6 +301,44 @@ sub GetDir {
return @Result;
}
+sub RunLoggedCommand {
+ my $Command = shift;
+ my $Log = shift;
+ my $Title = shift;
+ if ($TEELOGS) {
+ if ($VERBOSE) {
+ print "$Title\n";
+ print "$Command 2>&1 | tee $Log\n";
+ }
+ system "$Command 2>&1 | tee $Log";
+ } else {
+ if ($VERBOSE) {
+ print "$Title\n";
+ print "$Command 2>&1 > $Log\n";
+ }
+ system "$Command 2>&1 > $Log";
+ }
+}
+
+sub RunAppendingLoggedCommand {
+ my $Command = shift;
+ my $Log = shift;
+ my $Title = shift;
+ if ($TEELOGS) {
+ if ($VERBOSE) {
+ print "$Title\n";
+ print "$Command 2>&1 | tee -a $Log\n";
+ }
+ system "$Command 2>&1 | tee -a $Log";
+ } else {
+ if ($VERBOSE) {
+ print "$Title\n";
+ print "$Command 2>&1 > $Log\n";
+ }
+ system "$Command 2>&1 >> $Log";
+ }
+}
+
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# DiffFiles - Diff the current version of the file against the last version of
@@ -458,7 +504,11 @@ sub SendData{
WriteFile "$Prefix-sentdata.txt", $sentdata;
if (!($SUBMITAUX eq "")) {
- system "$SUBMITAUX \"$Prefix-sentdata.txt\"";
+ system "$SUBMITAUX \"$Prefix-sentdata.txt\"";
+ }
+
+ if (!$SUBMIT) {
+ return "Skipped standard submit.\n";
}
# Create the content to send to the server.
@@ -528,7 +578,6 @@ if (!$NOCHECKOUT) {
mkdir $BuildDir or die "Could not create checkout directory $BuildDir!";
}
}
-ChangeDir( $BuildDir, "checkout directory" );
##############################################################
@@ -537,38 +586,29 @@ ChangeDir( $BuildDir, "checkout directory" );
#
##############################################################
if (!$NOCHECKOUT) {
- if ( $VERBOSE ) { print "CHECKOUT STAGE:\n"; }
+ ChangeDir( $BuildDir, "checkout directory" );
if ($USESVN) {
my $SVNCMD = "$NICE svn co --non-interactive $SVNURL";
my $SVNCMD2 = "$NICE svn co --non-interactive $TestSVNURL";
- if ($VERBOSE) {
- print "( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " .
- "$SVNCMD2/test-suite/trunk llvm-test ) > $COLog 2>&1\n";
- }
- system "( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " .
- "$SVNCMD2/test-suite/trunk llvm-test ) > $COLog 2>&1\n";
+ RunLoggedCommand("( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " .
+ "$SVNCMD2/test-suite/trunk llvm-test )", $COLog,
+ "CHECKOUT LLVM");
if ($WITHCLANG) {
my $SVNCMD = "$NICE svn co --non-interactive $SVNURL/cfe/trunk";
- if ($VERBOSE) {
- print "( time -p cd llvm/tools ; $SVNCMD clang ) > $COLog 2>&1\n";
- }
- system "( time -p cd llvm/tools ; $SVNCMD clang ) > $COLog 2>&1\n";
+ RunLoggedCommand("( time -p cd llvm/tools ; $SVNCMD clang )", $COLog,
+ "CHECKOUT CLANG");
}
} else {
my $CVSOPT = "";
$CVSOPT = "-z3" # Use compression if going over ssh.
if $CVSRootDir =~ /^:ext:/;
my $CVSCMD = "$NICE cvs $CVSOPT -d $CVSRootDir co -P $CVSCOOPT";
- if ($VERBOSE) {
- print "( time -p $CVSCMD llvm; cd llvm/projects ; " .
- "$CVSCMD llvm-test ) > $COLog 2>&1\n";
- }
- system "( time -p $CVSCMD llvm; cd llvm/projects ; " .
- "$CVSCMD llvm-test ) > $COLog 2>&1\n";
+ RunLoggedCommand("( time -p $CVSCMD llvm; cd llvm/projects ; " .
+ "$CVSCMD llvm-test )", $COLog,
+ "CHECKOUT LLVM-TEST");
}
}
-ChangeDir( $BuildDir , "Checkout directory") ;
-ChangeDir( "llvm" , "llvm source directory") ;
+ChangeDir( $LLVMSrcDir , "llvm source directory") ;
##############################################################
#
@@ -721,21 +761,11 @@ my $UserUpdateList = join "\n", sort keys %UsersUpdated;
##############################################################
if (!$NOCHECKOUT && !$NOBUILD) {
my $EXTRAFLAGS = "--enable-spec --with-objroot=.";
- if ( $VERBOSE ) {
- print "CONFIGURE STAGE:\n";
- print "(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) " .
- "> $BuildLog 2>&1\n";
- }
- system "(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) " .
- "> $BuildLog 2>&1";
- if ( $VERBOSE ) {
- print "BUILD STAGE:\n";
- print "(time -p $NICE $MAKECMD clean) >> $BuildLog 2>&1\n";
- print "(time -p $NICE $MAKECMD $MAKEOPTS) >> $BuildLog 2>&1\n";
- }
+ RunLoggedCommand("(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) ",
+ $BuildLog, "CONFIGURE");
# Build the entire tree, capturing the output into $BuildLog
- system "(time -p $NICE $MAKECMD clean) >> $BuildLog 2>&1";
- system "(time -p $NICE $MAKECMD $MAKEOPTS) >> $BuildLog 2>&1";
+ RunAppendingLoggedCommand("(time -p $NICE $MAKECMD clean)", $BuildLog, "BUILD CLEAN");
+ RunAppendingLoggedCommand("(time -p $NICE $MAKECMD $MAKEOPTS)", $BuildLog, "BUILD");
}
##############################################################
@@ -751,7 +781,7 @@ if (!$NOCHECKOUT && !$NOBUILD) {
# Get the number of lines of source code. Must be here after the build is done
# because countloc.sh uses the llvm-config script which must be built.
-my $LOC = `utils/countloc.sh -topdir $BuildDir/llvm`;
+my $LOC = `utils/countloc.sh -topdir $LLVMSrcDir`;
# Get the time taken by the configure script
my $ConfigTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$BuildLog";
@@ -787,7 +817,7 @@ my $o_file_sizes="";
if (!$BuildError) {
print "Organizing size of .o and .a files\n"
if ( $VERBOSE );
- ChangeDir( "$BuildDir/llvm", "Build Directory" );
+ ChangeDir( "$LLVMObjDir", "Build Directory" );
my @dirs = ('utils', 'lib', 'tools');
if($BUILDTYPE eq "release"){
@@ -815,14 +845,9 @@ if (!$BuildError) {
my $DejangnuTestResults=""; # String containing the results of the dejagnu
my $dejagnu_output = "$DejagnuTestsLog";
if (!$NODEJAGNU) {
- if($VERBOSE) {
- print "DEJAGNU FEATURE/REGRESSION TEST STAGE:\n";
- print "(time -p $MAKECMD $MAKEOPTS check) > $dejagnu_output 2>&1\n";
- }
-
#Run the feature and regression tests, results are put into testrun.sum
#Full log in testrun.log
- system "(time -p $MAKECMD $MAKEOPTS check) > $dejagnu_output 2>&1";
+ RunLoggedCommand("(time -p $MAKECMD $MAKEOPTS check)", $dejagnu_output, "DEJAGNU");
#Copy the testrun.log and testrun.sum to our webdir
CopyFile("test/testrun.log", $DejagnuLog);
@@ -857,7 +882,7 @@ if (!$NODEJAGNU) {
if ($Warning =~ m/Entering directory \`([^\`]+)\'/) {
$CurDir = $1; # Keep track of directory warning is in...
# Remove buildir prefix if included
- if ($CurDir =~ m#$BuildDir/llvm/(.*)#) { $CurDir = $1; }
+ if ($CurDir =~ m#$LLVMSrcDir/(.*)#) { $CurDir = $1; }
} else {
push @Warnings, "$CurDir/$Warning"; # Add directory to warning...
}
@@ -886,9 +911,10 @@ if (!$NODEJAGNU) {
# "External")
#
##############################################################
+
sub TestDirectory {
my $SubDir = shift;
- ChangeDir( "$BuildDir/llvm/projects/llvm-test/$SubDir",
+ ChangeDir( "$LLVMTestDir/$SubDir",
"Programs Test Subdirectory" ) || return ("", "");
my $ProgramTestLog = "$Prefix-$SubDir-ProgramTest.txt";
@@ -899,8 +925,8 @@ sub TestDirectory {
print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
"TEST=nightly > $ProgramTestLog 2>&1\n";
}
- system "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
- "TEST=nightly > $ProgramTestLog 2>&1";
+ RunLoggedCommand("$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
+ "TEST=nightly", $ProgramTestLog, "TEST DIRECTORY $SubDir");
$llcbeta_options=`$MAKECMD print-llcbeta-option`;
}
@@ -933,21 +959,12 @@ sub TestDirectory {
#
##############################################################
if (!$BuildError) {
- if ( $VERBOSE ) {
- print "SingleSource TEST STAGE\n";
- }
($SingleSourceProgramsTable, $llcbeta_options) =
TestDirectory("SingleSource");
WriteFile "$Prefix-SingleSource-Performance.txt", $SingleSourceProgramsTable;
- if ( $VERBOSE ) {
- print "MultiSource TEST STAGE\n";
- }
($MultiSourceProgramsTable, $llcbeta_options) = TestDirectory("MultiSource");
WriteFile "$Prefix-MultiSource-Performance.txt", $MultiSourceProgramsTable;
if ( ! $NOEXTERNALS ) {
- if ( $VERBOSE ) {
- print "External TEST STAGE\n";
- }
($ExternalProgramsTable, $llcbeta_options) = TestDirectory("External");
WriteFile "$Prefix-External-Performance.txt", $ExternalProgramsTable;
system "cat $Prefix-SingleSource-Tests.txt " .
@@ -1116,7 +1133,7 @@ my %hash_of_data = (
'target_triple' => $targetTriple
);
-if ($SUBMIT) {
+if ($SUBMIT || !($SUBMITAUX eq "")) {
my $response = SendData $SUBMITSERVER,$SUBMITSCRIPT,\%hash_of_data;
if( $VERBOSE) { print "============================\n$response"; }
} else {
diff --git a/utils/TableGen/CodeGenDAGPatterns.cpp b/utils/TableGen/CodeGenDAGPatterns.cpp
index 839059d..6a7d305 100644
--- a/utils/TableGen/CodeGenDAGPatterns.cpp
+++ b/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -2390,6 +2390,10 @@ void CodeGenDAGPatterns::GenerateVariants() {
// Scan to see if an instruction or explicit pattern already matches this.
bool AlreadyExists = false;
for (unsigned p = 0, e = PatternsToMatch.size(); p != e; ++p) {
+ // Skip if the top level predicates do not match.
+ if (PatternsToMatch[i].getPredicates() !=
+ PatternsToMatch[p].getPredicates())
+ continue;
// Check to see if this variant already exists.
if (Variant->isIsomorphicTo(PatternsToMatch[p].getSrcPattern(), DepVars)) {
DOUT << " *** ALREADY EXISTS, ignoring variant.\n";
diff --git a/utils/TableGen/LLVMCConfigurationEmitter.cpp b/utils/TableGen/LLVMCConfigurationEmitter.cpp
index d7e8550..9fcfd05 100644
--- a/utils/TableGen/LLVMCConfigurationEmitter.cpp
+++ b/utils/TableGen/LLVMCConfigurationEmitter.cpp
@@ -1132,12 +1132,14 @@ void TokenizeCmdline(const std::string& CmdLine, StrVector& Out) {
enum TokenizerState
{ Normal, SpecialCommand, InsideSpecialCommand, InsideQuotationMarks }
cur_st = Normal;
+
+ if (CmdLine.empty())
+ return;
Out.push_back("");
std::string::size_type B = CmdLine.find_first_not_of(Delimiters),
E = CmdLine.size();
- if (B == std::string::npos)
- throw "Empty command-line string!";
+
for (; B != E; ++B) {
char cur_ch = CmdLine[B];
@@ -1278,7 +1280,7 @@ void EmitCmdLineVecFill(const Init* CmdLine, const std::string& ToolName,
TokenizeCmdline(InitPtrToString(CmdLine), StrVec);
if (StrVec.empty())
- throw "Tool " + ToolName + " has empty command line!";
+ throw "Tool '" + ToolName + "' has empty command line!";
StrVector::const_iterator I = StrVec.begin(), E = StrVec.end();
@@ -1652,11 +1654,11 @@ void EmitToolClassDefinition (const ToolDescription& D,
}
-/// EmitOptionDefintions - Iterate over a list of option descriptions
+/// EmitOptionDefinitions - Iterate over a list of option descriptions
/// and emit registration code.
-void EmitOptionDefintions (const OptionDescriptions& descs,
- bool HasSink, bool HasExterns,
- std::ostream& O)
+void EmitOptionDefinitions (const OptionDescriptions& descs,
+ bool HasSink, bool HasExterns,
+ std::ostream& O)
{
std::vector<OptionDescription> Aliases;
@@ -1681,7 +1683,7 @@ void EmitOptionDefintions (const OptionDescriptions& descs,
continue;
}
- O << "(\"" << val.Name << '\"';
+ O << "(\"" << val.Name << "\"\n";
if (val.Type == OptionType::Prefix || val.Type == OptionType::PrefixList)
O << ", cl::Prefix";
@@ -1712,7 +1714,7 @@ void EmitOptionDefintions (const OptionDescriptions& descs,
if (!val.Help.empty())
O << ", cl::desc(\"" << val.Help << "\")";
- O << ");\n";
+ O << ");\n\n";
}
// Emit the aliases (they should go after all the 'proper' options).
@@ -1984,6 +1986,7 @@ void EmitRegisterPlugin(int Priority, std::ostream& O) {
/// additional declarations.
void EmitIncludes(std::ostream& O) {
O << "#include \"llvm/CompilerDriver/CompilationGraph.h\"\n"
+ << "#include \"llvm/CompilerDriver/ForceLinkageMacros.h\"\n"
<< "#include \"llvm/CompilerDriver/Plugin.h\"\n"
<< "#include \"llvm/CompilerDriver/Tool.h\"\n\n"
@@ -2081,7 +2084,7 @@ void EmitPluginCode(const PluginData& Data, std::ostream& O) {
EmitIncludes(O);
// Emit global option registration code.
- EmitOptionDefintions(Data.OptDescs, Data.HasSink, Data.HasExterns, O);
+ EmitOptionDefinitions(Data.OptDescs, Data.HasSink, Data.HasExterns, O);
// Emit hook declarations.
EmitHookDeclarations(Data.ToolDescs, O);
@@ -2106,7 +2109,13 @@ void EmitPluginCode(const PluginData& Data, std::ostream& O) {
// Emit code for plugin registration.
EmitRegisterPlugin(Data.Priority, O);
- O << "} // End anonymous namespace.\n";
+ O << "} // End anonymous namespace.\n\n";
+
+ // Force linkage magic.
+ O << "namespace llvmc {\n";
+ O << "LLVMC_FORCE_LINKAGE_DECL(LLVMC_PLUGIN_NAME) {}\n";
+ O << "}\n";
+
// EOF
}
OpenPOWER on IntegriCloud