Set a CodeGenOption in Clang to inhibit insertion
of profiling code into expressions.
Modified IRForTarget to emit array and record
member accesses correctly. (Reading and writing
both work.)
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@110088 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/IRForTarget.cpp b/source/Expression/IRForTarget.cpp
index 995c42f..63752e1 100644
--- a/source/Expression/IRForTarget.cpp
+++ b/source/Expression/IRForTarget.cpp
@@ -247,6 +247,14 @@
{
lldb_private::Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS);
+ if (ConstantExpr *constant_expr = dyn_cast<ConstantExpr>(V))
+ {
+ if (constant_expr->getOpcode() == Instruction::GetElementPtr)
+ {
+ Value *s = constant_expr->getOperand(0);
+ MaybeHandleVariable(M, s, Store);
+ }
+ }
if (GlobalVariable *global_variable = dyn_cast<GlobalVariable>(V))
{
clang::NamedDecl *named_decl = DeclForGlobalValue(M, global_variable);