rocprofiler-sdk/CMakeFiles/3.27.4/CompilerIdCXX/CMakeCXXCompilerId.cpp File Reference

rocprofiler-sdk/CMakeFiles/3.27.4/CompilerIdCXX/CMakeCXXCompilerId.cpp File Reference#

Rocprofiler SDK Developer API: rocprofiler-sdk/CMakeFiles/3.27.4/CompilerIdCXX/CMakeCXXCompilerId.cpp File Reference
Rocprofiler SDK Developer API 0.4.0
ROCm Profiling API and tools
CMakeCXXCompilerId.cpp File Reference

Go to the source code of this file.

Macros

#define __has_include(x)   0
 
#define COMPILER_ID   ""
 
#define STRINGIFY_HELPER(X)   #X
 
#define STRINGIFY(X)   STRINGIFY_HELPER(X)
 
#define PLATFORM_ID
 
#define ARCHITECTURE_ID
 
#define DEC(n)
 
#define HEX(n)
 
#define CXX_STD   __cplusplus
 

Functions

int main (int argc, char *argv[])
 

Variables

char const * info_compiler = "INFO" ":" "compiler[" "" "]"
 
char const * info_platform = "INFO" ":" "platform[" "]"
 
char const * info_arch = "INFO" ":" "arch[" "]"
 
const char * info_language_standard_default
 
const char * info_language_extensions_default
 

Macro Definition Documentation

◆ __has_include

#define __has_include (   x)    0

Definition at line 11 of file CMakeCXXCompilerId.cpp.

◆ ARCHITECTURE_ID

#define ARCHITECTURE_ID

Definition at line 701 of file CMakeCXXCompilerId.cpp.

◆ COMPILER_ID

#define COMPILER_ID   ""

Definition at line 412 of file CMakeCXXCompilerId.cpp.

◆ CXX_STD

#define CXX_STD   __cplusplus

Definition at line 799 of file CMakeCXXCompilerId.cpp.

◆ DEC

#define DEC (   n)
Value:
('0' + (((n) / 10000000)%10)), \
('0' + (((n) / 1000000)%10)), \
('0' + (((n) / 100000)%10)), \
('0' + (((n) / 10000)%10)), \
('0' + (((n) / 1000)%10)), \
('0' + (((n) / 100)%10)), \
('0' + (((n) / 10)%10)), \
('0' + ((n) % 10))

Definition at line 705 of file CMakeCXXCompilerId.cpp.

727 :" "compiler_version[" COMPILER_VERSION "]";
728
729/* Construct a string literal encoding the version number components. */
730#elif defined(COMPILER_VERSION_MAJOR)
731char const info_version[] = {
732 'I', 'N', 'F', 'O', ':',
733 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
734 COMPILER_VERSION_MAJOR,
735# ifdef COMPILER_VERSION_MINOR
736 '.', COMPILER_VERSION_MINOR,
737# ifdef COMPILER_VERSION_PATCH
738 '.', COMPILER_VERSION_PATCH,
739# ifdef COMPILER_VERSION_TWEAK
740 '.', COMPILER_VERSION_TWEAK,
741# endif
742# endif
743# endif
744 ']','\0'};
745#endif
746
747/* Construct a string literal encoding the internal version number. */
748#ifdef COMPILER_VERSION_INTERNAL
749char const info_version_internal[] = {
750 'I', 'N', 'F', 'O', ':',
751 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
752 'i','n','t','e','r','n','a','l','[',
753 COMPILER_VERSION_INTERNAL,']','\0'};
754#elif defined(COMPILER_VERSION_INTERNAL_STR)
755char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]";
756#endif
757
758/* Construct a string literal encoding the version number components. */
759#ifdef SIMULATE_VERSION_MAJOR
760char const info_simulate_version[] = {
761 'I', 'N', 'F', 'O', ':',
762 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
763 SIMULATE_VERSION_MAJOR,
764# ifdef SIMULATE_VERSION_MINOR
765 '.', SIMULATE_VERSION_MINOR,
766# ifdef SIMULATE_VERSION_PATCH
767 '.', SIMULATE_VERSION_PATCH,
768# ifdef SIMULATE_VERSION_TWEAK
769 '.', SIMULATE_VERSION_TWEAK,
770# endif
771# endif
772# endif
773 ']','\0'};
774#endif
775
776/* Construct the string literal in pieces to prevent the source from
777 getting matched. Store it in a pointer rather than an array
778 because some compilers will just produce instructions to fill the
779 array rather than assigning a pointer to a static array. */
780char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
781char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
782
783
784
785#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L
786# if defined(__INTEL_CXX11_MODE__)
787# if defined(__cpp_aggregate_nsdmi)
788# define CXX_STD 201402L
789# else
790# define CXX_STD 201103L
791# endif
792# else
793# define CXX_STD 199711L
794# endif
795#elif defined(_MSC_VER) && defined(_MSVC_LANG)
796# define CXX_STD _MSVC_LANG
797#else
798# define CXX_STD __cplusplus
799#endif
800
801const char* info_language_standard_default = "INFO" ":" "standard_default["
802#if CXX_STD > 202002L
803 "23"
804#elif CXX_STD > 201703L
805 "20"
806#elif CXX_STD >= 201703L
807 "17"
808#elif CXX_STD >= 201402L
809 "14"
810#elif CXX_STD >= 201103L
811 "11"
812#else
813 "98"
814#endif
815"]";
816
817const char* info_language_extensions_default = "INFO" ":" "extensions_default["
818#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \
819 defined(__TI_COMPILER_VERSION__)) && \
820 !defined(__STRICT_ANSI__)
821 "ON"
822#else
823 "OFF"
824#endif
825"]";
826
827/*--------------------------------------------------------------------------*/
828
829int main(int argc, char* argv[])
830{
831 int require = 0;
832 require += info_compiler[argc];
833 require += info_platform[argc];
834 require += info_arch[argc];
835#ifdef COMPILER_VERSION_MAJOR
836 require += info_version[argc];
837#endif
838#ifdef COMPILER_VERSION_INTERNAL
839 require += info_version_internal[argc];
840#endif
841#ifdef SIMULATE_ID
842 require += info_simulate[argc];
843#endif
844#ifdef SIMULATE_VERSION_MAJOR
845 require += info_simulate_version[argc];
846#endif
847#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
848 require += info_cray[argc];
849#endif
850 require += info_language_standard_default[argc];
851 require += info_language_extensions_default[argc];
852 (void)argv;
853 return require;
854}

