projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ARM: Refactor instaliases using TableGen support for #NAME#.
[oota-llvm.git]
/
lib
/
Target
/
Target.cpp
diff --git
a/lib/Target/Target.cpp
b/lib/Target/Target.cpp
index cddf49e5154eb023be4319b92eec2de1c4bfa5ea..a2b83bcce46e52a4bf3d48f7d481d76141676443 100644
(file)
--- a/
lib/Target/Target.cpp
+++ b/
lib/Target/Target.cpp
@@
-7,19
+7,31
@@
//
//===----------------------------------------------------------------------===//
//
//
//===----------------------------------------------------------------------===//
//
-// This file implements the
C bindings for libLLVMTarget.a, which implements
-// target information.
+// This file implements the
common infrastructure (including C bindings) for
+//
libLLVMTarget.a, which implements
target information.
//
//===----------------------------------------------------------------------===//
#include "llvm-c/Target.h"
//
//===----------------------------------------------------------------------===//
#include "llvm-c/Target.h"
+#include "llvm-c/Initialization.h"
+#include "llvm/InitializePasses.h"
#include "llvm/PassManager.h"
#include "llvm/Target/TargetData.h"
#include "llvm/PassManager.h"
#include "llvm/Target/TargetData.h"
+#include "llvm/Target/TargetLibraryInfo.h"
#include "llvm/LLVMContext.h"
#include <cstring>
using namespace llvm;
#include "llvm/LLVMContext.h"
#include <cstring>
using namespace llvm;
+void llvm::initializeTarget(PassRegistry &Registry) {
+ initializeTargetDataPass(Registry);
+ initializeTargetLibraryInfoPass(Registry);
+}
+
+void LLVMInitializeTarget(LLVMPassRegistryRef R) {
+ initializeTarget(*unwrap(R));
+}
+
LLVMTargetDataRef LLVMCreateTargetData(const char *StringRep) {
return wrap(new TargetData(StringRep));
}
LLVMTargetDataRef LLVMCreateTargetData(const char *StringRep) {
return wrap(new TargetData(StringRep));
}
@@
-28,13
+40,18
@@
void LLVMAddTargetData(LLVMTargetDataRef TD, LLVMPassManagerRef PM) {
unwrap(PM)->add(new TargetData(*unwrap(TD)));
}
unwrap(PM)->add(new TargetData(*unwrap(TD)));
}
+void LLVMAddTargetLibraryInfo(LLVMTargetLibraryInfoRef TLI,
+ LLVMPassManagerRef PM) {
+ unwrap(PM)->add(new TargetLibraryInfo(*unwrap(TLI)));
+}
+
char *LLVMCopyStringRepOfTargetData(LLVMTargetDataRef TD) {
std::string StringRep = unwrap(TD)->getStringRepresentation();
return strdup(StringRep.c_str());
}
LLVMByteOrdering LLVMByteOrder(LLVMTargetDataRef TD) {
char *LLVMCopyStringRepOfTargetData(LLVMTargetDataRef TD) {
std::string StringRep = unwrap(TD)->getStringRepresentation();
return strdup(StringRep.c_str());
}
LLVMByteOrdering LLVMByteOrder(LLVMTargetDataRef TD) {
- return unwrap(TD)->isLittleEndian();
+ return unwrap(TD)->isLittleEndian()
? LLVMLittleEndian : LLVMBigEndian
;
}
unsigned LLVMPointerSize(LLVMTargetDataRef TD) {
}
unsigned LLVMPointerSize(LLVMTargetDataRef TD) {
@@
-76,20
+93,16
@@
unsigned LLVMPreferredAlignmentOfGlobal(LLVMTargetDataRef TD,
unsigned LLVMElementAtOffset(LLVMTargetDataRef TD, LLVMTypeRef StructTy,
unsigned long long Offset) {
unsigned LLVMElementAtOffset(LLVMTargetDataRef TD, LLVMTypeRef StructTy,
unsigned long long Offset) {
-
const
StructType *STy = unwrap<StructType>(StructTy);
+ StructType *STy = unwrap<StructType>(StructTy);
return unwrap(TD)->getStructLayout(STy)->getElementContainingOffset(Offset);
}
unsigned long long LLVMOffsetOfElement(LLVMTargetDataRef TD, LLVMTypeRef StructTy,
unsigned Element) {
return unwrap(TD)->getStructLayout(STy)->getElementContainingOffset(Offset);
}
unsigned long long LLVMOffsetOfElement(LLVMTargetDataRef TD, LLVMTypeRef StructTy,
unsigned Element) {
-
const
StructType *STy = unwrap<StructType>(StructTy);
+ StructType *STy = unwrap<StructType>(StructTy);
return unwrap(TD)->getStructLayout(STy)->getElementOffset(Element);
}
return unwrap(TD)->getStructLayout(STy)->getElementOffset(Element);
}
-void LLVMInvalidateStructLayout(LLVMTargetDataRef TD, LLVMTypeRef StructTy) {
- unwrap(TD)->InvalidateStructLayoutInfo(unwrap<StructType>(StructTy));
-}
-
void LLVMDisposeTargetData(LLVMTargetDataRef TD) {
delete unwrap(TD);
}
void LLVMDisposeTargetData(LLVMTargetDataRef TD) {
delete unwrap(TD);
}