[PATCH] D154983: [clang-extdef-mapping] register necessary targest for ms-style asm block

Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 18 02:11:26 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG2c651184a2b0: [clang-extdef-mapping] register necessary targest for ms-style asm block (authored by dingfei <fding at feysh.com>).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154983

Files:
  clang/test/Tooling/ms-asm-clang-extdef-mapping.c
  clang/tools/clang-extdef-mapping/CMakeLists.txt
  clang/tools/clang-extdef-mapping/ClangExtDefMapGen.cpp


Index: clang/tools/clang-extdef-mapping/ClangExtDefMapGen.cpp
===================================================================
--- clang/tools/clang-extdef-mapping/ClangExtDefMapGen.cpp
+++ clang/tools/clang-extdef-mapping/ClangExtDefMapGen.cpp
@@ -23,6 +23,7 @@
 #include "clang/Tooling/Tooling.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Signals.h"
+#include "llvm/Support/TargetSelect.h"
 #include <optional>
 #include <sstream>
 #include <string>
@@ -214,6 +215,10 @@
   }
   CommonOptionsParser &OptionsParser = ExpectedParser.get();
 
+  llvm::InitializeAllTargetInfos();
+  llvm::InitializeAllTargetMCs();
+  llvm::InitializeAllAsmParsers();
+
   return HandleFiles(OptionsParser.getSourcePathList(),
                      OptionsParser.getCompilations());
 }
Index: clang/tools/clang-extdef-mapping/CMakeLists.txt
===================================================================
--- clang/tools/clang-extdef-mapping/CMakeLists.txt
+++ clang/tools/clang-extdef-mapping/CMakeLists.txt
@@ -1,5 +1,8 @@
 set(LLVM_LINK_COMPONENTS
   ${LLVM_TARGETS_TO_BUILD}
+  AllTargetsAsmParsers
+  AllTargetsDescs
+  AllTargetsInfos
   support
   )
 
Index: clang/test/Tooling/ms-asm-clang-extdef-mapping.c
===================================================================
--- /dev/null
+++ clang/test/Tooling/ms-asm-clang-extdef-mapping.c
@@ -0,0 +1,7 @@
+// RUN: clang-extdef-mapping "%s" -- -fasm-blocks 2>&1 | FileCheck %s
+
+void Break() {
+  __asm { int 3 }
+}
+
+// CHECK: {{c:@F at Break .*}}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154983.541403.patch
Type: text/x-patch
Size: 1518 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230718/c2053232/attachment.bin>


More information about the cfe-commits mailing list