diff --git a/test/tools/llvm-ml/include_by_env_var.asm b/test/tools/llvm-ml/include_by_env_var.asm deleted file mode 100644 index 78b08946518..00000000000 --- a/test/tools/llvm-ml/include_by_env_var.asm +++ /dev/null @@ -1,20 +0,0 @@ -; RUN: INCLUDE=%S llvm-ml -filetype=s %s /Fo - | FileCheck %s - -include included.inc - -.code - -t1: -mov eax, Const - -; CHECK-LABEL: t1: -; CHECK-NEXT: mov eax, 8 - -t2: -push_pop ebx - -; CHECK-LABEL: t2: -; CHECK-NEXT: push ebx -; CHECK-NEXT: pop ebx - -end diff --git a/test/tools/llvm-ml/include_by_env_var_errors.asm b/test/tools/llvm-ml/include_by_env_var_errors.asm deleted file mode 100644 index 161c43ac9aa..00000000000 --- a/test/tools/llvm-ml/include_by_env_var_errors.asm +++ /dev/null @@ -1,16 +0,0 @@ -; RUN: not llvm-ml -filetype=s %s /Fo - 2>&1 | FileCheck %s --implicit-check-not=error: -; RUN: INCLUDE=%S not llvm-ml -filetype=s %s /X /Fo - 2>&1 | FileCheck %s --implicit-check-not=error: - -; CHECK: :[[# @LINE + 1]]:9: error: Could not find include file 'included.inc' -include included.inc - -.code - -t1: -mov eax, Const - -t2: -; CHECK: :[[# @LINE + 1]]:1: error: invalid instruction mnemonic 'push_pop' -push_pop ebx - -end diff --git a/tools/llvm-ml/Opts.td b/tools/llvm-ml/Opts.td index 06871b49ad0..b5ba920c876 100644 --- a/tools/llvm-ml/Opts.td +++ b/tools/llvm-ml/Opts.td @@ -73,8 +73,6 @@ def assembly_file : MLJoinedOrSeparate<"Ta">, def error_on_warning : MLFlag<"WX">, Alias; def parse_only : MLFlag<"Zs">, HelpText<"Run a syntax-check only">, Alias, AliasArgs<["null"]>; -def ignore_include_envvar : MLFlag<"X">, - HelpText<"Ignore the INCLUDE environment variable">; def tiny_model_support : UnsupportedFlag<"AT">, HelpText<"">; def alternate_linker : UnsupportedJoined<"Bl">, HelpText<"">; @@ -107,6 +105,7 @@ def listing_title : UnsupportedSeparate<"St">, HelpText<"">; def listing_false_conditionals : UnsupportedFlag<"Sx">, HelpText<"">; def extra_warnings : UnsupportedFlag<"w">, HelpText<"">; def warning_level : UnsupportedJoined<"W">, HelpText<"">; +def ignore_include_envvar : UnsupportedFlag<"X">, HelpText<"">; def line_number_info : UnsupportedFlag<"Zd">, HelpText<"">; def export_all_symbols : UnsupportedFlag<"Zf">, HelpText<"">; def codeview_info : UnsupportedFlag<"Zi">, HelpText<"">; diff --git a/tools/llvm-ml/llvm-ml.cpp b/tools/llvm-ml/llvm-ml.cpp index 7fefb9dda95..14f75d0d814 100644 --- a/tools/llvm-ml/llvm-ml.cpp +++ b/tools/llvm-ml/llvm-ml.cpp @@ -36,7 +36,6 @@ #include "llvm/Support/InitLLVM.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Path.h" -#include "llvm/Support/Process.h" #include "llvm/Support/SourceMgr.h" #include "llvm/Support/TargetRegistry.h" #include "llvm/Support/TargetSelect.h" @@ -264,21 +263,8 @@ int main(int Argc, char **Argv) { SrcMgr.AddNewSourceBuffer(std::move(*BufferPtr), SMLoc()); // Record the location of the include directories so that the lexer can find - // included files later. - std::vector IncludeDirs = - InputArgs.getAllArgValues(OPT_include_path); - if (!InputArgs.hasArg(OPT_ignore_include_envvar)) { - if (llvm::Optional cl_include_dir = - llvm::sys::Process::GetEnv("INCLUDE")) { - SmallVector Dirs; - StringRef(*cl_include_dir) - .split(Dirs, ";", /*MaxSplit=*/-1, /*KeepEmpty=*/false); - IncludeDirs.reserve(IncludeDirs.size() + Dirs.size()); - for (StringRef Dir : Dirs) - IncludeDirs.push_back(Dir.str()); - } - } - SrcMgr.setIncludeDirs(IncludeDirs); + // it later. + SrcMgr.setIncludeDirs(InputArgs.getAllArgValues(OPT_include_path)); std::unique_ptr MRI(TheTarget->createMCRegInfo(TripleName)); assert(MRI && "Unable to create target register info!");