mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-28 07:16:07 +00:00

Currently, all AST consumers are located in the Frontend library, meaning that in a shared library configuration, Frontend has a dependency on Rewrite, Checker and CodeGen. This is suboptimal for clients which only wish to make use of the frontend. CodeGen in particular introduces a large number of unwanted dependencies. This patch breaks the dependency by moving all AST consumers with dependencies on Rewrite, Checker and/or CodeGen to their respective libraries. The patch therefore introduces dependencies in the other direction (i.e. from Rewrite, Checker and CodeGen to Frontend). After applying this patch, Clang builds correctly using CMake and shared libraries ("cmake -DBUILD_SHARED_LIBS=ON"). N.B. This patch includes file renames which are indicated in the patch body. Changes in this revision of the patch: - Fixed some copy-paste mistakes in the header files - Modified certain aspects of the coding to comply with the LLVM Coding Standards llvm-svn: 106010
22 lines
817 B
C++
22 lines
817 B
C++
//===--- FrontendActions.cpp ----------------------------------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "clang/Checker/FrontendActions.h"
|
|
#include "clang/Frontend/CompilerInstance.h"
|
|
#include "clang/Checker/AnalysisConsumer.h"
|
|
using namespace clang;
|
|
|
|
ASTConsumer *AnalysisAction::CreateASTConsumer(CompilerInstance &CI,
|
|
llvm::StringRef InFile) {
|
|
return CreateAnalysisConsumer(CI.getPreprocessor(),
|
|
CI.getFrontendOpts().OutputFile,
|
|
CI.getAnalyzerOpts());
|
|
}
|
|
|