llvm/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
..
Analysis Revert "[analyzer] Prevent misuses of -analyze-function" 2022-02-08 17:42:46 +01:00
APINotes
ARCMT
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
clang-rename
ClangScanDeps
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
CodeGenCoroutines
CodeGenCUDA [HIP] Emit amdgpu_code_object_version module flag 2022-02-08 21:58:40 -05:00
CodeGenCUDASPIRV
CodeGenCXX [clang] Properly cache member pointer LLVM types 2022-02-08 13:22:24 -08:00
CodeGenHIP
CodeGenObjC
CodeGenObjCXX
CodeGenOpenCL [OpenCL] Mark kernel arguments as ABI aligned 2022-02-08 16:12:51 +01:00
CodeGenOpenCLCXX
CodeGenSYCL
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
CXX [clang] Add test for C++ DR2390 2022-02-10 14:52:30 +01: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
OpenMP [OpenMP][Clang] Move partial support of reverse offload to a future version 2022-02-09 07:11:41 +00:00
Parser Use functions with prototypes when appropriate; NFC 2022-02-09 09:11:49 -05:00
ParserSYCL
PCH
Preprocessor [AArch64] ACLE feature macro for Armv8.8-A MOPS 2022-02-10 09:08:35 +00:00
Profile
Refactor
Rewriter
Sema [X86] Implement -fzero-call-used-regs option 2022-02-08 17:42:54 -08:00
SemaCUDA
SemaCXX Allow parameter pack expansions and initializer lists in annotate attribute 2022-02-08 13:38:07 -05:00
SemaObjC
SemaObjCXX
SemaOpenCL
SemaOpenCLCXX
SemaSYCL
SemaTemplate Allow parameter pack expansions and initializer lists in annotate attribute 2022-02-08 13:38:07 -05:00
Syntax
TableGen
Templight
Tooling
Unit
utils/update_cc_test_checks
VFS
.clang-format
CMakeLists.txt replace clang LLVM_ENABLE_PLUGINS -> CLANG_PLUGIN_SUPPORT in tests 2022-02-09 17:31:34 -05:00
cxx-sections.data
lit.cfg.py
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
TestRunner.sh