Skip to content

Commit a96ec1c

Browse files
committed
Revert " [clang] Refactor to remove clangDriver dependency from clangFrontend and flangFrontend (#165277)"
This reverts commit 3773bbe (and relands the last revert attempt 40334b8).
1 parent 5c15f57 commit a96ec1c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+681
-934
lines changed

clang-tools-extra/clangd/CompileCommands.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ std::optional<std::string> detectSysroot() {
132132

133133
std::string detectStandardResourceDir() {
134134
static int StaticForMainAddr; // Just an address in this process.
135-
return GetResourcesPath("clangd", (void *)&StaticForMainAddr);
135+
return CompilerInvocation::GetResourcesPath("clangd",
136+
(void *)&StaticForMainAddr);
136137
}
137138

138139
// The path passed to argv[0] is important:

clang-tools-extra/clangd/Compiler.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include "Compiler.h"
1010
#include "support/Logger.h"
1111
#include "clang/Basic/TargetInfo.h"
12-
#include "clang/Driver/CreateInvocationFromArgs.h"
1312
#include "clang/Frontend/CompilerInvocation.h"
1413
#include "clang/Lex/PreprocessorOptions.h"
1514
#include "clang/Serialization/PCHContainerOperations.h"

clang/docs/ReleaseNotes.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ Potentially Breaking Changes
8484
- Downstream projects that previously linked only against ``clangDriver`` may
8585
now (also) need to link against the new ``clangOptions`` library, since
8686
options-related code has been moved out of the Driver into a separate library.
87-
- The ``clangFrontend`` library no longer depends on ``clangDriver``, which may
88-
break downstream projects that relied on this transitive dependency.
8987

9088
C/C++ Language Potentially Breaking Changes
9189
-------------------------------------------

clang/include/clang/Driver/CommonArgs.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,16 @@ void handleVectorizeLoopsArgs(const llvm::opt::ArgList &Args,
291291
void handleVectorizeSLPArgs(const llvm::opt::ArgList &Args,
292292
llvm::opt::ArgStringList &CmdArgs);
293293

294+
// Parse -mprefer-vector-width=. Return the Value string if well-formed.
295+
// Otherwise, return an empty string and issue a diagnosic message if needed.
296+
StringRef parseMPreferVectorWidthOption(clang::DiagnosticsEngine &Diags,
297+
const llvm::opt::ArgList &Args);
298+
299+
// Parse -mrecip. Return the Value string if well-formed.
300+
// Otherwise, return an empty string and issue a diagnosic message if needed.
301+
StringRef parseMRecipOption(clang::DiagnosticsEngine &Diags,
302+
const llvm::opt::ArgList &Args);
303+
294304
// Convert ComplexRangeKind to a string that can be passed as a frontend option.
295305
std::string complexRangeKindToStr(LangOptions::ComplexRangeKind Range);
296306

clang/include/clang/Driver/CreateASTUnitFromArgs.h

Lines changed: 0 additions & 80 deletions
This file was deleted.

clang/include/clang/Driver/CreateInvocationFromArgs.h

Lines changed: 0 additions & 76 deletions
This file was deleted.

clang/include/clang/Driver/Driver.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,10 @@ class Driver {
406406
SmallString<128> &CrashDiagDir);
407407

408408
public:
409+
/// Takes the path to a binary that's either in bin/ or lib/ and returns
410+
/// the path to clang's resource directory.
411+
static std::string GetResourcesPath(StringRef BinaryPath);
412+
409413
Driver(StringRef ClangExecutable, StringRef TargetTriple,
410414
DiagnosticsEngine &Diags, std::string Title = "clang LLVM compiler",
411415
IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS = nullptr);

0 commit comments

Comments
 (0)