Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit 1b7255d

Browse files
committed
Move ExecuteCompilerInvocation to a new library FrontendTool
r110903 introduced a dependency from Frontend to every library that declared an Action by introducing Action references that previously resided in the driver in the file ExecuteCompilerInvocation.cpp. This patch moves ExecuteCompilerInvocation to a new library named FrontendTool which is intended to bear these dependencies. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111873 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent aaa107a commit 1b7255d

File tree

11 files changed

+57
-14
lines changed

11 files changed

+57
-14
lines changed

include/clang/Frontend/Utils.h

-7
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,6 @@ void AttachDependencyFileGen(Preprocessor &PP,
7777
/// a seekable stream.
7878
void CacheTokens(Preprocessor &PP, llvm::raw_fd_ostream* OS);
7979

80-
81-
/// ExecuteCompilerInvocation - Execute the given actions described by the
82-
/// compiler invocation object in the given compiler instance.
83-
///
84-
/// \return - True on success.
85-
bool ExecuteCompilerInvocation(CompilerInstance *Clang);
86-
8780
} // end namespace clang
8881

8982
#endif

include/clang/FrontendTool/Utils.h

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//===--- Utils.h - Misc utilities for the front-end -------------*- C++ -*-===//
2+
//
3+
// The LLVM Compiler Infrastructure
4+
//
5+
// This file is distributed under the University of Illinois Open Source
6+
// License. See LICENSE.TXT for details.
7+
//
8+
//===----------------------------------------------------------------------===//
9+
//
10+
// This header contains miscellaneous utilities for various front-end actions
11+
// which were split from Frontend to minimise Frontend's dependencies.
12+
//
13+
//===----------------------------------------------------------------------===//
14+
15+
#ifndef LLVM_CLANG_FRONTENDTOOL_UTILS_H
16+
#define LLVM_CLANG_FRONTENDTOOL_UTILS_H
17+
18+
namespace clang {
19+
20+
class CompilerInstance;
21+
22+
/// ExecuteCompilerInvocation - Execute the given actions described by the
23+
/// compiler invocation object in the given compiler instance.
24+
///
25+
/// \return - True on success.
26+
bool ExecuteCompilerInvocation(CompilerInstance *Clang);
27+
28+
} // end namespace clang
29+
30+
#endif

lib/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ add_subdirectory(Rewrite)
1010
add_subdirectory(Driver)
1111
add_subdirectory(Serialization)
1212
add_subdirectory(Frontend)
13+
add_subdirectory(FrontendTool)
1314
add_subdirectory(Index)
1415
add_subdirectory(Checker)

lib/Frontend/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ add_clang_library(clangFrontend
1212
DependencyFile.cpp
1313
DiagChecker.cpp
1414
DocumentXML.cpp
15-
ExecuteCompilerInvocation.cpp
1615
FrontendAction.cpp
1716
FrontendActions.cpp
1817
FrontendOptions.cpp

lib/FrontendTool/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
set(LLVM_NO_RTTI 1)
2+
3+
add_clang_library(clangFrontendTool
4+
ExecuteCompilerInvocation.cpp
5+
)

lib/Frontend/ExecuteCompilerInvocation.cpp lib/FrontendTool/ExecuteCompilerInvocation.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#include "clang/Frontend/Utils.h"
15+
#include "clang/FrontendTool/Utils.h"
1616
#include "clang/Checker/FrontendActions.h"
1717
#include "clang/CodeGen/CodeGenAction.h"
1818
#include "clang/Driver/CC1Options.h"

lib/FrontendTool/Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
##===- clang/lib/FrontendTool/Makefile ---------------------*- Makefile -*-===##
2+
#
3+
# The LLVM Compiler Infrastructure
4+
#
5+
# This file is distributed under the University of Illinois Open Source
6+
# License. See LICENSE.TXT for details.
7+
#
8+
##===----------------------------------------------------------------------===##
9+
10+
CLANG_LEVEL := ../..
11+
LIBRARYNAME := clangFrontendTool
12+
13+
include $(CLANG_LEVEL)/Makefile

lib/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
CLANG_LEVEL := ..
1010

1111
PARALLEL_DIRS = Headers Basic Lex Parse AST Sema CodeGen Analysis \
12-
Checker Rewrite Serialization Frontend Index Driver
12+
Checker Rewrite Serialization Frontend FrontendTool Index Driver
1313

1414
include $(CLANG_LEVEL)/Makefile
1515

tools/driver/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
set(LLVM_NO_RTTI 1)
22

33
set( LLVM_USED_LIBS
4+
clangFrontendTool
45
clangFrontend
56
clangDriver
67
clangSerialization

tools/driver/Makefile

+4-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ include $(CLANG_LEVEL)/../../Makefile.config
2727

2828
LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \
2929
ipo selectiondag
30-
USEDLIBS = clangFrontend.a clangDriver.a clangSerialization.a clangCodeGen.a \
31-
clangParse.a clangSema.a clangChecker.a clangAnalysis.a \
32-
clangIndex.a clangRewrite.a clangAST.a clangLex.a clangBasic.a
30+
USEDLIBS = clangFrontendTool.a clangFrontend.a clangDriver.a \
31+
clangSerialization.a clangCodeGen.a clangParse.a clangSema.a \
32+
clangChecker.a clangAnalysis.a clangIndex.a clangRewrite.a \
33+
clangAST.a clangLex.a clangBasic.a
3334

3435
include $(CLANG_LEVEL)/Makefile
3536

tools/driver/cc1_main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "clang/Frontend/FrontendDiagnostic.h"
2424
#include "clang/Frontend/TextDiagnosticBuffer.h"
2525
#include "clang/Frontend/TextDiagnosticPrinter.h"
26-
#include "clang/Frontend/Utils.h"
26+
#include "clang/FrontendTool/Utils.h"
2727
#include "llvm/LLVMContext.h"
2828
#include "llvm/ADT/Statistic.h"
2929
#include "llvm/Support/ErrorHandling.h"

0 commit comments

Comments
 (0)