diff --git a/clang/test/Tooling/ms-asm-clang-extdef-mapping.c b/clang/test/Tooling/ms-asm-clang-extdef-mapping.c new file mode 100644 --- /dev/null +++ b/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@Break .*}} diff --git a/clang/tools/clang-extdef-mapping/CMakeLists.txt b/clang/tools/clang-extdef-mapping/CMakeLists.txt --- a/clang/tools/clang-extdef-mapping/CMakeLists.txt +++ b/clang/tools/clang-extdef-mapping/CMakeLists.txt @@ -1,5 +1,8 @@ set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} + AllTargetsAsmParsers + AllTargetsDescs + AllTargetsInfos support ) diff --git a/clang/tools/clang-extdef-mapping/ClangExtDefMapGen.cpp b/clang/tools/clang-extdef-mapping/ClangExtDefMapGen.cpp --- a/clang/tools/clang-extdef-mapping/ClangExtDefMapGen.cpp +++ b/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 #include #include @@ -214,6 +215,10 @@ } CommonOptionsParser &OptionsParser = ExpectedParser.get(); + llvm::InitializeAllTargetInfos(); + llvm::InitializeAllTargetMCs(); + llvm::InitializeAllAsmParsers(); + return HandleFiles(OptionsParser.getSourcePathList(), OptionsParser.getCompilations()); }