From 053d6b684218a3a82ea59a90758231188ffeeb2f Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 22 Jan 2019 18:04:40 +0000 Subject: [PATCH] Remove customizations in #includes of Options.inc, and adjust lld Makefile to generate the file in the right place. --- contrib/llvm/tools/lld/ELF/Driver.h | 2 +- contrib/llvm/tools/lld/ELF/DriverUtils.cpp | 4 ++-- usr.bin/clang/lld/Makefile | 13 +++++++------ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/contrib/llvm/tools/lld/ELF/Driver.h b/contrib/llvm/tools/lld/ELF/Driver.h index f2bb676b1f63..81d7f608e588 100644 --- a/contrib/llvm/tools/lld/ELF/Driver.h +++ b/contrib/llvm/tools/lld/ELF/Driver.h @@ -56,7 +56,7 @@ class ELFOptTable : public llvm::opt::OptTable { enum { OPT_INVALID = 0, #define OPTION(_1, _2, ID, _4, _5, _6, _7, _8, _9, _10, _11, _12) OPT_##ID, -#include "ELF/Options.inc" +#include "Options.inc" #undef OPTION }; diff --git a/contrib/llvm/tools/lld/ELF/DriverUtils.cpp b/contrib/llvm/tools/lld/ELF/DriverUtils.cpp index 9b1d8d713ac4..e51d02e38da1 100644 --- a/contrib/llvm/tools/lld/ELF/DriverUtils.cpp +++ b/contrib/llvm/tools/lld/ELF/DriverUtils.cpp @@ -38,7 +38,7 @@ using namespace lld::elf; // Create prefix string literals used in Options.td #define PREFIX(NAME, VALUE) const char *const NAME[] = VALUE; -#include "ELF/Options.inc" +#include "Options.inc" #undef PREFIX // Create table mapping all options defined in Options.td @@ -46,7 +46,7 @@ static const opt::OptTable::Info OptInfo[] = { #define OPTION(X1, X2, ID, KIND, GROUP, ALIAS, X7, X8, X9, X10, X11, X12) \ {X1, X2, X10, X11, OPT_##ID, opt::Option::KIND##Class, \ X9, X8, OPT_##GROUP, OPT_##ALIAS, X7, X12}, -#include "ELF/Options.inc" +#include "Options.inc" #undef OPTION }; diff --git a/usr.bin/clang/lld/Makefile b/usr.bin/clang/lld/Makefile index b7629b199b0b..96c2693c97d7 100644 --- a/usr.bin/clang/lld/Makefile +++ b/usr.bin/clang/lld/Makefile @@ -85,12 +85,13 @@ LDADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a .endfor LLVM_TBLGEN?= llvm-tblgen -ELF/Options.inc: ${LLD_SRCS}/ELF/Options.td - ${LLVM_TBLGEN} -gen-opt-parser-defs \ - -I ${LLVM_SRCS}/include \ - -d ${.TARGET:C/$/.d/} -o ${.TARGET} \ - ${LLVM_SRCS}/tools/lld/ELF/Options.td -TGHDRS+= ELF/Options.inc +INCFILE= Options.inc +TDFILE= ${LLD_SRCS}/ELF/Options.td +GENOPT= -gen-opt-parser-defs +${INCFILE}: ${TDFILE} + ${LLVM_TBLGEN} ${GENOPT} -I ${LLVM_SRCS}/include -d ${.TARGET:C/$/.d/} \ + -o ${.TARGET} ${TDFILE} +TGHDRS+= ${INCFILE} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/}