about summary refs log tree commit diff homepage
path: root/lib/Module/IntrinsicCleaner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Module/IntrinsicCleaner.cpp')
-rw-r--r--lib/Module/IntrinsicCleaner.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Module/IntrinsicCleaner.cpp b/lib/Module/IntrinsicCleaner.cpp
index 41dc5724..fd0db91d 100644
--- a/lib/Module/IntrinsicCleaner.cpp
+++ b/lib/Module/IntrinsicCleaner.cpp
@@ -26,7 +26,11 @@
 #include "llvm/Support/IRBuilder.h"
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
-#include "llvm/Target/DataLayout.h"
+#if LLVM_VERSION_CODE <= LLVM_VERSION(3, 1)
+#include "llvm/Target/TargetData.h"
+#else
+#include "llvm/DataLayout.h"
+#endif
 
 using namespace llvm;
 
@@ -45,7 +49,11 @@ bool IntrinsicCleanerPass::runOnModule(Module &M) {
 bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b) { 
   bool dirty = false;
   
+#if LLVM_VERSION_CODE <= LLVM_VERSION(3, 1)
+  unsigned WordSize = TargetData.getPointerSizeInBits() / 8;
+#else
   unsigned WordSize = DataLayout.getPointerSizeInBits() / 8;
+#endif
   for (BasicBlock::iterator i = b.begin(), ie = b.end(); i != ie;) {     
     IntrinsicInst *ii = dyn_cast<IntrinsicInst>(&*i);
     // increment now since LowerIntrinsic deletion makes iterator invalid.