summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/ClangStmtVisitor.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2010-07-09 20:39:50 +0000
committerGreg Clayton <gclayton@apple.com>2010-07-09 20:39:50 +0000
commitc982c768d248b21b82fbd70b61a4cc824cd82ddc (patch)
tree68c5d417ce51994a2d393e5a5a7f0025b6e4ed35 /lldb/source/Expression/ClangStmtVisitor.cpp
parent2a5725b1a324639d0e16e9c125f5713acfabca60 (diff)
downloadbcm5719-llvm-c982c768d248b21b82fbd70b61a4cc824cd82ddc.tar.gz
bcm5719-llvm-c982c768d248b21b82fbd70b61a4cc824cd82ddc.zip
Merged Eli Friedman's linux build changes where he added Makefile files that
enabled LLVM make style building and made this compile LLDB on Mac OS X. We can now iterate on this to make the build work on both linux and macosx. llvm-svn: 108009
Diffstat (limited to 'lldb/source/Expression/ClangStmtVisitor.cpp')
-rw-r--r--lldb/source/Expression/ClangStmtVisitor.cpp23
1 files changed, 7 insertions, 16 deletions
diff --git a/lldb/source/Expression/ClangStmtVisitor.cpp b/lldb/source/Expression/ClangStmtVisitor.cpp
index b3aecebaeac..cfe525068a5 100644
--- a/lldb/source/Expression/ClangStmtVisitor.cpp
+++ b/lldb/source/Expression/ClangStmtVisitor.cpp
@@ -37,6 +37,9 @@ GetScalarTypeForClangType (clang::ASTContext &ast_context, clang::QualType clang
switch (clang_type->getTypeClass())
{
+ default:
+ break;
+
case clang::Type::FunctionNoProto:
case clang::Type::FunctionProto:
break;
@@ -135,8 +138,8 @@ lldb_private::ClangStmtVisitor::ClangStmtVisitor
lldb_private::StreamString &strm
) :
m_ast_context (ast_context),
- m_variable_list (variable_list),
m_decl_map (decl_map),
+ m_variable_list (variable_list),
m_stream (strm)
{
}
@@ -477,22 +480,10 @@ lldb_private::ClangStmtVisitor::VisitStringLiteral (clang::StringLiteral *Str)
bool is_wide = Str->isWide();
size_t new_length = byte_length + (is_wide ? 1 : 2);
+
+ std::string null_terminated_string (Str->getStrData(), byte_length);
- uint8_t null_terminated_string[new_length];
-
- memcpy(&null_terminated_string[0], Str->getStrData(), byte_length);
-
- if(is_wide)
- {
- null_terminated_string[byte_length] = '\0';
- null_terminated_string[byte_length + 1] = '\0';
- }
- else
- {
- null_terminated_string[byte_length] = '\0';
- }
-
- Value *val = new Value(null_terminated_string, new_length);
+ Value *val = new Value((uint8_t*)null_terminated_string.c_str(), new_length);
val->SetContext(Value::eContextTypeOpaqueClangQualType, Str->getType().getAsOpaquePtr());
uint32_t val_idx = m_variable_list.AppendValue(val);
OpenPOWER on IntegriCloud