[all-commits] [llvm/llvm-project] 938cbd: [HLSL] Implement `export` keyword (#96823)

Helena Kotas via All-commits all-commits at lists.llvm.org
Mon Jul 1 13:55:47 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 938cbdb4cf428bf08558c24d845aeac9174c7022
      https://github.com/llvm/llvm-project/commit/938cbdb4cf428bf08558c24d845aeac9174c7022
  Author: Helena Kotas <hekotas at microsoft.com>
  Date:   2024-07-01 (Mon, 01 Jul 2024)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Parse/ParseDeclCXX.cpp
    M clang/lib/Parse/Parser.cpp
    M clang/lib/Sema/SemaModule.cpp
    A clang/test/AST/HLSL/export.hlsl
    A clang/test/CodeGenHLSL/export.hlsl
    A clang/test/SemaHLSL/export.hlsl

  Log Message:
  -----------
  [HLSL] Implement `export` keyword (#96823)

Implements `export` keyword in HLSL.

There are two ways the `export` keyword can be used:
1. On individual function declarations
```
export void f() {}
```
2. On a group of function declaration:
```
export {
   void f1();
   void f2() {}
}
```

Functions declared with the `export` keyword have external linkage. The
implementation does not include validation of when a function can or
cannot be exported, such as when it has resource argument or semantic
annotations. That will be covered by llvm/llvm-project#93330.

Currently all function declarations in global or named namespaces have
external linkage by default so there are no specific code changes
required right now to make sure exported function have external linkage
as well. That will change as part of llvm/llvm-project#92071. Any
additional changes to make sure exported functions still have external
linkage will be done as part of this work item.

Fixes #92812



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list