Tuesday, December 10, 2024

UPDATE: devel/clang-tools-extra

Switch devel/clang-tools-extra from 16 to 18. OK?

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/clang-tools-extra/Makefile,v
diff -u -p -r1.39 Makefile
--- Makefile 7 Aug 2024 20:56:29 -0000 1.39
+++ Makefile 11 Dec 2024 06:47:11 -0000
@@ -12,8 +12,7 @@ DPB_PROPERTIES = parallel

COMMENT= Clang extra tools

-LLVM_V = 16.0.6
-LLVM_BASE = llvm16
+LLVM_V = 18.1.8
DISTNAME = llvm-project-${LLVM_V}.src
PKGNAME= clang-tools-extra-${LLVM_V}

@@ -38,9 +37,9 @@ MODULES = devel/cmake \
lang/clang \
lang/python

+MODCLANG_VERSION = 18
MODCLANG_COMPILER_LINKS = No
MODCLANG_BUILDDEP = No
-MODCLANG_RUNDEP = No

CONFIGURE_STYLE = cmake

@@ -53,9 +52,6 @@ BUILD_DEPENDS += devel/swig \
textproc/py-sphinx${MODPY_FLAVOR} \
textproc/py-recommonmark${MODPY_FLAVOR}

-CLANG_INCLUDE_PATH = ${LLVM_BASE}/lib/clang/16/include
-SUBST_VARS += CLANG_INCLUDE_PATH LLVM_V
-
CONFIGURE_ARGS += -DLLVM_ENABLE_BACKTRACES=OFF \
-DLLVM_ENABLE_FFI=OFF \
-DLLVM_ENABLE_LIBXML2=OFF \
@@ -96,6 +92,9 @@ CXXFLAGS += ${CXXFLAGS-${MACHINE_ARCH}}
# hack to disable the use of -Bsymbolic-functions
OPENBSD_LD_IS_LLD = FALSE
SUBST_VARS += OPENBSD_LD_IS_LLD
+
+CLANG_INCLUDE_PATH = llvm${MODCLANG_VERSION}/lib/clang/${MODCLANG_VERSION}/include
+SUBST_VARS += CLANG_INCLUDE_PATH LLVM_V

ALL_TARGET = clang-change-namespace clang-apply-replacements
ALL_TARGET += clang-doc clang-format clang-include-fixer clang-move
Index: _portcheck.pbh
===================================================================
RCS file: _portcheck.pbh
diff -N _portcheck.pbh
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ _portcheck.pbh 11 Dec 2024 06:47:11 -0000
@@ -0,0 +1,12 @@
+15 line(s) longer than 80 chars in Makefile
+hardcoded paths detected in Makefile, consider using SUBST_VARS and TRUEPREFIX/LOCALBASE/LOCALSTATEDIR/VARBASE
+LIB_DEPENDS devel/llvm/16 not needed for devel/clang-tools-extra ?
+LIB_DEPENDS devel/llvm/18 not needed for devel/clang-tools-extra ?
+LIB_DEPENDS devel/llvm/19 not needed for devel/clang-tools-extra ?
+Python module without compiled version, consider using ${MODPY_COMPILEALL}: share/clang/clang-format-diff.py
+Python module without compiled version, consider using ${MODPY_COMPILEALL}: share/clang/clang-format-sublime.py
+Python module without compiled version, consider using ${MODPY_COMPILEALL}: share/clang/clang-format.py
+Python module without compiled version, consider using ${MODPY_COMPILEALL}: share/clang/clang-include-fixer.py
+Python module without compiled version, consider using ${MODPY_COMPILEALL}: share/clang/clang-tidy-diff.py
+Python module without compiled version, consider using ${MODPY_COMPILEALL}: share/clang/run-find-all-symbols.py
+devel/clang-tools-extra
Index: distinfo
===================================================================
RCS file: /cvs/ports/devel/clang-tools-extra/distinfo,v
diff -u -p -r1.5 distinfo
--- distinfo 27 May 2024 18:14:08 -0000 1.5
+++ distinfo 11 Dec 2024 06:47:11 -0000
@@ -1,2 +1,2 @@
-SHA256 (llvm-project-16.0.6.src.tar.xz) = zl5xCB0Xzp6G18vPooxLBLkwD4+354Qisf62vFLDAo4=
-SIZE (llvm-project-16.0.6.src.tar.xz) = 118013488
+SHA256 (llvm-project-18.1.8.src.tar.xz) = C1hVem0yzu6XyNUzpZuSEth+D8TSgzkk62xhEkfbLyo=
+SIZE (llvm-project-18.1.8.src.tar.xz) = 132067260
Index: patches/patch-clang_docs_CommandGuide_clang_rst
===================================================================
RCS file: /cvs/ports/devel/clang-tools-extra/patches/patch-clang_docs_CommandGuide_clang_rst,v
diff -u -p -r1.1 patch-clang_docs_CommandGuide_clang_rst
--- patches/patch-clang_docs_CommandGuide_clang_rst 27 May 2024 18:14:08 -0000 1.1
+++ patches/patch-clang_docs_CommandGuide_clang_rst 11 Dec 2024 06:47:11 -0000
@@ -9,7 +9,7 @@ Index: clang/docs/CommandGuide/clang.rst

