Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/include/clang/Basic/Attr.td
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ def AVRSignal : InheritableAttr, TargetSpecificAttr<TargetAVR> {
}

def AsmLabel : InheritableAttr {
let Spellings = [CustomKeyword<"asm">, CustomKeyword<"__asm__">];
let Spellings = [CustomKeyword<"asm">, CustomKeyword<"__asm">, CustomKeyword<"__asm__">];
let Args = [
// Label specifies the mangled name for the decl.
StringArgument<"Label">, ];
Expand Down
8 changes: 4 additions & 4 deletions clang/include/clang/Basic/AttrDocs.td
Original file line number Diff line number Diff line change
Expand Up @@ -4295,17 +4295,17 @@ used by other languages. (This prefix is also added to the standard Itanium
C++ ABI prefix on "mangled" symbol names, so that e.g. on such targets the true
symbol name for a C++ variable declared as ``int cppvar;`` would be
``__Z6cppvar``; note the two underscores.) This prefix is *not* added to the
symbol names specified by the ``asm`` attribute; programmers wishing to match a
C symbol name must compensate for this.
symbol names specified by the ``__asm`` attribute; programmers wishing to match
a C symbol name must compensate for this.

For example, consider the following C code:

.. code-block:: c

int var1 asm("altvar") = 1; // "altvar" in symbol table.
int var1 __asm("altvar") = 1; // "altvar" in symbol table.
int var2 = 1; // "_var2" in symbol table.

void func1(void) asm("altfunc");
void func1(void) __asm("altfunc");
void func1(void) {} // "altfunc" in symbol table.
void func2(void) {} // "_func2" in symbol table.

Expand Down
Loading