◆ HEX

#define HEX (   n)
Value:
('0' + ((n)>>28 & 0xF)), \
('0' + ((n)>>24 & 0xF)), \
('0' + ((n)>>20 & 0xF)), \
('0' + ((n)>>16 & 0xF)), \
('0' + ((n)>>12 & 0xF)), \
('0' + ((n)>>8 & 0xF)), \
('0' + ((n)>>4 & 0xF)), \
('0' + ((n) & 0xF))

Definition at line 716 of file CMakeCXXCompilerId.cpp.

◆ PLATFORM_ID

#define PLATFORM_ID

Definition at line 543 of file CMakeCXXCompilerId.cpp.

◆ STRINGIFY

#define STRINGIFY (   X)    STRINGIFY_HELPER(X)

Definition at line 433 of file CMakeCXXCompilerId.cpp.

◆ STRINGIFY_HELPER

#define STRINGIFY_HELPER (   X)    #X

Definition at line 432 of file CMakeCXXCompilerId.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 830 of file CMakeCXXCompilerId.cpp.

831{
832 int require = 0;
833 require += info_compiler[argc];
834 require += info_platform[argc];
835 require += info_arch[argc];
836#ifdef COMPILER_VERSION_MAJOR
837 require += info_version[argc];
838#endif
839#ifdef COMPILER_VERSION_INTERNAL
840 require += info_version_internal[argc];
841#endif
842#ifdef SIMULATE_ID
843 require += info_simulate[argc];
844#endif
845#ifdef SIMULATE_VERSION_MAJOR
846 require += info_simulate_version[argc];
847#endif
848#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
849 require += info_cray[argc];
850#endif
851 require += info_language_standard_default[argc];
852 require += info_language_extensions_default[argc];
853 (void)argv;
854 return require;
855}
const char * info_language_extensions_default
char const * info_platform
const char * info_language_standard_default
char const * info_compiler
char const * info_arch

References info_arch, info_compiler, info_language_extensions_default, info_language_standard_default, and info_platform.

Variable Documentation

◆ info_arch

char const* info_arch = "INFO" ":" "arch[" "]"

Definition at line 782 of file CMakeCXXCompilerId.cpp.

Referenced by main().

◆ info_compiler

char const* info_compiler = "INFO" ":" "compiler[" "" "]"

Definition at line 419 of file CMakeCXXCompilerId.cpp.

Referenced by main().

◆ info_language_extensions_default

const char* info_language_extensions_default
Initial value:
= "INFO" ":" "extensions_default["
"OFF"
"]"

Definition at line 818 of file CMakeCXXCompilerId.cpp.

Referenced by main().

◆ info_language_standard_default

const char* info_language_standard_default
Initial value:
= "INFO" ":" "standard_default["
"98"
"]"

Definition at line 802 of file CMakeCXXCompilerId.cpp.

Referenced by main().

◆ info_platform

char const* info_platform = "INFO" ":" "platform[" "]"

Definition at line 781 of file CMakeCXXCompilerId.cpp.

Referenced by main().