aaron.ballman added a comment.

In D126559#3547921 <https://reviews.llvm.org/D126559#3547921>, @steplong wrote:

> It looks like MSVC also accepts
>
>   // foo.c
>   static void foo();
>   #pragma alloc_text("hello", foo)
>   void foo() {}
>
> and
>
>   // foo.cpp
>   extern "C" {
>   static void foo();
>   #pragma alloc_text("hello", foo)
>   void foo() {}
>   }
>
> Do you know of a way I can check whether a function is coming from c or c++? 
> `isExternC()` returns false for the static case

You can look at `!LangOpts.CPlusPlus` to know that you're in C mode (or C++ 
mode)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126559/new/

https://reviews.llvm.org/D126559

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to