From: Greg Clayton Date: Fri, 28 Jun 2013 21:08:47 +0000 (+0000) Subject: Default parameters are evil and should not be used. Case and point this checkin that... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0d5510458e6a5e9810f87df90e1c83a2a21b94cf;p=platform%2Fupstream%2Fllvm.git Default parameters are evil and should not be used. Case and point this checkin that fixes implicit conversions that were happening. llvm-svn: 185217 --- diff --git a/lldb/source/Expression/ClangASTSource.cpp b/lldb/source/Expression/ClangASTSource.cpp index e7c90b9..b7904c5 100644 --- a/lldb/source/Expression/ClangASTSource.cpp +++ b/lldb/source/Expression/ClangASTSource.cpp @@ -1741,18 +1741,21 @@ NameSearchContext::AddFunDecl (void *type) m_function_types.insert(type); + const bool isInlineSpecified = false; + const bool hasWrittenPrototype = true; + const bool isConstexprSpecified = false; + clang::FunctionDecl *func_decl = FunctionDecl::Create (*m_ast_source.m_ast_context, const_cast(m_decl_context), SourceLocation(), - SourceLocation(), m_decl_name.getAsIdentifierInfo(), QualType::getFromOpaquePtr(type), NULL, SC_Static, - SC_Static, - false, - true); - + isInlineSpecified, + hasWrittenPrototype, + isConstexprSpecified); + // We have to do more than just synthesize the FunctionDecl. We have to // synthesize ParmVarDecls for all of the FunctionDecl's arguments. To do // this, we raid the function's FunctionProtoType for types. diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index d583a24..00ebfaa 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -5534,6 +5534,10 @@ ClangASTContext::CreateFunctionDeclaration (DeclContext *decl_ctx, const char *n if (decl_ctx == NULL) decl_ctx = ast->getTranslationUnitDecl(); + + const bool hasWrittenPrototype = true; + const bool isConstexprSpecified = false; + if (name && name[0]) { func_decl = FunctionDecl::Create (*ast, @@ -5544,8 +5548,9 @@ ClangASTContext::CreateFunctionDeclaration (DeclContext *decl_ctx, const char *n QualType::getFromOpaquePtr(function_clang_type), NULL, (FunctionDecl::StorageClass)storage, - (FunctionDecl::StorageClass)storage, - is_inline); + is_inline, + hasWrittenPrototype, + isConstexprSpecified); } else { @@ -5557,8 +5562,9 @@ ClangASTContext::CreateFunctionDeclaration (DeclContext *decl_ctx, const char *n QualType::getFromOpaquePtr(function_clang_type), NULL, (FunctionDecl::StorageClass)storage, - (FunctionDecl::StorageClass)storage, - is_inline); + is_inline, + hasWrittenPrototype, + isConstexprSpecified); } if (func_decl) decl_ctx->addDecl (func_decl);