SYNOPSIS
--------
-@@ -697,4 +697,4 @@ output of the compiler, along with information to repr
+@@ -737,4 +737,4 @@ output of the compiler, along with information to repr
SEE ALSO
--------

Index: patches/patch-clang_docs_conf_py
===================================================================
RCS file: patches/patch-clang_docs_conf_py
diff -N patches/patch-clang_docs_conf_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-clang_docs_conf_py 11 Dec 2024 06:47:11 -0000
@@ -0,0 +1,21 @@
+Index: clang/docs/conf.py
+--- clang/docs/conf.py.orig
++++ clang/docs/conf.py
+@@ -35,8 +35,16 @@ templates_path = ["_templates"]
+
+ import sphinx
+
+-if sphinx.version_info >= (3, 0):
++# When building man pages, we do not use the markdown pages,
++# So, we can continue without the myst_parser dependencies.
++# Doing so reduces dependencies of some packaged llvm distributions.
++try:
++ import myst_parser
++
+ extensions.append("myst_parser")
++except ImportError:
++ if not tags.has("builder-man"):
++ raise
+
+ # The encoding of source files.
+ # source_encoding = 'utf-8-sig'
Index: patches/patch-clang_include_clang_Basic_CodeGenOptions_def
===================================================================
RCS file: /cvs/ports/devel/clang-tools-extra/patches/patch-clang_include_clang_Basic_CodeGenOptions_def,v
diff -u -p -r1.1 patch-clang_include_clang_Basic_CodeGenOptions_def
--- patches/patch-clang_include_clang_Basic_CodeGenOptions_def 27 May 2024 18:14:08 -0000 1.1
+++ patches/patch-clang_include_clang_Basic_CodeGenOptions_def 11 Dec 2024 06:47:11 -0000
@@ -1,13 +1,13 @@
Index: clang/include/clang/Basic/CodeGenOptions.def
--- clang/include/clang/Basic/CodeGenOptions.def.orig
+++ clang/include/clang/Basic/CodeGenOptions.def
-@@ -385,6 +385,9 @@ VALUE_CODEGENOPT(SmallDataLimit, 32, 0)
+@@ -357,6 +357,9 @@ VALUE_CODEGENOPT(SmallDataLimit, 32, 0)
/// The lower bound for a buffer to be considered for stack protection.
VALUE_CODEGENOPT(SSPBufferSize, 32, 0)

+/// Whether to use return protectors
+CODEGENOPT(ReturnProtector, 1, 0)
+
- /// The kind of generated debug info.
- ENUM_CODEGENOPT(DebugInfo, codegenoptions::DebugInfoKind, 4, codegenoptions::NoDebugInfo)
+ /// The kind of inlining to perform.
+ ENUM_CODEGENOPT(Inlining, InliningMethod, 2, NormalInlining)

Index: patches/patch-clang_include_clang_Basic_DiagnosticSemaKinds_td
===================================================================
RCS file: /cvs/ports/devel/clang-tools-extra/patches/patch-clang_include_clang_Basic_DiagnosticSemaKinds_td,v
diff -u -p -r1.1 patch-clang_include_clang_Basic_DiagnosticSemaKinds_td
--- patches/patch-clang_include_clang_Basic_DiagnosticSemaKinds_td 27 May 2024 18:14:08 -0000 1.1
+++ patches/patch-clang_include_clang_Basic_DiagnosticSemaKinds_td 11 Dec 2024 06:47:11 -0000
@@ -1,7 +1,7 @@
Index: clang/include/clang/Basic/DiagnosticSemaKinds.td
--- clang/include/clang/Basic/DiagnosticSemaKinds.td.orig
+++ clang/include/clang/Basic/DiagnosticSemaKinds.td
-@@ -251,7 +251,7 @@ def warn_deprecated_register : Warning<
+@@ -277,7 +277,7 @@ def warn_deprecated_register : Warning<
"and incompatible with C++17">, InGroup<DeprecatedRegister>;
def ext_register_storage_class : ExtWarn<
"ISO C++17 does not allow 'register' storage class specifier">,
@@ -10,7 +10,7 @@ Index: clang/include/clang/Basic/Diagnos

