[llvm-branch-commits] [llvm] 6785ca0 - [llvm-c] Delete unimplemented llvm-c/LinkTimeOptimizer.h

Fangrui Song via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Dec 6 15:23:37 PST 2020


Author: Fangrui Song
Date: 2020-12-06T15:18:25-08:00
New Revision: 6785ca01248ce271dfff16e03cce82f649fa14f7

URL: https://github.com/llvm/llvm-project/commit/6785ca01248ce271dfff16e03cce82f649fa14f7
DIFF: https://github.com/llvm/llvm-project/commit/6785ca01248ce271dfff16e03cce82f649fa14f7.diff

LOG: [llvm-c] Delete unimplemented llvm-c/LinkTimeOptimizer.h

The file was added in 2007 but the functions have never been implemented.
Having the file can only cause confusion to existing C API (llvm-c/lto.h) users.

Added: 
    

Modified: 
    llvm/tools/llvm-c-test/include-all.c

Removed: 
    llvm/include/llvm-c/LinkTimeOptimizer.h


################################################################################
diff  --git a/llvm/include/llvm-c/LinkTimeOptimizer.h b/llvm/include/llvm-c/LinkTimeOptimizer.h
deleted file mode 100644
index 9ae65b8fe5e0..000000000000
--- a/llvm/include/llvm-c/LinkTimeOptimizer.h
+++ /dev/null
@@ -1,66 +0,0 @@
-//===-- llvm/LinkTimeOptimizer.h - LTO Public C Interface -------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// This header provides a C API to use the LLVM link time optimization
-// library. This is intended to be used by linkers which are C-only in
-// their implementation for performing LTO.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_C_LINKTIMEOPTIMIZER_H
-#define LLVM_C_LINKTIMEOPTIMIZER_H
-
-#include "llvm-c/ExternC.h"
-
-LLVM_C_EXTERN_C_BEGIN
-
-/**
- * @defgroup LLVMCLinkTimeOptimizer Link Time Optimization
- * @ingroup LLVMC
- *
- * @{
- */
-
-  /// This provides a dummy type for pointers to the LTO object.
-  typedef void* llvm_lto_t;
-
-  /// This provides a C-visible enumerator to manage status codes.
-  /// This should map exactly onto the C++ enumerator LTOStatus.
-  typedef enum llvm_lto_status {
-    LLVM_LTO_UNKNOWN,
-    LLVM_LTO_OPT_SUCCESS,
-    LLVM_LTO_READ_SUCCESS,
-    LLVM_LTO_READ_FAILURE,
-    LLVM_LTO_WRITE_FAILURE,
-    LLVM_LTO_NO_TARGET,
-    LLVM_LTO_NO_WORK,
-    LLVM_LTO_MODULE_MERGE_FAILURE,
-    LLVM_LTO_ASM_FAILURE,
-
-    //  Added C-specific error codes
-    LLVM_LTO_NULL_OBJECT
-  } llvm_lto_status_t;
-
-  /// This provides C interface to initialize link time optimizer. This allows
-  /// linker to use dlopen() interface to dynamically load LinkTimeOptimizer.
-  /// extern "C" helps, because dlopen() interface uses name to find the symbol.
-  extern llvm_lto_t llvm_create_optimizer(void);
-  extern void llvm_destroy_optimizer(llvm_lto_t lto);
-
-  extern llvm_lto_status_t llvm_read_object_file
-    (llvm_lto_t lto, const char* input_filename);
-  extern llvm_lto_status_t llvm_optimize_modules
-    (llvm_lto_t lto, const char* output_filename);
-
-/**
- * @}
- */
-
-  LLVM_C_EXTERN_C_END
-
-#endif

diff  --git a/llvm/tools/llvm-c-test/include-all.c b/llvm/tools/llvm-c-test/include-all.c
index b109b11491d3..27b11fb7e0f6 100644
--- a/llvm/tools/llvm-c-test/include-all.c
+++ b/llvm/tools/llvm-c-test/include-all.c
@@ -29,7 +29,6 @@
 #include "llvm-c/Initialization.h"
 #include "llvm-c/IRReader.h"
 #include "llvm-c/Linker.h"
-#include "llvm-c/LinkTimeOptimizer.h"
 #include "llvm-c/Object.h"
 #include "llvm-c/Orc.h"
 #include "llvm-c/Remarks.h"


        


More information about the llvm-branch-commits mailing list