Skip to content

Commit 68d0db0

Browse files
committed
Revert "[ms] [llvm-ml] Add support for INCLUDE environment variable"
This reverts commit c43f413 due to Windows environment build breaks
1 parent c43f413 commit 68d0db0

File tree

4 files changed

+3
-54
lines changed

4 files changed

+3
-54
lines changed

llvm/test/tools/llvm-ml/include_by_env_var.asm

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

llvm/test/tools/llvm-ml/include_by_env_var_errors.asm

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

llvm/tools/llvm-ml/Opts.td

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ def assembly_file : MLJoinedOrSeparate<"Ta">,
7373
def error_on_warning : MLFlag<"WX">, Alias<fatal_warnings>;
7474
def parse_only : MLFlag<"Zs">, HelpText<"Run a syntax-check only">,
7575
Alias<filetype>, AliasArgs<["null"]>;
76-
def ignore_include_envvar : MLFlag<"X">,
77-
HelpText<"Ignore the INCLUDE environment variable">;
7876

7977
def tiny_model_support : UnsupportedFlag<"AT">, HelpText<"">;
8078
def alternate_linker : UnsupportedJoined<"Bl">, HelpText<"">;
@@ -107,6 +105,7 @@ def listing_title : UnsupportedSeparate<"St">, HelpText<"">;
107105
def listing_false_conditionals : UnsupportedFlag<"Sx">, HelpText<"">;
108106
def extra_warnings : UnsupportedFlag<"w">, HelpText<"">;
109107
def warning_level : UnsupportedJoined<"W">, HelpText<"">;
108+
def ignore_include_envvar : UnsupportedFlag<"X">, HelpText<"">;
110109
def line_number_info : UnsupportedFlag<"Zd">, HelpText<"">;
111110
def export_all_symbols : UnsupportedFlag<"Zf">, HelpText<"">;
112111
def codeview_info : UnsupportedFlag<"Zi">, HelpText<"">;

llvm/tools/llvm-ml/llvm-ml.cpp

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include "llvm/Support/InitLLVM.h"
3737
#include "llvm/Support/MemoryBuffer.h"
3838
#include "llvm/Support/Path.h"
39-
#include "llvm/Support/Process.h"
4039
#include "llvm/Support/SourceMgr.h"
4140
#include "llvm/Support/TargetRegistry.h"
4241
#include "llvm/Support/TargetSelect.h"
@@ -264,21 +263,8 @@ int main(int Argc, char **Argv) {
264263
SrcMgr.AddNewSourceBuffer(std::move(*BufferPtr), SMLoc());
265264

266265
// Record the location of the include directories so that the lexer can find
267-
// included files later.
268-
std::vector<std::string> IncludeDirs =
269-
InputArgs.getAllArgValues(OPT_include_path);
270-
if (!InputArgs.hasArg(OPT_ignore_include_envvar)) {
271-
if (llvm::Optional<std::string> cl_include_dir =
272-
llvm::sys::Process::GetEnv("INCLUDE")) {
273-
SmallVector<StringRef, 8> Dirs;
274-
StringRef(*cl_include_dir)
275-
.split(Dirs, ";", /*MaxSplit=*/-1, /*KeepEmpty=*/false);
276-
IncludeDirs.reserve(IncludeDirs.size() + Dirs.size());
277-
for (StringRef Dir : Dirs)
278-
IncludeDirs.push_back(Dir.str());
279-
}
280-
}
281-
SrcMgr.setIncludeDirs(IncludeDirs);
266+
// it later.
267+
SrcMgr.setIncludeDirs(InputArgs.getAllArgValues(OPT_include_path));
282268

283269
std::unique_ptr<MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TripleName));
284270
assert(MRI && "Unable to create target register info!");

0 commit comments

Comments
 (0)