Updated IRForTarget to change the way we generate
relocations.  We used to do GEP on a pointer to
the result type, which is wrong.  We should be doing
GEP on a pointer to char, which allows us to offset
correctly.

This fixes the C modules testcase, so it's no longer
ExpectFail.

llvm-svn: 234918
diff --git a/lldb/source/Expression/IRForTarget.cpp b/lldb/source/Expression/IRForTarget.cpp
index 210ba65..b831baa 100644
--- a/lldb/source/Expression/IRForTarget.cpp
+++ b/lldb/source/Expression/IRForTarget.cpp
@@ -2453,9 +2453,11 @@
     offset_array[0] = offset_int;
 
     llvm::ArrayRef<llvm::Constant *> offsets(offset_array, 1);
+    llvm::Type *char_type = llvm::Type::getInt8Ty(m_module->getContext());
+    llvm::Type *char_pointer_type = char_type->getPointerTo();
 
-    llvm::Constant *reloc_placeholder_bitcast = ConstantExpr::getBitCast(m_reloc_placeholder, type->getPointerTo());
-    llvm::Constant *reloc_getelementptr = ConstantExpr::getGetElementPtr(type, reloc_placeholder_bitcast, offsets);
+    llvm::Constant *reloc_placeholder_bitcast = ConstantExpr::getBitCast(m_reloc_placeholder, char_pointer_type);
+    llvm::Constant *reloc_getelementptr = ConstantExpr::getGetElementPtr(char_type, reloc_placeholder_bitcast, offsets);
     llvm::Constant *reloc_bitcast = ConstantExpr::getBitCast(reloc_getelementptr, type);
 
     return reloc_bitcast;