Skip to content

Commit

Permalink
C API: Remove LLVMGetDataLayout that was deprecated in 3.7
Browse files Browse the repository at this point in the history
From: Mehdi Amini <[email protected]>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260657 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
joker-eph committed Feb 12, 2016
1 parent 0ff839a commit 0090eb9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 20 deletions.
3 changes: 2 additions & 1 deletion docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ Non-comprehensive list of changes in this release

* .. 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
Expand Down
5 changes: 0 additions & 5 deletions include/llvm/Target/TargetMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ class TargetMachine {
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;

Expand Down
14 changes: 0 additions & 14 deletions lib/Target/TargetMachineC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -175,11 +166,6 @@ char* LLVMGetTargetMachineFeatureString(LLVMTargetMachineRef T) {
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;
Expand Down

0 comments on commit 0090eb9

Please sign in to comment.