[llvm] r349678 - Revert 349677, it contained a whole bunch of stuff I did not mean to commit

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 19 12:19:58 PST 2018


Author: nico
Date: Wed Dec 19 12:19:58 2018
New Revision: 349678

URL: http://llvm.org/viewvc/llvm-project?rev=349678&view=rev
Log:
Revert 349677, it contained a whole bunch of stuff I did not mean to commit

Removed:
    llvm/trunk/utils/gn/secondary/clang/
Modified:
    llvm/trunk/tools/llvm-ar/CMakeLists.txt
    llvm/trunk/tools/llvm-bcanalyzer/CMakeLists.txt
    llvm/trunk/tools/llvm-demangle-fuzzer/llvm-demangle-fuzzer.cpp
    llvm/trunk/utils/gn/secondary/BUILD.gn
    llvm/trunk/utils/gn/secondary/lld/include/lld/Common/BUILD.gn
    llvm/trunk/utils/gn/secondary/llvm/utils/TableGen/tablegen.gni
    llvm/trunk/utils/lit/lit/TestRunner.py
    llvm/trunk/utils/lit/lit/run.py

Modified: llvm/trunk/tools/llvm-ar/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ar/CMakeLists.txt?rev=349678&r1=349677&r2=349678&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-ar/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-ar/CMakeLists.txt Wed Dec 19 12:19:58 2018
@@ -10,6 +10,9 @@ set(LLVM_LINK_COMPONENTS
 
 add_llvm_tool(llvm-ar
   llvm-ar.cpp
+
+  DEPENDS
+  intrinsics_gen
   )
 
 add_llvm_tool_symlink(llvm-ranlib llvm-ar)

Modified: llvm/trunk/tools/llvm-bcanalyzer/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-bcanalyzer/CMakeLists.txt?rev=349678&r1=349677&r2=349678&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-bcanalyzer/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-bcanalyzer/CMakeLists.txt Wed Dec 19 12:19:58 2018
@@ -5,4 +5,7 @@ set(LLVM_LINK_COMPONENTS
 
 add_llvm_tool(llvm-bcanalyzer
   llvm-bcanalyzer.cpp
+
+  DEPENDS
+  intrinsics_gen
   )

Modified: llvm/trunk/tools/llvm-demangle-fuzzer/llvm-demangle-fuzzer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-demangle-fuzzer/llvm-demangle-fuzzer.cpp?rev=349678&r1=349677&r2=349678&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-demangle-fuzzer/llvm-demangle-fuzzer.cpp (original)
+++ llvm/trunk/tools/llvm-demangle-fuzzer/llvm-demangle-fuzzer.cpp Wed Dec 19 12:19:58 2018
@@ -14,19 +14,11 @@
 #include <string>
 
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
-  if (Size == 0)
-    return 0;
-
-  bool UseItanium = Data[0] < 128;
-  std::string NullTerminatedString((const char *)Data + 1, Size - 1);
-
-  if (UseItanium) {
-    free(llvm::itaniumDemangle(NullTerminatedString.c_str(), nullptr, nullptr,
-                               nullptr));
-  } else {
-    free(llvm::microsoftDemangle(NullTerminatedString.c_str(), nullptr, nullptr,
-                                 nullptr));
-  }
+  std::string NullTerminatedString((const char *)Data, Size);
+  int status = 0;
+  if (char *demangle = llvm::itaniumDemangle(NullTerminatedString.c_str(), nullptr,
+                                         nullptr, &status))
+    free(demangle);
 
   return 0;
 }

Modified: llvm/trunk/utils/gn/secondary/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/BUILD.gn?rev=349678&r1=349677&r2=349678&view=diff
==============================================================================
--- llvm/trunk/utils/gn/secondary/BUILD.gn (original)
+++ llvm/trunk/utils/gn/secondary/BUILD.gn Wed Dec 19 12:19:58 2018
@@ -1,7 +1,6 @@
 group("default") {
   deps = [
     ":lld",
-    "//clang/lib/Basic",
     "//llvm/tools/llc",
     "//llvm/tools/llvm-ar:symlinks",
     "//llvm/tools/llvm-as",

Modified: llvm/trunk/utils/gn/secondary/lld/include/lld/Common/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/lld/include/lld/Common/BUILD.gn?rev=349678&r1=349677&r2=349678&view=diff
==============================================================================
--- llvm/trunk/utils/gn/secondary/lld/include/lld/Common/BUILD.gn (original)
+++ llvm/trunk/utils/gn/secondary/lld/include/lld/Common/BUILD.gn Wed Dec 19 12:19:58 2018
@@ -12,6 +12,7 @@ action("version") {
   args = [
     "-o",
     rebase_path(outputs[0], root_out_dir),
+
     rebase_path(sources[0], root_out_dir),
 
     "LLD_VERSION=$llvm_version",

Modified: llvm/trunk/utils/gn/secondary/llvm/utils/TableGen/tablegen.gni
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/llvm/utils/TableGen/tablegen.gni?rev=349678&r1=349677&r2=349678&view=diff
==============================================================================
--- llvm/trunk/utils/gn/secondary/llvm/utils/TableGen/tablegen.gni (original)
+++ llvm/trunk/utils/gn/secondary/llvm/utils/TableGen/tablegen.gni Wed Dec 19 12:19:58 2018
@@ -36,12 +36,8 @@ template("tablegen") {
   action(target_name) {
     forward_variables_from(invoker, [ "visibility" ])
 
-    if (defined(invoker.tblgen_target)) {
-      tblgen_target = invoker.tblgen_target
-    } else {
-      # FIXME: In cross builds, this should depend on the host binary.
-      tblgen_target = "//llvm/utils/TableGen:llvm-tblgen"
-    }
+    # FIXME: In cross builds, this should depend on the host binary.
+    tblgen_target = "//llvm/utils/TableGen:llvm-tblgen"
     tblgen_executable = get_label_info(tblgen_target, "root_out_dir") +
                         "/bin/" + get_label_info(tblgen_target, "name")
     deps = [

Modified: llvm/trunk/utils/lit/lit/TestRunner.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestRunner.py?rev=349678&r1=349677&r2=349678&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/TestRunner.py (original)
+++ llvm/trunk/utils/lit/lit/TestRunner.py Wed Dec 19 12:19:58 2018
@@ -1108,7 +1108,6 @@ def executeScript(test, litConfig, tmpBa
     else:
         if bashPath:
             command = [bashPath, script]
-            #print command, cwd, test.config.environment
         else:
             command = ['/bin/sh', script]
         if litConfig.useValgrind:
@@ -1552,30 +1551,22 @@ def _runShTest(test, litConfig, useExter
     return lit.Test.Result(status, output)
 
 
-def extractScript(test, litConfig, useExternalSh, extra_substitutions):
+def executeShTest(test, litConfig, useExternalSh,
+                  extra_substitutions=[]):
     if test.config.unsupported:
-        return lit.Test.Result(Test.UNSUPPORTED, 'Test is unsupported'), ''
+        return lit.Test.Result(Test.UNSUPPORTED, 'Test is unsupported')
 
     script = parseIntegratedTestScript(test)
     if isinstance(script, lit.Test.Result):
-        return script, ''
+        return script
     if litConfig.noExecute:
-        return lit.Test.Result(Test.PASS), ''
+        return lit.Test.Result(Test.PASS)
 
     tmpDir, tmpBase = getTempPaths(test)
     substitutions = list(extra_substitutions)
     substitutions += getDefaultSubstitutions(test, tmpDir, tmpBase,
                                              normalize_slashes=useExternalSh)
     script = applySubstitutions(script, substitutions)
-    return script, tmpBase
-
-
-def executeShTest(test, litConfig, useExternalSh,
-                  extra_substitutions=[]):
-    script, tmpBase = extractScript(
-            test, litConfig, useExternalSh, extra_substitutions)
-    if isinstance(script, lit.Test.Result):
-        return script
 
     # Re-run failed tests up to test_retry_attempts times.
     attempts = 1

Modified: llvm/trunk/utils/lit/lit/run.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/run.py?rev=349678&r1=349677&r2=349678&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/run.py (original)
+++ llvm/trunk/utils/lit/lit/run.py Wed Dec 19 12:19:58 2018
@@ -55,52 +55,6 @@ class Run(object):
         return _execute_test_impl(test, self.lit_config,
                                   self.parallelism_semaphores)
 
-    def execute_tests_using_ninja(self, jobs, max_time):
-        import lit.TestRunner
-        import pipes
-        sys.path.append('/Users/thakis/src/ninja/misc')
-        import ninja_syntax
-        writer = ninja_syntax.Writer(open('lit.ninja', 'w'))
-        # Writes a build.ninja with commands for all tests and runs ninja
-        # to execute them.
-        for i, test in enumerate(self.tests):
-            if not isinstance(test.config.test_format, lit.formats.ShTest):
-                test.setResult(lit.Test.Result(lit.Test.PASS, ''))  # FIXME
-                continue
-            script, tmpBase = lit.TestRunner.extractScript(
-                    test, self.lit_config, True, [])
-            if isinstance(script, lit.Test.Result):
-                test.result = script
-                continue
-
-            # Create the output directory if it does not already exist.
-            lit.util.mkdir_p(os.path.dirname(tmpBase))
-
-            r = 'r%04d' % i
-            # FIXME: duplication with TestRunner.executeScript()
-            # FIXME: windows
-            execdir = os.path.dirname(test.getExecPath())
-            command = ''
-            for var, val in test.config.environment.iteritems():
-                # Need export, else LLD_VERSION doesn't make it through.
-                # The export means LIT_PRESERVES_TMP=1 needs to be set while
-                # running lit, else it's gone by the time ninja runs
-                # (...or this here must run ninja, probably better anyhoo)
-                command += 'export %s=%s; ' % (var, pipes.quote(val))
-            if test.config.pipefail:
-                command += 'set -o pipefail; '
-            command += 'cd %s; { ' % execdir
-            command += '; } && { '.join(script) + '; }'
-
-            # FIXME: tests require bash for e.g. `echo -e` -- unfortunate :-/
-            command = '/bin/bash -c %s' % pipes.quote(command)
-
-            writer.rule(r, command, description=test.getFullName())
-            writer.build('always%04d' % i, r)
-
-            # FIXME: ...well...
-            test.setResult(lit.Test.Result(lit.Test.PASS, ''))
-
     def execute_tests_in_pool(self, jobs, max_time):
         # We need to issue many wait calls, so compute the final deadline and
         # subtract time.time() from that as we go along.
@@ -196,7 +150,6 @@ class Run(object):
                 self.consume_test_result(result)
         else:
             self.execute_tests_in_pool(jobs, max_time)
-            #self.execute_tests_using_ninja(jobs, max_time)
 
         # Mark any tests that weren't run as UNRESOLVED.
         for test in self.tests:




More information about the llvm-commits mailing list