[llvm] r260657 - C API: Remove LLVMGetDataLayout that was deprecated in 3.7

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 11 22:22:00 PST 2016


Author: mehdi_amini
Date: Fri Feb 12 00:22:00 2016
New Revision: 260657

URL: http://llvm.org/viewvc/llvm-project?rev=260657&view=rev
Log:
C API: Remove LLVMGetDataLayout that was deprecated in 3.7

From: Mehdi Amini <mehdi.amini at apple.com>

Modified:
    llvm/trunk/docs/ReleaseNotes.rst
    llvm/trunk/include/llvm/Target/TargetMachine.h
    llvm/trunk/lib/Target/TargetMachineC.cpp

Modified: llvm/trunk/docs/ReleaseNotes.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.rst?rev=260657&r1=260656&r2=260657&view=diff
==============================================================================
--- llvm/trunk/docs/ReleaseNotes.rst (original)
+++ llvm/trunk/docs/ReleaseNotes.rst Fri Feb 12 00:22:00 2016
@@ -37,7 +37,8 @@ Non-comprehensive list of changes in thi
 
 * .. note about C API functions LLVMLinkModules, LLVMParseBitcode,
    LLVMParseBitcodeInContext, LLVMGetBitcodeModuleInContext and
-   LLVMGetBitcodeModule having been removed.
+   LLVMGetBitcodeModule having been removed. LLVMGetTargetMachineData has been
+   removed (use LLVMGetDataLayout instead).
 
 .. NOTE
    For small 1-3 sentence descriptions, just add an entry at the end of

Modified: llvm/trunk/include/llvm/Target/TargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetMachine.h?rev=260657&r1=260656&r2=260657&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetMachine.h (original)
+++ llvm/trunk/include/llvm/Target/TargetMachine.h Fri Feb 12 00:22:00 2016
@@ -103,11 +103,6 @@ protected: // Can only create subclasses
   unsigned RequireStructuredCFG : 1;
   unsigned O0WantsFastISel : 1;
 
-  /// This API is here to support the C API, deprecated in 3.7 release.
-  /// This should never be used outside of legacy existing client.
-  const DataLayout &getDataLayout() const { return DL; }
-  friend struct C_API_PRIVATE_ACCESS;
-
 public:
   mutable TargetOptions Options;
 

Modified: llvm/trunk/lib/Target/TargetMachineC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachineC.cpp?rev=260657&r1=260656&r2=260657&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetMachineC.cpp (original)
+++ llvm/trunk/lib/Target/TargetMachineC.cpp Fri Feb 12 00:22:00 2016
@@ -32,15 +32,6 @@
 
 using namespace llvm;
 
-namespace llvm {
-// Friend to the TargetMachine, access legacy API that are made private in C++
-struct C_API_PRIVATE_ACCESS {
-  static const DataLayout &getDataLayout(const TargetMachine &T) {
-    return T.getDataLayout();
-  }
-};
-}
-
 static TargetMachine *unwrap(LLVMTargetMachineRef P) {
   return reinterpret_cast<TargetMachine *>(P);
 }
@@ -175,11 +166,6 @@ char* LLVMGetTargetMachineFeatureString(
   return strdup(StringRep.c_str());
 }
 
-/** Deprecated: use LLVMGetDataLayout(LLVMModuleRef M) instead. */
-LLVMTargetDataRef LLVMGetTargetMachineData(LLVMTargetMachineRef T) {
-  return wrap(&C_API_PRIVATE_ACCESS::getDataLayout(*unwrap(T)));
-}
-
 void LLVMSetTargetMachineAsmVerbosity(LLVMTargetMachineRef T,
                                       LLVMBool VerboseAsm) {
   unwrap(T)->Options.MCOptions.AsmVerbose = VerboseAsm;




More information about the llvm-commits mailing list