llvm-project/clang/test
Yuanfang Chen bd3a1de683 [clang-cl] Support the /JMC flag
The introduction and some examples are on this page:
https://devblogs.microsoft.com/cppblog/announcing-jmc-stepping-in-visual-studio/

The `/JMC` flag enables these instrumentations:
- Insert at the beginning of every function immediately after the prologue with
  a call to `void __fastcall __CheckForDebuggerJustMyCode(unsigned char *JMC_flag)`.
  The argument for `__CheckForDebuggerJustMyCode` is the address of a boolean
  global variable (the global variable is initialized to 1) with the name
  convention `__<hash>_<filename>`. All such global variables are placed in
  the `.msvcjmc` section.
- The `<hash>` part of `__<hash>_<filename>` has a one-to-one mapping
  with a directory path. MSVC uses some unknown hashing function. Here I
  used DJB.
- Add a dummy/empty COMDAT function `__JustMyCode_Default`.
- Add `/alternatename:__CheckForDebuggerJustMyCode=__JustMyCode_Default` link
  option via ".drectve" section. This is to prevent failure in
  case `__CheckForDebuggerJustMyCode` is not provided during linking.

Implementation:
All the instrumentations are implemented in an IR codegen pass. The pass is placed immediately before CodeGenPrepare pass. This is to not interfere with mid-end optimizations and make the instrumentation target-independent (I'm still working on an ELF port in a separate patch).

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D118428
2022-02-10 10:26:30 -08:00
..
APINotes
ARCMT [NFC][clang] Inclusive language: replace masterPort with mainPort 2021-11-18 11:51:06 -06:00
AST Use functions with prototypes when appropriate; NFC 2022-02-09 09:11:49 -05:00
ASTMerge Use functions with prototypes when appropriate; NFC 2022-02-09 09:11:49 -05:00
Analysis Revert "[analyzer] Prevent misuses of -analyze-function" 2022-02-08 17:42:46 +01:00
CXX [clang] Add test for C++ DR2390 2022-02-10 14:52:30 +01:00
ClangScanDeps [NFC][AIX]Disable new pcm tests on AIX 2022-01-28 12:39:09 -05:00
CodeCompletion Use functions with prototypes when appropriate; NFC 2022-02-09 09:11:49 -05:00
CodeGen [AArch64] ACLE feature macro for Armv8.8-A MOPS 2022-02-10 09:08:35 +00:00
CodeGenCUDA [HIP] Emit amdgpu_code_object_version module flag 2022-02-08 21:58:40 -05:00
CodeGenCUDASPIRV [CUDA][SPIRV] Use OpenCLKernel CC for CUDA -> SPIRV 2021-12-06 15:06:57 -08:00
CodeGenCXX [clang] Properly cache member pointer LLVM types 2022-02-08 13:22:24 -08:00
CodeGenCoroutines [Clang/Test]: Rename enable_noundef_analysis to disable-noundef-analysis and turn it off by default 2022-01-16 18:54:17 +09:00
CodeGenHIP [HIPSPV] Fix literals are mapped to Generic address space 2022-02-05 17:26:52 -05:00
CodeGenObjC Do not crash when trying to encode a _BitInt type 2022-01-28 08:38:01 -05:00
CodeGenObjCXX [ObjC] Emit selector load right before msgSend call. 2022-01-26 20:52:54 -08:00
CodeGenOpenCL [OpenCL] Mark kernel arguments as ABI aligned 2022-02-08 16:12:51 +01:00
CodeGenOpenCLCXX [OpenCL] Add support of __opencl_c_device_enqueue feature macro. 2022-01-27 14:25:59 +03:00
CodeGenSYCL [SYCL] Disallow explicit casts between mismatching address spaces 2022-02-07 11:57:30 +03:00
Coverage Use functions with prototypes when appropriate; NFC 2022-02-09 09:11:49 -05:00
CoverageMapping Use functions with prototypes when appropriate; NFC 2022-02-09 09:11:49 -05:00
Driver [clang-cl] Support the /JMC flag 2022-02-10 10:26:30 -08:00
FixIt Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
Format
Frontend Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
Headers Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
Import
Index Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
Integration Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
InterfaceStubs Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
Interpreter
Layout
Lexer Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
LibClang
Misc Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
Modules [NFC] Add tests for ODR checking of default template argument 2022-01-28 15:32:28 +08:00
OpenMP [OpenMP][Clang] Move partial support of reverse offload to a future version 2022-02-09 07:11:41 +00:00
PCH Reland (2) "[AST] Add RParen loc for decltype AutoTypeloc."" 2022-01-17 11:33:11 +01:00
Parser Use functions with prototypes when appropriate; NFC 2022-02-09 09:11:49 -05:00
ParserSYCL
Preprocessor [AArch64] ACLE feature macro for Armv8.8-A MOPS 2022-02-10 09:08:35 +00:00
Profile [NFC][AIX][clang] un-XFAIL gcc profile flag compat test 2022-01-28 11:18:55 -05:00
Refactor
Rewriter [NFC][Clang][test] Inclusive language: Remove and rephrase uses of sanity test/check in clang/test 2021-11-24 14:03:49 -05:00
Sema [X86] Implement -fzero-call-used-regs option 2022-02-08 17:42:54 -08:00
SemaCUDA Use functions with prototypes when appropriate; NFC 2022-02-07 09:25:01 -05:00
SemaCXX Allow parameter pack expansions and initializer lists in annotate attribute 2022-02-08 13:38:07 -05:00
SemaObjC Use functions with prototypes when appropriate; NFC 2022-02-07 15:29:36 -05:00
SemaObjCXX [clang] roll-forward "[clang] Mark `trivial_abi` types as "trivially relocatable"". 2022-02-04 20:17:34 +01:00
SemaOpenCL Use functions with prototypes when appropriate; NFC 2022-02-07 09:25:01 -05:00
SemaOpenCLCXX [OpenCL] Add support of __opencl_c_device_enqueue feature macro. 2022-01-27 14:25:59 +03:00
SemaSYCL [SYCL] Disallow explicit casts between mismatching address spaces 2022-02-07 11:57:30 +03:00
SemaTemplate Allow parameter pack expansions and initializer lists in annotate attribute 2022-02-08 13:38:07 -05:00
Syntax [syntax][pseudo] Introduce the C++ spec grammar. 2022-02-04 11:58:50 +01:00
TableGen [clang] Introduce support for disabling warnings in system macros 2022-01-12 08:18:19 +00:00
Templight [Templight] Don't display empty strings for names of unnamed template parameters 2022-01-24 16:37:11 +01:00
Tooling [clang-check] Adjust argument adjusters for clang-check to strip options blocking the static analyzer 2022-01-14 10:05:47 +01:00
Unit
VFS [VFS] Add a "redirecting-with" field to overlays 2022-02-03 13:10:23 -08:00
clang-rename
utils/update_cc_test_checks [IRGen] Do not overwrite existing attributes in CGCall. 2022-01-20 13:45:19 +00:00
.clang-format
CMakeLists.txt replace clang LLVM_ENABLE_PLUGINS -> CLANG_PLUGIN_SUPPORT in tests 2022-02-09 17:31:34 -05:00
TestRunner.sh
cxx-sections.data
lit.cfg.py [AIX] Disable tests that fail because of no 64-bit XCOFF object file support 2022-01-09 12:25:24 -05:00
lit.site.cfg.py.in replace clang LLVM_ENABLE_PLUGINS -> CLANG_PLUGIN_SUPPORT in tests 2022-02-09 17:31:34 -05:00
make_test_dirs.pl