[PATCH] D124702: [MSVC] Add support for pragma function
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu May 12 06:43:20 PDT 2022
aaron.ballman added inline comments.
================
Comment at: clang/lib/Sema/SemaAttr.cpp:1070
+ SourceLocation Loc, const llvm::SmallVectorImpl<StringRef> &NoBuiltins) {
+ if (!CurContext->isFileContext()) {
+ Diag(Loc, diag::err_pragma_expected_file_scope) << "function";
----------------
It looks like we need `getRedeclContext()` after all, consider:
```
#include <cstring>
extern "C" {
void foo();
#pragma function(memset)
}
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124702/new/
https://reviews.llvm.org/D124702
More information about the cfe-commits
mailing list