Index: clang-tools-extra/clang-tidy/CMakeLists.txt =================================================================== --- clang-tools-extra/clang-tidy/CMakeLists.txt +++ clang-tools-extra/clang-tidy/CMakeLists.txt @@ -1,4 +1,6 @@ set(LLVM_LINK_COMPONENTS + AllTargetsAsmParsers + AllTargetsInfos Support ) Index: clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp =================================================================== --- clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp +++ clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp @@ -18,6 +18,7 @@ #include "../ClangTidy.h" #include "clang/Tooling/CommonOptionsParser.h" #include "llvm/Support/Process.h" +#include "llvm/Support/TargetSelect.h" using namespace clang::ast_matchers; using namespace clang::driver; @@ -403,6 +404,10 @@ ProfileData Profile; + llvm::InitializeAllTargetInfos(); + llvm::InitializeAllTargetMCs(); + llvm::InitializeAllAsmParsers(); + ClangTidyContext Context(std::move(OwningOptionsProvider)); runClangTidy(Context, OptionsParser.getCompilations(), PathList, EnableCheckProfile ? &Profile : nullptr); Index: clang-tools-extra/test/clang-tidy/hicpp-no-assembler.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/hicpp-no-assembler.cpp +++ clang-tools-extra/test/clang-tidy/hicpp-no-assembler.cpp @@ -9,4 +9,9 @@ void f() { __asm("mov al, 2"); // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: do not use inline assembler in safety-critical code [hicpp-no-assembler] + + _asm { + mov al, 2; + // CHECK-MESSAGES: :[[@LINE-2]]:3: warning: do not use inline assembler in safety-critical code [hicpp-no-assembler] + } }