All the callers pass an enum and we cast the int anyway back to the actual type,
so we might as well just use the type for the parameter.
FunctionDecl *TypeSystemClang::CreateFunctionDeclaration(
clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module,
- const char *name, const CompilerType &function_clang_type, int storage,
- bool is_inline) {
+ const char *name, const CompilerType &function_clang_type,
+ clang::StorageClass storage, bool is_inline) {
FunctionDecl *func_decl = nullptr;
ASTContext &ast = getASTContext();
if (!decl_ctx)
func_decl->setDeclContext(decl_ctx);
func_decl->setDeclName(declarationName);
func_decl->setType(ClangUtil::GetQualType(function_clang_type));
- func_decl->setStorageClass(static_cast<clang::StorageClass>(storage));
+ func_decl->setStorageClass(storage);
func_decl->setInlineSpecified(is_inline);
func_decl->setHasWrittenPrototype(hasWrittenPrototype);
func_decl->setConstexprKind(isConstexprSpecified ? CSK_constexpr
CreateFunctionDeclaration(clang::DeclContext *decl_ctx,
OptionalClangModuleID owning_module,
const char *name, const CompilerType &function_Type,
- int storage, bool is_inline);
+ clang::StorageClass storage, bool is_inline);
CompilerType CreateFunctionType(const CompilerType &result_type,
const CompilerType *args, unsigned num_args,
CompilerType clang_type =
m_ast->CreateFunctionType(int_type, nullptr, 0U, false, 0U);
FunctionDecl *func = m_ast->CreateFunctionDeclaration(
- TU, OptionalClangModuleID(), "foo", clang_type, 0, false);
+ TU, OptionalClangModuleID(), "foo", clang_type, StorageClass::SC_None,
+ false);
TypeSystemClang::TemplateParameterInfos empty_params;
// Create the actual function template.
// 1. FunctionDecls can't be in a Record (only CXXMethodDecls can).
// 2. It is mirroring the behavior of DWARFASTParserClang::ParseSubroutine.
FunctionDecl *func = m_ast->CreateFunctionDeclaration(
- TU, OptionalClangModuleID(), "foo", clang_type, 0, false);
+ TU, OptionalClangModuleID(), "foo", clang_type, StorageClass::SC_None,
+ false);
TypeSystemClang::TemplateParameterInfos empty_params;
// Create the actual function template.