diff options
author | Sean Callanan <scallanan@apple.com> | 2015-04-14 18:17:35 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2015-04-14 18:17:35 +0000 |
commit | 507b588a345adeeb74c4d6d520c6957ba3d35a7a (patch) | |
tree | fdd737cf27906bba39fcc19353b548c3382cde90 | |
parent | 39fee0ae07bccdba5af67f3c7be5479914efc145 (diff) | |
download | bcm5719-llvm-507b588a345adeeb74c4d6d520c6957ba3d35a7a.tar.gz bcm5719-llvm-507b588a345adeeb74c4d6d520c6957ba3d35a7a.zip |
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
-rw-r--r-- | lldb/source/Expression/IRForTarget.cpp | 6 | ||||
-rw-r--r-- | lldb/test/lang/c/modules/TestCModules.py | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Expression/IRForTarget.cpp b/lldb/source/Expression/IRForTarget.cpp index 210ba65f665..b831baa7972 100644 --- a/lldb/source/Expression/IRForTarget.cpp +++ b/lldb/source/Expression/IRForTarget.cpp @@ -2453,9 +2453,11 @@ IRForTarget::BuildRelocation(llvm::Type *type, uint64_t offset) 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; diff --git a/lldb/test/lang/c/modules/TestCModules.py b/lldb/test/lang/c/modules/TestCModules.py index dc0be269430..32b8f16b367 100644 --- a/lldb/test/lang/c/modules/TestCModules.py +++ b/lldb/test/lang/c/modules/TestCModules.py @@ -16,7 +16,6 @@ class CModulesTestCase(TestBase): @skipUnlessDarwin @dsym_test - @unittest2.expectedFailure("rdar://20416388") def test_expr_with_dsym(self): self.buildDsym() self.expr() @@ -24,7 +23,6 @@ class CModulesTestCase(TestBase): @dwarf_test @skipIfFreeBSD @skipIfLinux - @unittest2.expectedFailure("rdar://20416388") def test_expr_with_dwarf(self): self.buildDwarf() self.expr() |