diff options
Diffstat (limited to 'include/clang/Basic')
-rw-r--r-- | include/clang/Basic/Builtins.def | 1 | ||||
-rw-r--r-- | include/clang/Basic/BuiltinsX86.def | 6 | ||||
-rw-r--r-- | include/clang/Basic/DiagnosticDriverKinds.td | 2 | ||||
-rw-r--r-- | include/clang/Basic/DiagnosticLexKinds.td | 3 | ||||
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 33 | ||||
-rw-r--r-- | include/clang/Basic/MacroBuilder.h | 46 | ||||
-rw-r--r-- | include/clang/Basic/Makefile | 6 | ||||
-rw-r--r-- | include/clang/Basic/Specifiers.h | 82 | ||||
-rw-r--r-- | include/clang/Basic/Version.h | 24 |
9 files changed, 180 insertions, 23 deletions
diff --git a/include/clang/Basic/Builtins.def b/include/clang/Basic/Builtins.def index 14f7356..0894563 100644 --- a/include/clang/Basic/Builtins.def +++ b/include/clang/Basic/Builtins.def @@ -270,6 +270,7 @@ BUILTIN(__builtin_bswap64, "ULLiULLi", "nc") BUILTIN(__builtin_constant_p, "Us.", "nc") BUILTIN(__builtin_classify_type, "i.", "nc") BUILTIN(__builtin___CFStringMakeConstantString, "FC*cC*", "nc") +BUILTIN(__builtin___NSStringMakeConstantString, "FC*cC*", "nc") BUILTIN(__builtin_va_start, "vA.", "n") BUILTIN(__builtin_va_end, "vA", "n") BUILTIN(__builtin_va_copy, "vAA", "n") diff --git a/include/clang/Basic/BuiltinsX86.def b/include/clang/Basic/BuiltinsX86.def index 6315c16..0062846 100644 --- a/include/clang/Basic/BuiltinsX86.def +++ b/include/clang/Basic/BuiltinsX86.def @@ -79,12 +79,7 @@ BUILTIN(__builtin_ia32_pmaxub, "V8cV8cV8c", "") BUILTIN(__builtin_ia32_pmaxsw, "V4sV4sV4s", "") BUILTIN(__builtin_ia32_pminub, "V8cV8cV8c", "") BUILTIN(__builtin_ia32_pminsw, "V4sV4sV4s", "") -BUILTIN(__builtin_ia32_punpckhbw, "V8cV8cV8c", "") -BUILTIN(__builtin_ia32_punpckhwd, "V4sV4sV4s", "") -BUILTIN(__builtin_ia32_punpckhdq, "V2iV2iV2i", "") -BUILTIN(__builtin_ia32_punpcklbw, "V8cV8cV8c", "") BUILTIN(__builtin_ia32_punpcklwd, "V4sV4sV4s", "") -BUILTIN(__builtin_ia32_punpckldq, "V2iV2iV2i", "") BUILTIN(__builtin_ia32_cmppd, "V2dV2dV2dc", "") BUILTIN(__builtin_ia32_cmpsd, "V2dV2dV2dc", "") BUILTIN(__builtin_ia32_minpd, "V2dV2dV2d", "") @@ -99,7 +94,6 @@ BUILTIN(__builtin_ia32_paddusb128, "V16cV16cV16c", "") BUILTIN(__builtin_ia32_paddusw128, "V8sV8sV8s", "") BUILTIN(__builtin_ia32_psubusb128, "V16cV16cV16c", "") BUILTIN(__builtin_ia32_psubusw128, "V8sV8sV8s", "") -BUILTIN(__builtin_ia32_pmullw128, "V8sV8sV8s", "") BUILTIN(__builtin_ia32_pmulhw128, "V8sV8sV8s", "") BUILTIN(__builtin_ia32_pavgb128, "V16cV16cV16c", "") BUILTIN(__builtin_ia32_pavgw128, "V8sV8sV8s", "") diff --git a/include/clang/Basic/DiagnosticDriverKinds.td b/include/clang/Basic/DiagnosticDriverKinds.td index dfb6f8d..8cdf850 100644 --- a/include/clang/Basic/DiagnosticDriverKinds.td +++ b/include/clang/Basic/DiagnosticDriverKinds.td @@ -83,5 +83,7 @@ def warn_drv_assuming_mfloat_abi_is : Warning< "unknown platform, assuming -mfloat-abi=%0">; def warn_ignoring_ftabstop_value : Warning< "ignoring invalid -ftabstop value '%0', using default value %1">; +def warn_drv_missing_resource_library : Warning< + "missing resource library '%0', link may fail">; } diff --git a/include/clang/Basic/DiagnosticLexKinds.td b/include/clang/Basic/DiagnosticLexKinds.td index 26a80b5..3f765bd 100644 --- a/include/clang/Basic/DiagnosticLexKinds.td +++ b/include/clang/Basic/DiagnosticLexKinds.td @@ -172,9 +172,6 @@ def err_pp_hash_error : Error<"#error%0">; def err_pp_file_not_found : Error<"'%0' file not found">, DefaultFatal; def err_pp_error_opening_file : Error< "error opening file '%0': %1">, DefaultFatal; -def warn_pp_relative_include_from_framework : Warning< - "published framework headers should always #import headers within the " - "framework with framework paths">, InGroup<DiagGroup<"framework-headers">>; def err_pp_empty_filename : Error<"empty filename">; def err_pp_include_too_deep : Error<"#include nested too deeply">; def err_pp_expects_filename : Error<"expected \"FILENAME\" or <FILENAME>">; diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 7e59f88..8d75d2e 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -412,6 +412,15 @@ def err_class_redeclared_with_different_access : Error< "%0 redeclared with '%1' access">; def note_previous_access_declaration : Note< "previously declared '%1' here">; +def err_access_outside_class : Error< + "access to %select{private|protected}0 member outside any class context">; +def note_access_natural : Note<"declared %select{private|protected}0 here">; +def note_access_constrained_by_path : Note< + "access to decl constrained by %select{private|protected}0 inheritance">; +def err_access_protected : Error< + "access to protected member of %0 from %1, which is not a subclass">; +def err_access_private : Error< + "access to private member of %0 from %1">; // C++ name lookup def err_incomplete_nested_name_spec : Error< @@ -537,8 +546,9 @@ def err_destructor_name : Error< // C++ initialization def err_init_conversion_failed : Error< "cannot initialize %select{a variable|a parameter|return object|an " - "exception object|a value|a base class|a member subobject|an array element}0" - " of type %1 with an %select{rvalue|lvalue}2 of type %3">; + "exception object|a member subobject|an array element|a new value|a value|a " + "base class|an array element}0 of type %1 with an %select{rvalue|lvalue}2 of " + "type %3">; def err_lvalue_to_rvalue_ref : Error<"rvalue reference cannot bind to lvalue">; def err_invalid_initialization : Error< @@ -913,10 +923,24 @@ def note_ovl_candidate_arity : Note<"candidate " "function (the implicit copy assignment operator)}0 not viable: requires" "%select{ at least| at most|}2 %3 argument%s3, but %4 %plural{1:was|:were}4 " "provided">; + def note_ovl_candidate_deleted : Note< "candidate %select{function|function|constructor|" "function |function |constructor |||}0%1 " "has been explicitly %select{made unavailable|deleted}2">; + +// Giving the index of the bad argument really clutters this message, and +// it's relatively unimportant because 1) it's generally obvious which +// argument(s) are of the given object type and 2) the fix is usually +// to complete the type, which doesn't involve changes to the call line +// anyway. If people complain, we can change it. +def note_ovl_candidate_bad_conv_incomplete : Note<"candidate " + "%select{function|function|constructor|" + "function |function |constructor |" + "constructor (the implicit default constructor)|" + "constructor (the implicit copy constructor)|" + "function (the implicit copy assignment operator)}0%1 " + "not viable: cannot convert argument of incomplete type %2 to %3">; def note_ovl_candidate_bad_conv : Note<"candidate " "%select{function|function|constructor|" "function |function |constructor |" @@ -1840,6 +1864,9 @@ def err_illegal_super_cast : Error< def warn_setter_getter_impl_required : Warning< "property %0 requires method %1 to be defined - " "use @synthesize, @dynamic or provide a method implementation">; +def warn_setter_getter_impl_required_in_category : Warning< + "property %0 requires method %1 to be defined - " + "use @dynamic or provide a method implementation in category">; def note_property_impl_required : Note< "implementation is here">; @@ -2458,8 +2485,6 @@ def warn_stringcompare : Warning< def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks" " or pick a deployment target that supports them">; def err_expected_block_lbrace : Error<"expected '{' in block literal">; -def err_goto_in_block : Error< - "goto not allowed in block literal">; def err_return_in_block_expression : Error< "return not allowed in block expression literal">; def err_block_returns_array : Error< diff --git a/include/clang/Basic/MacroBuilder.h b/include/clang/Basic/MacroBuilder.h new file mode 100644 index 0000000..3287b30 --- /dev/null +++ b/include/clang/Basic/MacroBuilder.h @@ -0,0 +1,46 @@ +//===--- MacroBuilder.h - CPP Macro building utility ------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines the MacroBuilder utility class. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_BASIC_MACROBUILDER_H +#define LLVM_CLANG_BASIC_MACROBUILDER_H + +#include "llvm/ADT/Twine.h" +#include "llvm/Support/raw_ostream.h" + +namespace clang { + +class MacroBuilder { + llvm::raw_ostream &Out; +public: + MacroBuilder(llvm::raw_ostream &Output) : Out(Output) {} + + /// Append a #define line for macro of the form "#define Name Value\n". + void defineMacro(const llvm::Twine &Name, const llvm::Twine &Value = "1") { + Out << "#define " << Name << ' ' << Value << '\n'; + } + + /// Append a #undef line for Name. Name should be of the form XXX + /// and we emit "#undef XXX". + void undefineMacro(const llvm::Twine &Name) { + Out << "#undef " << Name << '\n'; + } + + /// Directly append Str and a newline to the underlying buffer. + void append(const llvm::Twine &Str) { + Out << Str << '\n'; + } +}; + +} // end namespace clang + +#endif diff --git a/include/clang/Basic/Makefile b/include/clang/Basic/Makefile index b85eb07..48f7f9d 100644 --- a/include/clang/Basic/Makefile +++ b/include/clang/Basic/Makefile @@ -11,14 +11,12 @@ include $(LEVEL)/Makefile.common INPUT_TDS = $(wildcard $(PROJ_SRC_DIR)/Diagnostic*.td) -$(ObjDir)/Diagnostic%Kinds.inc.tmp : Diagnostic.td Diagnostic%Kinds.td $(TBLGEN) +$(ObjDir)/Diagnostic%Kinds.inc.tmp : Diagnostic.td Diagnostic%Kinds.td $(TBLGEN) $(ObjDir)/.dir $(Echo) "Building Clang $(patsubst Diagnostic%Kinds.inc.tmp,%,$(@F)) diagnostic tables with tblgen" - $(Verb) -$(MKDIR) $(@D) $(Verb) $(TableGen) -gen-clang-diags-defs -clang-component=$(patsubst Diagnostic%Kinds.inc.tmp,%,$(@F)) -o $(call SYSPATH, $@) $< -$(ObjDir)/DiagnosticGroups.inc.tmp : Diagnostic.td DiagnosticGroups.td $(INPUT_TDS) $(TBLGEN) +$(ObjDir)/DiagnosticGroups.inc.tmp : Diagnostic.td DiagnosticGroups.td $(INPUT_TDS) $(TBLGEN) $(ObjDir)/.dir $(Echo) "Building Clang diagnostic groups with tblgen" - $(Verb) -$(MKDIR) $(@D) $(Verb) $(TableGen) -gen-clang-diag-groups -o $(call SYSPATH, $@) $< diff --git a/include/clang/Basic/Specifiers.h b/include/clang/Basic/Specifiers.h new file mode 100644 index 0000000..4cace86 --- /dev/null +++ b/include/clang/Basic/Specifiers.h @@ -0,0 +1,82 @@ +//===--- Specifiers.h - Declaration and Type Specifiers ---------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines various enumerations that describe declaration and +// type specifiers. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_BASIC_SPECIFIERS_H +#define LLVM_CLANG_BASIC_SPECIFIERS_H + +namespace clang { + /// \brief Specifies the width of a type, e.g., short, long, or long long. + enum TypeSpecifierWidth { + TSW_unspecified, + TSW_short, + TSW_long, + TSW_longlong + }; + + /// \brief Specifies the signedness of a type, e.g., signed or unsigned. + enum TypeSpecifierSign { + TSS_unspecified, + TSS_signed, + TSS_unsigned + }; + + /// \brief Specifies the kind of type. + enum TypeSpecifierType { + TST_unspecified, + TST_void, + TST_char, + TST_wchar, // C++ wchar_t + TST_char16, // C++0x char16_t + TST_char32, // C++0x char32_t + TST_int, + TST_float, + TST_double, + TST_bool, // _Bool + TST_decimal32, // _Decimal32 + TST_decimal64, // _Decimal64 + TST_decimal128, // _Decimal128 + TST_enum, + TST_union, + TST_struct, + TST_class, // C++ class type + TST_typename, // Typedef, C++ class-name or enum name, etc. + TST_typeofType, + TST_typeofExpr, + TST_decltype, // C++0x decltype + TST_auto, // C++0x auto + TST_error // erroneous type + }; + + /// WrittenBuiltinSpecs - Structure that packs information about the + /// type specifiers that were written in a particular type specifier + /// sequence. + struct WrittenBuiltinSpecs { + /*DeclSpec::TST*/ unsigned Type : 5; + /*DeclSpec::TSS*/ unsigned Sign : 2; + /*DeclSpec::TSW*/ unsigned Width : 2; + bool ModeAttr : 1; + }; + + /// AccessSpecifier - A C++ access specifier (public, private, + /// protected), plus the special value "none" which means + /// different things in different contexts. + enum AccessSpecifier { + AS_public, + AS_protected, + AS_private, + AS_none + }; +} + +#endif // LLVM_CLANG_BASIC_SPECIFIERS_H diff --git a/include/clang/Basic/Version.h b/include/clang/Basic/Version.h index 120d5a4..4710b6b 100644 --- a/include/clang/Basic/Version.h +++ b/include/clang/Basic/Version.h @@ -15,6 +15,8 @@ #ifndef LLVM_CLANG_BASIC_VERSION_H #define LLVM_CLANG_BASIC_VERSION_H +#include "llvm/ADT/StringRef.h" + /// \brief Clang major version #define CLANG_VERSION_MAJOR 1 @@ -47,13 +49,23 @@ #endif namespace clang { - /// \brief Retrieves the Subversion path that identifies the particular - /// Clang branch, tag, or trunk from which this Clang was built. - const char *getClangSubversionPath(); + /// \brief Retrieves the repository path (e.g., Subversion path) that + /// identifies the particular Clang branch, tag, or trunk from which this + /// Clang was built. + llvm::StringRef getClangRepositoryPath(); + + /// \brief Retrieves the repository revision number (or identifer) from which + /// this Clang was built. + llvm::StringRef getClangRevision(); + + /// \brief Retrieves the full repository version that is an amalgamation of + /// the information in getClangRepositoryPath() and getClangRevision(). + llvm::StringRef getClangFullRepositoryVersion(); - /// \brief Retrieves the Subversion revision number from which this Clang - /// was built. - unsigned getClangSubversionRevision(); + /// \brief Retrieves a string representing the complete clang version, + /// which includes the clang version number, the repository version, + /// and the vendor tag. + const char *getClangFullVersion(); } #endif // LLVM_CLANG_BASIC_VERSION_H |