diff options
Diffstat (limited to 'include/clang/Driver')
-rw-r--r-- | include/clang/Driver/Action.h | 22 | ||||
-rw-r--r-- | include/clang/Driver/Arg.h | 6 | ||||
-rw-r--r-- | include/clang/Driver/ArgList.h | 62 | ||||
-rw-r--r-- | include/clang/Driver/CC1Options.td | 71 | ||||
-rw-r--r-- | include/clang/Driver/Compilation.h | 16 | ||||
-rw-r--r-- | include/clang/Driver/Driver.h | 67 | ||||
-rw-r--r-- | include/clang/Driver/DriverDiagnostic.h | 2 | ||||
-rw-r--r-- | include/clang/Driver/Job.h | 13 | ||||
-rw-r--r-- | include/clang/Driver/Makefile | 12 | ||||
-rw-r--r-- | include/clang/Driver/OptTable.h | 8 | ||||
-rw-r--r-- | include/clang/Driver/Option.h | 13 | ||||
-rw-r--r-- | include/clang/Driver/Options.td | 27 | ||||
-rw-r--r-- | include/clang/Driver/Tool.h | 6 | ||||
-rw-r--r-- | include/clang/Driver/ToolChain.h | 27 | ||||
-rw-r--r-- | include/clang/Driver/Types.def | 3 | ||||
-rw-r--r-- | include/clang/Driver/Util.h | 8 |
16 files changed, 232 insertions, 131 deletions
diff --git a/include/clang/Driver/Action.h b/include/clang/Driver/Action.h index 4b45c98313c4c..a33c33bf734c3 100644 --- a/include/clang/Driver/Action.h +++ b/include/clang/Driver/Action.h @@ -10,17 +10,9 @@ #ifndef CLANG_DRIVER_ACTION_H_ #define CLANG_DRIVER_ACTION_H_ -#include "llvm/ADT/SmallVector.h" - #include "clang/Driver/Types.h" #include "clang/Driver/Util.h" - -#include "llvm/Support/Casting.h" -using llvm::isa; -using llvm::cast; -using llvm::cast_or_null; -using llvm::dyn_cast; -using llvm::dyn_cast_or_null; +#include "llvm/ADT/SmallVector.h" namespace clang { namespace driver { @@ -52,9 +44,10 @@ public: LinkJobClass, LipoJobClass, DsymutilJobClass, + VerifyJobClass, JobClassFirst=PreprocessJobClass, - JobClassLast=DsymutilJobClass + JobClassLast=VerifyJobClass }; static const char *getClassName(ActionClass AC); @@ -222,6 +215,15 @@ public: static bool classof(const DsymutilJobAction *) { return true; } }; +class VerifyJobAction : public JobAction { +public: + VerifyJobAction(ActionList &Inputs, types::ID Type); + static bool classof(const Action *A) { + return A->getKind() == VerifyJobClass; + } + static bool classof(const VerifyJobAction *) { return true; } +}; + } // end namespace driver } // end namespace clang diff --git a/include/clang/Driver/Arg.h b/include/clang/Driver/Arg.h index 265d6d8716721..e8625bbd5175a 100644 --- a/include/clang/Driver/Arg.h +++ b/include/clang/Driver/Arg.h @@ -51,7 +51,7 @@ namespace driver { mutable unsigned OwnsValues : 1; /// The argument values, as C strings. - llvm::SmallVector<const char *, 2> Values; + SmallVector<const char *, 2> Values; public: Arg(const Option *Opt, unsigned Index, const Arg *BaseArg = 0); @@ -87,11 +87,11 @@ namespace driver { return Values[N]; } - llvm::SmallVectorImpl<const char*> &getValues() { + SmallVectorImpl<const char*> &getValues() { return Values; } - bool containsValue(llvm::StringRef Value) const { + bool containsValue(StringRef Value) const { for (unsigned i = 0, e = getNumValues(); i != e; ++i) if (Values[i] == Value) return true; diff --git a/include/clang/Driver/ArgList.h b/include/clang/Driver/ArgList.h index 0fcf821c752cf..04faf64dc5ec9 100644 --- a/include/clang/Driver/ArgList.h +++ b/include/clang/Driver/ArgList.h @@ -10,6 +10,7 @@ #ifndef CLANG_DRIVER_ARGLIST_H_ #define CLANG_DRIVER_ARGLIST_H_ +#include "clang/Basic/LLVM.h" #include "clang/Driver/OptSpecifier.h" #include "clang/Driver/Util.h" #include "llvm/ADT/SmallVector.h" @@ -19,12 +20,8 @@ #include <string> #include <vector> -namespace llvm { - class Twine; -} - namespace clang { - class Diagnostic; + class DiagnosticsEngine; namespace driver { class Arg; @@ -34,7 +31,7 @@ namespace driver { /// arg_iterator - Iterates through arguments stored inside an ArgList. class arg_iterator { /// The current argument. - llvm::SmallVectorImpl<Arg*>::const_iterator Current; + SmallVectorImpl<Arg*>::const_iterator Current; /// The argument list we are iterating over. const ArgList &Args; @@ -58,7 +55,7 @@ namespace driver { typedef std::forward_iterator_tag iterator_category; typedef std::ptrdiff_t difference_type; - arg_iterator(llvm::SmallVectorImpl<Arg*>::const_iterator it, + arg_iterator(SmallVectorImpl<Arg*>::const_iterator it, const ArgList &_Args, OptSpecifier _Id0 = 0U, OptSpecifier _Id1 = 0U, OptSpecifier _Id2 = 0U) : Current(it), Args(_Args), Id0(_Id0), Id1(_Id1), Id2(_Id2) { @@ -101,7 +98,7 @@ namespace driver { void operator=(const ArgList &); // DO NOT IMPLEMENT public: - typedef llvm::SmallVector<Arg*, 16> arglist_type; + typedef SmallVector<Arg*, 16> arglist_type; typedef arglist_type::iterator iterator; typedef arglist_type::const_iterator const_iterator; typedef arglist_type::reverse_iterator reverse_iterator; @@ -153,6 +150,13 @@ namespace driver { } /// @} + /// @name Arg Removal + /// @{ + + /// eraseArg - Remove any option matching \arg Id. + void eraseArg(OptSpecifier Id); + + /// @} /// @name Arg Access /// @{ @@ -195,13 +199,13 @@ namespace driver { /// @{ /// getLastArgValue - Return the value of the last argument, or a default. - llvm::StringRef getLastArgValue(OptSpecifier Id, - llvm::StringRef Default = "") const; + StringRef getLastArgValue(OptSpecifier Id, + 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; + DiagnosticsEngine &Diags) const; /// getAllArgValues - Get the values of all instances of the given argument /// as strings. @@ -245,25 +249,29 @@ namespace driver { /// option id. void ClaimAllArgs(OptSpecifier Id0) const; + /// ClaimAllArgs - Claim all arguments. + /// + void ClaimAllArgs() const; + /// @} /// @name Arg Synthesis /// @{ /// MakeArgString - Construct a constant string pointer whose /// lifetime will match that of the ArgList. - virtual const char *MakeArgString(llvm::StringRef Str) const = 0; + virtual const char *MakeArgString(StringRef Str) const = 0; const char *MakeArgString(const char *Str) const { - return MakeArgString(llvm::StringRef(Str)); + return MakeArgString(StringRef(Str)); } const char *MakeArgString(std::string Str) const { - return MakeArgString(llvm::StringRef(Str)); + return MakeArgString(StringRef(Str)); } - const char *MakeArgString(const llvm::Twine &Str) const; + const char *MakeArgString(const Twine &Str) const; /// \brief Create an arg string for (\arg LHS + \arg RHS), reusing the /// string at \arg Index if possible. - const char *GetOrMakeJoinedArgString(unsigned Index, llvm::StringRef LHS, - llvm::StringRef RHS) const; + const char *GetOrMakeJoinedArgString(unsigned Index, StringRef LHS, + StringRef RHS) const; /// @} }; @@ -304,10 +312,10 @@ namespace driver { public: /// MakeIndex - Get an index for the given string(s). - unsigned MakeIndex(llvm::StringRef String0) const; - unsigned MakeIndex(llvm::StringRef String0, llvm::StringRef String1) const; + unsigned MakeIndex(StringRef String0) const; + unsigned MakeIndex(StringRef String0, StringRef String1) const; - virtual const char *MakeArgString(llvm::StringRef Str) const; + virtual const char *MakeArgString(StringRef Str) const; /// @} }; @@ -346,7 +354,7 @@ namespace driver { SynthesizedArgs.push_back(A); } - virtual const char *MakeArgString(llvm::StringRef Str) const; + virtual const char *MakeArgString(StringRef Str) const; /// AddFlagArg - Construct a new FlagArg for the given option \arg Id and /// append it to the argument list. @@ -358,7 +366,7 @@ namespace driver { /// \arg Id, with the provided \arg Value and append it to the argument /// list. void AddPositionalArg(const Arg *BaseArg, const Option *Opt, - llvm::StringRef Value) { + StringRef Value) { append(MakePositionalArg(BaseArg, Opt, Value)); } @@ -367,7 +375,7 @@ namespace driver { /// \arg Id, with the provided \arg Value and append it to the argument /// list. void AddSeparateArg(const Arg *BaseArg, const Option *Opt, - llvm::StringRef Value) { + StringRef Value) { append(MakeSeparateArg(BaseArg, Opt, Value)); } @@ -375,7 +383,7 @@ namespace driver { /// AddJoinedArg - Construct a new Positional arg for the given option \arg /// Id, with the provided \arg Value and append it to the argument list. void AddJoinedArg(const Arg *BaseArg, const Option *Opt, - llvm::StringRef Value) { + StringRef Value) { append(MakeJoinedArg(BaseArg, Opt, Value)); } @@ -387,17 +395,17 @@ namespace driver { /// MakePositionalArg - Construct a new Positional arg for the /// given option \arg Id, with the provided \arg Value. Arg *MakePositionalArg(const Arg *BaseArg, const Option *Opt, - llvm::StringRef Value) const; + StringRef Value) const; /// MakeSeparateArg - Construct a new Positional arg for the /// given option \arg Id, with the provided \arg Value. Arg *MakeSeparateArg(const Arg *BaseArg, const Option *Opt, - llvm::StringRef Value) const; + StringRef Value) const; /// MakeJoinedArg - Construct a new Positional arg for the /// given option \arg Id, with the provided \arg Value. Arg *MakeJoinedArg(const Arg *BaseArg, const Option *Opt, - llvm::StringRef Value) const; + StringRef Value) const; /// @} }; diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td index d8e9e3d3e88be..4473d46e2b320 100644 --- a/include/clang/Driver/CC1Options.td +++ b/include/clang/Driver/CC1Options.td @@ -57,6 +57,10 @@ def analyzer_output : Separate<"-analyzer-output">, def analyzer_output_EQ : Joined<"-analyzer-output=">, Alias<analyzer_output>; +def analyzer_purge : Separate<"-analyzer-purge">, + HelpText<"Source Code Analysis - Dead Symbol Removal Frequency">; +def analyzer_purge_EQ : Joined<"-analyzer-purge=">, Alias<analyzer_purge>; + 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">, @@ -68,8 +72,6 @@ def analyze_function : Separate<"-analyze-function">, def analyze_function_EQ : Joined<"-analyze-function=">, Alias<analyze_function>; 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">, @@ -113,9 +115,10 @@ def dwarf_debug_flags : Separate<"-dwarf-debug-flags">, def fforbid_guard_variables : Flag<"-fforbid-guard-variables">, HelpText<"Emit an error if a C++ static local initializer would need a guard variable">; def g : Flag<"-g">, HelpText<"Generate source level debug information">; -def fno_dwarf2_cfi_asm : Flag<"-fno-dwarf2-cfi-asm">, HelpText<"Don't use the cfi directives">; +def fno_dwarf2_cfi_asm : Flag<"-fno-dwarf2-cfi-asm">, + HelpText<"Don't use the cfi directives">; def fcatch_undefined_behavior : Flag<"-fcatch-undefined-behavior">, - HelpText<"Generate runtime checks for 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">, @@ -157,6 +160,8 @@ def mdisable_fp_elim : Flag<"-mdisable-fp-elim">, HelpText<"Disable frame pointer elimination optimization">; def mfloat_abi : Separate<"-mfloat-abi">, HelpText<"The float ABI to use">; +def mno_global_merge : Flag<"-mno-global-merge">, + HelpText<"Disable merging of globals">; def mlimit_float_precision : Separate<"-mlimit-float-precision">, HelpText<"Limit float precision to the given value">; def mno_exec_stack : Flag<"-mnoexecstack">, @@ -359,6 +364,8 @@ def ast_view : Flag<"-ast-view">, HelpText<"Build ASTs and view them with GraphViz">; def print_decl_contexts : Flag<"-print-decl-contexts">, HelpText<"Print DeclContexts and their Decls">; +def emit_module : Flag<"-emit-module">, + HelpText<"Generate pre-compiled module file">; def emit_pth : Flag<"-emit-pth">, HelpText<"Generate pre-tokenized header file">; def emit_pch : Flag<"-emit-pch">, @@ -381,9 +388,6 @@ def rewrite_objc : Flag<"-rewrite-objc">, HelpText<"Rewrite ObjC into C (code rewriter example)">; def rewrite_macros : Flag<"-rewrite-macros">, HelpText<"Expand macros without full preprocessing">; - -def create_module : Flag<"-create-module">, - HelpText<"Create a module definition file">; } def arcmt_check : Flag<"-arcmt-check">, @@ -394,9 +398,10 @@ def arcmt_migrate : Flag<"-arcmt-migrate">, HelpText<"Apply modifications and produces temporary files that conform to ARC">; def arcmt_migrate_directory : Separate<"-arcmt-migrate-directory">, HelpText<"Directory for temporary files produced during ARC migration">; - -def import_module : Separate<"-import-module">, - HelpText<"Import a module definition file">; +def arcmt_migrate_report_output : Separate<"-arcmt-migrate-report-output">, + HelpText<"Output path for the plist report">; +def arcmt_migrate_emit_arc_errors : Flag<"-arcmt-migrate-emit-errors">, + HelpText<"Emit ARC errors even if the migrator can fix them">; def working_directory : JoinedOrSeparate<"-working-directory">, HelpText<"Resolve file paths relative to the specified directory">; @@ -405,8 +410,6 @@ def working_directory_EQ : Joined<"-working-directory=">, def relocatable_pch : Flag<"-relocatable-pch">, HelpText<"Whether to build a relocatable precompiled header">; -def chained_pch : Flag<"-chained-pch">, - HelpText<"Whether to chain the new precompiled header to the old one.">; def print_stats : Flag<"-print-stats">, HelpText<"Print performance metrics and statistics">; def ftime_report : Flag<"-ftime-report">, @@ -446,7 +449,9 @@ def fno_dollars_in_identifiers : Flag<"-fno-dollars-in-identifiers">, 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">; + HelpText<"Enable the 'blocks' language feature">; +def fblocks_runtime_optional : Flag<"-fblocks-runtime-optional">, + HelpText<"Weakly link in the blocks runtime">; def fheinous_gnu_extensions : Flag<"-fheinous-gnu-extensions">; def fexceptions : Flag<"-fexceptions">, HelpText<"Enable support for exception handling">; @@ -469,7 +474,9 @@ def stdlib_EQ : Joined<"-stdlib=">, 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 ">; + HelpText<"Accept some non-standard constructs supported by the Microsoft compiler">; +def fms_compatibility : Flag<"-fms-compatibility">, + HelpText<"Enable Microsoft compatibility mode">; 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">, @@ -517,8 +524,8 @@ def fobjc_default_synthesize_properties : Flag<"-fobjc-default-synthesize-proper 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_fragile_abi : Flag<"-fobjc-fragile-abi">, + HelpText<"Use Objective-C's fragile ABI">; def fno_objc_infer_related_result_type : Flag< "-fno-objc-infer-related-result-type">, HelpText< @@ -534,6 +541,8 @@ def pic_level : Separate<"-pic-level">, HelpText<"Value for __PIC__">; def pthread : Flag<"-pthread">, HelpText<"Support POSIX threads in generated code">; +def fpack_struct : Separate<"-fpack-struct">, + HelpText<"Specify the default maximum struct packing alignment">; def fpascal_strings : Flag<"-fpascal-strings">, HelpText<"Recognize and construct Pascal-style string literals">; def fno_rtti : Flag<"-fno-rtti">, @@ -593,22 +602,41 @@ def fno_deprecated_macro : Flag<"-fno-deprecated-macro">, // Header Search Options //===----------------------------------------------------------------------===// -def nostdinc : Flag<"-nostdinc">, - HelpText<"Disable standard #include directories">; +def nostdsysteminc : Flag<"-nostdsysteminc">, + HelpText<"Disable standard system #include directories">; def nostdincxx : Flag<"-nostdinc++">, HelpText<"Disable standard #include directories for the C++ standard library">; def nobuiltininc : Flag<"-nobuiltininc">, HelpText<"Disable builtin #include directories">; +def fmodule_cache_path : Separate<"-fmodule-cache-path">, + MetaVarName<"<directory>">, + HelpText<"Specify the module cache path">; +def fdisable_module_hash : Flag<"-fdisable-module-hash">, + HelpText<"Disable the module hash">; +def fauto_module_import : Flag<"-fauto-module-import">, + HelpText<"Automatically translate #include/#import into module imports " + "when possible">; + def F : JoinedOrSeparate<"-F">, MetaVarName<"<directory>">, HelpText<"Add directory to framework include search path">; def I : JoinedOrSeparate<"-I">, MetaVarName<"<directory>">, HelpText<"Add directory to include search path">; def idirafter : JoinedOrSeparate<"-idirafter">, MetaVarName<"<directory>">, HelpText<"Add directory to AFTER include search path">; +def index_header_map : Flag<"-index-header-map">, + HelpText<"Make the next included directory (-I or -F) an indexer header map">; def iquote : JoinedOrSeparate<"-iquote">, MetaVarName<"<directory>">, HelpText<"Add directory to QUOTE include search path">; +def c_isystem : JoinedOrSeparate<"-c-isystem">, MetaVarName<"<directory>">, + HelpText<"Add directory to the C SYSTEM include search path">; def cxx_isystem : JoinedOrSeparate<"-cxx-isystem">, MetaVarName<"<directory>">, HelpText<"Add directory to the C++ SYSTEM include search path">; +def objc_isystem : JoinedOrSeparate<"-objc-isystem">, + MetaVarName<"<directory>">, + HelpText<"Add directory to the ObjC SYSTEM include search path">; +def objcxx_isystem : JoinedOrSeparate<"-objcxx-isystem">, + MetaVarName<"<directory>">, + HelpText<"Add directory to the ObjC++ SYSTEM include search path">; def isystem : JoinedOrSeparate<"-isystem">, MetaVarName<"<directory>">, HelpText<"Add directory to SYSTEM include search path">; def iwithsysroot : JoinedOrSeparate<"-iwithsysroot">,MetaVarName<"<directory>">, @@ -686,3 +714,10 @@ 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">; + +//===----------------------------------------------------------------------===// +// CUDA Options +//===----------------------------------------------------------------------===// + +def fcuda_is_device : Flag<"-fcuda-is-device">, + HelpText<"Generate code for CUDA device">; diff --git a/include/clang/Driver/Compilation.h b/include/clang/Driver/Compilation.h index 2db712d9321f9..8c9990909ebb0 100644 --- a/include/clang/Driver/Compilation.h +++ b/include/clang/Driver/Compilation.h @@ -12,12 +12,8 @@ #include "clang/Driver/Job.h" #include "clang/Driver/Util.h" - #include "llvm/ADT/DenseMap.h" - -namespace llvm { - class raw_ostream; -} +#include "llvm/Support/Path.h" namespace clang { namespace driver { @@ -60,6 +56,9 @@ class Compilation { /// Result files which should be removed on failure. ArgStringList ResultFiles; + /// Redirection for stdout, stderr, etc. + const llvm::sys::Path **Redirects; + public: Compilation(const Driver &D, const ToolChain &DefaultToolChain, InputArgList *Args, DerivedArgList *TranslatedArgs); @@ -120,7 +119,7 @@ public: /// \param J - The job to print. /// \param Terminator - A string to print at the end of the line. /// \param Quote - Should separate arguments be quoted. - void PrintJob(llvm::raw_ostream &OS, const Job &J, + void PrintJob(raw_ostream &OS, const Job &J, const char *Terminator, bool Quote) const; /// ExecuteCommand - Execute an actual command. @@ -136,6 +135,11 @@ public: /// Command which failed. /// \return The accumulated result code of the job. int ExecuteJob(const Job &J, const Command *&FailingCommand) const; + + /// initCompilationForDiagnostics - Remove stale state and suppress output + /// so compilation can be reexecuted to generate additional diagnostic + /// information (e.g., preprocessed source(s)). + void initCompilationForDiagnostics(); }; } // end namespace driver diff --git a/include/clang/Driver/Driver.h b/include/clang/Driver/Driver.h index b6951663148b1..6fdf6fcfad649 100644 --- a/include/clang/Driver/Driver.h +++ b/include/clang/Driver/Driver.h @@ -13,6 +13,7 @@ #include "clang/Basic/Diagnostic.h" #include "clang/Driver/Phases.h" +#include "clang/Driver/Types.h" #include "clang/Driver/Util.h" #include "llvm/ADT/StringRef.h" @@ -24,13 +25,14 @@ #include <string> namespace llvm { - class raw_ostream; template<typename T> class ArrayRef; } namespace clang { namespace driver { class Action; + class Arg; class ArgList; + class Command; class Compilation; class DerivedArgList; class HostInfo; @@ -45,7 +47,7 @@ namespace driver { class Driver { OptTable *Opts; - Diagnostic &Diags; + DiagnosticsEngine &Diags; public: // Diag - Forwarding function for diagnostics. @@ -75,7 +77,7 @@ public: /// functionality. /// FIXME: This type of customization should be removed in favor of the /// universal driver when it is ready. - typedef llvm::SmallVector<std::string, 4> prefix_list; + typedef SmallVector<std::string, 4> prefix_list; prefix_list PrefixDirs; /// sysroot, if present @@ -109,6 +111,9 @@ public: /// The file to log CC_LOG_DIAGNOSTICS output to, if enabled. const char *CCLogDiagnosticsFilename; + /// A list of inputs and their types for the given arguments. + typedef SmallVector<std::pair<types::ID, const Arg*>, 16> InputList; + /// Whether the driver should follow g++ like behavior. unsigned CCCIsCXX : 1; @@ -134,6 +139,9 @@ public: /// format. unsigned CCLogDiagnostics : 1; + /// Whether the driver is generating diagnostics for debugging purposes. + unsigned CCGenDiagnostics : 1; + private: /// Name to use when invoking gcc/g++. std::string CCCGenericGCCName; @@ -172,12 +180,17 @@ private: /// arguments, after applying the standard argument translations. DerivedArgList *TranslateInputArgs(const InputArgList &Args) const; + // getFinalPhase - Determine which compilation mode we are in and record + // which option we used to determine the final phase. + phases::ID getFinalPhase(const DerivedArgList &DAL, Arg **FinalPhaseArg = 0) + const; + public: - Driver(llvm::StringRef _ClangExecutable, - llvm::StringRef _DefaultHostTriple, - llvm::StringRef _DefaultImageName, - bool IsProduction, bool CXXIsProduction, - Diagnostic &_Diags); + Driver(StringRef _ClangExecutable, + StringRef _DefaultHostTriple, + StringRef _DefaultImageName, + bool IsProduction, + DiagnosticsEngine &_Diags); ~Driver(); /// @name Accessors @@ -189,7 +202,7 @@ public: const OptTable &getOpts() const { return *Opts; } - const Diagnostic &getDiags() const { return Diags; } + const DiagnosticsEngine &getDiags() const { return Diags; } bool getCheckInputsExist() const { return CheckInputsExist; } @@ -209,7 +222,7 @@ public: return InstalledDir.c_str(); return Dir.c_str(); } - void setInstalledDir(llvm::StringRef Value) { + void setInstalledDir(StringRef Value) { InstalledDir = Value; } @@ -224,14 +237,24 @@ public: /// argument vector. A null return value does not necessarily /// indicate an error condition, the diagnostics should be queried /// to determine if an error occurred. - Compilation *BuildCompilation(llvm::ArrayRef<const char *> Args); + Compilation *BuildCompilation(ArrayRef<const char *> Args); /// @name Driver Steps /// @{ /// ParseArgStrings - Parse the given list of strings into an /// ArgList. - InputArgList *ParseArgStrings(llvm::ArrayRef<const char *> Args); + InputArgList *ParseArgStrings(ArrayRef<const char *> Args); + + /// BuildInputs - Construct the list of inputs and their types from + /// the given arguments. + /// + /// \param TC - The default host tool chain. + /// \param Args - The input arguments. + /// \param Inputs - The list to store the resulting compilation + /// inputs onto. + void BuildInputs(const ToolChain &TC, const DerivedArgList &Args, + InputList &Inputs) const; /// BuildActions - Construct the list of actions to perform for the /// given arguments, which are only done for a single architecture. @@ -240,7 +263,7 @@ public: /// \param Args - The input arguments. /// \param Actions - The list to store the resulting actions onto. void BuildActions(const ToolChain &TC, const DerivedArgList &Args, - ActionList &Actions) const; + const InputList &Inputs, ActionList &Actions) const; /// BuildUniversalActions - Construct the list of actions to perform /// for the given arguments, which may require a universal build. @@ -249,6 +272,7 @@ public: /// \param Args - The input arguments. /// \param Actions - The list to store the resulting actions onto. void BuildUniversalActions(const ToolChain &TC, const DerivedArgList &Args, + const InputList &BAInputs, ActionList &Actions) const; /// BuildJobs - Bind actions to concrete tools and translate @@ -263,7 +287,14 @@ public: /// This routine handles additional processing that must be done in addition /// to just running the subprocesses, for example reporting errors, removing /// temporary files, etc. - int ExecuteCompilation(const Compilation &C) const; + int ExecuteCompilation(const Compilation &C, + const Command *&FailingCommand) const; + + /// generateCompilationDiagnostics - Generate diagnostics information + /// including preprocessed source file(s). + /// + void generateCompilationDiagnostics(Compilation &C, + const Command *FailingCommand); /// @} /// @name Helper Methods @@ -281,7 +312,7 @@ public: void PrintOptions(const ArgList &Args) const; /// PrintVersion - Print the driver version. - void PrintVersion(const Compilation &C, llvm::raw_ostream &OS) const; + void PrintVersion(const Compilation &C, raw_ostream &OS) const; /// GetFilePath - Lookup \arg Name in the list of file search paths. /// @@ -342,11 +373,11 @@ public: const char *BaseInput, bool AtTopLevel) const; - /// GetTemporaryPath - Return the pathname of a temporary file to - /// use as part of compilation; the file will have the given suffix. + /// GetTemporaryPath - Return the pathname of a temporary file to use + /// as part of compilation; the file will have the given prefix and suffix. /// /// GCC goes to extra lengths here to be a bit more robust. - std::string GetTemporaryPath(const char *Suffix) const; + std::string GetTemporaryPath(StringRef Prefix, const char *Suffix) const; /// GetHostInfo - Construct a new host info object for the given /// host triple. diff --git a/include/clang/Driver/DriverDiagnostic.h b/include/clang/Driver/DriverDiagnostic.h index 0f9376b8dea16..844f918c1b2e9 100644 --- a/include/clang/Driver/DriverDiagnostic.h +++ b/include/clang/Driver/DriverDiagnostic.h @@ -16,7 +16,7 @@ namespace clang { namespace diag { enum { #define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,\ - SFINAE,ACCESS,CATEGORY,BRIEF,FULL) ENUM, + SFINAE,ACCESS,NOWERROR,SHOWINSYSHEADER,CATEGORY,BRIEF,FULL) ENUM, #define DRIVERSTART #include "clang/Basic/DiagnosticDriverKinds.inc" #undef DIAG diff --git a/include/clang/Driver/Job.h b/include/clang/Driver/Job.h index d2767d1b877ba..367955f59f049 100644 --- a/include/clang/Driver/Job.h +++ b/include/clang/Driver/Job.h @@ -12,13 +12,7 @@ #include "clang/Driver/Util.h" #include "llvm/ADT/SmallVector.h" - -#include "llvm/Support/Casting.h" -using llvm::isa; -using llvm::cast; -using llvm::cast_or_null; -using llvm::dyn_cast; -using llvm::dyn_cast_or_null; +#include "clang/Basic/LLVM.h" namespace clang { namespace driver { @@ -88,7 +82,7 @@ public: /// JobList - A sequence of jobs to perform. class JobList : public Job { public: - typedef llvm::SmallVector<Job*, 4> list_type; + typedef SmallVector<Job*, 4> list_type; typedef list_type::size_type size_type; typedef list_type::iterator iterator; typedef list_type::const_iterator const_iterator; @@ -103,6 +97,9 @@ public: /// Add a job to the list (taking ownership). void addJob(Job *J) { Jobs.push_back(J); } + /// Clear the job list. + void clear(); + const list_type &getJobs() const { return Jobs; } size_type size() const { return Jobs.size(); } diff --git a/include/clang/Driver/Makefile b/include/clang/Driver/Makefile index d8291662a563b..45bc40f3b7151 100644 --- a/include/clang/Driver/Makefile +++ b/include/clang/Driver/Makefile @@ -5,14 +5,14 @@ TABLEGEN_INC_FILES_COMMON = 1 include $(CLANG_LEVEL)/Makefile -$(ObjDir)/Options.inc.tmp : Options.td OptParser.td $(TBLGEN) $(ObjDir)/.dir +$(ObjDir)/Options.inc.tmp : Options.td OptParser.td $(CLANG_TBLGEN) $(ObjDir)/.dir $(Echo) "Building Clang Driver Option tables with tblgen" - $(Verb) $(TableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $< + $(Verb) $(ClangTableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $< -$(ObjDir)/CC1Options.inc.tmp : CC1Options.td OptParser.td $(TBLGEN) $(ObjDir)/.dir +$(ObjDir)/CC1Options.inc.tmp : CC1Options.td OptParser.td $(CLANG_TBLGEN) $(ObjDir)/.dir $(Echo) "Building Clang CC1 Option tables with tblgen" - $(Verb) $(TableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $< + $(Verb) $(ClangTableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $< -$(ObjDir)/CC1AsOptions.inc.tmp : CC1AsOptions.td OptParser.td $(TBLGEN) $(ObjDir)/.dir +$(ObjDir)/CC1AsOptions.inc.tmp : CC1AsOptions.td OptParser.td $(CLANG_TBLGEN) $(ObjDir)/.dir $(Echo) "Building Clang CC1 Assembler Option tables with tblgen" - $(Verb) $(TableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $< + $(Verb) $(ClangTableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $< diff --git a/include/clang/Driver/OptTable.h b/include/clang/Driver/OptTable.h index 3befe1defba95..abd224db449da 100644 --- a/include/clang/Driver/OptTable.h +++ b/include/clang/Driver/OptTable.h @@ -10,12 +10,8 @@ #ifndef CLANG_DRIVER_OPTTABLE_H #define CLANG_DRIVER_OPTTABLE_H +#include "clang/Basic/LLVM.h" #include "clang/Driver/OptSpecifier.h" -#include <cassert> - -namespace llvm { - class raw_ostream; -} namespace clang { namespace driver { @@ -181,7 +177,7 @@ namespace options { /// \param Name - The name to use in the usage line. /// \param Title - The title to use in the usage line. /// \param ShowHidden - Whether help-hidden arguments should be shown. - void PrintHelp(llvm::raw_ostream &OS, const char *Name, + void PrintHelp(raw_ostream &OS, const char *Name, const char *Title, bool ShowHidden = false) const; }; } diff --git a/include/clang/Driver/Option.h b/include/clang/Driver/Option.h index 9dfa4614009f6..8243f6d69314b 100644 --- a/include/clang/Driver/Option.h +++ b/include/clang/Driver/Option.h @@ -12,12 +12,7 @@ #include "clang/Driver/OptSpecifier.h" #include "llvm/ADT/StringRef.h" -#include "llvm/Support/Casting.h" -using llvm::isa; -using llvm::cast; -using llvm::cast_or_null; -using llvm::dyn_cast; -using llvm::dyn_cast_or_null; +#include "clang/Basic/LLVM.h" namespace clang { namespace driver { @@ -65,7 +60,7 @@ namespace driver { OptSpecifier ID; /// The option name. - llvm::StringRef Name; + StringRef Name; /// Group this option is a member of, if any. const OptionGroup *Group; @@ -104,7 +99,7 @@ namespace driver { unsigned getID() const { return ID.getID(); } OptionClass getKind() const { return Kind; } - llvm::StringRef getName() const { return Name; } + StringRef getName() const { return Name; } const OptionGroup *getGroup() const { return Group; } const Option *getAlias() const { return Alias; } @@ -144,7 +139,7 @@ namespace driver { /// getRenderName - Return the name to use when rendering this /// option. - llvm::StringRef getRenderName() const { + StringRef getRenderName() const { return getUnaliasedOption()->getName(); } diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index d5482765e756f..ae8c7945cb939 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -122,6 +122,10 @@ def ccc_arcmt_migrate : Separate<"-ccc-arcmt-migrate">, CCCDriverOpt, HelpText<"Apply modifications and produces temporary files that conform to ARC">; def ccc_arcmt_migrate_EQ : Joined<"-ccc-arcmt-migrate=">, CCCDriverOpt, Alias<ccc_arcmt_migrate>; +def arcmt_migrate_report_output : Separate<"-arcmt-migrate-report-output">, + HelpText<"Output path for the plist report">; +def arcmt_migrate_emit_arc_errors : Flag<"-arcmt-migrate-emit-errors">, + HelpText<"Emit ARC errors even if the migrator can fix them">; // Make sure all other -ccc- options are rejected. def ccc_ : Joined<"-ccc-">, Group<ccc_Group>, Flags<[Unsupported]>; @@ -130,6 +134,9 @@ def ccc_ : Joined<"-ccc-">, Group<ccc_Group>, Flags<[Unsupported]>; def _HASH_HASH_HASH : Flag<"-###">, Flags<[DriverOption]>, HelpText<"Print the commands to run for this compilation">; +// The '--' option is here for the sake of compatibility with gcc, but is +// being ignored by the driver. +def _DASH_DASH : Flag<"--">, Flags<[DriverOption]>; def A : JoinedOrSeparate<"-A">; def B : JoinedOrSeparate<"-B">; def CC : Flag<"-CC">; @@ -315,7 +322,7 @@ def fno_gnu89_inline : Flag<"-fno-gnu89-inline">, Group<f_Group>; def fgnu_runtime : Flag<"-fgnu-runtime">, Group<f_Group>; def fheinous_gnu_extensions : Flag<"-fheinous-gnu-extensions">; def filelist : Separate<"-filelist">, Flags<[LinkerInput]>; -def findirect_virtual_calls : Flag<"-findirect-virtual-calls">, Group<f_Group>; +def findirect_virtual_calls : Flag<"-findirect-virtual-calls">, Alias<fapple_kext>; def finline_functions : Flag<"-finline-functions">, Group<clang_ignored_f_Group>; def finline : Flag<"-finline">, Group<clang_ignored_f_Group>; def finstrument_functions : Flag<"-finstrument-functions">, Group<f_Group>; @@ -333,8 +340,14 @@ 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 fms_compatibility : Flag<"-fms-compatibility">, Group<f_Group>; def fmsc_version : Joined<"-fmsc-version=">, Group<f_Group>; def fdelayed_template_parsing : Flag<"-fdelayed-template-parsing">, Group<f_Group>; +def fmodule_cache_path : Separate<"-fmodule-cache-path">, Group<i_Group>, + Flags<[NoForward]>; +def fauto_module_import : Flag <"-fauto-module-import">, Group<f_Group>, + Flags<[NoForward]>; + def fmudflapth : Flag<"-fmudflapth">, Group<f_Group>; def fmudflap : Flag<"-fmudflap">, Group<f_Group>; def fnested_functions : Flag<"-fnested-functions">, Group<f_Group>; @@ -370,6 +383,7 @@ 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_ms_compatibility : Flag<"-fno-ms-compatibility">, Group<f_Group>; def fno_delayed_template_parsing : Flag<"-fno-delayed-template-parsing">, Group<f_Group>; def fno_objc_default_synthesize_properties : Flag<"-fno-objc-default-synthesize-properties">, Group<f_Group>; @@ -426,6 +440,9 @@ def force__cpusubtype__ALL : Flag<"-force_cpusubtype_ALL">; def force__flat__namespace : Flag<"-force_flat_namespace">; def force__load : Separate<"-force_load">; def foutput_class_dir_EQ : Joined<"-foutput-class-dir=">, Group<f_Group>; +def fpack_struct : Flag<"-fpack-struct">, Group<f_Group>; +def fno_pack_struct : Flag<"-fno-pack-struct">, Group<f_Group>; +def fpack_struct_EQ : Joined<"-fpack-struct=">, Group<f_Group>; def fpascal_strings : Flag<"-fpascal-strings">, Group<f_Group>; def fpch_preprocess : Flag<"-fpch-preprocess">, Group<f_Group>; def fpic : Flag<"-fpic">, Group<f_Group>; @@ -466,7 +483,7 @@ def Wlarger_than_ : Joined<"-Wlarger-than-">, Alias<Wlarger_than>; def Wframe_larger_than : Separate<"-Wframe-larger-than">, Group<clang_ignored_f_Group>; def Wframe_larger_than_EQ : Joined<"-Wframe-larger-than=">, Alias<Wframe_larger_than>; -def fterminated_vtables : Flag<"-fterminated-vtables">, Group<f_Group>; +def fterminated_vtables : Flag<"-fterminated-vtables">, Alias<fapple_kext>; 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>; @@ -496,6 +513,7 @@ def gused : Joined<"-gused">, Group<g_Group>; def g_Flag : Flag<"-g">, Group<g_Group>; def g_Joined : Joined<"-g">, Group<g_Group>; def headerpad__max__install__names : Joined<"-headerpad_max_install_names">; +def index_header_map : Flag<"-index-header-map">; def idirafter : JoinedOrSeparate<"-idirafter">, Group<clang_i_Group>; def iframework : JoinedOrSeparate<"-iframework">, Group<clang_i_Group>; def imacros : JoinedOrSeparate<"-imacros">, Group<clang_i_Group>; @@ -528,6 +546,7 @@ def mdynamic_no_pic : Joined<"-mdynamic-no-pic">, Group<m_Group>, Flags<[NoArgum def mfix_and_continue : Flag<"-mfix-and-continue">, Group<clang_ignored_m_Group>; def mfloat_abi_EQ : Joined<"-mfloat-abi=">, Group<m_Group>; def mfpu_EQ : Joined<"-mfpu=">, Group<m_Group>; +def mglobal_merge : Flag<"-mglobal-merge">, Group<m_Group>; def mhard_float : Flag<"-mhard-float">, Group<m_Group>; def miphoneos_version_min_EQ : Joined<"-miphoneos-version-min=">, Group<m_Group>; def mios_version_min_EQ : Joined<"-mios-version-min=">, Alias<miphoneos_version_min_EQ>; @@ -542,6 +561,7 @@ 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>; def mno_constant_cfstrings : Flag<"-mno-constant-cfstrings">, Group<m_Group>; +def mno_global_merge : Flag<"-mno-global-merge">, Group<m_Group>; def mno_mmx : Flag<"-mno-mmx">, Group<m_x86_Features_Group>; def mno_pascal_strings : Flag<"-mno-pascal-strings">, Group<m_Group>; def mno_red_zone : Flag<"-mno-red-zone">, Group<m_Group>; @@ -604,6 +624,7 @@ def noprebind : Flag<"-noprebind">; def noseglinkedit : Flag<"-noseglinkedit">; def nostartfiles : Flag<"-nostartfiles">; def nostdinc : Flag<"-nostdinc">; +def nostdlibinc : Flag<"-nostdlibinc">; def nostdincxx : Flag<"-nostdinc++">; def nostdlib : Flag<"-nostdlib">; def object : Flag<"-object">; @@ -688,6 +709,8 @@ 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 verify : Flag<"-verify">, Flags<[DriverOption]>, + HelpText<"Verify output using a verifier.">; def weak_l : Joined<"-weak-l">, Flags<[LinkerInput]>; def weak__framework : Separate<"-weak_framework">, Flags<[LinkerInput]>; def weak__library : Separate<"-weak_library">, Flags<[LinkerInput]>; diff --git a/include/clang/Driver/Tool.h b/include/clang/Driver/Tool.h index c30fa4c6e7316..378b516b39e51 100644 --- a/include/clang/Driver/Tool.h +++ b/include/clang/Driver/Tool.h @@ -10,9 +10,7 @@ #ifndef CLANG_DRIVER_TOOL_H_ #define CLANG_DRIVER_TOOL_H_ -namespace llvm { - template<typename T, unsigned N> class SmallVector; -} +#include "clang/Basic/LLVM.h" namespace clang { namespace driver { @@ -23,7 +21,7 @@ namespace driver { class JobAction; class ToolChain; - typedef llvm::SmallVector<InputInfo, 4> InputInfoList; + typedef SmallVector<InputInfo, 4> InputInfoList; /// Tool - Information on a specific compilation tool. class Tool { diff --git a/include/clang/Driver/ToolChain.h b/include/clang/Driver/ToolChain.h index 4836d3ffac224..a5d51ca9d7c91 100644 --- a/include/clang/Driver/ToolChain.h +++ b/include/clang/Driver/ToolChain.h @@ -32,7 +32,7 @@ namespace driver { /// ToolChain - Access to tools for a single platform. class ToolChain { public: - typedef llvm::SmallVector<std::string, 4> path_list; + typedef SmallVector<std::string, 4> path_list; enum CXXStdlibType { CST_Libcxx, @@ -63,9 +63,9 @@ public: const llvm::Triple &getTriple() const { return Triple; } llvm::Triple::ArchType getArch() const { return Triple.getArch(); } - llvm::StringRef getArchName() const { return Triple.getArchName(); } - llvm::StringRef getPlatform() const { return Triple.getVendorName(); } - llvm::StringRef getOS() const { return Triple.getOSName(); } + StringRef getArchName() const { return Triple.getArchName(); } + StringRef getPlatform() const { return Triple.getVendorName(); } + StringRef getOS() const { return Triple.getOSName(); } std::string getTripleString() const { return Triple.getTriple(); @@ -139,7 +139,9 @@ public: /// GetDefaultStackProtectorLevel - Get the default stack protector level for /// this tool chain (0=off, 1=on, 2=all). - virtual unsigned GetDefaultStackProtectorLevel() const { return 0; } + virtual unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const { + return 0; + } /// IsUnwindTablesDefault - Does this tool chain use -funwind-tables /// by default. @@ -169,21 +171,30 @@ public: /// ComputeLLVMTriple - Return the LLVM target triple to use, after taking /// command line arguments into account. - virtual std::string ComputeLLVMTriple(const ArgList &Args) const; + virtual std::string ComputeLLVMTriple(const ArgList &Args, + types::ID InputType = types::TY_INVALID) const; /// ComputeEffectiveClangTriple - Return the Clang triple to use for this /// target, which may take into account the command line arguments. For /// example, on Darwin the -mmacosx-version-min= command line argument (which /// sets the deployment target) determines the version in the triple passed to /// Clang. - virtual std::string ComputeEffectiveClangTriple(const ArgList &Args) const; + virtual std::string ComputeEffectiveClangTriple(const ArgList &Args, + types::ID InputType = types::TY_INVALID) const; /// configureObjCRuntime - Configure the known properties of the /// Objective-C runtime for this platform. /// - /// FIXME: this doesn't really belong here. + /// FIXME: this really belongs on some sort of DeploymentTarget abstraction virtual void configureObjCRuntime(ObjCRuntime &runtime) const; + /// hasBlocksRuntime - Given that the user is compiling with + /// -fblocks, does this tool chain guarantee the existence of a + /// blocks runtime? + /// + /// FIXME: this really belongs on some sort of DeploymentTarget abstraction + virtual bool hasBlocksRuntime() const { return true; } + // GetCXXStdlibType - Determine the C++ standard library type to use with the // given compilation arguments. virtual CXXStdlibType GetCXXStdlibType(const ArgList &Args) const; diff --git a/include/clang/Driver/Types.def b/include/clang/Driver/Types.def index f09a1dcaf26f3..8449d639e6982 100644 --- a/include/clang/Driver/Types.def +++ b/include/clang/Driver/Types.def @@ -44,15 +44,18 @@ 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("objc-cpp-output", PP_ObjC_Alias, INVALID, "mi", "u") TYPE("objective-c", ObjC, PP_ObjC, 0, "u") TYPE("c++-cpp-output", PP_CXX, INVALID, "ii", "u") TYPE("c++", CXX, PP_CXX, 0, "u") TYPE("objective-c++-cpp-output", PP_ObjCXX, INVALID, "mii", "u") +TYPE("objc++-cpp-output", PP_ObjCXX_Alias, INVALID, "mii", "u") TYPE("objective-c++", ObjCXX, PP_ObjCXX, 0, "u") // C family input files to precompile. TYPE("c-header-cpp-output", PP_CHeader, INVALID, "i", "p") TYPE("c-header", CHeader, PP_CHeader, 0, "pu") +TYPE("cl-header", CLHeader, PP_CHeader, 0, "pu") TYPE("objective-c-header-cpp-output", PP_ObjCHeader, INVALID, "mi", "p") TYPE("objective-c-header", ObjCHeader, PP_ObjCHeader, 0, "pu") TYPE("c++-header-cpp-output", PP_CXXHeader, INVALID, "ii", "p") diff --git a/include/clang/Driver/Util.h b/include/clang/Driver/Util.h index 52f268d182a86..65aef4b31025f 100644 --- a/include/clang/Driver/Util.h +++ b/include/clang/Driver/Util.h @@ -10,19 +10,17 @@ #ifndef CLANG_DRIVER_UTIL_H_ #define CLANG_DRIVER_UTIL_H_ -namespace llvm { - template<typename T, unsigned N> class SmallVector; -} +#include "clang/Basic/LLVM.h" namespace clang { namespace driver { class Action; /// ArgStringList - Type used for constructing argv lists for subprocesses. - typedef llvm::SmallVector<const char*, 16> ArgStringList; + typedef SmallVector<const char*, 16> ArgStringList; /// ActionList - Type used for lists of actions. - typedef llvm::SmallVector<Action*, 3> ActionList; + typedef SmallVector<Action*, 3> ActionList; } // end namespace driver } // end namespace clang |