Skip to content

Commit 0724778

Browse files
committed
Correct typos and misc nits
1 parent d571f05 commit 0724778

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,11 @@ Attribute Changes in Clang
341341
- New format attributes ``gnu_printf``, ``gnu_scanf``, ``gnu_strftime`` and ``gnu_strfmon`` are added
342342
as aliases for ``printf``, ``scanf``, ``strftime`` and ``strfmon``. (#GH16219)
343343

344-
- New attribute ``modular_format`` to allow dynamically selecting at link time
345-
which aspects of a statically linked libc's printf (et al) implementation are
346-
required. This can reduce code size without requiring e.g. multilibs for
347-
printf features. Requires cooperation with the libc implementation.
344+
- Added new attribute ``modular_format`` to allow dynamically selecting at link
345+
time which aspects of a statically linked libc's printf (et al)
346+
implementation are required. This can reduce code size without requiring e.g.
347+
multilibs for printf features. Requires cooperation with the libc
348+
implementation.
348349

349350
Improvements to Clang's diagnostics
350351
-----------------------------------

clang/include/clang/Basic/AttrDocs.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9680,15 +9680,15 @@ def ModularFormatDocs : Documentation {
96809680
let Content = [{
96819681
The ``modular_format`` attribute can be applied to a function that bears the
96829682
``format`` attribute (or standard library functions) to indicate that the
9683-
implementation is "modular", that is, that the implemenation is logically
9683+
implementation is "modular", that is, that the implementation is logically
96849684
divided into a number of named aspects. When the compiler can determine that
96859685
not all aspects of the implementation are needed for a given call, the compiler
96869686
may redirect the call to the identifier given as the first argument to the
96879687
attribute (the modular implementation function).
96889688

96899689
The second argument is a implementation name, and the remaining arguments are
96909690
aspects of the format string for the compiler to report. The implementation
9691-
name is an unevaluted identifier be in the C namespace.
9691+
name is an unevaluated identifier be in the C namespace.
96929692

96939693
The compiler reports that a call requires an aspect by issuing a relocation for
96949694
the symbol ``<impl_name>_<aspect>`` at the point of the call. This arranges for

clang/lib/CodeGen/CGCall.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2560,7 +2560,6 @@ void CodeGenModule::ConstructAttributeList(StringRef Name,
25602560
FuncAttrs.addAttribute("aarch64_pstate_sm_body");
25612561

25622562
if (auto *ModularFormat = TargetDecl->getAttr<ModularFormatAttr>()) {
2563-
// TODO: Error checking
25642563
FormatAttr *Format = TargetDecl->getAttr<FormatAttr>();
25652564
StringRef Type = Format->getType()->getName();
25662565
std::string FormatIdx = std::to_string(Format->getFormatIdx());
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//RUN: %clang_cc1 -fsyntax-only -verify %s
22

3-
#include <stdarg.h>
4-
53
int printf(const char *fmt, ...) __attribute__((modular_format(__modular_printf, "__printf", "float"))); // no-error
64
int myprintf(const char *fmt, ...) __attribute__((modular_format(__modular_printf, "__printf", "float"))); // expected-error {{'modular_format' attribute requires 'format' attribute}}
75

0 commit comments

Comments
 (0)