[Lldb-commits] [lldb] r185217 - Default parameters are evil and should not be used. Case and point this checkin that fixes implicit conversions that were happening.
Greg Clayton
gclayton at apple.com
Fri Jun 28 14:08:47 PDT 2013
Author: gclayton
Date: Fri Jun 28 16:08:47 2013
New Revision: 185217
URL: http://llvm.org/viewvc/llvm-project?rev=185217&view=rev
Log:
Default parameters are evil and should not be used. Case and point this checkin that fixes implicit conversions that were happening.
Modified:
lldb/trunk/source/Expression/ClangASTSource.cpp
lldb/trunk/source/Symbol/ClangASTContext.cpp
Modified: lldb/trunk/source/Expression/ClangASTSource.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangASTSource.cpp?rev=185217&r1=185216&r2=185217&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangASTSource.cpp (original)
+++ lldb/trunk/source/Expression/ClangASTSource.cpp Fri Jun 28 16:08:47 2013
@@ -1741,18 +1741,21 @@ NameSearchContext::AddFunDecl (void *typ
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<DeclContext*>(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.
Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=185217&r1=185216&r2=185217&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Fri Jun 28 16:08:47 2013
@@ -5534,6 +5534,10 @@ ClangASTContext::CreateFunctionDeclarati
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::CreateFunctionDeclarati
QualType::getFromOpaquePtr(function_clang_type),
NULL,
(FunctionDecl::StorageClass)storage,
- (FunctionDecl::StorageClass)storage,
- is_inline);
+ is_inline,
+ hasWrittenPrototype,
+ isConstexprSpecified);
}
else
{
@@ -5557,8 +5562,9 @@ ClangASTContext::CreateFunctionDeclarati
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);
More information about the lldb-commits
mailing list