diff options
author | dim <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
commit | 39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df (patch) | |
tree | a9243275843fbeaa590afc07ee888e006b8d54ea /include/clang/Driver | |
parent | 69b4eca4a4255ba43baa5c1d9bbdec3ec17f479e (diff) | |
download | FreeBSD-src-39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df.zip FreeBSD-src-39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df.tar.gz |
Vendor import of clang trunk r126079:
http://llvm.org/svn/llvm-project/cfe/trunk@126079
Diffstat (limited to 'include/clang/Driver')
-rw-r--r-- | include/clang/Driver/ArgList.h | 2 | ||||
-rw-r--r-- | include/clang/Driver/CC1AsOptions.td | 4 | ||||
-rw-r--r-- | include/clang/Driver/CC1Options.td | 133 | ||||
-rw-r--r-- | include/clang/Driver/Driver.h | 22 | ||||
-rw-r--r-- | include/clang/Driver/DriverDiagnostic.h | 2 | ||||
-rw-r--r-- | include/clang/Driver/HostInfo.h | 2 | ||||
-rw-r--r-- | include/clang/Driver/OptTable.h | 4 | ||||
-rw-r--r-- | include/clang/Driver/Options.td | 76 | ||||
-rw-r--r-- | include/clang/Driver/ToolChain.h | 39 | ||||
-rw-r--r-- | include/clang/Driver/Types.def | 1 |
10 files changed, 224 insertions, 61 deletions
diff --git a/include/clang/Driver/ArgList.h b/include/clang/Driver/ArgList.h index 257b653..0fcf821 100644 --- a/include/clang/Driver/ArgList.h +++ b/include/clang/Driver/ArgList.h @@ -288,7 +288,7 @@ namespace driver { unsigned NumInputArgStrings; public: - InputArgList(const char **ArgBegin, const char **ArgEnd); + InputArgList(const char* const *ArgBegin, const char* const *ArgEnd); ~InputArgList(); virtual const char *getArgString(unsigned Index) const { diff --git a/include/clang/Driver/CC1AsOptions.td b/include/clang/Driver/CC1AsOptions.td index 5c08dc6..50472ff 100644 --- a/include/clang/Driver/CC1AsOptions.td +++ b/include/clang/Driver/CC1AsOptions.td @@ -46,6 +46,7 @@ def _help : Flag<"--help">, Alias<help>; def version : Flag<"-version">, HelpText<"Print the assembler version">; def _version : Flag<"--version">, Alias<version>; +def v : Flag<"-v">, Alias<version>; // Generic forwarding to LLVM options. This should only be used for debugging // and experimental features. @@ -69,3 +70,6 @@ def show_inst : Flag<"-show-inst">, def relax_all : Flag<"-relax-all">, HelpText<"Relax all fixups (for performance testing)">; + +def no_exec_stack : Flag<"--noexecstack">, + HelpText<"Mark the file as not needing an executable stack">;
\ No newline at end of file diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td index fd40aa0..a2c69f9 100644 --- a/include/clang/Driver/CC1Options.td +++ b/include/clang/Driver/CC1Options.td @@ -36,34 +36,20 @@ def triple_EQ : Joined<"-triple=">, Alias<triple>; // Analyzer Options //===----------------------------------------------------------------------===// -def analysis_CFGDump : Flag<"-cfg-dump">, - HelpText<"Display Control-Flow Graphs">; -def analysis_CFGView : Flag<"-cfg-view">, - HelpText<"View Control-Flow Graphs using GraphViz">; def analysis_UnoptimizedCFG : Flag<"-unoptimized-cfg">, HelpText<"Generate unoptimized CFGs for all analyses">; -def analysis_DisplayLiveVariables : Flag<"-dump-live-variables">, - HelpText<"Print results of live variable analysis">; -def analysis_LLVMConventionChecker : Flag<"-analyzer-check-llvm-conventions">, - HelpText<"Check code for LLVM codebase conventions (domain-specific)">; -def analysis_SecuritySyntacticChecks : Flag<"-analyzer-check-security-syntactic">, - HelpText<"Perform quick security checks that require no data flow">; -def analysis_WarnDeadStores : Flag<"-analyzer-check-dead-stores">, - HelpText<"Warn about stores to dead variables">; +def analysis_CFGAddImplicitDtors : Flag<"-cfg-add-implicit-dtors">, + HelpText<"Add C++ implicit destructors to CFGs for all analyses">; +def analysis_CFGAddInitializers : Flag<"-cfg-add-initializers">, + HelpText<"Add C++ initializers to CFGs for all analyses">; def analysis_WarnUninitVals : Flag<"-warn-uninit-values">, HelpText<"Warn about uses of uninitialized variables">; -def analysis_WarnObjCMethSigs : Flag<"-analyzer-check-objc-methodsigs">, - HelpText<"Warn about Objective-C method signatures with type incompatibilities">; -def analysis_WarnObjCDealloc : Flag<"-analyzer-check-objc-missing-dealloc">, - HelpText<"Warn about Objective-C classes that lack a correct implementation of -dealloc">; -def analysis_WarnObjCUnusedIvars : Flag<"-analyzer-check-objc-unused-ivars">, - HelpText<"Warn about private ivars that are never used">; 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_WarnIdempotentOps : Flag<"-analyzer-check-idempotent-operations">, - HelpText<"Warn about idempotent operations">; +def analysis_AnalyzerStats : Flag<"-analyzer-stats">, + HelpText<"Emit warnings with analyzer statistics">; +def analysis_WarnBufferOverflows : Flag<"-analyzer-check-buffer-overflows">, + HelpText<"Warn about buffer overflows">; def analyzer_store : Separate<"-analyzer-store">, HelpText<"Source Code Analysis - Abstract Memory Store Models">; @@ -82,7 +68,7 @@ def analyzer_output_EQ : Joined<"-analyzer-output=">, def analyzer_opt_analyze_headers : Flag<"-analyzer-opt-analyze-headers">, HelpText<"Force the static analyzer to analyze functions defined in header files">; def analyzer_opt_analyze_nested_blocks : Flag<"-analyzer-opt-analyze-nested-blocks">, - HelpText<"Analyze the definitions of blocks in addition to functions">; + HelpText<"Analyze the definitions of blocks in addition to functions">; def analyzer_display_progress : Flag<"-analyzer-display-progress">, HelpText<"Emit verbose output about the analyzer's progress">; def analyzer_experimental_checks : Flag<"-analyzer-experimental-checks">, @@ -97,6 +83,8 @@ def analyzer_eagerly_assume : Flag<"-analyzer-eagerly-assume">, HelpText<"Eagerly assume the truth/falseness of some symbolic constraints">; def analyzer_no_purge_dead : Flag<"-analyzer-no-purge-dead">, HelpText<"Don't remove dead symbols, bindings, and constraints before processing a statement">; +def analyzer_no_eagerly_trim_egraph : Flag<"-analyzer-no-eagerly-trim-egraph">, + HelpText<"Don't eagerly remove uninteresting ExplodedNodes from the ExplodedGraph">; def trim_egraph : Flag<"-trim-egraph">, HelpText<"Only show error-related paths in the analysis graph">; def analyzer_viz_egraph_graphviz : Flag<"-analyzer-viz-egraph-graphviz">, @@ -106,10 +94,20 @@ def analyzer_viz_egraph_ubigraph : Flag<"-analyzer-viz-egraph-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">; + 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_checker : Separate<"-analyzer-checker">, + HelpText<"Choose analyzer checkers to enable">; +def analyzer_checker_EQ : Joined<"-analyzer-checker=">, + Alias<analyzer_checker>; + +def analyzer_disable_checker : Separate<"-analyzer-disable-checker">, + HelpText<"Choose analyzer checkers to disable">; +def analyzer_disable_checker_EQ : Joined<"-analyzer-disable-checker=">, + Alias<analyzer_disable_checker>; + //===----------------------------------------------------------------------===// // CodeGen Options //===----------------------------------------------------------------------===// @@ -125,6 +123,8 @@ def dwarf_debug_flags : Separate<"-dwarf-debug-flags">, def g : Flag<"-g">, HelpText<"Generate source level debug information">; def fcatch_undefined_behavior : Flag<"-fcatch-undefined-behavior">, HelpText<"Generate runtime checks for undefined behavior.">; +def flimit_debug_info : Flag<"-flimit-debug-info">, + HelpText<"Limit debug information produced to reduce size of debug binary">; def fno_common : Flag<"-fno-common">, HelpText<"Compile common globals like normal definitions">; def no_implicit_float : Flag<"-no-implicit-float">, @@ -143,6 +143,8 @@ def fdata_sections : Flag<"-fdata-sections">, HelpText<"Place each data in its own section (ELF Only)">; def funroll_loops : Flag<"-funroll-loops">, HelpText<"Turn on loop unroller">; +def relaxed_aliasing : Flag<"-relaxed-aliasing">, + HelpText<"Turn off Type Based Alias Analysis">; def masm_verbose : Flag<"-masm-verbose">, HelpText<"Generate verbose assembly output">; def mcode_model : Separate<"-mcode-model">, @@ -161,6 +163,8 @@ def momit_leaf_frame_pointer : Flag<"-momit-leaf-frame-pointer">, HelpText<"Omit frame pointer setup for leaf functions.">; def msoft_float : Flag<"-msoft-float">, HelpText<"Use software floating point">; +def mregparm : Separate<"-mregparm">, + HelpText<"Limit the number of registers available for integer arguments">; def mrelax_all : Flag<"-mrelax-all">, HelpText<"Relax all machine instructions">; def mrelocation_model : Separate<"-mrelocation-model">, @@ -169,8 +173,11 @@ def munwind_tables : Flag<"-munwind-tables">, HelpText<"Generate unwinding tables for all functions">; def mconstructor_aliases : Flag<"-mconstructor-aliases">, HelpText<"Emit complete constructors and destructors as aliases when possible">; +def mms_bitfields : Flag<"-mms-bitfields">, + HelpText<"Set the default structure layout to be compatible with the Microsoft compiler standard.">; def O : Joined<"-O">, HelpText<"Optimization level">; def Os : Flag<"-Os">, HelpText<"Optimize for size">; +def pg : Flag<"-pg">, HelpText<"Enable mcount instrumentation">; //===----------------------------------------------------------------------===// // Dependency Output Options @@ -180,6 +187,10 @@ def dependency_file : Separate<"-dependency-file">, HelpText<"Filename (or -) to write dependency output to">; def sys_header_deps : Flag<"-sys-header-deps">, HelpText<"Include system headers in dependency output">; +def header_include_file : Separate<"-header-include-file">, + HelpText<"Filename (or -) to write header include output to">; +def H : Flag<"-H">, + HelpText<"Show header includes and nesting depth">; def MQ : Separate<"-MQ">, HelpText<"Specify target to quote for dependency">; def MT : Separate<"-MT">, HelpText<"Specify target for dependency">; def MP : Flag<"-MP">, @@ -203,7 +214,6 @@ def fno_caret_diagnostics : Flag<"-fno-caret-diagnostics">, HelpText<"Do not include source line and caret with diagnostics">; def fno_diagnostics_fixit_info : Flag<"-fno-diagnostics-fixit-info">, HelpText<"Do not include fixit information in diagnostics">; -def fdiagnostics_binary : Flag<"-fdiagnostics-binary">; def w : Flag<"-w">, HelpText<"Suppress all warnings">; def pedantic : Flag<"-pedantic">; def pedantic_errors : Flag<"-pedantic-errors">; @@ -221,7 +231,7 @@ 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<"<N>">, HelpText<"Set the tab stop distance.">; def ferror_limit : Separate<"-ferror-limit">, MetaVarName<"<N>">, @@ -260,8 +270,6 @@ def remap_file : Separate<"-remap-file">, HelpText<"Replace the contents of the <from> file with the contents of the <to> file">; def code_completion_at_EQ : Joined<"-code-completion-at=">, Alias<code_completion_at>; -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">, @@ -274,17 +282,16 @@ def help : Flag<"-help">, HelpText<"Print this help text">; def _help : Flag<"--help">, Alias<help>; def x : Separate<"-x">, HelpText<"Input language type">; -def cxx_inheritance_view : Separate<"-cxx-inheritance-view">, - MetaVarName<"<class name>">, - HelpText<"View C++ inheritance for a specified class">; def o : Separate<"-o">, MetaVarName<"<path>">, HelpText<"Specify output file">; def load : Separate<"-load">, MetaVarName<"<dsopath>">, HelpText<"Load the named plugin (dynamic shared object)">; def plugin : Separate<"-plugin">, MetaVarName<"<name>">, - HelpText<"Use the named plugin action (use \"help\" to list available options)">; -def plugin_arg : JoinedAndSeparate<"-plugin-arg-">, + HelpText<"Use the named plugin action instead of the default action (use \"help\" to list available options)">; +def plugin_arg : JoinedAndSeparate<"-plugin-arg-">, MetaVarName<"<name> <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">, @@ -323,6 +330,8 @@ def ast_print_xml : Flag<"-ast-print-xml">, HelpText<"Build ASTs and then print them in XML format">; def ast_dump : Flag<"-ast-dump">, HelpText<"Build ASTs and then debug dump them">; +def ast_dump_xml : Flag<"-ast-dump-xml">, + HelpText<"Build ASTs and then debug dump them in a verbose XML format">; def ast_view : Flag<"-ast-view">, HelpText<"Build ASTs and view them with GraphViz">; def boostcon : Flag<"-boostcon">, @@ -359,6 +368,11 @@ def create_module : Flag<"-create-module">, def import_module : Separate<"-import-module">, HelpText<"Import a module definition file">; +def working_directory : JoinedOrSeparate<"-working-directory">, + HelpText<"Resolve file paths relative to the specified directory">; +def working_directory_EQ : Joined<"-working-directory=">, + Alias<working_directory>; + def relocatable_pch : Flag<"-relocatable-pch">, HelpText<"Whether to build a relocatable precompiled header">; def chained_pch : Flag<"-chained-pch">, @@ -401,11 +415,13 @@ def femit_all_decls : Flag<"-femit-all-decls">, HelpText<"Emit all declarations, even if unused">; def fblocks : Flag<"-fblocks">, HelpText<"enable the 'blocks' language feature">; -def fheinous_gnu_extensions : Flag<"-fheinous-gnu-extensions">; +def fheinous_gnu_extensions : Flag<"-fheinous-gnu-extensions">; def fexceptions : Flag<"-fexceptions">, HelpText<"Enable support for exception handling">; def fsjlj_exceptions : Flag<"-fsjlj-exceptions">, HelpText<"Use SjLj style exceptions">; +def fno_objc_exceptions : Flag<"-fno-objc-exceptions">, + HelpText<"Disable Objective-C exceptions">; def ffreestanding : Flag<"-ffreestanding">, HelpText<"Assert that the compilation takes place in a freestanding environment">; def fgnu_runtime : Flag<"-fgnu-runtime">, @@ -418,6 +434,8 @@ def fmath_errno : Flag<"-fmath-errno">, HelpText<"Require math functions to indicate errors by setting errno">; def fms_extensions : Flag<"-fms-extensions">, HelpText<"Accept some non-standard constructs used in Microsoft header files ">; +def fmsc_version : Joined<"-fmsc-version=">, + HelpText<"Version of the Microsoft C/C++ compiler to report in _MSC_VER (0 = don't define it (default))">; def fborland_extensions : Flag<"-fborland-extensions">, HelpText<"Accept non-standard constructs supported by the Borland compiler">; def main_file_name : Separate<"-main-file-name">, @@ -431,7 +449,7 @@ def fno_operator_names : Flag<"-fno-operator-names">, def fno_signed_char : Flag<"-fno-signed-char">, HelpText<"Char is unsigned">; def fno_spell_checking : Flag<"-fno-spell-checking">, - HelpText<"Disable spell-checking">; + HelpText<"Disable spell-checking">; def fno_use_cxa_atexit : Flag<"-fno-use-cxa-atexit">, HelpText<"Don't use __cxa_atexit for calling destructors">; def fconstant_string_class : Separate<"-fconstant-string-class">, @@ -443,16 +461,21 @@ def fobjc_gc : Flag<"-fobjc-gc">, HelpText<"Enable Objective-C garbage collection">; def fobjc_gc_only : Flag<"-fobjc-gc-only">, HelpText<"Use GC exclusively for Objective-C related memory management">; +def fapple_kext : Flag<"-fapple-kext">, + HelpText<"Use Apple's kernel extensions ABI">; def fobjc_dispatch_method_EQ : Joined<"-fobjc-dispatch-method=">, HelpText<"Objective-C dispatch method to use">; +def fobjc_default_synthesize_properties : Flag<"-fobjc-default-synthesize-properties">, + HelpText<"enable the default synthesis of Objective-C properties">; def print_ivar_layout : Flag<"-print-ivar-layout">, HelpText<"Enable Objective-C Ivar layout bitmap print trace">; def fobjc_nonfragile_abi : Flag<"-fobjc-nonfragile-abi">, HelpText<"enable objective-c's nonfragile abi">; -def fobjc_nonfragile_abi2 : Flag<"-fobjc-nonfragile-abi2">, - HelpText<"enable objective-c's enhanced nonfragile abi">; def ftrapv : Flag<"-ftrapv">, HelpText<"Trap on integer overflow">; +def ftrapv_handler : Separate<"-ftrapv-handler">, + MetaVarName<"<function name>">, + HelpText<"Specify the function to be called on overflow.">; def fwrapv : Flag<"-fwrapv">, HelpText<"Treat signed integer overflow as two's complement">; def pic_level : Separate<"-pic-level">, @@ -465,8 +488,14 @@ def fno_rtti : Flag<"-fno-rtti">, HelpText<"Disable generation of rtti information">; def fno_validate_pch : Flag<"-fno-validate-pch">, HelpText<"Disable validation of precompiled headers">; +def dump_deserialized_pch_decls : Flag<"-dump-deserialized-decls">, + HelpText<"Dump declarations that are deserialized from PCH, for testing">; +def error_on_deserialized_pch_decl : Separate<"-error-on-deserialized-decl">, + HelpText<"Emit error if a specific declaration is deserialized from PCH, for testing">; def fshort_wchar : Flag<"-fshort-wchar">, HelpText<"Force wchar_t to be a short unsigned int">; +def fshort_enums : Flag<"-fshort-enums">, + HelpText<"Allocate to an enum type only as many bytes as it needs for the declared range of possible values">; def static_define : Flag<"-static-define">, HelpText<"Should __STATIC__ be defined">; def stack_protector : Separate<"-stack-protector">, @@ -477,6 +506,11 @@ def fvisibility_inlines_hidden : Flag<"-fvisibility-inlines-hidden">, HelpText<"Give inline C++ member functions default visibility by default">; def ftemplate_depth : Separate<"-ftemplate-depth">, HelpText<"Maximum depth of recursive template instantiation">; +def Wlarge_by_value_copy : Separate<"-Wlarge-by-value-copy">, + HelpText<"Warn if a function definition returns or accepts an object larger " + "in bytes that a given value">; +def Wlarge_by_value_copy_EQ : Joined<"-Wlarge-by-value-copy=">, + Alias<Wlarge_by_value_copy>; def trigraphs : Flag<"-trigraphs">, HelpText<"Process trigraph sequences">; def fwritable_strings : Flag<"-fwritable-strings">, @@ -516,6 +550,8 @@ def iwithprefixbefore : JoinedOrSeparate<"-iwithprefixbefore">, HelpText<"Set directory to include search path with prefix">; def isysroot : JoinedOrSeparate<"-isysroot">, MetaVarName<"<dir>">, HelpText<"Set the system root directory (usually /)">; +def cxx_system_include : Separate<"-cxx-system-include">, + HelpText<"Add a system #include directory for the C++ standard library">; def v : Flag<"-v">, HelpText<"Enable verbose output">; //===----------------------------------------------------------------------===// @@ -543,7 +579,7 @@ def undef : Flag<"-undef">, MetaVarName<"<macro>">, HelpText<"undef all system defines">; def detailed_preprocessing_record : Flag<"-detailed-preprocessing-record">, HelpText<"include a detailed record of preprocessing actions">; - + //===----------------------------------------------------------------------===// // Preprocessed Output Options //===----------------------------------------------------------------------===// @@ -558,5 +594,22 @@ def dM : Flag<"-dM">, HelpText<"Print macro definitions in -E mode instead of normal output">; def dD : Flag<"-dD">, HelpText<"Print macro definitions in -E mode in addition to normal output">; -def H : Flag<"-H">, - HelpText<"Show header includes and nesting depth">; + +//===----------------------------------------------------------------------===// +// OpenCL Options +//===----------------------------------------------------------------------===// + +def cl_opt_disable : Flag<"-cl-opt-disable">, + HelpText<"OpenCL only. This option disables all optimizations. The default is optimizations are enabled.">; +def cl_single_precision_constant : Flag<"-cl-single-precision-constant">, + HelpText<"OpenCL only. Treat double precision floating-point constant as single precision constant.">; +def cl_finite_math_only : Flag<"-cl-finite-math-only">, + HelpText<"OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf.">; +def cl_unsafe_math_optimizations : Flag<"-cl-unsafe-math-optimizations">, + HelpText<"OpenCL only. Allow unsafe floating-point optimizations. Also implies -cl-no-signed-zeros and -cl-mad-enable">; +def cl_fast_relaxed_math : Flag<"-cl-fast-relaxed-math">, + HelpText<"OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines __FAST_RELAXED_MATH__">; +def cl_mad_enable : Flag<"-cl-mad-enable">, + HelpText<"OpenCL only. Enable less precise MAD instructions to be generated.">; +def cl_std_EQ : Joined<"-cl-std=">, + HelpText<"OpenCL language standard to compile for">; diff --git a/include/clang/Driver/Driver.h b/include/clang/Driver/Driver.h index 28eff4f..03fa0ef 100644 --- a/include/clang/Driver/Driver.h +++ b/include/clang/Driver/Driver.h @@ -17,7 +17,7 @@ #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Triple.h" -#include "llvm/System/Path.h" // FIXME: Kill when CompilationInfo +#include "llvm/Support/Path.h" // FIXME: Kill when CompilationInfo // lands. #include <list> #include <set> @@ -74,7 +74,8 @@ public: /// functionality. /// FIXME: This type of customization should be removed in favor of the /// universal driver when it is ready. - std::string PrefixDir; + typedef llvm::SmallVector<std::string, 4> prefix_list; + prefix_list PrefixDirs; /// Default host triple. std::string DefaultHostTriple; @@ -92,12 +93,12 @@ public: /// Information about the host which can be overriden by the user. std::string HostBits, HostMachine, HostSystem, HostRelease; - /// Name to use when calling the generic gcc. - std::string CCCGenericGCCName; - /// The file to log CC_PRINT_OPTIONS output to, if enabled. const char *CCPrintOptionsFilename; + /// The file to log CC_PRINT_HEADERS output to, if enabled. + const char *CCPrintHeadersFilename; + /// Whether the driver should follow g++ like behavior. unsigned CCCIsCXX : 1; @@ -111,7 +112,14 @@ public: /// CCPrintOptionsFilename or to stderr. unsigned CCPrintOptions : 1; + /// Set CC_PRINT_HEADERS mode, which causes the frontend to log header include + /// information to CCPrintHeadersFilename or to stderr. + unsigned CCPrintHeaders : 1; + private: + /// Name to use when calling the generic gcc. + std::string CCCGenericGCCName; + /// Whether to check that input files exist when constructing compilation /// jobs. unsigned CheckInputsExist : 1; @@ -157,6 +165,10 @@ public: /// @name Accessors /// @{ + /// Name to use when calling the generic gcc. + const std::string &getCCCGenericGCCName() const { return CCCGenericGCCName; } + + const OptTable &getOpts() const { return *Opts; } const Diagnostic &getDiags() const { return Diags; } diff --git a/include/clang/Driver/DriverDiagnostic.h b/include/clang/Driver/DriverDiagnostic.h index c20d807b..0733c51 100644 --- a/include/clang/Driver/DriverDiagnostic.h +++ b/include/clang/Driver/DriverDiagnostic.h @@ -15,7 +15,7 @@ namespace clang { namespace diag { enum { -#define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,SFINAE,CATEGORY) ENUM, +#define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,SFINAE,ACCESS,CATEGORY) ENUM, #define DRIVERSTART #include "clang/Basic/DiagnosticDriverKinds.inc" #undef DIAG diff --git a/include/clang/Driver/HostInfo.h b/include/clang/Driver/HostInfo.h index 04e7299..7285a48 100644 --- a/include/clang/Driver/HostInfo.h +++ b/include/clang/Driver/HostInfo.h @@ -71,6 +71,8 @@ const HostInfo *createOpenBSDHostInfo(const Driver &D, const llvm::Triple& Triple); const HostInfo *createFreeBSDHostInfo(const Driver &D, const llvm::Triple& Triple); +const HostInfo *createNetBSDHostInfo(const Driver &D, + const llvm::Triple& Triple); const HostInfo *createMinixHostInfo(const Driver &D, const llvm::Triple& Triple); const HostInfo *createDragonFlyHostInfo(const Driver &D, diff --git a/include/clang/Driver/OptTable.h b/include/clang/Driver/OptTable.h index 08b483c..3befe1d 100644 --- a/include/clang/Driver/OptTable.h +++ b/include/clang/Driver/OptTable.h @@ -170,8 +170,8 @@ namespace options { /// \param MissingArgCount - On error, the number of missing options. /// \return - An InputArgList; on error this will contain all the options /// which could be parsed. - InputArgList *ParseArgs(const char **ArgBegin, - const char **ArgEnd, + InputArgList *ParseArgs(const char* const *ArgBegin, + const char* const *ArgEnd, unsigned &MissingArgIndex, unsigned &MissingArgCount) const; diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index c51d12a..7e3ddc6 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -38,6 +38,7 @@ def u_Group : OptionGroup<"<u group>">; def pedantic_Group : OptionGroup<"<pedantic group>">, Group<CompileOnly_Group>; +def reserved_lib_Group : OptionGroup<"<reserved libs group>">; // Temporary groups for clang options which we know we don't support, // but don't want to verbosely warn the user about. @@ -195,6 +196,7 @@ def allowable__client : Separate<"-allowable_client">; def ansi : Flag<"-ansi">, Group<a_Group>; def arch__errors__fatal : Flag<"-arch_errors_fatal">; def arch : Separate<"-arch">, Flags<[DriverOption]>; +def arch__only : Separate<"-arch_only">; def a : Joined<"-a">, Group<a_Group>; def bind__at__load : Flag<"-bind_at_load">; def bundle__loader : Separate<"-bundle_loader">; @@ -213,7 +215,7 @@ def dD : Flag<"-dD">, Group<d_Group>; def dM : Flag<"-dM">, Group<d_Group>; def dead__strip : Flag<"-dead_strip">; def dependency_file : Separate<"-dependency-file">; -def dumpmachine : Flag<"-dumpmachine">, Flags<[Unsupported]>; +def dumpmachine : Flag<"-dumpmachine">; def dumpspecs : Flag<"-dumpspecs">, Flags<[Unsupported]>; def dumpversion : Flag<"-dumpversion">; def dylib__file : Separate<"-dylib_file">; @@ -233,9 +235,13 @@ def fPIC : Flag<"-fPIC">, Group<f_Group>; def fPIE : Flag<"-fPIE">, Group<f_Group>; def fno_PIE : Flag<"-fno-PIE">, Group<f_Group>; def faccess_control : Flag<"-faccess-control">, Group<f_Group>; +def fallow_unsupported : Flag<"-fallow-unsupported">, Group<f_Group>; def fapple_kext : Flag<"-fapple-kext">, Group<f_Group>; def fasm : Flag<"-fasm">, Group<f_Group>; -def fasm_blocks : Flag<"-fasm-blocks">, Group<clang_ignored_f_Group>; + +def fasm_blocks : Flag<"-fasm-blocks">, Group<f_Group>; +def fno_asm_blocks : Flag<"-fno-asm-blocks">, Group<f_Group>; + def fassume_sane_operator_new : Flag<"-fassume-sane-operator-new">, Group<f_Group>; def fastcp : Flag<"-fastcp">, Group<f_Group>; def fastf : Flag<"-fastf">, Group<f_Group>; @@ -259,13 +265,13 @@ def fconstant_string_class_EQ : Joined<"-fconstant-string-class=">, Group<f_Grou def fcreate_profile : Flag<"-fcreate-profile">, Group<f_Group>; def fdebug_pass_arguments : Flag<"-fdebug-pass-arguments">, Group<f_Group>; def fdebug_pass_structure : Flag<"-fdebug-pass-structure">, Group<f_Group>; -def fdiagnostics_binary : Flag<"-fdiagnostics-binary">, Group<f_Group>, Flags<[HelpHidden]>; def fdiagnostics_fixit_info : Flag<"-fdiagnostics-fixit-info">, Group<f_Group>; def fdiagnostics_print_source_range_info : Flag<"-fdiagnostics-print-source-range-info">, Group<f_Group>; def fdiagnostics_parseable_fixits : Flag<"-fdiagnostics-parseable-fixits">, Group<f_Group>; def fdiagnostics_show_option : Flag<"-fdiagnostics-show-option">, Group<f_Group>; def fdiagnostics_show_category_EQ : Joined<"-fdiagnostics-show-category=">, Group<f_Group>; def fdollars_in_identifiers : Flag<"-fdollars-in-identifiers">, Group<f_Group>; +def felide_constructors : Flag<"-felide-constructors">, Group<f_Group>; def feliminate_unused_debug_symbols : Flag<"-feliminate-unused-debug-symbols">, Group<f_Group>; def femit_all_decls : Flag<"-femit-all-decls">, Group<f_Group>; def fencoding_EQ : Joined<"-fencoding=">, Group<f_Group>; @@ -274,6 +280,10 @@ def fextdirs_EQ : Joined<"-fextdirs=">, Group<f_Group>; def fhosted : Flag<"-fhosted">, Group<f_Group>; def ffast_math : Flag<"-ffast-math">, Group<clang_ignored_f_Group>; def ffinite_math_only : Flag<"-ffinite-math-only">, Group<clang_ignored_f_Group>; + +def ffor_scope : Flag<"-ffor-scope">, Group<f_Group>; +def fno_for_scope : Flag<"-fno-for-scope">, Group<f_Group>; + def ffreestanding : Flag<"-ffreestanding">, Group<f_Group>; def fgnu_keywords : Flag<"-fgnu-keywords">, Group<f_Group>; def fgnu_runtime : Flag<"-fgnu-runtime">, Group<f_Group>; @@ -286,14 +296,17 @@ def finstrument_functions : Flag<"-finstrument-functions">, Group<f_Group>; def fkeep_inline_functions : Flag<"-fkeep-inline-functions">, Group<clang_ignored_f_Group>; def flat__namespace : Flag<"-flat_namespace">; def flax_vector_conversions : Flag<"-flax-vector-conversions">, Group<f_Group>; +def flimit_debug_info : Flag<"-flimit-debug-info">, Group<f_Group>, + HelpText<"Limit debug information produced to reduce size of debug binary">; def flimited_precision_EQ : Joined<"-flimited-precision=">, Group<f_Group>; def flto : Flag<"-flto">, Group<f_Group>; -def fmacro_backtrace_limit_EQ : Joined<"-fmacro-backtrace-limit=">, +def fmacro_backtrace_limit_EQ : Joined<"-fmacro-backtrace-limit=">, Group<f_Group>; def fmath_errno : Flag<"-fmath-errno">, Group<f_Group>; 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>; +def fmsc_version : Joined<"-fmsc-version=">, Group<f_Group>; def fmudflapth : Flag<"-fmudflapth">, Group<f_Group>; def fmudflap : Flag<"-fmudflap">, Group<f_Group>; def fnested_functions : Flag<"-fnested-functions">, Group<f_Group>; @@ -314,6 +327,7 @@ def fno_constant_cfstrings : Flag<"-fno-constant-cfstrings">, Group<f_Group>; def fno_diagnostics_fixit_info : Flag<"-fno-diagnostics-fixit-info">, Group<f_Group>; def fno_diagnostics_show_option : Flag<"-fno-diagnostics-show-option">, Group<f_Group>; def fno_dollars_in_identifiers : Flag<"-fno-dollars-in-identifiers">, Group<f_Group>; +def fno_elide_constructors : Flag<"-fno-elide-constructors">, Group<f_Group>; def fno_eliminate_unused_debug_symbols : Flag<"-fno-eliminate-unused-debug-symbols">, Group<f_Group>; def fno_exceptions : Flag<"-fno-exceptions">, Group<f_Group>; def fno_finite_math_only : Flag<"-fno-finite-math-only">, Group<clang_ignored_f_Group>; @@ -325,15 +339,19 @@ def fno_lax_vector_conversions : Flag<"-fno-lax-vector-conversions">, Group<f_Gr def fno_math_errno : Flag<"-fno-math-errno">, Group<f_Group>; def fno_merge_all_constants : Flag<"-fno-merge-all-constants">, Group<f_Group>; def fno_ms_extensions : Flag<"-fno-ms-extensions">, Group<f_Group>; +def fno_objc_default_synthesize_properties + : Flag<"-fno-objc-default-synthesize-properties">, Group<f_Group>; +def fno_objc_exceptions: Flag<"-fno-objc-exceptions">, Group<f_Group>; def fno_objc_legacy_dispatch : Flag<"-fno-objc-legacy-dispatch">, Group<f_Group>; def fno_omit_frame_pointer : Flag<"-fno-omit-frame-pointer">, Group<f_Group>; def fno_pascal_strings : Flag<"-fno-pascal-strings">, Group<f_Group>; def fno_rtti : Flag<"-fno-rtti">, Group<f_Group>; +def fno_short_enums : Flag<"-fno-short-enums">, Group<f_Group>; def fno_show_column : Flag<"-fno-show-column">, Group<f_Group>; def fno_show_source_location : Flag<"-fno-show-source-location">, Group<f_Group>; def fno_spell_checking : Flag<"-fno-spell-checking">, Group<f_Group>; def fno_stack_protector : Flag<"-fno-stack-protector">, Group<f_Group>; -def fno_strict_aliasing : Flag<"-fno-strict-aliasing">, Group<clang_ignored_f_Group>; +def fno_strict_aliasing : Flag<"-fno-strict-aliasing">, Group<f_Group>; def fno_threadsafe_statics : Flag<"-fno-threadsafe-statics">, Group<f_Group>; def fno_use_cxa_atexit : Flag<"-fno-use-cxa-atexit">, Group<f_Group>; def fno_unit_at_a_time : Flag<"-fno-unit-at-a-time">, Group<f_Group>; @@ -341,15 +359,23 @@ def fno_unwind_tables : Flag<"-fno-unwind-tables">, Group<f_Group>; def fno_verbose_asm : Flag<"-fno-verbose-asm">, Group<f_Group>; def fno_working_directory : Flag<"-fno-working-directory">, Group<f_Group>; def fno_zero_initialized_in_bss : Flag<"-fno-zero-initialized-in-bss">, Group<f_Group>; -def fobjc_abi_version_EQ : Joined<"-fobjc-abi-version=">, Group<f_Group>; def fobjc_atdefs : Flag<"-fobjc-atdefs">, Group<clang_ignored_f_Group>; def fobjc_call_cxx_cdtors : Flag<"-fobjc-call-cxx-cdtors">, Group<clang_ignored_f_Group>; +def fobjc_default_synthesize_properties : + Flag<"-fobjc-default-synthesize-properties">, Group<f_Group>; +def fobjc_exceptions: Flag<"-fobjc-exceptions">, Group<f_Group>; + def fobjc_gc_only : Flag<"-fobjc-gc-only">, Group<f_Group>; def fobjc_gc : Flag<"-fobjc-gc">, Group<f_Group>; def fobjc_legacy_dispatch : Flag<"-fobjc-legacy-dispatch">, Group<f_Group>; def fobjc_new_property : Flag<"-fobjc-new-property">, Group<clang_ignored_f_Group>; + +// Objective-C ABI options. +def fobjc_abi_version_EQ : Joined<"-fobjc-abi-version=">, Group<f_Group>; +def fobjc_nonfragile_abi_version_EQ : Joined<"-fobjc-nonfragile-abi-version=">, Group<f_Group>; def fobjc_nonfragile_abi : Flag<"-fobjc-nonfragile-abi">, Group<f_Group>; -def fobjc_nonfragile_abi2 : Flag<"-fobjc-nonfragile-abi2">, Group<f_Group>; +def fno_objc_nonfragile_abi : Flag<"-fno-objc-nonfragile-abi">, Group<f_Group>; + 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>; @@ -368,7 +394,7 @@ def framework : Separate<"-framework">, Flags<[LinkerInput]>; def frandom_seed_EQ : Joined<"-frandom-seed=">, Group<clang_ignored_f_Group>; def frtti : Flag<"-frtti">, Group<f_Group>; def fsched_interblock : Flag<"-fsched-interblock">, Group<clang_ignored_f_Group>; -def fshort_enums : Flag<"-fshort-enums">, Group<clang_ignored_f_Group>; +def fshort_enums : Flag<"-fshort-enums">, Group<f_Group>; def freorder_blocks : Flag<"-freorder-blocks">, Group<clang_ignored_f_Group>; def fshort_wchar : Flag<"-fshort-wchar">, Group<f_Group>; def fshow_overloads_EQ : Joined<"-fshow-overloads=">, Group<f_Group>; @@ -378,17 +404,20 @@ def fsigned_bitfields : Flag<"-fsigned-bitfields">, Group<f_Group>; def fsigned_char : Flag<"-fsigned-char">, 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<clang_ignored_f_Group>; +def fstrict_aliasing : Flag<"-fstrict-aliasing">, Group<f_Group>; def fsyntax_only : Flag<"-fsyntax-only">, Flags<[DriverOption]>; def ftabstop_EQ : Joined<"-ftabstop=">, Group<f_Group>; def ferror_limit_EQ : Joined<"-ferror-limit=">, Group<f_Group>; def ftemplate_depth_ : Joined<"-ftemplate-depth-">, Group<f_Group>; -def ftemplate_backtrace_limit_EQ : Joined<"-ftemplate-backtrace-limit=">, +def ftemplate_backtrace_limit_EQ : Joined<"-ftemplate-backtrace-limit=">, Group<f_Group>; +def Wlarge_by_value_copy_def : Flag<"-Wlarge-by-value-copy">; +def Wlarge_by_value_copy_EQ : Joined<"-Wlarge-by-value-copy=">; def fterminated_vtables : Flag<"-fterminated-vtables">, Group<f_Group>; def fthreadsafe_statics : Flag<"-fthreadsafe-statics">, Group<f_Group>; def ftime_report : Flag<"-ftime-report">, Group<f_Group>; def ftrapv : Flag<"-ftrapv">, Group<f_Group>; +def ftrapv_handler_EQ : Joined<"-ftrapv-handler=">, Group<f_Group>; def funit_at_a_time : Flag<"-funit-at-a-time">, Group<f_Group>; def funroll_loops : Flag<"-funroll-loops">, Group<f_Group>; def funsigned_bitfields : Flag<"-funsigned-bitfields">, Group<f_Group>; @@ -417,6 +446,7 @@ def iframework : JoinedOrSeparate<"-iframework">, Group<clang_i_Group>; def imacros : JoinedOrSeparate<"-imacros">, Group<clang_i_Group>; def image__base : Separate<"-image_base">; def include_ : JoinedOrSeparate<"-include">, Group<clang_i_Group>, EnumName<"include">; +def include_pch : Separate<"-include-pch">, Group<clang_i_Group>; def init : Separate<"-init">; def install__name : Separate<"-install_name">; def integrated_as : Flag<"-integrated-as">, Flags<[DriverOption]>; @@ -450,6 +480,7 @@ def mkernel : Flag<"-mkernel">, Group<m_Group>; def mlinker_version_EQ : Joined<"-mlinker-version=">, Flags<[NoForward]>; def mllvm : Separate<"-mllvm">; def mmacosx_version_min_EQ : Joined<"-mmacosx-version-min=">, Group<m_Group>; +def mms_bitfields : Flag<"-mms-bitfields">, Group<m_Group>; def mmmx : Flag<"-mmmx">, Group<m_x86_Features_Group>; def mno_3dnowa : Flag<"-mno-3dnowa">, Group<m_x86_Features_Group>; def mno_3dnow : Flag<"-mno-3dnow">, Group<m_x86_Features_Group>; @@ -478,6 +509,7 @@ def mno_omit_leaf_frame_pointer : Flag<"-mno-omit-leaf-frame-pointer">, Group<f_ def momit_leaf_frame_pointer : Flag<"-momit-leaf-frame-pointer">, Group<f_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>; def mrelax_all : Flag<"-mrelax-all">, Group<m_Group>; def msoft_float : Flag<"-msoft-float">, Group<m_Group>; def msse2 : Flag<"-msse2">, Group<m_x86_Features_Group>; @@ -544,10 +576,12 @@ def private__bundle : Flag<"-private_bundle">; def pthreads : Flag<"-pthreads">; def pthread : Flag<"-pthread">; def p : Flag<"-p">; +def pie : Flag<"-pie">; def read__only__relocs : Separate<"-read_only_relocs">; def remap : Flag<"-remap">; def rewrite_objc : Flag<"-rewrite-objc">, Flags<[DriverOption]>, HelpText<"Rewrite Objective-C source to C++">; +def rdynamic : Flag<"-rdynamic">; def rpath : Separate<"-rpath">, Flags<[LinkerInput]>; def r : Flag<"-r">; def save_temps : Flag<"-save-temps">, Flags<[DriverOption]>, @@ -575,6 +609,7 @@ def static_libgcc : Flag<"-static-libgcc">; def static : Flag<"-static">, Flags<[NoArgumentUnused]>; def std_default_EQ : Joined<"-std-default=">; def std_EQ : Joined<"-std=">; +def stdlib_EQ : Joined<"-stdlib=">; def sub__library : JoinedOrSeparate<"-sub_library">; def sub__umbrella : JoinedOrSeparate<"-sub_umbrella">; def s : Flag<"-s">; @@ -591,6 +626,7 @@ def undefined : JoinedOrSeparate<"-undefined">, Group<u_Group>; def undef : Flag<"-undef">, Group<u_Group>; def unexported__symbols__list : Separate<"-unexported_symbols_list">; def u : JoinedOrSeparate<"-u">, Group<u_Group>; +def use_gold_plugin : Flag<"-use-gold-plugin">; def v : Flag<"-v">, HelpText<"Show commands to run and use verbose output">; def weak_l : Joined<"-weak-l">, Flags<[LinkerInput]>; @@ -605,6 +641,11 @@ def x : JoinedOrSeparate<"-x">, Flags<[DriverOption]>, MetaVarName<"<language>">; def y : Joined<"-y">; +def working_directory : Separate<"-working-directory">, + HelpText<"Resolve file paths relative to the specified directory">; +def working_directory_EQ : Joined<"-working-directory=">, + Alias<working_directory>; + // Double dash options, which are usually an alias for one of the previous // options. @@ -719,6 +760,8 @@ def _specs : Separate<"--specs">, Alias<specs_EQ>; def _static : Flag<"--static">, Alias<static>; def _std_EQ : Joined<"--std=">, Alias<std_EQ>; def _std : Separate<"--std">, Alias<std_EQ>; +def _stdlib_EQ : Joined<"--stdlib=">, Alias<std_EQ>; +def _stdlib : Separate<"--stdlib">, Alias<std_EQ>; def _sysroot_EQ : Joined<"--sysroot=">; def _sysroot : Separate<"--sysroot">, Alias<_sysroot_EQ>; def _target_help : Flag<"--target-help">; @@ -739,4 +782,15 @@ def _write_user_dependencies : Flag<"--write-user-dependencies">, Alias<MMD>; def _ : Joined<"--">, Flags<[Unsupported]>; // Special internal option to handle -Xlinker --no-demangle. -def Z_Xlinker__no_demangle : Flag<"-Z-Xlinker-no-demangle">, Flags<[Unsupported]>; +def Z_Xlinker__no_demangle : Flag<"-Z-Xlinker-no-demangle">, + Flags<[Unsupported, NoArgumentUnused]>; + +// Special internal option to allow forwarding arbitrary arguments to linker. +def Zlinker_input : Separate<"-Zlinker-input">, + Flags<[Unsupported, NoArgumentUnused]>; + +// Reserved library options. +def Z_reserved_lib_stdcxx : Flag<"-Z-reserved-lib-stdc++">, + Flags<[LinkerInput, NoArgumentUnused, Unsupported]>, Group<reserved_lib_Group>; +def Z_reserved_lib_cckext : Flag<"-Z-reserved-lib-cckext">, + Flags<[LinkerInput, NoArgumentUnused, Unsupported]>, Group<reserved_lib_Group>; diff --git a/include/clang/Driver/ToolChain.h b/include/clang/Driver/ToolChain.h index 55be4ee..f0012bd 100644 --- a/include/clang/Driver/ToolChain.h +++ b/include/clang/Driver/ToolChain.h @@ -10,10 +10,11 @@ #ifndef CLANG_DRIVER_TOOLCHAIN_H_ #define CLANG_DRIVER_TOOLCHAIN_H_ +#include "clang/Driver/Util.h" #include "clang/Driver/Types.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Triple.h" -#include "llvm/System/Path.h" +#include "llvm/Support/Path.h" #include <string> namespace clang { @@ -32,6 +33,11 @@ class ToolChain { public: typedef llvm::SmallVector<std::string, 4> path_list; + enum CXXStdlibType { + CST_Libcxx, + CST_Libstdcxx + }; + private: const HostInfo &Host; const llvm::Triple Triple; @@ -92,6 +98,10 @@ public: // Platform defaults information + /// HasNativeLTOLinker - Check whether the linker and related tools have + /// native LLVM support. + virtual bool HasNativeLLVMSupport() const; + /// LookupTypeForExtension - Return the default language type to use for the /// given extension. virtual types::ID LookupTypeForExtension(const char *Ext) const; @@ -103,6 +113,14 @@ public: /// by default. virtual bool IsIntegratedAssemblerDefault() const { return false; } + /// IsStrictAliasingDefault - Does this tool chain use -fstrict-aliasing by + /// default. + virtual bool IsStrictAliasingDefault() const { return true; } + + /// IsObjCDefaultSynthPropertiesDefault - Does this tool chain enable + /// -fobjc-default-synthesize-properties by default. + virtual bool IsObjCDefaultSynthPropertiesDefault() const { return false; } + /// IsObjCNonFragileABIDefault - Does this tool chain set /// -fobjc-nonfragile-abi by default. virtual bool IsObjCNonFragileABIDefault() const { return false; } @@ -153,6 +171,25 @@ public: /// sets the deployment target) determines the version in the triple passed to /// Clang. virtual std::string ComputeEffectiveClangTriple(const ArgList &Args) const; + + // GetCXXStdlibType - Determine the C++ standard library type to use with the + // given compilation arguments. + virtual CXXStdlibType GetCXXStdlibType(const ArgList &Args) const; + + /// AddClangCXXStdlibIncludeArgs - Add the clang -cc1 level arguments to set + /// the include paths to use for the given C++ standard library type. + virtual void AddClangCXXStdlibIncludeArgs(const ArgList &Args, + ArgStringList &CmdArgs) const; + + /// AddCXXStdlibLibArgs - Add the system specific linker arguments to use + /// for the given C++ standard library type. + virtual void AddCXXStdlibLibArgs(const ArgList &Args, + ArgStringList &CmdArgs) const; + + /// AddCCKextLibArgs - Add the system specific linker arguments to use + /// for kernel extensions (Darwin-specific). + virtual void AddCCKextLibArgs(const ArgList &Args, + ArgStringList &CmdArgs) const; }; } // end namespace driver diff --git a/include/clang/Driver/Types.def b/include/clang/Driver/Types.def index 06a8690..f09a1dc 100644 --- a/include/clang/Driver/Types.def +++ b/include/clang/Driver/Types.def @@ -42,6 +42,7 @@ TYPE("cpp-output", PP_C, INVALID, "i", "u") TYPE("c", C, PP_C, 0, "u") TYPE("cl", CL, PP_C, 0, "u") +TYPE("cuda", CUDA, PP_CXX, 0, "u") TYPE("objective-c-cpp-output", PP_ObjC, INVALID, "mi", "u") TYPE("objective-c", ObjC, PP_ObjC, 0, "u") TYPE("c++-cpp-output", PP_CXX, INVALID, "ii", "u") |