mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Remove -l flag from Swift interim driver.
Being able to pass -l to the driver isn't so interesting, and it's an extra field that lives on TranslationUnit for no reason. Just remove it. This doesn't interfere with autolinking, i.e. inferring -l flags based on imported modules. Swift SVN r9241
This commit is contained in:
@@ -458,9 +458,6 @@ public:
|
||||
/// \sa SourceFile
|
||||
class TranslationUnit : public Module {
|
||||
private:
|
||||
/// The list of libraries specified as link-time dependencies at compile time.
|
||||
ArrayRef<LinkLibrary> LinkLibraries;
|
||||
|
||||
/// If non-NULL, an plug-in that should be used when performing external
|
||||
/// lookups.
|
||||
ExternalNameLookup *ExternalLookup = nullptr;
|
||||
@@ -473,14 +470,6 @@ public:
|
||||
: Module(ModuleKind::TranslationUnit, Name, C) {
|
||||
}
|
||||
|
||||
void setLinkLibraries(ArrayRef<LinkLibrary> libs) {
|
||||
assert(LinkLibraries.empty() && "link libraries already set");
|
||||
LinkLibraries = libs;
|
||||
}
|
||||
ArrayRef<LinkLibrary> getLinkLibraries() const {
|
||||
return LinkLibraries;
|
||||
}
|
||||
|
||||
void clearLookupCache();
|
||||
|
||||
void cacheVisibleDecls(SmallVectorImpl<ValueDecl *> &&globals) const;
|
||||
|
||||
@@ -47,7 +47,6 @@ class CompilerInvocation {
|
||||
std::string ClangModuleCachePath;
|
||||
std::vector<std::string> ImportSearchPaths;
|
||||
std::vector<std::string> FrameworkSearchPaths;
|
||||
SmallVector<LinkLibrary, 4> LinkLibraries;
|
||||
std::string RuntimeIncludePath;
|
||||
std::string SDKPath;
|
||||
std::vector<std::string> ExtraClangArgs;
|
||||
@@ -121,14 +120,6 @@ public:
|
||||
return ExtraClangArgs;
|
||||
}
|
||||
|
||||
void addLinkLibrary(StringRef name, LibraryKind kind) {
|
||||
LinkLibraries.push_back({name, kind});
|
||||
}
|
||||
|
||||
ArrayRef<LinkLibrary> getLinkLibraries() const {
|
||||
return LinkLibraries;
|
||||
}
|
||||
|
||||
void setMainExecutablePath(StringRef Path);
|
||||
|
||||
void setRuntimeIncludePath(StringRef Path) {
|
||||
|
||||
@@ -1038,20 +1038,12 @@ void Module::forAllVisibleModules(Optional<AccessPathTy> thisPath,
|
||||
void Module::collectLinkLibraries(LinkLibraryCallback callback) {
|
||||
forAllImportedModules<false>(this, AccessPathTy(),
|
||||
[=](ImportedModule import) -> bool {
|
||||
Module *module = import.second;
|
||||
if (isa<BuiltinModule>(module)) {
|
||||
// The Builtin module requires no libraries.
|
||||
auto loadedModule = dyn_cast<LoadedModule>(import.second);
|
||||
if (!loadedModule)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (auto TU = dyn_cast<TranslationUnit>(module)) {
|
||||
for (auto lib : TU->getLinkLibraries())
|
||||
callback(lib);
|
||||
return true;
|
||||
}
|
||||
|
||||
ModuleLoader &owner = cast<LoadedModule>(module)->getOwner();
|
||||
owner.getLinkLibraries(module, callback);
|
||||
|
||||
ModuleLoader &owner = loadedModule->getOwner();
|
||||
owner.getLinkLibraries(loadedModule, callback);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -124,10 +124,6 @@ bool CompilerInvocation::parseArgs(ArrayRef<const char *> Args,
|
||||
LangOpts.DebugConstraintSolver = true;
|
||||
break;
|
||||
|
||||
case OPT_link_library:
|
||||
addLinkLibrary(InputArg->getValue(), LibraryKind::Library);
|
||||
break;
|
||||
|
||||
case OPT_std_EQ:
|
||||
if (strcmp(InputArg->getValue(), "axle") == 0)
|
||||
LangOpts.Axle = true;
|
||||
|
||||
@@ -123,8 +123,6 @@ void swift::CompilerInstance::doIt() {
|
||||
TU = new (*Context) TranslationUnit(ID, *Context);
|
||||
Context->LoadedModules[ID.str()] = TU;
|
||||
|
||||
TU->setLinkLibraries(Invocation.getLinkLibraries());
|
||||
|
||||
auto *SingleInputFile =
|
||||
new (*Context) SourceFile(*TU, Kind, Invocation.getParseStdlib());
|
||||
TU->MainSourceFile = SingleInputFile;
|
||||
|
||||
@@ -20,9 +20,6 @@ def parse_as_library : Flag<["-"], "parse-as-library">,
|
||||
def parse_stdlib : Flag<["-"], "parse-stdlib">,
|
||||
HelpText<"Parse the input as the swift standard library">;
|
||||
|
||||
def link_library : Joined<["-"], "l">,
|
||||
HelpText<"Link the given library into the output product">;
|
||||
|
||||
def Xclang : Separate<["-"], "Xclang">,
|
||||
HelpText<"Pass <arg> to the clang importer">;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user