From 53992adde3eda3ccf9da63bc7e45673f043de18f Mon Sep 17 00:00:00 2001 From: rdivacky Date: Thu, 27 May 2010 15:17:06 +0000 Subject: Update clang to r104832. --- include/clang/Driver/ArgList.h | 22 +++++++++++ include/clang/Driver/CC1AsOptions.h | 32 ++++++++++++++++ include/clang/Driver/CC1AsOptions.td | 71 ++++++++++++++++++++++++++++++++++++ include/clang/Driver/CC1Options.td | 17 ++++++++- include/clang/Driver/CMakeLists.txt | 6 +++ include/clang/Driver/Makefile | 6 ++- include/clang/Driver/Options.td | 16 +++++--- include/clang/Driver/Tool.h | 8 +++- 8 files changed, 167 insertions(+), 11 deletions(-) create mode 100644 include/clang/Driver/CC1AsOptions.h create mode 100644 include/clang/Driver/CC1AsOptions.td (limited to 'include/clang/Driver') diff --git a/include/clang/Driver/ArgList.h b/include/clang/Driver/ArgList.h index 0a8eaea..7a14ae8 100644 --- a/include/clang/Driver/ArgList.h +++ b/include/clang/Driver/ArgList.h @@ -17,12 +17,15 @@ #include #include +#include namespace llvm { class Twine; } namespace clang { + class Diagnostic; + namespace driver { class Arg; class ArgList; @@ -175,6 +178,25 @@ namespace driver { /// getArgString - Return the input argument string at \arg Index. virtual const char *getArgString(unsigned Index) const = 0; + + /// @} + /// @name Argument Lookup Utilities + /// @{ + + /// getLastArgValue - Return the value of the last argument, or a default. + llvm::StringRef getLastArgValue(OptSpecifier Id, + llvm::StringRef Default = "") const; + + /// getLastArgValue - Return the value of the last argument as an integer, + /// or a default. Emits an error if the argument is given, but non-integral. + int getLastArgIntValue(OptSpecifier Id, int Default, + Diagnostic &Diags) const; + + /// getAllArgValues - Get the values of all instances of the given argument + /// as strings. + std::vector getAllArgValues(OptSpecifier Id) const; + + /// @} /// @name Translation Utilities /// @{ diff --git a/include/clang/Driver/CC1AsOptions.h b/include/clang/Driver/CC1AsOptions.h new file mode 100644 index 0000000..0508213 --- /dev/null +++ b/include/clang/Driver/CC1AsOptions.h @@ -0,0 +1,32 @@ +//===--- CC1AsOptions.h - Clang Assembler Options Table ---------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef CLANG_DRIVER_CC1ASOPTIONS_H +#define CLANG_DRIVER_CC1ASOPTIONS_H + +namespace clang { +namespace driver { + class OptTable; + +namespace cc1asoptions { + enum ID { + OPT_INVALID = 0, // This is not an option ID. +#define OPTION(NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \ + HELPTEXT, METAVAR) OPT_##ID, +#include "clang/Driver/CC1AsOptions.inc" + LastOption +#undef OPTION + }; +} + + OptTable *createCC1AsOptTable(); +} +} + +#endif diff --git a/include/clang/Driver/CC1AsOptions.td b/include/clang/Driver/CC1AsOptions.td new file mode 100644 index 0000000..5c08dc6 --- /dev/null +++ b/include/clang/Driver/CC1AsOptions.td @@ -0,0 +1,71 @@ +//===--- CC1AsOptions.td - Options for clang -cc1as -----------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines the options accepted by clang -cc1as. +// +//===----------------------------------------------------------------------===// + +// Include the common option parsing interfaces. +include "OptParser.td" + +//===----------------------------------------------------------------------===// +// Target Options +//===----------------------------------------------------------------------===// + +def triple : Separate<"-triple">, + HelpText<"Specify target triple (e.g. x86_64-pc-linux-gnu)">; + +//===----------------------------------------------------------------------===// +// Language Options +//===----------------------------------------------------------------------===// + +def I : JoinedOrSeparate<"-I">, MetaVarName<"">, + HelpText<"Add directory to include search path">; +def n : Flag<"-n">, + HelpText<"Don't automatically start assembly file with a text section">; + +//===----------------------------------------------------------------------===// +// Frontend Options +//===----------------------------------------------------------------------===// + +def o : Separate<"-o">, MetaVarName<"">, HelpText<"Specify output file">; + +def filetype : Separate<"-filetype">, + HelpText<"Specify the output file type ('asm', 'null', or 'obj')">; + +def help : Flag<"-help">, + HelpText<"Print this help text">; +def _help : Flag<"--help">, Alias; + +def version : Flag<"-version">, + HelpText<"Print the assembler version">; +def _version : Flag<"--version">, Alias; + +// Generic forwarding to LLVM options. This should only be used for debugging +// and experimental features. +def mllvm : Separate<"-mllvm">, + HelpText<"Additional arguments to forward to LLVM's option processing">; + +//===----------------------------------------------------------------------===// +// Transliterate Options +//===----------------------------------------------------------------------===// + +def output_asm_variant : Separate<"-output-asm-variant">, + HelpText<"Select the asm variant index to use for output">; +def show_encoding : Flag<"-show-encoding">, + HelpText<"Show instruction encoding information in transliterate mode">; +def show_inst : Flag<"-show-inst">, + HelpText<"Show internal instruction representation in transliterate mode">; + +//===----------------------------------------------------------------------===// +// Assemble Options +//===----------------------------------------------------------------------===// + +def relax_all : Flag<"-relax-all">, + HelpText<"Relax all fixups (for performance testing)">; diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td index 0badeb9..fd8322b 100644 --- a/include/clang/Driver/CC1Options.td +++ b/include/clang/Driver/CC1Options.td @@ -56,8 +56,6 @@ def analysis_ObjCMemChecker : Flag<"-analyzer-check-objc-mem">, HelpText<"Run the [Core] Foundation reference count checker">; def analysis_WarnSizeofPointer : Flag<"-warn-sizeof-pointer">, HelpText<"Warn about unintended use of sizeof() on pointer expressions">; -def analysis_InlineCall : Flag<"-inline-call">, - HelpText<"Experimental transfer function inlining callees when its definition is available.">; def analyzer_store : Separate<"-analyzer-store">, HelpText<"Source Code Analysis - Abstract Memory Store Models">; @@ -97,8 +95,12 @@ def analyzer_viz_egraph_graphviz : Flag<"-analyzer-viz-egraph-graphviz">, HelpText<"Display exploded graph using GraphViz">; def analyzer_viz_egraph_ubigraph : Flag<"-analyzer-viz-egraph-ubigraph">, HelpText<"Display exploded graph using Ubigraph">; +def analyzer_inline_call : Flag<"-analyzer-inline-call">, + HelpText<"Experimental transfer function inlining callees when its definition is available.">; def analyzer_max_nodes : Separate<"-analyzer-max-nodes">, HelpText<"The maximum number of nodes the analyzer can generate">; +def analyzer_max_loop : Separate<"-analyzer-max-loop">, + HelpText<"The maximum number of times the analyzer will go through a loop">; //===----------------------------------------------------------------------===// // CodeGen Options @@ -145,6 +147,8 @@ def mno_zero_initialized_in_bss : Flag<"-mno-zero-initialized-in-bss">, HelpText<"Do not put zero initialized data in the BSS">; def msoft_float : Flag<"-msoft-float">, HelpText<"Use software floating point">; +def mrelax_all : Flag<"-mrelax-all">, + HelpText<"Relax all machine instructions">; def mrelocation_model : Separate<"-mrelocation-model">, HelpText<"The relocation model to use">; def munwind_tables : Flag<"-munwind-tables">, @@ -196,6 +200,9 @@ def fdiagnostics_print_source_range_info : Flag<"-fdiagnostics-print-source-rang HelpText<"Print source range spans in numeric form">; def fdiagnostics_show_option : Flag<"-fdiagnostics-show-option">, HelpText<"Print diagnostic name with mappable diagnostics">; +def fdiagnostics_show_category : Separate<"-fdiagnostics-show-category">, + HelpText<"Print diagnostic category">; + def ftabstop : Separate<"-ftabstop">, MetaVarName<"">, HelpText<"Set the tab stop distance.">; def ferror_limit : Separate<"-ferror-limit">, MetaVarName<"">, @@ -238,6 +245,8 @@ def no_code_completion_debug_printer : Flag<"-no-code-completion-debug-printer"> HelpText<"Don't use the \"debug\" code-completion print">; def code_completion_macros : Flag<"-code-completion-macros">, HelpText<"Include macros in code-completion results">; +def code_completion_patterns : Flag<"-code-completion-patterns">, + HelpText<"Include code patterns in code-completion results">; def disable_free : Flag<"-disable-free">, HelpText<"Disable freeing of memory on exit">; def help : Flag<"-help">, @@ -293,6 +302,8 @@ def ast_dump : Flag<"-ast-dump">, HelpText<"Build ASTs and then debug dump them">; def ast_view : Flag<"-ast-view">, HelpText<"Build ASTs and view them with GraphViz">; +def boostcon : Flag<"-boostcon">, + HelpText<"BoostCon workshop mode">; def print_decl_contexts : Flag<"-print-decl-contexts">, HelpText<"Print DeclContexts and their Decls">; def emit_pth : Flag<"-emit-pth">, @@ -307,6 +318,8 @@ def emit_llvm_bc : Flag<"-emit-llvm-bc">, HelpText<"Build ASTs then convert to LLVM, emit .bc file">; def emit_llvm_only : Flag<"-emit-llvm-only">, HelpText<"Build ASTs and convert to LLVM, discarding output">; +def emit_codegen_only : Flag<"-emit-codegen-only">, + HelpText<"Generate machine code, but discard output">; def emit_obj : Flag<"-emit-obj">, HelpText<"Emit native object files">; def rewrite_test : Flag<"-rewrite-test">, diff --git a/include/clang/Driver/CMakeLists.txt b/include/clang/Driver/CMakeLists.txt index ed9825b..99be53f 100644 --- a/include/clang/Driver/CMakeLists.txt +++ b/include/clang/Driver/CMakeLists.txt @@ -9,3 +9,9 @@ tablegen(CC1Options.inc -gen-opt-parser-defs) add_custom_target(ClangCC1Options DEPENDS CC1Options.inc) + +set(LLVM_TARGET_DEFINITIONS CC1AsOptions.td) +tablegen(CC1AsOptions.inc + -gen-opt-parser-defs) +add_custom_target(ClangCC1AsOptions + DEPENDS CC1AsOptions.inc) diff --git a/include/clang/Driver/Makefile b/include/clang/Driver/Makefile index 18f3e58..b462aaa 100644 --- a/include/clang/Driver/Makefile +++ b/include/clang/Driver/Makefile @@ -1,5 +1,5 @@ LEVEL = ../../../../.. -BUILT_SOURCES = Options.inc CC1Options.inc +BUILT_SOURCES = Options.inc CC1Options.inc CC1AsOptions.inc TABLEGEN_INC_FILES_COMMON = 1 @@ -13,4 +13,6 @@ $(ObjDir)/CC1Options.inc.tmp : CC1Options.td OptParser.td $(TBLGEN) $(ObjDir)/.d $(Echo) "Building Clang CC1 Option tables with tblgen" $(Verb) $(TableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $< - +$(ObjDir)/CC1AsOptions.inc.tmp : CC1AsOptions.td OptParser.td $(TBLGEN) $(ObjDir)/.dir + $(Echo) "Building Clang CC1 Assembler Option tables with tblgen" + $(Verb) $(TableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $< diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index f6e69e0..a9a52c0 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -139,6 +139,7 @@ def MQ : JoinedOrSeparate<"-MQ">, Group; def MT : JoinedOrSeparate<"-MT">, Group; def Mach : Flag<"-Mach">; def M : Flag<"-M">, Group; +def O0 : Joined<"-O0">, Group; def O4 : Joined<"-O4">, Group; def ObjCXX : Flag<"-ObjC++">, Flags<[DriverOption]>, HelpText<"Treat source input files as Objective-C++ inputs">; @@ -231,6 +232,7 @@ def fPIC : Flag<"-fPIC">, Group; def fPIE : Flag<"-fPIE">, Group; def faccess_control : Flag<"-faccess-control">, Group; def fapple_kext : Flag<"-fapple-kext">, Group; +def fasm : Flag<"-fasm">, Group; def fasm_blocks : Flag<"-fasm-blocks">, Group; def fassume_sane_operator_new : Flag<"-fassume-sane-operator-new">, Group; def fastcp : Flag<"-fastcp">, Group; @@ -257,6 +259,7 @@ def fdiagnostics_binary : Flag<"-fdiagnostics-binary">, Group, Flags<[H def fdiagnostics_fixit_info : Flag<"-fdiagnostics-fixit-info">, Group; def fdiagnostics_print_source_range_info : Flag<"-fdiagnostics-print-source-range-info">, Group; def fdiagnostics_show_option : Flag<"-fdiagnostics-show-option">, Group; +def fdiagnostics_show_category_EQ : Joined<"-fdiagnostics-show-category=">, Group; def fdollars_in_identifiers : Flag<"-fdollars-in-identifiers">, Group; def feliminate_unused_debug_symbols : Flag<"-feliminate-unused-debug-symbols">, Group; def femit_all_decls : Flag<"-femit-all-decls">, Group; @@ -265,10 +268,7 @@ def fexceptions : Flag<"-fexceptions">, Group; def fextdirs_EQ : Joined<"-fextdirs=">, Group; def fhosted : Flag<"-fhosted">, Group; def ffreestanding : Flag<"-ffreestanding">, Group; - def fgnu_keywords : Flag<"-fgnu-keywords">, Group; -def fasm : Flag<"-fasm">, Alias; - def fgnu_runtime : Flag<"-fgnu-runtime">, Group; def fheinous_gnu_extensions : Flag<"-fheinous-gnu-extensions">; def filelist : Separate<"-filelist">, Flags<[LinkerInput]>; @@ -291,6 +291,7 @@ def fmudflap : Flag<"-fmudflap">, Group; def fnested_functions : Flag<"-fnested-functions">, Group; def fnext_runtime : Flag<"-fnext-runtime">, Group; def fno_access_control : Flag<"-fno-access-control">, Group; +def fno_asm : Flag<"-fno-asm">, Group; def fno_asynchronous_unwind_tables : Flag<"-fno-asynchronous-unwind-tables">, Group; def fno_assume_sane_operator_new : Flag<"-fno-assume-sane-operator-new">, Group; def fno_blocks : Flag<"-fno-blocks">, Group; @@ -306,10 +307,7 @@ def fno_diagnostics_show_option : Flag<"-fno-diagnostics-show-option">, Group, Group; def fno_eliminate_unused_debug_symbols : Flag<"-fno-eliminate-unused-debug-symbols">, Group; def fno_exceptions : Flag<"-fno-exceptions">, Group; - def fno_gnu_keywords : Flag<"-fno-gnu-keywords">, Group; -def fno_asm : Flag<"-fno-asm">, Alias; - def fno_inline_functions : Flag<"-fno-inline-functions">, Group; def fno_inline : Flag<"-fno-inline">, Group; def fno_keep_inline_functions : Flag<"-fno-keep-inline-functions">, Group; @@ -329,6 +327,7 @@ def fno_threadsafe_statics : Flag<"-fno-threadsafe-statics">, Group; def fno_use_cxa_atexit : Flag<"-fno-use-cxa-atexit">, Group; def fno_unit_at_a_time : Flag<"-fno-unit-at-a-time">, Group; def fno_unwind_tables : Flag<"-fno-unwind-tables">, Group; +def fno_verbose_asm : Flag<"-fno-verbose-asm">, Group; def fno_working_directory : Flag<"-fno-working-directory">, Group; def fno_zero_initialized_in_bss : Flag<"-fno-zero-initialized-in-bss">, Group; def fobjc_abi_version_EQ : Joined<"-fobjc-abi-version=">, Group; @@ -384,6 +383,8 @@ def fverbose_asm : Flag<"-fverbose-asm">, Group; def fvisibility_EQ : Joined<"-fvisibility=">, Group; def fwritable_strings : Flag<"-fwritable-strings">, Group; def fzero_initialized_in_bss : Flag<"-fzero-initialized-in-bss">, Group; +def ffunction_sections: Flag <"-ffunction-sections">, Group; +def fdata_sections : Flag <"-fdata-sections">, Group; def f : Joined<"-f">, Group; def g0 : Joined<"-g0">, Group; def g3 : Joined<"-g3">, Group; @@ -436,6 +437,7 @@ def mno_constant_cfstrings : Flag<"-mno-constant-cfstrings">, Group; def mno_mmx : Flag<"-mno-mmx">, Group; def mno_pascal_strings : Flag<"-mno-pascal-strings">, Group; def mno_red_zone : Flag<"-mno-red-zone">, Group; +def mno_relax_all : Flag<"-mno-relax-all">, Group; def mno_soft_float : Flag<"-mno-soft-float">, Group; def mno_sse2 : Flag<"-mno-sse2">, Group; def mno_sse3 : Flag<"-mno-sse3">, Group; @@ -453,6 +455,7 @@ def marm : Flag<"-marm">, Alias; def mno_warn_nonportable_cfstrings : Flag<"-mno-warn-nonportable-cfstrings">, Group; def mpascal_strings : Flag<"-mpascal-strings">, Group; def mred_zone : Flag<"-mred-zone">, Group; +def mrelax_all : Flag<"-mrelax-all">, Group; def msoft_float : Flag<"-msoft-float">, Group; def msse2 : Flag<"-msse2">, Group; def msse3 : Flag<"-msse3">, Group; @@ -667,6 +670,7 @@ def _pipe : Flag<"--pipe">, Alias, Flags<[DriverOption]>; def _prefix_EQ : Joined<"--prefix=">, Alias, Flags<[RenderSeparate]>; def _prefix : Separate<"--prefix">, Alias; def _preprocess : Flag<"--preprocess">, Alias; +def _print_diagnostic_categories : Flag<"--print-diagnostic-categories">; def _print_file_name_EQ : Joined<"--print-file-name=">, Alias; def _print_file_name : Separate<"--print-file-name">, Alias; def _print_libgcc_file_name : Flag<"--print-libgcc-file-name">, Alias; diff --git a/include/clang/Driver/Tool.h b/include/clang/Driver/Tool.h index ef77206..4368a81 100644 --- a/include/clang/Driver/Tool.h +++ b/include/clang/Driver/Tool.h @@ -30,17 +30,23 @@ class Tool { /// The tool name (for debugging). const char *Name; + /// The human readable name for the tool, for use in diagnostics. + const char *ShortName; + /// The tool chain this tool is a part of. const ToolChain &TheToolChain; public: - Tool(const char *Name, const ToolChain &TC); + Tool(const char *Name, const char *ShortName, + const ToolChain &TC); public: virtual ~Tool(); const char *getName() const { return Name; } + const char *getShortName() const { return ShortName; } + const ToolChain &getToolChain() const { return TheToolChain; } virtual bool acceptsPipedInput() const = 0; -- cgit v1.1