summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Target.cpp
diff options
context:
space:
mode:
authorAmaury Sechet <deadalnix@gmail.com>2016-02-16 05:11:24 +0000
committerAmaury Sechet <deadalnix@gmail.com>2016-02-16 05:11:24 +0000
commit5590967610afa5fcc79386e08acc4d0fad5b6b9f (patch)
tree79b584bf548d4bc6d19e0656121a58dcb5870757 /llvm/lib/Target/Target.cpp
parent6615654f565c3a19f1f8a6e74ccdc723fd0c71d3 (diff)
downloadbcm5719-llvm-5590967610afa5fcc79386e08acc4d0fad5b6b9f.tar.gz
bcm5719-llvm-5590967610afa5fcc79386e08acc4d0fad5b6b9f.zip
Restore the capability to manipulate datalayout from the C API
Summary: This consist in variosu addition to the C API: LLVMTargetDataRef LLVMGetModuleDataLayout(LLVMModuleRef M); void LLVMSetModuleDataLayout(LLVMModuleRef M, LLVMTargetDataRef DL); LLVMTargetDataRef LLVMCreateTargetMachineData(LLVMTargetMachineRef T); Reviewers: joker.eph, Wallbraker, echristo Subscribers: axw Differential Revision: http://reviews.llvm.org/D17255 llvm-svn: 260936
Diffstat (limited to 'llvm/lib/Target/Target.cpp')
-rw-r--r--llvm/lib/Target/Target.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/Target.cpp b/llvm/lib/Target/Target.cpp
index 51d30679b52..93eab09fb85 100644
--- a/llvm/lib/Target/Target.cpp
+++ b/llvm/lib/Target/Target.cpp
@@ -42,6 +42,14 @@ void LLVMInitializeTarget(LLVMPassRegistryRef R) {
initializeTarget(*unwrap(R));
}
+LLVMTargetDataRef LLVMGetModuleDataLayout(LLVMModuleRef M) {
+ return wrap(&unwrap(M)->getDataLayout());
+}
+
+void LLVMSetModuleDataLayout(LLVMModuleRef M, LLVMTargetDataRef DL) {
+ unwrap(M)->setDataLayout(*unwrap(DL));
+}
+
LLVMTargetDataRef LLVMCreateTargetData(const char *StringRep) {
return wrap(new DataLayout(StringRep));
}
OpenPOWER on IntegriCloud