def err_invalid_decl_spec_combination : Error<
"cannot combine with previous '%0' declaration specifier">;
-@@ -419,7 +419,7 @@ def warn_implicit_function_decl : Warning<
+@@ -452,7 +452,7 @@ def warn_implicit_function_decl : Warning<
InGroup<ImplicitFunctionDeclare>, DefaultIgnore;
def ext_implicit_function_decl_c99 : ExtWarn<
"call to undeclared function %0; ISO C99 and later do not support implicit "
@@ -19,7 +19,7 @@ Index: clang/include/clang/Basic/Diagnos
def note_function_suggestion : Note<"did you mean %0?">;

def err_ellipsis_first_param : Error<
-@@ -709,7 +709,7 @@ def ext_implicit_lib_function_decl : ExtWarn<
+@@ -746,7 +746,7 @@ def ext_implicit_lib_function_decl : ExtWarn<
def ext_implicit_lib_function_decl_c99 : ExtWarn<
"call to undeclared library function '%0' with type %1; ISO C99 and later "
"do not support implicit function declarations">,
@@ -28,7 +28,7 @@ Index: clang/include/clang/Basic/Diagnos
def note_include_header_or_declare : Note<
"include the header <%0> or explicitly provide a declaration for '%1'">;
def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">;
-@@ -4391,7 +4391,7 @@ def err_ident_list_in_fn_declaration : Error<
+@@ -4567,7 +4567,7 @@ def err_ident_list_in_fn_declaration : Error<
"a parameter list without types is only allowed in a function definition">;
def ext_param_not_declared : ExtWarn<
"parameter %0 was not declared, defaults to 'int'; ISO C99 and later do not "
@@ -37,7 +37,7 @@ Index: clang/include/clang/Basic/Diagnos
def err_param_default_argument : Error<
"C does not support default arguments">;
def err_param_default_argument_redefinition : Error<
-@@ -6980,7 +6980,7 @@ def warn_pointer_indirection_from_incompatible_type :
+@@ -7197,7 +7197,7 @@ def warn_pointer_indirection_from_incompatible_type :
InGroup<UndefinedReinterpretCast>, DefaultIgnore;
def warn_taking_address_of_packed_member : Warning<
"taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">,
@@ -46,7 +46,7 @@ Index: clang/include/clang/Basic/Diagnos
def warn_param_mismatched_alignment : Warning<
"passing %0-byte aligned argument to %1-byte aligned parameter %2%select{| of %4}3 may result in an unaligned pointer access">,
InGroup<DiagGroup<"align-mismatch">>;
-@@ -8113,7 +8113,7 @@ def err_typecheck_convert_pointer_int : Error<
+@@ -8365,7 +8365,7 @@ def err_typecheck_convert_pointer_int : Error<
"; remove &}3">;
def ext_typecheck_convert_pointer_int : ExtWarn<
err_typecheck_convert_pointer_int.Summary>,
@@ -55,7 +55,7 @@ Index: clang/include/clang/Basic/Diagnos
def err_typecheck_convert_int_pointer : Error<
"incompatible integer to pointer conversion "
"%select{%diff{assigning to $ from $|assigning to different types}0,1"
-@@ -8133,7 +8133,7 @@ def err_typecheck_convert_int_pointer : Error<
+@@ -8385,7 +8385,7 @@ def err_typecheck_convert_int_pointer : Error<
"; remove &}3">;
def ext_typecheck_convert_int_pointer : ExtWarn<
err_typecheck_convert_int_pointer.Summary>,
@@ -64,7 +64,7 @@ Index: clang/include/clang/Basic/Diagnos
def ext_typecheck_convert_pointer_void_func : Extension<
"%select{%diff{assigning to $ from $|assigning to different types}0,1"
"|%diff{passing $ to parameter of type $|"
-@@ -8174,7 +8174,7 @@ def ext_typecheck_convert_incompatible_pointer_sign :
+@@ -8426,7 +8426,7 @@ def ext_typecheck_convert_incompatible_pointer_sign :
"|%diff{casting $ to type $|casting between types}0,1}2"
" converts between pointers to integer types %select{with different sign|"
"where one is of the unique plain 'char' type and the other is not}3">,
@@ -73,7 +73,7 @@ Index: clang/include/clang/Basic/Diagnos
def err_typecheck_convert_incompatible_pointer_sign :
Error<ext_typecheck_convert_incompatible_pointer_sign.Summary>;
def ext_typecheck_convert_incompatible_pointer : ExtWarn<
-@@ -8231,7 +8231,7 @@ def err_typecheck_convert_incompatible_function_pointe
+@@ -8483,7 +8483,7 @@ def err_typecheck_convert_incompatible_function_pointe
"; remove &}3">;
def ext_typecheck_convert_incompatible_function_pointer : ExtWarn<
err_typecheck_convert_incompatible_function_pointer.Summary>,
@@ -82,7 +82,7 @@ Index: clang/include/clang/Basic/Diagnos
def warn_typecheck_convert_incompatible_function_pointer_strict : Warning<
err_typecheck_convert_incompatible_function_pointer.Summary>,
InGroup<DiagGroup<"incompatible-function-pointer-types-strict">>, DefaultIgnore;
-@@ -9769,6 +9769,9 @@ def err_os_log_argument_too_big : Error<
+@@ -10065,6 +10065,9 @@ def err_os_log_argument_too_big : Error<
def warn_os_log_format_narg : Error<
"os_log() '%%n' format specifier is not allowed">, DefaultError;

