diff options
Diffstat (limited to 'include/clang/Driver')
-rw-r--r-- | include/clang/Driver/Arg.h | 7 | ||||
-rw-r--r-- | include/clang/Driver/ArgList.h | 5 | ||||
-rw-r--r-- | include/clang/Driver/CC1AsOptions.td | 8 | ||||
-rw-r--r-- | include/clang/Driver/CC1Options.td | 47 | ||||
-rw-r--r-- | include/clang/Driver/Compilation.h | 43 | ||||
-rw-r--r-- | include/clang/Driver/Driver.h | 14 | ||||
-rw-r--r-- | include/clang/Driver/Job.h | 2 | ||||
-rw-r--r-- | include/clang/Driver/OptSpecifier.h | 4 | ||||
-rw-r--r-- | include/clang/Driver/Option.h | 2 | ||||
-rw-r--r-- | include/clang/Driver/Options.td | 107 | ||||
-rw-r--r-- | include/clang/Driver/Phases.h | 4 | ||||
-rw-r--r-- | include/clang/Driver/Tool.h | 1 | ||||
-rw-r--r-- | include/clang/Driver/ToolChain.h | 36 | ||||
-rw-r--r-- | include/clang/Driver/Types.def | 3 | ||||
-rw-r--r-- | include/clang/Driver/Types.h | 13 | ||||
-rw-r--r-- | include/clang/Driver/Util.h | 5 |
16 files changed, 224 insertions, 77 deletions
diff --git a/include/clang/Driver/Arg.h b/include/clang/Driver/Arg.h index 3b3829a..662a2e2 100644 --- a/include/clang/Driver/Arg.h +++ b/include/clang/Driver/Arg.h @@ -15,9 +15,8 @@ #ifndef CLANG_DRIVER_ARG_H_ #define CLANG_DRIVER_ARG_H_ -#include "clang/Driver/Option.h" - #include "Util.h" +#include "clang/Driver/Option.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" #include <string> @@ -52,7 +51,7 @@ namespace driver { /// ArgList. unsigned Index; - /// \brief Was this argument used to effect compilation? + /// \brief Was this argument used to affect compilation? /// /// This is used for generating "argument unused" diagnostics. mutable unsigned Claimed : 1; @@ -72,7 +71,7 @@ namespace driver { const char *Value0, const char *Value1, const Arg *BaseArg = 0); ~Arg(); - const Option getOption() const { return Opt; } + Option getOption() const { return Opt; } StringRef getSpelling() const { return Spelling; } unsigned getIndex() const { return Index; } diff --git a/include/clang/Driver/ArgList.h b/include/clang/Driver/ArgList.h index 72ed7bf..3967dcc 100644 --- a/include/clang/Driver/ArgList.h +++ b/include/clang/Driver/ArgList.h @@ -11,12 +11,11 @@ #define CLANG_DRIVER_ARGLIST_H_ #include "clang/Basic/LLVM.h" -#include "clang/Driver/Option.h" #include "clang/Driver/OptSpecifier.h" +#include "clang/Driver/Option.h" #include "clang/Driver/Util.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" - #include <list> #include <string> #include <vector> @@ -291,6 +290,8 @@ namespace driver { StringRef RHS) const; /// @} + + void dump(); }; class InputArgList : public ArgList { diff --git a/include/clang/Driver/CC1AsOptions.td b/include/clang/Driver/CC1AsOptions.td index 9fd855a..2749bcd 100644 --- a/include/clang/Driver/CC1AsOptions.td +++ b/include/clang/Driver/CC1AsOptions.td @@ -37,6 +37,8 @@ def L : Flag<["-"], "L">, HelpText<"Save temporary labels in the symbol table. " "Note this may change .s semantics, it should almost never be used " "on compiler generated code!">; +def main_file_name : Separate<["-"], "main-file-name">, + HelpText<"Main file name to use for debug info">; //===----------------------------------------------------------------------===// // Frontend Options @@ -86,5 +88,11 @@ def fatal_warnings : Flag<["--"], "fatal-warnings">, def g : Flag<["-"], "g">, HelpText<"Generate source level debug information">; +def fdebug_compilation_dir : Separate<["-"], "fdebug-compilation-dir">, + HelpText<"The compilation directory to embed in the debug info.">; + def dwarf_debug_flags : Separate<["-"], "dwarf-debug-flags">, HelpText<"The string to embed in the Dwarf debug flags record.">; + +def dwarf_debug_producer : Separate<["-"], "dwarf-debug-producer">, + HelpText<"The string to embed in the Dwarf debug AT_producer record.">; diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td index 3ff2549..e4dd345 100644 --- a/include/clang/Driver/CC1Options.td +++ b/include/clang/Driver/CC1Options.td @@ -81,15 +81,6 @@ def analyzer_inline_max_stack_depth : Separate<["-"], "analyzer-inline-max-stack def analyzer_inline_max_stack_depth_EQ : Joined<["-"], "analyzer-inline-max-stack-depth=">, Alias<analyzer_inline_max_stack_depth>; -def analyzer_inline_max_function_size : Separate<["-"], "analyzer-inline-max-function-size">, - HelpText<"Bound on the number of basic blocks in an inlined function (200 by default)">; -def analyzer_inline_max_function_size_EQ : Joined<["-"], "analyzer-inline-max-function-size=">, - Alias<analyzer_inline_max_function_size>; - -def analyzer_ipa : Separate<["-"], "analyzer-ipa">, - HelpText<"Specify the inter-procedural analysis mode">; -def analyzer_ipa_EQ : Joined<["-"], "analyzer-ipa=">, Alias<analyzer_ipa>; - def analyzer_inlining_mode : Separate<["-"], "analyzer-inlining-mode">, HelpText<"Specify the function selection heuristic used during inlining">; def analyzer_inlining_mode_EQ : Joined<["-"], "analyzer-inlining-mode=">, Alias<analyzer_inlining_mode>; @@ -97,8 +88,6 @@ def analyzer_inlining_mode_EQ : Joined<["-"], "analyzer-inlining-mode=">, Alias< def analyzer_disable_retry_exhausted : Flag<["-"], "analyzer-disable-retry-exhausted">, HelpText<"Do not re-analyze paths leading to exhausted nodes with a different strategy (may decrease code coverage)">; -def analyzer_max_nodes : Separate<["-"], "analyzer-max-nodes">, - HelpText<"The maximum number of nodes the analyzer can generate (150000 default, 0 = no limit)">; def analyzer_max_loop : Separate<["-"], "analyzer-max-loop">, HelpText<"The maximum number of times the analyzer will go through a loop">; def analyzer_stats : Flag<["-"], "analyzer-stats">, @@ -145,6 +134,8 @@ def dwarf_debug_flags : Separate<["-"], "dwarf-debug-flags">, HelpText<"The string to embed in the Dwarf debug flags record.">; def dwarf_column_info : Flag<["-"], "dwarf-column-info">, HelpText<"Turn on column location information.">; +def split_dwarf : Flag<["-"], "split-dwarf">, + HelpText<"Split out the dwarf .dwo sections">; def fforbid_guard_variables : Flag<["-"], "fforbid-guard-variables">, HelpText<"Emit an error if a C++ static local initializer would need a guard variable">; def no_implicit_float : Flag<["-"], "no-implicit-float">, @@ -158,10 +149,20 @@ def femit_coverage_data: Flag<["-"], "femit-coverage-data">, def coverage_file : Separate<["-"], "coverage-file">, HelpText<"Emit coverage data to this filename. The extension will be replaced.">; def coverage_file_EQ : Joined<["-"], "coverage-file=">, Alias<coverage_file>; +def coverage_cfg_checksum : Flag<["-"], "coverage-cfg-checksum">, + HelpText<"Emit CFG checksum for functions in .gcno files.">; +def coverage_no_function_names_in_data : Flag<["-"], "coverage-no-function-names-in-data">, + HelpText<"Emit function names in .gcda files.">; +def coverage_version_EQ : Joined<["-"], "coverage-version=">, + HelpText<"Four-byte version string for gcov files.">; +def test_coverage : Flag<["-"], "test-coverage">, + HelpText<"Do not generate coverage files or remove coverage changes from IR">; def fuse_register_sized_bitfield_access: Flag<["-"], "fuse-register-sized-bitfield-access">, HelpText<"Use register sized accesses to bit-fields, when possible.">; def relaxed_aliasing : Flag<["-"], "relaxed-aliasing">, HelpText<"Turn off Type Based Alias Analysis">; +def struct_path_tbaa : Flag<["-"], "struct-path-tbaa">, + HelpText<"Turn on struct-path aware Type Based Alias Analysis">; def masm_verbose : Flag<["-"], "masm-verbose">, HelpText<"Generate verbose assembly output">; def mcode_model : Separate<["-"], "mcode-model">, @@ -185,6 +186,8 @@ def mlimit_float_precision : Separate<["-"], "mlimit-float-precision">, HelpText<"Limit float precision to the given value">; def mno_exec_stack : Flag<["-"], "mnoexecstack">, HelpText<"Mark the file as not needing an executable stack">; +def split_stacks : Flag<["-"], "split-stacks">, + HelpText<"Try to use a split stack if possible.">; def mno_zero_initialized_in_bss : Flag<["-"], "mno-zero-initialized-in-bss">, HelpText<"Do not put zero initialized data in the BSS">; def backend_option : Separate<["-"], "backend-option">, @@ -197,8 +200,6 @@ def mrelocation_model : Separate<["-"], "mrelocation-model">, HelpText<"The relocation model to use">; def munwind_tables : Flag<["-"], "munwind-tables">, HelpText<"Generate unwinding tables for all functions">; -def fuse_init_array : Flag<["-"], "fuse-init-array">, - HelpText<"Use .init_array instead of .ctors">; def mconstructor_aliases : Flag<["-"], "mconstructor-aliases">, HelpText<"Emit complete constructors and destructors as aliases when possible">; def mlink_bitcode_file : Separate<["-"], "mlink-bitcode-file">, @@ -217,9 +218,6 @@ def header_include_file : Separate<["-"], "header-include-file">, // Diagnostic Options //===----------------------------------------------------------------------===// -def dump_build_information : Separate<["-"], "dump-build-information">, - MetaVarName<"<filename>">, - HelpText<"output a dump of some build information to a file">; def diagnostic_log_file : Separate<["-"], "diagnostic-log-file">, HelpText<"Filename (or -) to log diagnostics to">; def diagnostic_serialized_file : Separate<["-"], "serialize-diagnostic-file">, @@ -230,6 +228,8 @@ def fdiagnostics_format : Separate<["-"], "fdiagnostics-format">, HelpText<"Change diagnostic formatting to match IDE and command line tools">; def fdiagnostics_show_category : Separate<["-"], "fdiagnostics-show-category">, HelpText<"Print diagnostic category">; +def fno_diagnostics_use_presumed_location : Flag<["-"], "fno-diagnostics-use-presumed-location">, + HelpText<"Ignore #line directives when displaying diagnostic locations">; def ftabstop : Separate<["-"], "ftabstop">, MetaVarName<"<N>">, HelpText<"Set the tab stop distance.">; def ferror_limit : Separate<["-"], "ferror-limit">, MetaVarName<"<N>">, @@ -245,6 +245,9 @@ def fmessage_length : Separate<["-"], "fmessage-length">, MetaVarName<"<N>">, def Wno_rewrite_macros : Flag<["-"], "Wno-rewrite-macros">, HelpText<"Silence ObjC rewriting warnings">; +def fwarn_on_spellcheck : Flag<["-"], "fwarn-on-spellcheck">, + HelpText<"Emit warning if spell-check is initiated, for testing">; + //===----------------------------------------------------------------------===// // Frontend Options //===----------------------------------------------------------------------===// @@ -283,8 +286,6 @@ def plugin_arg : JoinedAndSeparate<["-"], "plugin-arg-">, HelpText<"Pass <arg> to plugin <name>">; def add_plugin : Separate<["-"], "add-plugin">, MetaVarName<"<name>">, HelpText<"Use the named plugin action in addition to the default action">; -def resource_dir : Separate<["-"], "resource-dir">, - HelpText<"The directory which holds the compiler resource files">; def version : Flag<["-"], "version">, HelpText<"Print the compiler version">; def ast_dump_filter : Separate<["-"], "ast-dump-filter">, @@ -292,6 +293,8 @@ def ast_dump_filter : Separate<["-"], "ast-dump-filter">, HelpText<"Use with -ast-dump or -ast-print to dump/print only AST declaration" " nodes having a certain substring in a qualified name. Use" " -ast-list to list all filterable declaration node names.">; +def fno_modules_global_index : Flag<["-"], "fno-modules-global-index">, + HelpText<"Do not automatically generate or update the global module index">; let Group = Action_Group in { @@ -389,6 +392,8 @@ def fhidden_weak_vtables : Flag<["-"], "fhidden-weak-vtables">, HelpText<"Generate weak vtables and RTTI with hidden visibility">; def main_file_name : Separate<["-"], "main-file-name">, HelpText<"Main file name to use for debug info">; +def split_dwarf_file : Separate<["-"], "split-dwarf-file">, + HelpText<"File name to use for split dwarf debug info output">; def fno_signed_char : Flag<["-"], "fno-signed-char">, HelpText<"Char is unsigned">; def fno_wchar : Flag<["-"], "fno-wchar">, @@ -425,11 +430,15 @@ def stack_protector : Separate<["-"], "stack-protector">, def stack_protector_buffer_size : Separate<["-"], "stack-protector-buffer-size">, HelpText<"Lower bound for a buffer to be considered for stack protection">; def fvisibility : Separate<["-"], "fvisibility">, - HelpText<"Default symbol visibility">; + HelpText<"Default type and symbol visibility">; +def ftype_visibility : Separate<["-"], "ftype-visibility">, + HelpText<"Default type visibility">; def ftemplate_depth : Separate<["-"], "ftemplate-depth">, HelpText<"Maximum depth of recursive template instantiation">; def fconstexpr_depth : Separate<["-"], "fconstexpr-depth">, HelpText<"Maximum depth of recursive constexpr function calls">; +def fbracket_depth : Separate<["-"], "fbracket-depth">, + HelpText<"Maximum nesting level for parentheses, brackets, and braces">; def fconst_strings : Flag<["-"], "fconst-strings">, HelpText<"Use a const qualified type for string literals in C and ObjC">; def fno_const_strings : Flag<["-"], "fno-const-strings">, diff --git a/include/clang/Driver/Compilation.h b/include/clang/Driver/Compilation.h index 5f63aa7..15c5e40 100644 --- a/include/clang/Driver/Compilation.h +++ b/include/clang/Driver/Compilation.h @@ -20,6 +20,7 @@ namespace driver { class DerivedArgList; class Driver; class InputArgList; + class JobAction; class JobList; class ToolChain; @@ -54,11 +55,11 @@ class Compilation { ArgStringList TempFiles; /// Result files which should be removed on failure. - ArgStringList ResultFiles; + ArgStringMap ResultFiles; /// Result files which are generated correctly on failure, and which should /// only be removed if we crash. - ArgStringList FailureResultFiles; + ArgStringMap FailureResultFiles; /// Redirection for stdout, stderr, etc. const llvm::sys::Path **Redirects; @@ -88,9 +89,9 @@ public: const ArgStringList &getTempFiles() const { return TempFiles; } - const ArgStringList &getResultFiles() const { return ResultFiles; } + const ArgStringMap &getResultFiles() const { return ResultFiles; } - const ArgStringList &getFailureResultFiles() const { + const ArgStringMap &getFailureResultFiles() const { return FailureResultFiles; } @@ -113,24 +114,40 @@ public: /// addResultFile - Add a file to remove on failure, and returns its /// argument. - const char *addResultFile(const char *Name) { - ResultFiles.push_back(Name); + const char *addResultFile(const char *Name, const JobAction *JA) { + ResultFiles[JA] = Name; return Name; } /// addFailureResultFile - Add a file to remove if we crash, and returns its /// argument. - const char *addFailureResultFile(const char *Name) { - FailureResultFiles.push_back(Name); + const char *addFailureResultFile(const char *Name, const JobAction *JA) { + FailureResultFiles[JA] = Name; return Name; } + /// CleanupFile - Delete a given file. + /// + /// \param IssueErrors - Report failures as errors. + /// \return Whether the file was removed successfully. + bool CleanupFile(const char *File, bool IssueErrors = false) const; + /// CleanupFileList - Remove the files in the given list. /// /// \param IssueErrors - Report failures as errors. /// \return Whether all files were removed successfully. bool CleanupFileList(const ArgStringList &Files, - bool IssueErrors=false) const; + bool IssueErrors = false) const; + + /// CleanupFileMap - Remove the files in the given map. + /// + /// \param JA - If specified, only delete the files associated with this + /// JobAction. Otherwise, delete all files in the map. + /// \param IssueErrors - Report failures as errors. + /// \return Whether all files were removed successfully. + bool CleanupFileMap(const ArgStringMap &Files, + const JobAction *JA, + bool IssueErrors = false) const; /// PrintJob - Print one job in -### format. /// @@ -158,10 +175,10 @@ public: /// ExecuteJob - Execute a single job. /// - /// \param FailingCommand - For non-zero results, this will be set to the - /// Command which failed. - /// \return The accumulated result code of the job. - int ExecuteJob(const Job &J, const Command *&FailingCommand) const; + /// \param FailingCommands - For non-zero results, this will be a vector of + /// failing commands and their associated result code. + void ExecuteJob(const Job &J, + SmallVectorImpl< std::pair<int, const Command *> > &FailingCommands) const; /// initCompilationForDiagnostics - Remove stale state and suppress output /// so compilation can be reexecuted to generate additional diagnostic diff --git a/include/clang/Driver/Driver.h b/include/clang/Driver/Driver.h index b752ce6..1330e95 100644 --- a/include/clang/Driver/Driver.h +++ b/include/clang/Driver/Driver.h @@ -11,11 +11,10 @@ #define CLANG_DRIVER_DRIVER_H_ #include "clang/Basic/Diagnostic.h" - +#include "clang/Basic/LLVM.h" #include "clang/Driver/Phases.h" #include "clang/Driver/Types.h" #include "clang/Driver/Util.h" - #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Triple.h" @@ -25,9 +24,6 @@ #include <set> #include <string> -namespace llvm { - template<typename T> class ArrayRef; -} namespace clang { namespace driver { class Action; @@ -178,7 +174,6 @@ public: Driver(StringRef _ClangExecutable, StringRef _DefaultTargetTriple, StringRef _DefaultImageName, - bool IsProduction, DiagnosticsEngine &_Diags); ~Driver(); @@ -277,7 +272,7 @@ public: /// to just running the subprocesses, for example reporting errors, removing /// temporary files, etc. int ExecuteCompilation(const Compilation &C, - const Command *&FailingCommand) const; + SmallVectorImpl< std::pair<int, const Command *> > &FailingCommands) const; /// generateCompilationDiagnostics - Generate diagnostics information /// including preprocessed source file(s). @@ -363,10 +358,9 @@ public: /// GCC goes to extra lengths here to be a bit more robust. std::string GetTemporaryPath(StringRef Prefix, const char *Suffix) const; - /// ShouldUseClangCompilar - Should the clang compiler be used to + /// ShouldUseClangCompiler - Should the clang compiler be used to /// handle this action. - bool ShouldUseClangCompiler(const Compilation &C, const JobAction &JA, - const llvm::Triple &ArchName) const; + bool ShouldUseClangCompiler(const JobAction &JA) const; bool IsUsingLTO(const ArgList &Args) const; diff --git a/include/clang/Driver/Job.h b/include/clang/Driver/Job.h index 84f5ee1..045b5d8 100644 --- a/include/clang/Driver/Job.h +++ b/include/clang/Driver/Job.h @@ -10,9 +10,9 @@ #ifndef CLANG_DRIVER_JOB_H_ #define CLANG_DRIVER_JOB_H_ +#include "clang/Basic/LLVM.h" #include "clang/Driver/Util.h" #include "llvm/ADT/SmallVector.h" -#include "clang/Basic/LLVM.h" namespace clang { namespace driver { diff --git a/include/clang/Driver/OptSpecifier.h b/include/clang/Driver/OptSpecifier.h index bb1cd17..e683ef3 100644 --- a/include/clang/Driver/OptSpecifier.h +++ b/include/clang/Driver/OptSpecifier.h @@ -10,6 +10,8 @@ #ifndef CLANG_DRIVER_OPTSPECIFIER_H #define CLANG_DRIVER_OPTSPECIFIER_H +#include "llvm/Support/Compiler.h" + namespace clang { namespace driver { class Option; @@ -19,7 +21,7 @@ namespace driver { unsigned ID; private: - explicit OptSpecifier(bool); // DO NOT IMPLEMENT + explicit OptSpecifier(bool) LLVM_DELETED_FUNCTION; public: OptSpecifier() : ID(0) {} diff --git a/include/clang/Driver/Option.h b/include/clang/Driver/Option.h index c3db773..764934f 100644 --- a/include/clang/Driver/Option.h +++ b/include/clang/Driver/Option.h @@ -10,10 +10,10 @@ #ifndef CLANG_DRIVER_OPTION_H_ #define CLANG_DRIVER_OPTION_H_ +#include "clang/Basic/LLVM.h" #include "clang/Driver/OptTable.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/ErrorHandling.h" -#include "clang/Basic/LLVM.h" namespace clang { namespace driver { diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index 77ba17a..112feb7 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -152,7 +152,8 @@ def E : Flag<["-"], "E">, Flags<[DriverOption,CC1Option]>, Group<Action_Group>, HelpText<"Only run the preprocessor">; def F : JoinedOrSeparate<["-"], "F">, Flags<[RenderJoined,CC1Option]>, HelpText<"Add directory to framework include search path">; -def G : Separate<["-"], "G">, Flags<[DriverOption]>; +def G : JoinedOrSeparate<["-"], "G">, Flags<[DriverOption]>; +def G_EQ : Joined<["-"], "G=">, Flags<[DriverOption]>; def H : Flag<["-"], "H">, Flags<[CC1Option]>, HelpText<"Show header includes and nesting depth">; def I_ : Flag<["-"], "I-">, Group<I_Group>; @@ -290,6 +291,7 @@ def faccess_control : Flag<["-"], "faccess-control">, Group<f_Group>; def fallow_unsupported : Flag<["-"], "fallow-unsupported">, Group<f_Group>; def faltivec : Flag<["-"], "faltivec">, Group<f_Group>, Flags<[CC1Option]>, HelpText<"Enable AltiVec vector initializer syntax">; +def fno_altivec : Flag<["-"], "fno-altivec">, Group<f_Group>, Flags<[CC1Option]>; def fapple_kext : Flag<["-"], "fapple-kext">, Group<f_Group>, Flags<[CC1Option]>, HelpText<"Use Apple's kernel extensions ABI">; def fapple_pragma_pack : Flag<["-"], "fapple-pragma-pack">, Group<f_Group>, Flags<[CC1Option]>, @@ -300,7 +302,7 @@ def fthread_sanitizer : Flag<["-"], "fthread-sanitizer">, Group<f_Group>; def fno_thread_sanitizer : Flag<["-"], "fno-thread-sanitizer">, Group<f_Group>; def fasm : Flag<["-"], "fasm">, Group<f_Group>; -def fasm_blocks : Flag<["-"], "fasm-blocks">, Group<f_Group>; +def fasm_blocks : Flag<["-"], "fasm-blocks">, Group<f_Group>, Flags<[CC1Option]>; def fno_asm_blocks : Flag<["-"], "fno-asm-blocks">, Group<f_Group>; def fassume_sane_operator_new : Flag<["-"], "fassume-sane-operator-new">, Group<f_Group>; @@ -325,6 +327,9 @@ def fcatch_undefined_behavior : Flag<["-"], "fcatch-undefined-behavior">, Group< def fclasspath_EQ : Joined<["-"], "fclasspath=">, Group<f_Group>; def fcolor_diagnostics : Flag<["-"], "fcolor-diagnostics">, Group<f_Group>, Flags<[CC1Option]>, HelpText<"Use colors in diagnostics">; +def fcomment_block_commands : CommaJoined<["-"], "fcomment-block-commands=">, Group<f_clang_Group>, Flags<[CC1Option]>, + HelpText<"Treat each comma separated argument in <arg> as a documentation comment block command">, + MetaVarName<"<arg>">; def fcommon : Flag<["-"], "fcommon">, Group<f_Group>; def fcompile_resource_EQ : Joined<["-"], "fcompile-resource=">, Group<f_Group>; def fconstant_cfstrings : Flag<["-"], "fconstant-cfstrings">, Group<f_Group>; @@ -374,6 +379,10 @@ def ferror_limit_EQ : Joined<["-"], "ferror-limit=">, Group<f_Group>; def fexceptions : Flag<["-"], "fexceptions">, Group<f_Group>, Flags<[CC1Option]>, HelpText<"Enable support for exception handling">; def fextdirs_EQ : Joined<["-"], "fextdirs=">, Group<f_Group>; +def fextended_identifiers : Flag<["-"], "fextended-identifiers">, + Group<clang_ignored_f_Group>; +def fno_extended_identifiers : Flag<["-"], "fno-extended-identifiers">, + Group<f_Group>, Flags<[Unsupported]>; def fhosted : Flag<["-"], "fhosted">, Group<f_Group>; def ffast_math : Flag<["-"], "ffast-math">, Group<f_Group>, Flags<[CC1Option]>, HelpText<"Enable the *frontend*'s 'fast-math' mode. This has no effect on " @@ -383,6 +392,7 @@ def fno_fast_math : Flag<["-"], "fno-fast-math">, Group<f_Group>; def fmath_errno : Flag<["-"], "fmath-errno">, Group<f_Group>, Flags<[CC1Option]>, HelpText<"Require math functions to indicate errors by setting errno">; def fno_math_errno : Flag<["-"], "fno-math-errno">, Group<f_Group>; +def fbracket_depth_EQ : Joined<["-"], "fbracket-depth=">, Group<f_Group>; def fsignaling_math : Flag<["-"], "fsignaling-math">, Group<f_Group>; def fno_signaling_math : Flag<["-"], "fno-signaling-math">, Group<f_Group>; def fsanitize_EQ : CommaJoined<["-"], "fsanitize=">, Group<f_clang_Group>, @@ -391,6 +401,32 @@ def fsanitize_EQ : CommaJoined<["-"], "fsanitize=">, Group<f_clang_Group>, "address (memory errors) | thread (race detection) | " "undefined (miscellaneous undefined behavior)">; def fno_sanitize_EQ : CommaJoined<["-"], "fno-sanitize=">, Group<f_clang_Group>; +def fsanitize_address_zero_base_shadow : Flag<["-"], "fsanitize-address-zero-base-shadow">, + Group<f_clang_Group>, Flags<[CC1Option]>, + HelpText<"Make AddressSanitizer map shadow memory" + "at zero offset">; +def fno_sanitize_address_zero_base_shadow : Flag<["-"], "fno-sanitize-address-zero-base-shadow">, + Group<f_clang_Group>; +def fsanitize_blacklist : Joined<["-"], "fsanitize-blacklist=">, + Group<f_clang_Group>, Flags<[CC1Option]>, + HelpText<"Path to blacklist file for sanitizers">; +def fno_sanitize_blacklist : Flag<["-"], "fno-sanitize-blacklist">, + Group<f_clang_Group>, + HelpText<"Don't use blacklist file for sanitizers">; +def fsanitize_memory_track_origins : Flag<["-"], "fsanitize-memory-track-origins">, + Group<f_clang_Group>, Flags<[CC1Option]>, + HelpText<"Enable origins tracking in MemorySanitizer">; +def fno_sanitize_memory_track_origins : Flag<["-"], "fno-sanitize-memory-track-origins">, + Group<f_clang_Group>; +def fsanitize_recover : Flag<["-"], "fsanitize-recover">, + Group<f_clang_Group>; +def fno_sanitize_recover : Flag<["-"], "fno-sanitize-recover">, + Group<f_clang_Group>, Flags<[CC1Option]>, + HelpText<"Disable sanitizer check recovery">; +def fsanitize_undefined_trap_on_error : Flag<["-"], "fsanitize-undefined-trap-on-error">, + Group<f_clang_Group>, Flags<[CC1Option]>; +def fno_sanitize_undefined_trap_on_error : Flag<["-"], "fno-sanitize-undefined-trap-on-error">, + Group<f_clang_Group>; def funsafe_math_optimizations : Flag<["-"], "funsafe-math-optimizations">, Group<f_Group>; def fno_unsafe_math_optimizations : Flag<["-"], "fno-unsafe-math-optimizations">, @@ -453,8 +489,6 @@ def fmerge_all_constants : Flag<["-"], "fmerge-all-constants">, Group<f_Group>; def fmessage_length_EQ : Joined<["-"], "fmessage-length=">, Group<f_Group>; def fms_extensions : Flag<["-"], "fms-extensions">, Group<f_Group>, Flags<[CC1Option]>, HelpText<"Accept some non-standard constructs supported by the Microsoft compiler">; -def fenable_experimental_ms_inline_asm : Flag<["-"], "fenable-experimental-ms-inline-asm">, Group<f_Group>, Flags<[CC1Option]>, - HelpText<"Enable support for Microsoft style inine assembly">; def fms_compatibility : Flag<["-"], "fms-compatibility">, Group<f_Group>, Flags<[CC1Option]>, HelpText<"Enable Microsoft compatibility mode">; def fmsc_version : Joined<["-"], "fmsc-version=">, Group<f_Group>, Flags<[CC1Option]>, @@ -462,11 +496,23 @@ def fmsc_version : Joined<["-"], "fmsc-version=">, Group<f_Group>, Flags<[CC1Opt def fdelayed_template_parsing : Flag<["-"], "fdelayed-template-parsing">, Group<f_Group>, HelpText<"Parse templated function definitions at the end of the " "translation unit ">, Flags<[CC1Option]>; -def fmodule_cache_path : Separate<["-"], "fmodule-cache-path">, Group<i_Group>, +def fmodules_cache_path : Joined<["-"], "fmodules-cache-path=">, Group<i_Group>, Flags<[NoForward,CC1Option]>, MetaVarName<"<directory>">, HelpText<"Specify the module cache path">; +def fmodules_prune_interval : Joined<["-"], "fmodules-prune-interval=">, Group<i_Group>, + Flags<[CC1Option]>, MetaVarName<"<seconds>">, + HelpText<"Specify the interval (in seconds) between attempts to prune the module cache">; +def fmodules_prune_after : Joined<["-"], "fmodules-prune-after=">, Group<i_Group>, + Flags<[CC1Option]>, MetaVarName<"<seconds>">, + HelpText<"Specify the interval (in seconds) after which a module file will be considered unused">; def fmodules : Flag <["-"], "fmodules">, Group<f_Group>, Flags<[NoForward,CC1Option]>, HelpText<"Enable the 'modules' language feature">; +def fmodules_autolink : Flag <["-"], "fmodules-autolink">, Group<f_Group>, Flags<[NoForward,CC1Option]>, + HelpText<"Enable autolinking of the libraries for imported modules">; +def fno_modules_autolink : Flag <["-"], "fno-modules-autolink">, Group<f_Group>, + HelpText<"Disable autolinking of the libraries for imported modules">; +def fmodules_ignore_macro : Joined<["-"], "fmodules-ignore-macro=">, Group<f_Group>, Flags<[CC1Option]>, + HelpText<"Ignore the definition of the given macro when building and loading modules">; def fretain_comments_from_system_headers : Flag<["-"], "fretain-comments-from-system-headers">, Group<f_Group>, Flags<[CC1Option]>; def fmudflapth : Flag<["-"], "fmudflapth">, Group<f_Group>; @@ -541,12 +587,15 @@ def fno_spell_checking : Flag<["-"], "fno-spell-checking">, Group<f_Group>, Flags<[CC1Option]>, HelpText<"Disable spell-checking">; def fno_stack_protector : Flag<["-"], "fno-stack-protector">, Group<f_Group>; def fno_strict_aliasing : Flag<["-"], "fno-strict-aliasing">, Group<f_Group>; +def fstruct_path_tbaa : Flag<["-"], "fstruct-path-tbaa">, Group<f_Group>; def fno_strict_enums : Flag<["-"], "fno-strict-enums">, Group<f_Group>; def fno_strict_overflow : Flag<["-"], "fno-strict-overflow">, Group<f_Group>; def fno_threadsafe_statics : Flag<["-"], "fno-threadsafe-statics">, Group<f_Group>, Flags<[CC1Option]>, HelpText<"Do not emit code to make initialization of local statics thread safe">; def fno_use_cxa_atexit : Flag<["-"], "fno-use-cxa-atexit">, Group<f_Group>, Flags<[CC1Option]>, HelpText<"Don't use __cxa_atexit for calling destructors">; +def fno_use_init_array : Flag<["-"], "fno-use-init-array">, Group<f_Group>, Flags<[CC1Option]>, + HelpText<"Don't use .init_array instead of .ctors">; def fno_unit_at_a_time : Flag<["-"], "fno-unit-at-a-time">, Group<f_Group>; def fno_unwind_tables : Flag<["-"], "fno-unwind-tables">, Group<f_Group>; def fno_verbose_asm : Flag<["-"], "fno-verbose-asm">, Group<f_Group>; @@ -590,7 +639,7 @@ def fno_objc_nonfragile_abi : Flag<["-"], "fno-objc-nonfragile-abi">, Group<f_Gr def fobjc_sender_dependent_dispatch : Flag<["-"], "fobjc-sender-dependent-dispatch">, Group<f_Group>; def fobjc : Flag<["-"], "fobjc">, Group<f_Group>; def fomit_frame_pointer : Flag<["-"], "fomit-frame-pointer">, Group<f_Group>; -def fopenmp : Flag<["-"], "fopenmp">, Group<f_Group>; +def fopenmp : Flag<["-"], "fopenmp">, Group<f_Group>, Flags<[CC1Option]>; def fno_optimize_sibling_calls : Flag<["-"], "fno-optimize-sibling-calls">, Group<f_Group>; def foptimize_sibling_calls : Flag<["-"], "foptimize-sibling-calls">, Group<f_Group>; def force__cpusubtype__ALL : Flag<["-"], "force_cpusubtype_ALL">; @@ -627,6 +676,7 @@ def fshow_source_location : Flag<["-"], "fshow-source-location">, Group<f_Group> def fspell_checking : Flag<["-"], "fspell-checking">, Group<f_Group>; def fsigned_bitfields : Flag<["-"], "fsigned-bitfields">, Group<f_Group>; def fsigned_char : Flag<["-"], "fsigned-char">, Group<f_Group>; +def fsplit_stack : Flag<["-"], "fsplit-stack">, Group<f_Group>; def fstack_protector_all : Flag<["-"], "fstack-protector-all">, Group<f_Group>; def fstack_protector : Flag<["-"], "fstack-protector">, Group<f_Group>; def fstrict_aliasing : Flag<["-"], "fstrict-aliasing">, Group<f_Group>; @@ -641,6 +691,16 @@ def ftemplate_depth_ : Joined<["-"], "ftemplate-depth-">, Group<f_Group>; def ftemplate_backtrace_limit_EQ : Joined<["-"], "ftemplate-backtrace-limit=">, Group<f_Group>; def ftest_coverage : Flag<["-"], "ftest-coverage">, Group<f_Group>; +def fvectorize : Flag<["-"], "fvectorize">, Group<f_Group>, + HelpText<"Enable the loop vectorization passes">; +def fno_vectorize : Flag<["-"], "fno-vectorize">, Group<f_Group>; +def ftree_vectorize : Flag<["-"], "ftree-vectorize">, Alias<fvectorize>; +def fno_tree_vectorize : Flag<["-"], "fno-tree-vectorize">, Alias<fno_vectorize>; +def fslp_vectorize : Flag<["-"], "fslp-vectorize">, Group<f_Group>, + HelpText<"Enable the superword-level parallelism vectorization passes">; +def fno_slp_vectorize : Flag<["-"], "fno-slp-vectorize">, Group<f_Group>; +def ftree_slp_vectorize : Flag<["-"], "ftree-slp-vectorize">, Alias<fslp_vectorize>; +def fno_tree_slp_vectorize : Flag<["-"], "fno-tree-slp-vectorize">, Alias<fno_slp_vectorize>; def Wlarge_by_value_copy_def : Flag<["-"], "Wlarge-by-value-copy">, HelpText<"Warn if a function definition returns or accepts an object larger " "in bytes than a given value">, Flags<[HelpHidden]>; @@ -672,11 +732,17 @@ def funsigned_bitfields : Flag<["-"], "funsigned-bitfields">, Group<f_Group>; def funsigned_char : Flag<["-"], "funsigned-char">, Group<f_Group>; def funwind_tables : Flag<["-"], "funwind-tables">, Group<f_Group>; def fuse_cxa_atexit : Flag<["-"], "fuse-cxa-atexit">, Group<f_Group>; +def fuse_init_array : Flag<["-"], "fuse-init-array">, Group<f_Group>, Flags<[CC1Option]>, + HelpText<"Use .init_array instead of .ctors">; def fverbose_asm : Flag<["-"], "fverbose-asm">, Group<f_Group>; -def fvisibility_EQ : Joined<["-"], "fvisibility=">, Group<f_Group>; +def fvisibility_EQ : Joined<["-"], "fvisibility=">, Group<f_Group>, + HelpText<"Set the default symbol visibility for all global declarations">; def fvisibility_inlines_hidden : Flag<["-"], "fvisibility-inlines-hidden">, Group<f_Group>, HelpText<"Give inline C++ member functions default visibility by default">, Flags<[CC1Option]>; +def fvisibility_ms_compat : Flag<["-"], "fvisibility-ms-compat">, Group<f_Group>, + HelpText<"Give global types 'default' visibility and global functions and " + "variables 'hidden' visibility by default">; def fwrapv : Flag<["-"], "fwrapv">, Group<f_Group>, Flags<[CC1Option]>, HelpText<"Treat signed integer overflow as two's complement">; def fwritable_strings : Flag<["-"], "fwritable-strings">, Group<f_Group>, Flags<[CC1Option]>, @@ -716,6 +782,7 @@ def gno_record_gcc_switches : Flag<["-"], "gno-record-gcc-switches">, def gstrict_dwarf : Flag<["-"], "gstrict-dwarf">, Group<g_flags_Group>; def gno_strict_dwarf : Flag<["-"], "gno-strict-dwarf">, Group<g_flags_Group>; def gcolumn_info : Flag<["-"], "gcolumn-info">, Group<g_flags_Group>; +def gsplit_dwarf : Flag<["-"], "gsplit-dwarf">, Group<g_flags_Group>; def headerpad__max__install__names : Joined<["-"], "headerpad_max_install_names">; def help : Flag<["-", "--"], "help">, Flags<[CC1Option]>, HelpText<"Display available options">; @@ -757,6 +824,8 @@ def keep__private__externs : Flag<["-"], "keep_private_externs">; def l : JoinedOrSeparate<["-"], "l">, Flags<[LinkerInput, RenderJoined]>; def lazy__framework : Separate<["-"], "lazy_framework">, Flags<[LinkerInput]>; def lazy__library : Separate<["-"], "lazy_library">, Flags<[LinkerInput]>; +def EL : Flag<["-"], "EL">, Flags<[DriverOption]>; +def EB : Flag<["-"], "EB">, Flags<[DriverOption]>; def m32 : Flag<["-"], "m32">, Group<m_Group>, Flags<[DriverOption]>; def mqdsp6_compat : Flag<["-"], "mqdsp6-compat">, Group<m_Group>, Flags<[DriverOption,CC1Option]>, HelpText<"Enable hexagon-qdsp6 backward compatibility">; @@ -766,6 +835,15 @@ def m64 : Flag<["-"], "m64">, Group<m_Group>, Flags<[DriverOption]>; def mabi_EQ : Joined<["-"], "mabi=">, Group<m_Group>; def march_EQ : Joined<["-"], "march=">, Group<m_Group>; def maltivec : Flag<["-"], "maltivec">, Alias<faltivec>; +def mno_altivec : Flag<["-"], "mno-altivec">, Alias<fno_altivec>; +def mfprnd : Flag<["-"], "mfprnd">, Group<m_Group>; +def mno_fprnd : Flag<["-"], "mno-fprnd">, Group<m_Group>; +def mmfcrf : Flag<["-"], "mmfcrf">, Group<m_Group>; +def mno_mfcrf : Flag<["-"], "mno-mfcrf">, Group<m_Group>; +def mpopcntd : Flag<["-"], "mpopcntd">, Group<m_Group>; +def mno_popcntd : Flag<["-"], "mno-popcntd">, Group<m_Group>; +def mqpx : Flag<["-"], "mqpx">, Group<m_Group>; +def mno_qpx : Flag<["-"], "mno-qpx">, Group<m_Group>; def mcmodel_EQ : Joined<["-"], "mcmodel=">, Group<m_Group>; def mconstant_cfstrings : Flag<["-"], "mconstant-cfstrings">, Group<clang_ignored_m_Group>; def mcpu_EQ : Joined<["-"], "mcpu=">, Group<m_Group>; @@ -827,6 +905,8 @@ def mno_fma : Flag<["-"], "mno-fma">, Group<m_x86_Features_Group>; def mno_xop : Flag<["-"], "mno-xop">, Group<m_x86_Features_Group>; def mno_f16c : Flag<["-"], "mno-f16c">, Group<m_x86_Features_Group>; def mno_rtm : Flag<["-"], "mno-rtm">, Group<m_x86_Features_Group>; +def mno_prfchw : Flag<["-"], "mno-prfchw">, Group<m_x86_Features_Group>; +def mno_rdseed : Flag<["-"], "mno-rdseed">, Group<m_x86_Features_Group>; def mno_thumb : Flag<["-"], "mno-thumb">, Group<m_Group>; def marm : Flag<["-"], "marm">, Alias<mno_thumb>; @@ -835,6 +915,7 @@ def mno_warn_nonportable_cfstrings : Flag<["-"], "mno-warn-nonportable-cfstrings def mno_omit_leaf_frame_pointer : Flag<["-"], "mno-omit-leaf-frame-pointer">, Group<m_Group>; def momit_leaf_frame_pointer : Flag<["-"], "momit-leaf-frame-pointer">, Group<m_Group>, HelpText<"Omit frame pointer setup for leaf functions">, Flags<[CC1Option]>; +def moslib_EQ : Joined<["-"], "moslib=">, Group<m_Group>; def mpascal_strings : Flag<["-"], "mpascal-strings">, Group<m_Group>; def mred_zone : Flag<["-"], "mred-zone">, Group<m_Group>; def mregparm_EQ : Joined<["-"], "mregparm=">, Group<m_Group>; @@ -869,8 +950,12 @@ def mfma : Flag<["-"], "mfma">, Group<m_x86_Features_Group>; def mxop : Flag<["-"], "mxop">, Group<m_x86_Features_Group>; def mf16c : Flag<["-"], "mf16c">, Group<m_x86_Features_Group>; def mrtm : Flag<["-"], "mrtm">, Group<m_x86_Features_Group>; +def mprfchw : Flag<["-"], "mprfchw">, Group<m_x86_Features_Group>; +def mrdseed : Flag<["-"], "mrdseed">, Group<m_x86_Features_Group>; def mips16 : Flag<["-"], "mips16">, Group<m_Group>; def mno_mips16 : Flag<["-"], "mno-mips16">, Group<m_Group>; +def mxgot : Flag<["-"], "mxgot">, Group<m_Group>; +def mno_xgot : Flag<["-"], "mno-xgot">, Group<m_Group>; def mdsp : Flag<["-"], "mdsp">, Group<m_Group>; def mno_dsp : Flag<["-"], "mno-dsp">, Group<m_Group>; def mdspr2 : Flag<["-"], "mdspr2">, Group<m_Group>; @@ -883,6 +968,7 @@ def mips64 : Flag<["-"], "mips64">, Group<mips_CPUs_Group>, HelpText<"Equivalent to -march=mips64">, Flags<[HelpHidden]>; def mips64r2 : Flag<["-"], "mips64r2">, Group<mips_CPUs_Group>, HelpText<"Equivalent to -march=mips64r2">, Flags<[HelpHidden]>; +def module_file_info : Flag<["-"], "module-file-info">, Flags<[DriverOption,CC1Option]>, Group<Action_Group>; def mthumb : Flag<["-"], "mthumb">, Group<m_Group>; def mtune_EQ : Joined<["-"], "mtune=">, Group<m_Group>; def multi__module : Flag<["-"], "multi_module">; @@ -951,6 +1037,11 @@ def rewrite_objc : Flag<["-"], "rewrite-objc">, Flags<[DriverOption,CC1Option]>, def rewrite_legacy_objc : Flag<["-"], "rewrite-legacy-objc">, Flags<[DriverOption]>, HelpText<"Rewrite Legacy Objective-C source to C++">; def rdynamic : Flag<["-"], "rdynamic">; +def resource_dir : Separate<["-"], "resource-dir">, + Flags<[DriverOption, CC1Option, HelpHidden]>, + HelpText<"The directory which holds the compiler resource files">; +def resource_dir_EQ : Joined<["-"], "resource-dir=">, Flags<[DriverOption]>, + Alias<resource_dir>; def rpath : Separate<["-"], "rpath">, Flags<[LinkerInput]>; def rtlib_EQ : Joined<["-", "--"], "rtlib=">; def r : Flag<["-"], "r">; @@ -1100,7 +1191,7 @@ def _output_class_directory_EQ : Joined<["--"], "output-class-directory=">, Alia def _output_class_directory : Separate<["--"], "output-class-directory">, Alias<foutput_class_dir_EQ>; def _output_EQ : Joined<["--"], "output=">, Alias<o>; def _output : Separate<["--"], "output">, Alias<o>; -def _param : Separate<["--"], "param">; +def _param : Separate<["--"], "param">, Group<CompileOnly_Group>; def _param_EQ : Joined<["--"], "param=">, Alias<_param>; def _prefix_EQ : Joined<["--"], "prefix=">, Alias<B>; def _prefix : Separate<["--"], "prefix">, Alias<B>; diff --git a/include/clang/Driver/Phases.h b/include/clang/Driver/Phases.h index a0c42ea..4e0f40c 100644 --- a/include/clang/Driver/Phases.h +++ b/include/clang/Driver/Phases.h @@ -23,6 +23,10 @@ namespace phases { Link }; + enum { + MaxNumberOfPhases = Link + 1 + }; + const char *getPhaseName(ID Id); } // end namespace phases diff --git a/include/clang/Driver/Tool.h b/include/clang/Driver/Tool.h index c62e756..4c05d0a 100644 --- a/include/clang/Driver/Tool.h +++ b/include/clang/Driver/Tool.h @@ -50,6 +50,7 @@ public: virtual bool hasIntegratedAssembler() const { return false; } virtual bool hasIntegratedCPP() const = 0; virtual bool isLinkJob() const { return false; } + virtual bool isDsymutilJob() const { return false; } /// \brief Does this tool have "good" standardized diagnostics, or should the /// driver add an additional "command failed" diagnostic on failures. diff --git a/include/clang/Driver/ToolChain.h b/include/clang/Driver/ToolChain.h index 509e08d..ae9e397 100644 --- a/include/clang/Driver/ToolChain.h +++ b/include/clang/Driver/ToolChain.h @@ -10,8 +10,10 @@ #ifndef CLANG_DRIVER_TOOLCHAIN_H_ #define CLANG_DRIVER_TOOLCHAIN_H_ -#include "clang/Driver/Util.h" +#include "clang/Driver/Action.h" #include "clang/Driver/Types.h" +#include "clang/Driver/Util.h" +#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Triple.h" #include "llvm/Support/Path.h" @@ -47,6 +49,7 @@ public: private: const Driver &D; const llvm::Triple Triple; + const ArgList &Args; /// The list of toolchain specific path prefixes to search for /// files. @@ -56,8 +59,20 @@ private: /// programs. path_list ProgramPaths; + mutable OwningPtr<Tool> Clang; + mutable OwningPtr<Tool> Assemble; + mutable OwningPtr<Tool> Link; + Tool *getClang() const; + Tool *getAssemble() const; + Tool *getLink() const; + Tool *getClangAs() const; + protected: - ToolChain(const Driver &D, const llvm::Triple &T); + ToolChain(const Driver &D, const llvm::Triple &T, const ArgList &Args); + + virtual Tool *buildAssembler() const; + virtual Tool *buildLinker() const; + virtual Tool *getTool(Action::ActionClass AC) const; /// \name Utilities for implementing subclasses. ///@{ @@ -111,10 +126,8 @@ public: return 0; } - /// SelectTool - Choose a tool to use to handle the action \p JA with the - /// given \p Inputs. - virtual Tool &SelectTool(const Compilation &C, const JobAction &JA, - const ActionList &Inputs) const = 0; + /// Choose a tool to use to handle the action \p JA. + Tool *SelectTool(const JobAction &JA) const; // Helper methods @@ -138,6 +151,9 @@ public: /// by default. virtual bool IsIntegratedAssemblerDefault() const { return false; } + /// \brief Check if the toolchain should use the integrated assembler. + bool useIntegratedAs() const; + /// IsStrictAliasingDefault - Does this tool chain use -fstrict-aliasing by /// default. virtual bool IsStrictAliasingDefault() const { return true; } @@ -147,7 +163,7 @@ public: /// IsObjCDefaultSynthPropertiesDefault - Does this tool chain enable /// -fobjc-default-synthesize-properties by default. - virtual bool IsObjCDefaultSynthPropertiesDefault() const { return false; } + virtual bool IsObjCDefaultSynthPropertiesDefault() const { return true; } /// IsEncodeExtendedBlockSignatureDefault - Does this tool chain enable /// -fencode-extended-block-signature by default. @@ -233,9 +249,9 @@ public: virtual void AddClangSystemIncludeArgs(const ArgList &DriverArgs, ArgStringList &CC1Args) const; - // addClangTargetOptions - Add options that need to be passed to cc1 for - // this target. - virtual void addClangTargetOptions(ArgStringList &CC1Args) const; + /// \brief Add options that need to be passed to cc1 for this target. + virtual void addClangTargetOptions(const ArgList &DriverArgs, + ArgStringList &CC1Args) const; // GetRuntimeLibType - Determine the runtime library type to use with the // given compilation arguments. diff --git a/include/clang/Driver/Types.def b/include/clang/Driver/Types.def index 318c55a..42f0709 100644 --- a/include/clang/Driver/Types.def +++ b/include/clang/Driver/Types.def @@ -30,7 +30,7 @@ // The fourth value is the suffix to use when creating temporary files // of this type, or null if unspecified. -// The fifth value is a string containt option flags. Valid values: +// The fifth value is a string containing option flags. Valid values: // a - The type should only be assembled. // p - The type should only be precompiled. // u - The type can be user specified (with -x). @@ -80,6 +80,7 @@ TYPE("lto-bc", LTO_BC, INVALID, "o", "") // Misc. TYPE("ast", AST, INVALID, "ast", "u") +TYPE("pcm", ModuleFile, INVALID, "pcm", "u") TYPE("plist", Plist, INVALID, "plist", "") TYPE("rewritten-objc", RewrittenObjC,INVALID, "cpp", "") TYPE("rewritten-legacy-objc", RewrittenLegacyObjC,INVALID, "cpp", "") diff --git a/include/clang/Driver/Types.h b/include/clang/Driver/Types.h index d28ca88..18cd2d5 100644 --- a/include/clang/Driver/Types.h +++ b/include/clang/Driver/Types.h @@ -11,6 +11,7 @@ #define CLANG_DRIVER_TYPES_H_ #include "clang/Driver/Phases.h" +#include "llvm/ADT/SmallVector.h" namespace clang { namespace driver { @@ -73,14 +74,12 @@ namespace types { /// specified type name. ID lookupTypeForTypeSpecifier(const char *Name); - /// getNumCompilationPhases - Return the complete number of phases - /// to be done for this type. - unsigned getNumCompilationPhases(ID Id); + /// getCompilationPhases - Get the list of compilation phases ('Phases') to be + /// done for type 'Id'. + void getCompilationPhases( + ID Id, + llvm::SmallVector<phases::ID, phases::MaxNumberOfPhases> &Phases); - /// getCompilationPhase - Return the \p N th compilation phase to - /// be done for this type. - phases::ID getCompilationPhase(ID Id, unsigned N); - /// lookupCXXTypeForCType - Lookup CXX input type that corresponds to given /// C type (used for clang++ emulation of g++ behaviour) ID lookupCXXTypeForCType(ID Id); diff --git a/include/clang/Driver/Util.h b/include/clang/Driver/Util.h index 65aef4b..06b82b9 100644 --- a/include/clang/Driver/Util.h +++ b/include/clang/Driver/Util.h @@ -11,14 +11,19 @@ #define CLANG_DRIVER_UTIL_H_ #include "clang/Basic/LLVM.h" +#include "llvm/ADT/DenseMap.h" namespace clang { namespace driver { class Action; + class JobAction; /// ArgStringList - Type used for constructing argv lists for subprocesses. typedef SmallVector<const char*, 16> ArgStringList; + /// ArgStringMap - Type used to map a JobAction to its result file. + typedef llvm::DenseMap<const JobAction*, const char*> ArgStringMap; + /// ActionList - Type used for lists of actions. typedef SmallVector<Action*, 3> ActionList; |