@@ -92,7 +92,7 @@ Index: clang/include/clang/Basic/Diagnos
// Statements.
def err_continue_not_in_loop : Error<
"'continue' statement not in loop statement">;
-@@ -10105,7 +10108,7 @@ def warn_receiver_forward_class : Warning<
+@@ -10407,7 +10410,7 @@ def warn_receiver_forward_class : Warning<
def note_method_sent_forward_class : Note<"method %0 is used for the forward class">;
def ext_missing_type_specifier : ExtWarn<
"type specifier missing, defaults to 'int'; ISO C99 and later do not support "
Index: patches/patch-clang_include_clang_Driver_Options_td
===================================================================
RCS file: /cvs/ports/devel/clang-tools-extra/patches/patch-clang_include_clang_Driver_Options_td,v
diff -u -p -r1.1 patch-clang_include_clang_Driver_Options_td
--- patches/patch-clang_include_clang_Driver_Options_td 27 May 2024 18:14:08 -0000 1.1
+++ patches/patch-clang_include_clang_Driver_Options_td 11 Dec 2024 06:47:11 -0000
@@ -1,42 +1,53 @@
Index: clang/include/clang/Driver/Options.td
--- clang/include/clang/Driver/Options.td.orig
+++ clang/include/clang/Driver/Options.td
-@@ -2847,6 +2847,16 @@ def ftrivial_auto_var_init : Joined<["-"], "ftrivial-a
+@@ -3672,6 +3672,20 @@ def ftrivial_auto_var_init : Joined<["-"], "ftrivial-a
NormalizedValuesScope<"LangOptions::TrivialAutoVarInitKind">,
NormalizedValues<["Uninitialized", "Zero", "Pattern"]>,
MarshallingInfoEnum<LangOpts<"TrivialAutoVarInit">, "Uninitialized">;
-+def ret_protector : Flag<["-"], "ret-protector">, Flags<[CC1Option]>,
++def ret_protector : Flag<["-"], "ret-protector">, Visibility<[CC1Option]>,
+ HelpText<"Enable Return Protectors">;
-+def fno_ret_protector : Flag<["-"], "fno-ret-protector">, Group<f_Group>, Flags<[CoreOption]>,
++def fno_ret_protector : Flag<["-"], "fno-ret-protector">, Group<f_Group>, Visibility<[ClangOption, CLOption, DXCOption]>,
+ HelpText<"Disable return protector">;
-+def fret_protector : Flag<["-"], "fret-protector">, Group<f_Group>, Flags<[CoreOption]>,
++def fret_protector : Flag<["-"], "fret-protector">, Group<f_Group>, Visibility<[ClangOption, CLOption, DXCOption]>,
+ HelpText<"Enable return protector">;
-+def fno_fixup_gadgets : Flag<["-"], "fno-fixup-gadgets">, Group<f_Group>, Flags<[CoreOption]>,
++def fno_fixup_gadgets : Flag<["-"], "fno-fixup-gadgets">, Group<f_Group>, Visibility<[ClangOption, CLOption, DXCOption]>,
+ HelpText<"Disable FixupGadgets pass (x86 only)">;
-+def ffixup_gadgets : Flag<["-"], "ffixup-gadgets">, Group<f_Group>, Flags<[CoreOption]>,
++def ffixup_gadgets : Flag<["-"], "ffixup-gadgets">, Group<f_Group>, Visibility<[ClangOption, CLOption, DXCOption]>,
+ HelpText<"Replace ROP friendly instructions with safe alternatives (x86 only)">;
++def fno_ret_clean : Flag<["-"], "fno-ret-clean">, Group<f_Group>, Visibility<[ClangOption, CLOption, DXCOption]>,
++ HelpText<"Disable ret-clean pass">;
++def fret_clean : Flag<["-"], "fret-clean">, Group<f_Group>, Visibility<[ClangOption, CLOption, DXCOption]>,
++ HelpText<"Clean return address from stack after call">;
def ftrivial_auto_var_init_stop_after : Joined<["-"], "ftrivial-auto-var-init-stop-after=">, Group<f_Group>,
- Flags<[CC1Option, CoreOption]>, HelpText<"Stop initializing trivial automatic stack variables after the specified number of instances">,
- MarshallingInfoInt<LangOpts<"TrivialAutoVarInitStopAfter">>;
-@@ -3943,6 +3953,8 @@ def mno_check_zero_division : Flag<["-"], "mno-check-z
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
+ HelpText<"Stop initializing trivial automatic stack variables after the specified number of instances">,
+@@ -5061,6 +5075,8 @@ def mno_check_zero_division : Flag<["-"], "mno-check-z
def mfix4300 : Flag<["-"], "mfix4300">, Group<m_mips_Features_Group>;
def mcompact_branches_EQ : Joined<["-"], "mcompact-branches=">,
Group<m_mips_Features_Group>;
+def mfix_loongson2f_btb : Flag<["-"], "mfix-loongson2f-btb">,
+ Group<m_mips_Features_Group>;
+ } // let Flags = [TargetSpecific]
def mbranch_likely : Flag<["-"], "mbranch-likely">, Group<m_Group>,
IgnoredGCCCompat;
- def mno_branch_likely : Flag<["-"], "mno-branch-likely">, Group<m_Group>,
-@@ -4184,7 +4196,7 @@ defm pthread : BoolOption<"", "pthread",
- LangOpts<"POSIXThreads">, DefaultFalse,
- PosFlag<SetTrue, [], "Support POSIX threads in generated code">,
- NegFlag<SetFalse>, BothFlags<[CC1Option]>>;
--def p : Flag<["-"], "p">;
+@@ -5276,10 +5292,14 @@ def pedantic_errors : Flag<["-", "--"], "pedantic-erro
+ def pedantic : Flag<["-", "--"], "pedantic">, Group<pedantic_Group>,
+ Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
+ HelpText<"Warn on language extensions">, MarshallingInfoFlag<DiagnosticOpts<"Pedantic">>;
+-def p : Flag<["-"], "p">, HelpText<"Enable mcount instrumentation with prof">;
++// def p : Flag<["-"], "p">, HelpText<"Enable mcount instrumentation with prof">;
++// Commit 7f85c560b43bd1b2ebf77cc443281b474b5e19c6 re-added -p as another
++// option, referencing AIX. We deliberately added -p as an alias of -pg (below)
++// in 4a39d3fe14b39d088ca94a7747e4bab1dac261b1 and will keep it that way for now.
+ def pg : Flag<["-"], "pg">, HelpText<"Enable mcount instrumentation">,
+ Visibility<[ClangOption, CC1Option]>,
+ MarshallingInfoFlag<CodeGenOpts<"InstrumentForProfiling">>;
+def p : Flag<["-"], "p">, Alias<pg>;
- def pie : Flag<["-"], "pie">, Group<Link_Group>;
- def static_pie : Flag<["-"], "static-pie">, Group<Link_Group>;
- def read__only__relocs : Separate<["-"], "read_only_relocs">;
-@@ -4796,6 +4808,8 @@ def mshstk : Flag<["-"], "mshstk">, Group<m_x86_Featur
+ def pipe : Flag<["-", "--"], "pipe">,
+ HelpText<"Use pipes between commands, when possible">;
+ def prebind__all__twolevel__modules : Flag<["-"], "prebind_all_twolevel_modules">;
+@@ -6076,6 +6096,8 @@ def mshstk : Flag<["-"], "mshstk">, Group<m_x86_Featur
def mno_shstk : Flag<["-"], "mno-shstk">, Group<m_x86_Features_Group>;
def mretpoline_external_thunk : Flag<["-"], "mretpoline-external-thunk">, Group<m_x86_Features_Group>;
def mno_retpoline_external_thunk : Flag<["-"], "mno-retpoline-external-thunk">, Group<m_x86_Features_Group>;
@@ -44,4 +55,4 @@ Index: clang/include/clang/Driver/Option
+def mno_save_args : Flag<["-"], "mno-save-args">, Group<m_x86_Features_Group>;
def mvzeroupper : Flag<["-"], "mvzeroupper">, Group<m_x86_Features_Group>;
def mno_vzeroupper : Flag<["-"], "mno-vzeroupper">, Group<m_x86_Features_Group>;
-
+ def mno_gather : Flag<["-"], "mno-gather">, Group<m_Group>,
Index: patches/patch-clang_include_clang_Sema_Sema_h
===================================================================
RCS file: /cvs/ports/devel/clang-tools-extra/patches/patch-clang_include_clang_Sema_Sema_h,v
diff -u -p -r1.1 patch-clang_include_clang_Sema_Sema_h
--- patches/patch-clang_include_clang_Sema_Sema_h 27 May 2024 18:14:08 -0000 1.1
+++ patches/patch-clang_include_clang_Sema_Sema_h 11 Dec 2024 06:47:11 -0000
@@ -1,7 +1,7 @@
Index: clang/include/clang/Sema/Sema.h
--- clang/include/clang/Sema/Sema.h.orig
+++ clang/include/clang/Sema/Sema.h
-@@ -13567,6 +13567,7 @@ class Sema final { (public)
+@@ -14019,6 +14019,7 @@ class Sema final { (public)
FST_FreeBSDKPrintf,
FST_OSTrace,
FST_OSLog,
Index: patches/patch-clang_lib_AST_FormatString_cpp
===================================================================
RCS file: /cvs/ports/devel/clang-tools-extra/patches/patch-clang_lib_AST_FormatString_cpp,v
diff -u -p -r1.1 patch-clang_lib_AST_FormatString_cpp
--- patches/patch-clang_lib_AST_FormatString_cpp 27 May 2024 18:14:08 -0000 1.1
+++ patches/patch-clang_lib_AST_FormatString_cpp 11 Dec 2024 06:47:11 -0000
@@ -1,7 +1,7 @@
Index: clang/lib/AST/FormatString.cpp
--- clang/lib/AST/FormatString.cpp.orig
+++ clang/lib/AST/FormatString.cpp
-@@ -828,6 +828,10 @@ bool FormatSpecifier::hasValidLengthModifier(const Tar
+@@ -858,6 +858,10 @@ bool FormatSpecifier::hasValidLengthModifier(const Tar
case ConversionSpecifier::XArg:
case ConversionSpecifier::nArg:
return true;
@@ -12,7 +12,7 @@ Index: clang/lib/AST/FormatString.cpp
case ConversionSpecifier::FreeBSDrArg:
case ConversionSpecifier::FreeBSDyArg:
return Target.getTriple().isOSFreeBSD() || Target.getTriple().isPS();
-@@ -863,6 +867,10 @@ bool FormatSpecifier::hasValidLengthModifier(const Tar
+@@ -895,6 +899,10 @@ bool FormatSpecifier::hasValidLengthModifier(const Tar
case ConversionSpecifier::ScanListArg:
case ConversionSpecifier::ZArg:
return true;
@@ -23,7 +23,7 @@ Index: clang/lib/AST/FormatString.cpp
case ConversionSpecifier::FreeBSDrArg:
case ConversionSpecifier::FreeBSDyArg:
return Target.getTriple().isOSFreeBSD() || Target.getTriple().isPS();
-@@ -1024,6 +1032,7 @@ bool FormatSpecifier::hasStandardLengthConversionCombi
+@@ -1056,6 +1064,7 @@ bool FormatSpecifier::hasStandardLengthConversionCombi
case ConversionSpecifier::uArg:
case ConversionSpecifier::xArg:
case ConversionSpecifier::XArg:
Index: patches/patch-clang_lib_Basic_Targets_Mips_h
===================================================================
RCS file: /cvs/ports/devel/clang-tools-extra/patches/patch-clang_lib_Basic_Targets_Mips_h,v
diff -u -p -r1.1 patch-clang_lib_Basic_Targets_Mips_h
--- patches/patch-clang_lib_Basic_Targets_Mips_h 27 May 2024 18:14:08 -0000 1.1
+++ patches/patch-clang_lib_Basic_Targets_Mips_h 11 Dec 2024 06:47:11 -0000
@@ -2,8 +2,8 @@ Index: clang/lib/Basic/Targets/Mips.h
--- clang/lib/Basic/Targets/Mips.h.orig
+++ clang/lib/Basic/Targets/Mips.h
@@ -238,6 +238,7 @@ class LLVM_LIBRARY_VISIBILITY MipsTargetInfo : public
+ case 'd': // Equivalent to "r" unless generating MIPS16 code.
case 'y': // Equivalent to "r", backward compatibility only.
- case 'f': // floating-point registers.
case 'c': // $25 for indirect jumps
+ case 'h': // hi register
case 'l': // lo register
Index: patches/patch-clang_lib_Basic_Targets_X86_cpp
===================================================================
RCS file: /cvs/ports/devel/clang-tools-extra/patches/patch-clang_lib_Basic_Targets_X86_cpp,v
diff -u -p -r1.1 patch-clang_lib_Basic_Targets_X86_cpp
--- patches/patch-clang_lib_Basic_Targets_X86_cpp 27 May 2024 18:14:08 -0000 1.1
+++ patches/patch-clang_lib_Basic_Targets_X86_cpp 11 Dec 2024 06:47:11 -0000
@@ -1,7 +1,7 @@
Index: clang/lib/Basic/Targets/X86.cpp
--- clang/lib/Basic/Targets/X86.cpp.orig
+++ clang/lib/Basic/Targets/X86.cpp
-@@ -323,6 +323,8 @@ bool X86TargetInfo::handleTargetFeatures(std::vector<s
+@@ -389,6 +389,8 @@ bool X86TargetInfo::handleTargetFeatures(std::vector<s
HasPTWRITE = true;
} else if (Feature == "+invpcid") {
HasINVPCID = true;
@@ -10,7 +10,7 @@ Index: clang/lib/Basic/Targets/X86.cpp
} else if (Feature == "+enqcmd") {
HasENQCMD = true;
} else if (Feature == "+hreset") {
-@@ -1070,6 +1072,7 @@ bool X86TargetInfo::hasFeature(StringRef Feature) cons
+@@ -1222,6 +1224,7 @@ bool X86TargetInfo::hasFeature(StringRef Feature) cons
.Case("movbe", HasMOVBE)
.Case("movdiri", HasMOVDIRI)
.Case("movdir64b", HasMOVDIR64B)
Index: patches/patch-clang_lib_Basic_Targets_X86_h
===================================================================
RCS file: /cvs/ports/devel/clang-tools-extra/patches/patch-clang_lib_Basic_Targets_X86_h,v
diff -u -p -r1.1 patch-clang_lib_Basic_Targets_X86_h
--- patches/patch-clang_lib_Basic_Targets_X86_h 27 May 2024 18:14:08 -0000 1.1
+++ patches/patch-clang_lib_Basic_Targets_X86_h 11 Dec 2024 06:47:11 -0000
@@ -1,11 +1,11 @@
Index: clang/lib/Basic/Targets/X86.h
--- clang/lib/Basic/Targets/X86.h.orig
+++ clang/lib/Basic/Targets/X86.h
-@@ -138,6 +138,7 @@ class LLVM_LIBRARY_VISIBILITY X86TargetInfo : public T
+@@ -147,6 +147,7 @@ class LLVM_LIBRARY_VISIBILITY X86TargetInfo : public T
bool HasMOVDIR64B = false;
bool HasPTWRITE = false;
bool HasINVPCID = false;
+ bool HasSaveArgs = false;
bool HasENQCMD = false;
+ bool HasAVXVNNIINT16 = false;
bool HasAMXFP16 = false;
- bool HasCMPCCXADD = false;
Index: patches/patch-clang_lib_CodeGen_CGCall_cpp
===================================================================
RCS file: /cvs/ports/devel/clang-tools-extra/patches/patch-clang_lib_CodeGen_CGCall_cpp,v
diff -u -p -r1.1 patch-clang_lib_CodeGen_CGCall_cpp
--- patches/patch-clang_lib_CodeGen_CGCall_cpp 27 May 2024 18:14:08 -0000 1.1
+++ patches/patch-clang_lib_CodeGen_CGCall_cpp 11 Dec 2024 06:47:11 -0000
@@ -1,7 +1,7 @@
Index: clang/lib/CodeGen/CGCall.cpp
--- clang/lib/CodeGen/CGCall.cpp.orig
+++ clang/lib/CodeGen/CGCall.cpp
-@@ -2347,6 +2347,9 @@ void CodeGenModule::ConstructAttributeList(StringRef N
+@@ -2556,6 +2556,9 @@ void CodeGenModule::ConstructAttributeList(StringRef N
// CPU/feature overrides. addDefaultFunctionDefinitionAttributes
// handles these separately to set them based on the global defaults.
GetCPUAndFeaturesAttributes(CalleeInfo.getCalleeDecl(), FuncAttrs);
Index: patches/patch-clang_lib_CodeGen_CodeGenModule_cpp
===================================================================
RCS file: patches/patch-clang_lib_CodeGen_CodeGenModule_cpp
diff -N patches/patch-clang_lib_CodeGen_CodeGenModule_cpp
--- patches/patch-clang_lib_CodeGen_CodeGenModule_cpp 27 May 2024 18:14:08 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-Index: clang/lib/CodeGen/CodeGenModule.cpp
---- clang/lib/CodeGen/CodeGenModule.cpp.orig
-+++ clang/lib/CodeGen/CodeGenModule.cpp
-@@ -979,7 +979,7 @@ void CodeGenModule::EmitOpenCLMetadata() {
- void CodeGenModule::EmitBackendOptionsMetadata(
- const CodeGenOptions CodeGenOpts) {
- if (getTriple().isRISCV()) {
-- getModule().addModuleFlag(llvm::Module::Error, "SmallDataLimit",
-+ getModule().addModuleFlag(llvm::Module::Warning, "SmallDataLimit",
- CodeGenOpts.SmallDataLimit);
- }
- }
Index: patches/patch-clang_lib_Driver_Driver_cpp
===================================================================
RCS file: /cvs/ports/devel/clang-tools-extra/patches/patch-clang_lib_Driver_Driver_cpp,v
diff -u -p -r1.1 patch-clang_lib_Driver_Driver_cpp
--- patches/patch-clang_lib_Driver_Driver_cpp 27 May 2024 18:14:08 -0000 1.1
+++ patches/patch-clang_lib_Driver_Driver_cpp 11 Dec 2024 06:47:11 -0000
@@ -1,13 +1,13 @@
Index: clang/lib/Driver/Driver.cpp
--- clang/lib/Driver/Driver.cpp.orig
+++ clang/lib/Driver/Driver.cpp
-@@ -5826,7 +5826,50 @@ const char *Driver::GetNamedOutputPath(Compilation &C,
+@@ -6064,7 +6064,50 @@ const char *Driver::GetNamedOutputPath(Compilation &C,
return C.addResultFile(NamedOutput, &JA);
}

+
+namespace {
-+static Optional<std::string> findFile(StringRef path1, const Twine &path2) {
++static std::optional<std::string> findFile(StringRef path1, const Twine &path2) {
+ SmallString<128> s;
+ llvm::sys::path::append(s, path1, path2);
+
@@ -17,7 +17,7 @@ Index: clang/lib/Driver/Driver.cpp
+}
+
+// Must be in sync with findMajMinShlib in lld/ELF/DriverUtils.cpp.
-+llvm::Optional<std::string> findMajMinShlib(StringRef dir, const Twine& libNameSo) {
++std::optional<std::string> findMajMinShlib(StringRef dir, const Twine& libNameSo) {
+ // Handle OpenBSD-style maj/min shlib scheme
+ llvm::SmallString<128> Scratch;
+ const StringRef LibName = (libNameSo + ".").toStringRef(Scratch);
@@ -27,7 +27,7 @@ Index: clang/lib/Driver/Driver.cpp
+ LI != LE; LI = LI.increment(EC)) {
+ StringRef FilePath = LI->path();
+ StringRef FileName = llvm::sys::path::filename(FilePath);
-+ if (!(FileName.startswith(LibName)))
++ if (!(FileName.starts_with(LibName)))
+ continue;
+ std::pair<StringRef, StringRef> MajMin =
+ FileName.substr(LibName.size()).split('.');
@@ -48,11 +48,11 @@ Index: clang/lib/Driver/Driver.cpp
+} // namespace
+
std::string Driver::GetFilePath(StringRef Name, const ToolChain &TC) const {
-+ const bool lookForLibDotSo = Name.startswith("lib") && Name.endswith(".so");
++ const bool lookForLibDotSo = Name.starts_with("lib") && Name.ends_with(".so");
// Search for Name in a list of paths.
auto SearchPaths = [&](const llvm::SmallVectorImpl<std::string> &P)
-> std::optional<std::string> {
-@@ -5836,9 +5879,14 @@ std::string Driver::GetFilePath(StringRef Name, const
+@@ -6074,9 +6117,14 @@ std::string Driver::GetFilePath(StringRef Name, const
if (Dir.empty())
continue;
SmallString<128> P(Dir[0] == '=' ? SysRoot + Dir.substr(1) : Dir);
Index: patches/patch-clang_lib_Driver_ToolChains_Arch_RISCV_cpp
===================================================================
RCS file: /cvs/ports/devel/clang-tools-extra/patches/patch-clang_lib_Driver_ToolChains_Arch_RISCV_cpp,v
diff -u -p -r1.1 patch-clang_lib_Driver_ToolChains_Arch_RISCV_cpp
--- patches/patch-clang_lib_Driver_ToolChains_Arch_RISCV_cpp 27 May 2024 18:14:08 -0000 1.1
+++ patches/patch-clang_lib_Driver_ToolChains_Arch_RISCV_cpp 11 Dec 2024 06:47:11 -0000
@@ -1,7 +1,7 @@
Index: clang/lib/Driver/ToolChains/Arch/RISCV.cpp
--- clang/lib/Driver/ToolChains/Arch/RISCV.cpp.orig
+++ clang/lib/Driver/ToolChains/Arch/RISCV.cpp
-@@ -140,6 +140,13 @@ void riscv::getRISCVTargetFeatures(const Driver &D, co
+@@ -154,6 +154,13 @@ void riscv::getRISCVTargetFeatures(const Driver &D, co
if (Args.hasArg(options::OPT_ffixed_x31))
Features.push_back("+reserve-x31");

@@ -15,11 +15,11 @@ Index: clang/lib/Driver/ToolChains/Arch/
// -mrelax is default, unless -mno-relax is specified.
if (Args.hasFlag(options::OPT_mrelax, options::OPT_mno_relax, true)) {
Features.push_back("+relax");
-@@ -152,6 +159,7 @@ void riscv::getRISCVTargetFeatures(const Driver &D, co
+@@ -166,6 +173,7 @@ void riscv::getRISCVTargetFeatures(const Driver &D, co
} else {
Features.push_back("-relax");
}
+

No comments:

Post a Comment