For this small program, only a tiny fraction of the source
+locations, types, declarations, identifiers, and macros were actually
+deserialized from the precompiled header. These statistics can be
+useful to determine whether the precompiled header implementation can
+be improved by making more of the implementation lazy.
. The contents of each of these logical blocks are described
below.
+For a given precompiled header, the llvm-bcanalyzer
+utility can be used to examine the actual structure of the bitstream
+for the precompiled header. This information can be used both to help
+understand the structure of the precompiled header and to isolate
+areas where precompiled headers can still be optimized, e.g., through
+the introduction of abbreviations.
+
The metadata block contains several records that provide
@@ -393,7 +440,60 @@ values to the offset of the selector wit
and will be used when de-serializing an Objective-C method declaration
(or other Objective-C construct) that refers to the selector.
-
+Precompiled Header Integration Points
+
+The "lazy" deserialization behavior of precompiled headers requires
+their integration into several completely different submodules of
+Clang. For example, lazily deserializing the declarations during name
+lookup requires that the name-lookup routines be able to query the
+precompiled header to find entities within the PCH file.
+
+For each Clang data structure that requires direct interaction with
+the precompiled header logic, there is an abstract class that provides
+the interface between the two modules. The PCHReader
+class, which handles the loading of a precompiled header, inherits
+from all of these abstract classes to provide lazy deserialization of
+Clang's data structures. PCHReader
implements the
+following abstract classes:
+
+
+ StatSysCallCache
+ - This abstract interface is associated with the
+
FileManager
class, and is used whenever the file
+ manager is going to perform a stat()
system call.
+
+ ExternalSLocEntrySource
+ - This abstract interface is associated with the
+
SourceManager
class, and is used whenever the
+ source manager needs to load the details
+ of a file, buffer, or macro instantiation.
+
+ IdentifierInfoLookup
+ - This abstract interface is associated with the
+
IdentifierTable
class, and is used whenever the
+ program source refers to an identifier that has not yet been seen.
+ In this case, the precompiled header implementation searches for
+ this identifier within its identifier table
+ to load any top-level declarations or macros associated with that
+ identifier.
+
+ ExternalASTSource
+ - This abstract interface is associated with the
+
ASTContext
class, and is used whenever the abstract
+ syntax tree nodes need to loaded from the precompiled header. It
+ provides the ability to de-serialize declarations and types
+ identified by their numeric values, read the bodies of functions
+ when required, and read the declarations stored within a
+ declaration context (either for iteration or for name lookup).
+
+ ExternalSemaSource
+ - This abstract interface is associated with the
Sema
+ class, and is used whenever semantic analysis needs to read
+ information from the global method
+ pool.
+
+
+
Modified: vendor/clang/dist/docs/UsersManual.html
==============================================================================
--- vendor/clang/dist/docs/UsersManual.html Sat Jun 6 08:21:06 2009 (r193575)
+++ vendor/clang/dist/docs/UsersManual.html Sat Jun 6 08:21:31 2009 (r193576)
@@ -431,50 +431,43 @@ headers vary between compilers, precompi
highly effective at speeding up program compilation on systems with very large
system headers (e.g., Mac OS/X).
-Clang supports an implementation of precompiled headers known as
-pre-tokenized headers (PTH). Clang's pre-tokenized headers support most
-of same interfaces as GCC's pre-compiled headers (as well as others) but are
-completely different in their implementation. If you are interested in how
-PTH is implemented, please see the PTH Internals
- document.
+Generating a PCH File
-Generating a PTH File
-
-To generate a PTH file using Clang, one invokes Clang with
+
To generate a PCH file using Clang, one invokes Clang with
the -x <language>-header option. This mirrors the
interface in GCC for generating PCH files:
$ gcc -x c-header test.h -o test.h.gch
- $ clang -x c-header test.h -o test.h.pth
+ $ clang -x c-header test.h -o test.h.pch
-Using a PTH File
+Using a PCH File
-A PTH file can then be used as a prefix header when a
+
A PCH file can then be used as a prefix header when a
-include option is passed to clang:
$ clang -include test.h test.c -o test
-The clang driver will first check if a PTH file for test.h
+
The clang driver will first check if a PCH file for test.h
is available; if so, the contents of test.h (and the files it includes)
-will be processed from the PTH file. Otherwise, Clang falls back to
+will be processed from the PCH file. Otherwise, Clang falls back to
directly processing the content of test.h. This mirrors the behavior of
GCC.
-NOTE: Clang does not automatically use PTH files
+
NOTE: Clang does not automatically use PCH files
for headers that are directly included within a source file. For example:
- $ clang -x c-header test.h -o test.h.pth
+ $ clang -x c-header test.h -o test.h.cth
$ cat test.c
#include "test.h"
$ clang test.c -o test
-In this example, clang will not automatically use the PTH file for
+
In this example, clang will not automatically use the PCH file for
test.h since test.h was included directly in the source file
and not specified on the command line using -include.
@@ -607,6 +600,12 @@ in structures. This is for a few of rea
to implement, two, the extension is completely undocumented, and three, the
extension appears to be very rarely used.
+clang does not support duplicate definitions of a function where one is
+inline. This complicates clients of the AST which normally can expect there is
+at most one definition for each function. Source code using this feature should
+be changed to define the inline and out-of-line definitions in separate
+translation units.
+
Microsoft extensions
Modified: vendor/clang/dist/include/clang/AST/ASTContext.h
==============================================================================
--- vendor/clang/dist/include/clang/AST/ASTContext.h Sat Jun 6 08:21:06 2009 (r193575)
+++ vendor/clang/dist/include/clang/AST/ASTContext.h Sat Jun 6 08:21:31 2009 (r193576)
@@ -539,11 +539,16 @@ public:
void CollectObjCIvars(const ObjCInterfaceDecl *OI,
llvm::SmallVectorImpl &Fields);
-
+
+ void ShallowCollectObjCIvars(const ObjCInterfaceDecl *OI,
+ llvm::SmallVectorImpl &Ivars,
+ bool CollectSynthesized = true);
void CollectSynthesizedIvars(const ObjCInterfaceDecl *OI,
llvm::SmallVectorImpl &Ivars);
void CollectProtocolSynthesizedIvars(const ObjCProtocolDecl *PD,
llvm::SmallVectorImpl &Ivars);
+ unsigned CountSynthesizedIvars(const ObjCInterfaceDecl *OI);
+ unsigned CountProtocolSynthesizedIvars(const ObjCProtocolDecl *PD);
//===--------------------------------------------------------------------===//
// Type Operators
Modified: vendor/clang/dist/include/clang/AST/Builtins.def
==============================================================================
--- vendor/clang/dist/include/clang/AST/Builtins.def Sat Jun 6 08:21:06 2009 (r193575)
+++ vendor/clang/dist/include/clang/AST/Builtins.def Sat Jun 6 08:21:31 2009 (r193576)
@@ -332,25 +332,31 @@ BUILTIN(__sync_fetch_and_max, "ii*i", "n
BUILTIN(__sync_fetch_and_umin, "UiUi*Ui", "n")
BUILTIN(__sync_fetch_and_umax, "UiUi*Ui", "n")
-// Builtin library functions
-LIBBUILTIN(alloca, "v*z", "f", "stdlib.h")
+// C99 library functions
+// C99 stdlib.h
LIBBUILTIN(calloc, "v*zz", "f", "stdlib.h")
LIBBUILTIN(malloc, "v*z", "f", "stdlib.h")
LIBBUILTIN(realloc, "v*v*z", "f", "stdlib.h")
+// C99 string.h
LIBBUILTIN(memcpy, "v*v*vC*z", "f", "string.h")
LIBBUILTIN(memmove, "v*v*vC*z", "f", "string.h")
-LIBBUILTIN(memset, "v*v*iz", "f", "string.h")
+LIBBUILTIN(strcpy, "c*c*cC*", "f", "string.h")
+LIBBUILTIN(strncpy, "c*c*cC*z", "f", "string.h")
LIBBUILTIN(strcat, "c*c*cC*", "f", "string.h")
+LIBBUILTIN(strncat, "c*c*cC*z", "f", "string.h")
+LIBBUILTIN(strxfrm, "zc*cC*z", "f", "string.h")
+LIBBUILTIN(memchr, "v*vC*iz", "f", "string.h")
LIBBUILTIN(strchr, "c*cC*i", "f", "string.h")
-LIBBUILTIN(strcpy, "c*c*cC*", "f", "string.h")
LIBBUILTIN(strcspn, "zcC*cC*", "f", "string.h")
-LIBBUILTIN(strlen, "zcC*", "f", "string.h")
-LIBBUILTIN(strncat, "c*c*cC*z", "f", "string.h")
-LIBBUILTIN(strncpy, "c*c*cC*z", "f", "string.h")
LIBBUILTIN(strpbrk, "c*cC*cC*", "f", "string.h")
LIBBUILTIN(strrchr, "c*cC*i", "f", "string.h")
LIBBUILTIN(strspn, "zcC*cC*", "f", "string.h")
LIBBUILTIN(strstr, "c*cC*cC*", "f", "string.h")
+LIBBUILTIN(strtok, "c*c*cC*", "f", "string.h")
+LIBBUILTIN(memset, "v*v*iz", "f", "string.h")
+LIBBUILTIN(strerror, "c*i", "f", "string.h")
+LIBBUILTIN(strlen, "zcC*", "f", "string.h")
+// C99 stdio.h
LIBBUILTIN(printf, "icC*.", "fp:0:", "stdio.h")
LIBBUILTIN(fprintf, "iP*cC*.", "fp:1:", "stdio.h")
LIBBUILTIN(snprintf, "ic*zcC*.", "fp:2:", "stdio.h")
@@ -360,6 +366,18 @@ LIBBUILTIN(vfprintf, "i.", "fP:1:
LIBBUILTIN(vsnprintf, "ic*zcC*a", "fP:2:", "stdio.h")
LIBBUILTIN(vsprintf, "ic*cC*a", "fP:1:", "stdio.h")
+// Non-C library functions
+// FIXME: Non-C-standard stuff shouldn't be builtins in non-GNU mode!
+LIBBUILTIN(alloca, "v*z", "f", "stdlib.h")
+// POSIX string.h
+LIBBUILTIN(stpcpy, "c*c*cC*", "f", "string.h")
+LIBBUILTIN(stpncpy, "c*c*cC*z", "f", "string.h")
+LIBBUILTIN(strdup, "c*cC*", "f", "string.h")
+LIBBUILTIN(strndup, "c*cC*z", "f", "string.h")
+// POSIX strings.h
+LIBBUILTIN(index, "c*cC*i", "f", "strings.h")
+LIBBUILTIN(rindex, "c*cC*i", "f", "strings.h")
+
// FIXME: This type isn't very correct, it should be
// id objc_msgSend(id, SEL)
// but we need new type letters for that.
Modified: vendor/clang/dist/include/clang/AST/Decl.h
==============================================================================
--- vendor/clang/dist/include/clang/AST/Decl.h Sat Jun 6 08:21:06 2009 (r193575)
+++ vendor/clang/dist/include/clang/AST/Decl.h Sat Jun 6 08:21:31 2009 (r193576)
@@ -515,10 +515,22 @@ public:
objcDeclQualifier = QTVal;
}
- const Expr *getDefaultArg() const { return DefaultArg; }
- Expr *getDefaultArg() { return DefaultArg; }
+ const Expr *getDefaultArg() const {
+ assert(!hasUnparsedDefaultArg() && "Default argument is not yet parsed!");
+ return DefaultArg;
+ }
+ Expr *getDefaultArg() {
+ assert(!hasUnparsedDefaultArg() && "Default argument is not yet parsed!");
+ return DefaultArg;
+ }
void setDefaultArg(Expr *defarg) { DefaultArg = defarg; }
+ /// hasDefaultArg - Determines whether this parameter has a default argument,
+ /// either parsed or not.
+ bool hasDefaultArg() const {
+ return DefaultArg != 0;
+ }
+
/// hasUnparsedDefaultArg - Determines whether this parameter has a
/// default argument that has not yet been parsed. This will occur
/// during the processing of a C++ class whose member functions have
Modified: vendor/clang/dist/include/clang/AST/DeclObjC.h
==============================================================================
--- vendor/clang/dist/include/clang/AST/DeclObjC.h Sat Jun 6 08:21:06 2009 (r193575)
+++ vendor/clang/dist/include/clang/AST/DeclObjC.h Sat Jun 6 08:21:31 2009 (r193576)
@@ -330,6 +330,7 @@ public:
// Get the local instance/class method declared in this interface.
ObjCMethodDecl *getInstanceMethod(ASTContext &Context, Selector Sel) const;
ObjCMethodDecl *getClassMethod(ASTContext &Context, Selector Sel) const;
+ ObjCIvarDecl *getIvarDecl(ASTContext &Context, IdentifierInfo *Id) const;
ObjCMethodDecl *
getMethod(ASTContext &Context, Selector Sel, bool isInstance) const {
Modified: vendor/clang/dist/include/clang/AST/DeclTemplate.h
==============================================================================
--- vendor/clang/dist/include/clang/AST/DeclTemplate.h Sat Jun 6 08:21:06 2009 (r193575)
+++ vendor/clang/dist/include/clang/AST/DeclTemplate.h Sat Jun 6 08:21:31 2009 (r193576)
@@ -203,6 +203,9 @@ public:
/// Get the position of the template parameter within its parameter list.
unsigned getPosition() const { return Position; }
+
+ /// Get the index of the template parameter within its parameter list.
+ unsigned getIndex() const { return Position; }
};
/// TemplateTypeParmDecl - Declaration of a template type parameter,
@@ -299,7 +302,8 @@ public:
using TemplateParmPosition::getDepth;
using TemplateParmPosition::getPosition;
-
+ using TemplateParmPosition::getIndex;
+
/// \brief Determine whether this template parameter has a default
/// argument.
bool hasDefaultArgument() const { return DefaultArgument; }
@@ -350,7 +354,8 @@ public:
using TemplateParmPosition::getDepth;
using TemplateParmPosition::getPosition;
-
+ using TemplateParmPosition::getIndex;
+
/// \brief Determine whether this template parameter has a default
/// argument.
bool hasDefaultArgument() const { return DefaultArgument; }
@@ -390,20 +395,21 @@ class TemplateArgument {
public:
/// \brief The type of template argument we're storing.
enum ArgKind {
+ Null = 0,
/// The template argument is a type. It's value is stored in the
/// TypeOrValue field.
- Type = 0,
+ Type = 1,
/// The template argument is a declaration
- Declaration = 1,
+ Declaration = 2,
/// The template argument is an integral value stored in an llvm::APSInt.
- Integral = 2,
+ Integral = 3,
/// The template argument is a value- or type-dependent expression
/// stored in an Expr*.
- Expression = 3
+ Expression = 4
} Kind;
/// \brief Construct an empty, invalid template argument.
- TemplateArgument() : TypeOrValue(0), StartLoc(), Kind(Type) { }
+ TemplateArgument() : TypeOrValue(0), StartLoc(), Kind(Null) { }
/// \brief Construct a template type argument.
TemplateArgument(SourceLocation Loc, QualType T) : Kind(Type) {
@@ -484,6 +490,9 @@ public:
/// \brief Return the kind of stored template argument.
ArgKind getKind() const { return Kind; }
+ /// \brief Determine whether this template argument has no value.
+ bool isNull() const { return Kind == Null; }
+
/// \brief Retrieve the template argument as a type.
QualType getAsType() const {
if (Kind != Type)
@@ -519,6 +528,12 @@ public:
return QualType::getFromOpaquePtr(Integer.Type);
}
+ void setIntegralType(QualType T) {
+ assert(Kind == Integral &&
+ "Cannot set the integral type of a non-integral template argument");
+ Integer.Type = T.getAsOpaquePtr();
+ };
+
/// \brief Retrieve the template argument as an expression.
Expr *getAsExpr() const {
if (Kind != Expression)
@@ -534,6 +549,9 @@ public:
void Profile(llvm::FoldingSetNodeID &ID) const {
ID.AddInteger(Kind);
switch (Kind) {
+ case Null:
+ break;
+
case Type:
getAsType().Profile(ID);
break;
@@ -555,6 +573,22 @@ public:
}
};
+/// \brief A helper class for making template argument lists.
+class TemplateArgumentListBuilder {
+ llvm::SmallVector Args;
+
+ ASTContext &Context;
+public:
+ TemplateArgumentListBuilder(ASTContext &Context) : Context(Context) { }
+
+ // FIXME: Should use the index array size.
+ size_t size() const { return Args.size(); }
+ size_t flatSize() const { return Args.size(); }
+
+ void push_back(const TemplateArgument& Arg);
+ TemplateArgument *getFlatArgumentList() { return Args.data(); }
+};
+
/// \brief A template argument list.
///
/// FIXME: In the future, this class will be extended to support
@@ -571,12 +605,10 @@ class TemplateArgumentList {
/// argument list.
unsigned NumArguments;
-
public:
TemplateArgumentList(ASTContext &Context,
- TemplateArgument *TemplateArgs,
- unsigned NumTemplateArgs,
- bool CopyArgs);
+ TemplateArgumentListBuilder &Builder,
+ bool CopyArgs, bool FlattenArgs);
~TemplateArgumentList();
@@ -660,14 +692,13 @@ protected:
ClassTemplateSpecializationDecl(ASTContext &Context, Kind DK,
DeclContext *DC, SourceLocation L,
ClassTemplateDecl *SpecializedTemplate,
- TemplateArgument *TemplateArgs,
- unsigned NumTemplateArgs);
+ TemplateArgumentListBuilder &Builder);
public:
static ClassTemplateSpecializationDecl *
Create(ASTContext &Context, DeclContext *DC, SourceLocation L,
ClassTemplateDecl *SpecializedTemplate,
- TemplateArgument *TemplateArgs, unsigned NumTemplateArgs,
+ TemplateArgumentListBuilder &Builder,
ClassTemplateSpecializationDecl *PrevDecl);
/// \brief Retrieve the template that this specialization specializes.
@@ -730,11 +761,9 @@ class ClassTemplatePartialSpecialization
DeclContext *DC, SourceLocation L,
TemplateParameterList *Params,
ClassTemplateDecl *SpecializedTemplate,
- TemplateArgument *TemplateArgs,
- unsigned NumTemplateArgs)
+ TemplateArgumentListBuilder &Builder)
: ClassTemplateSpecializationDecl(Context, ClassTemplatePartialSpecialization,
- DC, L, SpecializedTemplate, TemplateArgs,
- NumTemplateArgs),
+ DC, L, SpecializedTemplate, Builder),
TemplateParams(Params) { }
public:
@@ -742,7 +771,7 @@ public:
Create(ASTContext &Context, DeclContext *DC, SourceLocation L,
TemplateParameterList *Params,
ClassTemplateDecl *SpecializedTemplate,
- TemplateArgument *TemplateArgs, unsigned NumTemplateArgs,
+ TemplateArgumentListBuilder &Builder,
ClassTemplatePartialSpecializationDecl *PrevDecl);
/// Get the list of template parameters
Modified: vendor/clang/dist/include/clang/AST/ExprCXX.h
==============================================================================
--- vendor/clang/dist/include/clang/AST/ExprCXX.h Sat Jun 6 08:21:06 2009 (r193575)
+++ vendor/clang/dist/include/clang/AST/ExprCXX.h Sat Jun 6 08:21:31 2009 (r193576)
@@ -1023,14 +1023,17 @@ class CXXExprWithTemporaries : public Ex
CXXTemporary **Temps;
unsigned NumTemps;
- CXXExprWithTemporaries(Expr *subexpr, CXXTemporary **temps,
- unsigned numtemps);
+ bool DestroyTemps;
+
+ CXXExprWithTemporaries(Expr *SubExpr, CXXTemporary **Temps,
+ unsigned NumTemps, bool DestroyTemps);
~CXXExprWithTemporaries();
public:
static CXXExprWithTemporaries *Create(ASTContext &C, Expr *SubExpr,
CXXTemporary **Temps,
- unsigned NumTemps);
+ unsigned NumTemps,
+ bool DestroyTems);
void Destroy(ASTContext &C);
unsigned getNumTemporaries() const { return NumTemps; }
Modified: vendor/clang/dist/include/clang/Basic/DiagnosticFrontendKinds.td
==============================================================================
--- vendor/clang/dist/include/clang/Basic/DiagnosticFrontendKinds.td Sat Jun 6 08:21:06 2009 (r193575)
+++ vendor/clang/dist/include/clang/Basic/DiagnosticFrontendKinds.td Sat Jun 6 08:21:31 2009 (r193576)
@@ -130,6 +130,9 @@ def warn_pch_compiler_options_mismatch :
def warn_pch_access_control : Error<
"C++ access control was %select{disabled|enabled}0 in the PCH file but "
"is currently %select{disabled|enabled}1">;
+def warn_pch_char_signed : Error<
+ "char was %select{unsigned|signed}0 in the PCH file but "
+ "is currently %select{unsigned|signed}1">;
def err_not_a_pch_file : Error<
"'%0' does not appear to be a precompiled header file">, DefaultFatal;
Modified: vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td
==============================================================================
--- vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td Sat Jun 6 08:21:06 2009 (r193575)
+++ vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td Sat Jun 6 08:21:31 2009 (r193576)
@@ -264,6 +264,8 @@ def warn_pragma_expected_rparen : Warnin
"missing ')' after '#pragma %0' - ignoring">;
def warn_pragma_expected_identifier : Warning<
"expected identifier in '#pragma %0' - ignored">;
+def warn_pragma_extra_tokens_at_eol : Warning<
+ "extra tokens at end of '#pragma %0' - ignored">;
// - #pragma pack
def warn_pragma_pack_invalid_action : Warning<
"unknown action for '#pragma pack' - ignored">;
Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td
==============================================================================
--- vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Sat Jun 6 08:21:06 2009 (r193575)
+++ vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Sat Jun 6 08:21:31 2009 (r193576)
@@ -131,6 +131,8 @@ def warn_pragma_pack_pop_failed : Warnin
def warn_pragma_unused_expected_localvar : Warning<
"only local variables can be arguments to '#pragma unused'">;
+def err_unsupported_pragma_weak : Error<
+ "using '#pragma weak' to refer to an undeclared identifier is not yet supported">;
/// Objective-C parser diagnostics
def err_duplicate_class_def : Error<
Modified: vendor/clang/dist/include/clang/Basic/LangOptions.h
==============================================================================
--- vendor/clang/dist/include/clang/Basic/LangOptions.h Sat Jun 6 08:21:06 2009 (r193575)
+++ vendor/clang/dist/include/clang/Basic/LangOptions.h Sat Jun 6 08:21:31 2009 (r193576)
@@ -79,6 +79,7 @@ public:
unsigned AccessControl : 1; // Whether C++ access control should
// be enabled.
+ unsigned CharIsSigned : 1; // Whether char is a signed or unsigned type
private:
unsigned GC : 2; // Objective-C Garbage Collection modes. We declare
// this enum as unsigned because MSVC insists on making enums
@@ -137,6 +138,8 @@ public:
GNUInline = 0;
NoInline = 0;
+ CharIsSigned = 1;
+
MainFileName = 0;
}
Modified: vendor/clang/dist/include/clang/Basic/TargetInfo.h
==============================================================================
--- vendor/clang/dist/include/clang/Basic/TargetInfo.h Sat Jun 6 08:21:06 2009 (r193575)
+++ vendor/clang/dist/include/clang/Basic/TargetInfo.h Sat Jun 6 08:21:31 2009 (r193576)
@@ -38,7 +38,6 @@ class TargetInfo {
protected:
// Target values set by the ctor of the actual target implementation. Default
// values are specified by the TargetInfo constructor.
- bool CharIsSigned;
bool TLSSupported;
unsigned char PointerWidth, PointerAlign;
unsigned char WCharWidth, WCharAlign;
@@ -88,11 +87,6 @@ public:
IntType getIntPtrType() const { return IntPtrType; }
IntType getWCharType() const { return WCharType; }
- /// isCharSigned - Return true if 'char' is 'signed char' or false if it is
- /// treated as 'unsigned char'. This is implementation defined according to
- /// C99 6.2.5p15. In our implementation, this is target-specific.
- bool isCharSigned() const { return CharIsSigned; }
-
/// getPointerWidth - Return the width of pointers on this target, for the
/// specified address space.
uint64_t getPointerWidth(unsigned AddrSpace) const {
Modified: vendor/clang/dist/include/clang/Driver/Options.def
==============================================================================
--- vendor/clang/dist/include/clang/Driver/Options.def Sat Jun 6 08:21:06 2009 (r193575)
+++ vendor/clang/dist/include/clang/Driver/Options.def Sat Jun 6 08:21:31 2009 (r193576)
@@ -194,6 +194,7 @@ OPTION("--no-integrated-cpp", _no_integr
OPTION("--no-line-commands", _no_line_commands, Flag, INVALID, P, "", 0, 0, 0)
OPTION("--no-standard-includes", _no_standard_includes, Flag, INVALID, nostdinc, "", 0, 0, 0)
OPTION("--no-standard-libraries", _no_standard_libraries, Flag, INVALID, nostdlib, "", 0, 0, 0)
+OPTION("--no-undefined", _no_undefined, Flag, INVALID, INVALID, "l", 0, 0, 0)
OPTION("--no-warnings", _no_warnings, Flag, INVALID, w, "", 0, 0, 0)
OPTION("--optimize=", _optimize_EQ, Joined, INVALID, O, "u", 0, 0, 0)
OPTION("--optimize", _optimize, Flag, INVALID, O, "u", 0, 0, 0)
@@ -226,6 +227,7 @@ OPTION("--resource=", _resource_EQ, Join
OPTION("--resource", _resource, Separate, INVALID, fcompile_resource_EQ, "J", 0, 0, 0)
OPTION("--save-temps", _save_temps, Flag, INVALID, save_temps, "", 0, 0, 0)
OPTION("--shared", _shared, Flag, INVALID, shared, "", 0, 0, 0)
+OPTION("--signed-char", _signed_char, Flag, INVALID, fsigned_char, "", 0, 0, 0)
OPTION("--specs=", _specs_EQ, Joined, INVALID, specs_EQ, "u", 0, 0, 0)
OPTION("--specs", _specs, Separate, INVALID, specs_EQ, "uJ", 0, 0, 0)
OPTION("--static", _static, Flag, INVALID, static, "", 0, 0, 0)
@@ -240,6 +242,7 @@ OPTION("--traditional", _traditional, Fl
OPTION("--trigraphs", _trigraphs, Flag, INVALID, trigraphs, "", 0, 0, 0)
OPTION("--undefine-macro=", _undefine_macro_EQ, Joined, INVALID, U, "", 0, 0, 0)
OPTION("--undefine-macro", _undefine_macro, Separate, INVALID, U, "J", 0, 0, 0)
+OPTION("--unsigned-char", _unsigned_char, Flag, INVALID, funsigned_char, "", 0, 0, 0)
OPTION("--user-dependencies", _user_dependencies, Flag, INVALID, MM, "", 0, 0, 0)
OPTION("--verbose", _verbose, Flag, INVALID, v, "", 0, 0, 0)
OPTION("--version", _version, Flag, INVALID, INVALID, "", 0, 0, 0)
@@ -364,6 +367,7 @@ OPTION("-fblocks", fblocks, Flag, f_Grou
OPTION("-fbootclasspath=", fbootclasspath_EQ, Joined, f_Group, INVALID, "", 0, 0, 0)
OPTION("-fbuiltin", fbuiltin, Flag, f_Group, INVALID, "", 0, 0, 0)
OPTION("-fclasspath=", fclasspath_EQ, Joined, f_Group, INVALID, "", 0, 0, 0)
+OPTION("-fcolor-diagnostics", fcolor_diagnostics, Flag, f_Group, INVALID, "", 0, 0, 0)
OPTION("-fcommon", fcommon, Flag, f_Group, INVALID, "", 0, 0, 0)
OPTION("-fcompile-resource=", fcompile_resource_EQ, Joined, f_Group, INVALID, "", 0, 0, 0)
OPTION("-fconstant-cfstrings", fconstant_cfstrings, Flag, clang_ignored_f_Group, INVALID, "", 0, 0, 0)
@@ -402,6 +406,7 @@ OPTION("-fno-asynchronous-unwind-tables"
OPTION("-fno-blocks", fno_blocks, Flag, f_Group, INVALID, "", 0, 0, 0)
OPTION("-fno-builtin", fno_builtin, Flag, f_Group, INVALID, "", 0, 0, 0)
OPTION("-fno-caret-diagnostics", fno_caret_diagnostics, Flag, f_Group, INVALID, "", 0, 0, 0)
+OPTION("-fno-color-diagnostics", fno_color_diagnostics, Flag, f_Group, INVALID, "", 0, 0, 0)
OPTION("-fno-common", fno_common, Flag, f_Group, INVALID, "", 0, 0, 0)
OPTION("-fno-constant-cfstrings", fno_constant_cfstrings, Flag, f_Group, INVALID, "", 0, 0, 0)
OPTION("-fno-diagnostics-fixit-info", fno_diagnostics_fixit_info, Flag, f_Group, INVALID, "", 0, 0, 0)
@@ -442,6 +447,7 @@ OPTION("-fprofile-arcs", fprofile_arcs,
OPTION("-fprofile-generate", fprofile_generate, Flag, f_Group, INVALID, "", 0, 0, 0)
OPTION("-framework", framework, Separate, INVALID, INVALID, "l", 0, 0, 0)
OPTION("-fsigned-bitfields", fsigned_bitfields, Flag, f_Group, INVALID, "", 0, 0, 0)
+OPTION("-fsigned-char", fsigned_char, Flag, f_Group, INVALID, "", 0, 0, 0)
OPTION("-fstack-protector", fstack_protector, Flag, clang_ignored_f_Group, INVALID, "", 0, 0, 0)
OPTION("-fstrict-aliasing", fstrict_aliasing, Flag, clang_ignored_f_Group, INVALID, "", 0, 0, 0)
OPTION("-fsyntax-only", fsyntax_only, Flag, INVALID, INVALID, "d", 0, 0, 0)
@@ -452,6 +458,7 @@ OPTION("-ftraditional", ftraditional, Fl
OPTION("-ftrapv", ftrapv, Flag, f_Group, INVALID, "", 0, 0, 0)
OPTION("-funit-at-a-time", funit_at_a_time, Flag, f_Group, INVALID, "", 0, 0, 0)
OPTION("-funsigned-bitfields", funsigned_bitfields, Flag, f_Group, INVALID, "", 0, 0, 0)
+OPTION("-funsigned-char", funsigned_char, Flag, f_Group, INVALID, "", 0, 0, 0)
OPTION("-funwind-tables", funwind_tables, Flag, f_Group, INVALID, "", 0, 0, 0)
OPTION("-fverbose-asm", fverbose_asm, Flag, f_Group, INVALID, "", 0, 0, 0)
OPTION("-fvisibility=", fvisibility_EQ, Joined, f_Group, INVALID, "", 0, 0, 0)
@@ -569,6 +576,7 @@ OPTION("-pthread", pthread, Flag, INVALI
OPTION("-p", p, Flag, INVALID, INVALID, "", 0, 0, 0)
OPTION("-read_only_relocs", read__only__relocs, Separate, INVALID, INVALID, "", 0, 0, 0)
OPTION("-remap", remap, Flag, INVALID, INVALID, "", 0, 0, 0)
+OPTION("-rpath", rpath, Separate, INVALID, INVALID, "l", 0, 0, 0)
OPTION("-r", r, Flag, INVALID, INVALID, "", 0, 0, 0)
OPTION("-save-temps", save_temps, Flag, INVALID, INVALID, "d", 0,
"Save intermediate compilation results", 0)
Modified: vendor/clang/dist/include/clang/Frontend/CompileOptions.h
==============================================================================
--- vendor/clang/dist/include/clang/Frontend/CompileOptions.h Sat Jun 6 08:21:06 2009 (r193575)
+++ vendor/clang/dist/include/clang/Frontend/CompileOptions.h Sat Jun 6 08:21:31 2009 (r193576)
@@ -41,6 +41,8 @@ public:
/// should be run through the LLVM Verifier.
unsigned TimePasses : 1; /// Set when -ftime-report is enabled.
unsigned NoCommon : 1; /// Set when -fno-common or C++ is enabled.
+ unsigned DisableRedZone : 1; /// Set when -mno-red-zone is enabled.
+ unsigned NoImplicitFloat : 1; /// Set when -mno-implicit-float is enabled.
/// Inlining - The kind of inlining to perform.
InliningMethod Inlining;
@@ -63,6 +65,8 @@ public:
TimePasses = 0;
NoCommon = 0;
Inlining = NoInlining;
+ DisableRedZone = 0;
+ NoImplicitFloat = 0;
}
};
Modified: vendor/clang/dist/include/clang/Frontend/TextDiagnosticPrinter.h
==============================================================================
--- vendor/clang/dist/include/clang/Frontend/TextDiagnosticPrinter.h Sat Jun 6 08:21:06 2009 (r193575)
+++ vendor/clang/dist/include/clang/Frontend/TextDiagnosticPrinter.h Sat Jun 6 08:21:31 2009 (r193576)
@@ -40,6 +40,7 @@ class TextDiagnosticPrinter : public Dia
bool PrintDiagnosticOption;
bool PrintFixItInfo;
unsigned MessageLength;
+ bool UseColors;
public:
TextDiagnosticPrinter(llvm::raw_ostream &os,
@@ -48,14 +49,16 @@ public:
bool printRangeInfo = true,
bool printDiagnosticOption = true,
bool printFixItInfo = true,
- unsigned messageLength = 0)
+ unsigned messageLength = 0,
+ bool useColors = false)
: OS(os), LangOpts(0),
LastCaretDiagnosticWasNote(false), ShowColumn(showColumn),
CaretDiagnostics(caretDiagnistics), ShowLocation(showLocation),
PrintRangeInfo(printRangeInfo),
PrintDiagnosticOption(printDiagnosticOption),
PrintFixItInfo(printFixItInfo),
- MessageLength(messageLength) {}
+ MessageLength(messageLength),
+ UseColors(useColors) {}
void setLangOptions(const LangOptions *LO) {
LangOpts = LO;
Modified: vendor/clang/dist/include/clang/Parse/Action.h
==============================================================================
--- vendor/clang/dist/include/clang/Parse/Action.h Sat Jun 6 08:21:06 2009 (r193575)
+++ vendor/clang/dist/include/clang/Parse/Action.h Sat Jun 6 08:21:31 2009 (r193576)
@@ -417,6 +417,7 @@ public:
}
virtual DeclPtrTy ActOnIvar(Scope *S, SourceLocation DeclStart,
+ DeclPtrTy IntfDecl,
Declarator &D, ExprTy *BitfieldWidth,
tok::ObjCKeywordKind visibility) {
return DeclPtrTy();
@@ -1750,13 +1751,29 @@ public:
return;
}
- /// ActOnPragmaPack - Called on well formed #pragma pack(...).
+ /// ActOnPragmaUnused - Called on well formed #pragma unused(...).
virtual void ActOnPragmaUnused(ExprTy **Exprs, unsigned NumExprs,
SourceLocation PragmaLoc,
SourceLocation LParenLoc,
SourceLocation RParenLoc) {
return;
- }
+ }
+
+ /// ActOnPragmaWeakID - Called on well formed #pragma weak ident.
+ virtual void ActOnPragmaWeakID(IdentifierInfo* WeakName,
+ SourceLocation PragmaLoc,
+ SourceLocation WeakNameLoc) {
+ return;
+ }
+
+ /// ActOnPragmaWeakAlias - Called on well formed #pragma weak ident = ident.
+ virtual void ActOnPragmaWeakAlias(IdentifierInfo* WeakName,
+ IdentifierInfo* AliasName,
+ SourceLocation PragmaLoc,
+ SourceLocation WeakNameLoc,
+ SourceLocation AliasNameLoc) {
+ return;
+ }
};
/// MinimalAction - Minimal actions are used by light-weight clients of the
Modified: vendor/clang/dist/include/clang/Parse/Parser.h
==============================================================================
--- vendor/clang/dist/include/clang/Parse/Parser.h Sat Jun 6 08:21:06 2009 (r193575)
+++ vendor/clang/dist/include/clang/Parse/Parser.h Sat Jun 6 08:21:31 2009 (r193576)
@@ -81,6 +81,7 @@ class Parser {
llvm::OwningPtr PackHandler;
llvm::OwningPtr UnusedHandler;
+ llvm::OwningPtr WeakHandler;
/// Whether the '>' token acts as an operator or not. This will be
/// true except when we are parsing an expression within a C++
Modified: vendor/clang/dist/lib/AST/ASTContext.cpp
==============================================================================
--- vendor/clang/dist/lib/AST/ASTContext.cpp Sat Jun 6 08:21:06 2009 (r193575)
+++ vendor/clang/dist/lib/AST/ASTContext.cpp Sat Jun 6 08:21:31 2009 (r193576)
@@ -143,7 +143,7 @@ void ASTContext::InitBuiltinTypes() {
// C99 6.2.5p2.
InitBuiltinType(BoolTy, BuiltinType::Bool);
// C99 6.2.5p3.
- if (Target.isCharSigned())
+ if (LangOpts.CharIsSigned)
InitBuiltinType(CharTy, BuiltinType::Char_S);
else
InitBuiltinType(CharTy, BuiltinType::Char_U);
@@ -613,6 +613,20 @@ void ASTContext::CollectObjCIvars(const
CollectLocalObjCIvars(this, OI, Fields);
}
+/// ShallowCollectObjCIvars -
+/// Collect all ivars, including those synthesized, in the current class.
+///
+void ASTContext::ShallowCollectObjCIvars(const ObjCInterfaceDecl *OI,
+ llvm::SmallVectorImpl &Ivars,
+ bool CollectSynthesized) {
+ for (ObjCInterfaceDecl::ivar_iterator I = OI->ivar_begin(),
+ E = OI->ivar_end(); I != E; ++I) {
+ Ivars.push_back(*I);
+ }
+ if (CollectSynthesized)
+ CollectSynthesizedIvars(OI, Ivars);
+}
+
void ASTContext::CollectProtocolSynthesizedIvars(const ObjCProtocolDecl *PD,
llvm::SmallVectorImpl &Ivars) {
for (ObjCContainerDecl::prop_iterator I = PD->prop_begin(*this),
@@ -645,6 +659,38 @@ void ASTContext::CollectSynthesizedIvars
}
}
+unsigned ASTContext::CountProtocolSynthesizedIvars(const ObjCProtocolDecl *PD) {
+ unsigned count = 0;
+ for (ObjCContainerDecl::prop_iterator I = PD->prop_begin(*this),
+ E = PD->prop_end(*this); I != E; ++I)
+ if ((*I)->getPropertyIvarDecl())
+ ++count;
+
+ // Also look into nested protocols.
+ for (ObjCProtocolDecl::protocol_iterator P = PD->protocol_begin(),
+ E = PD->protocol_end(); P != E; ++P)
+ count += CountProtocolSynthesizedIvars(*P);
+ return count;
+}
+
+unsigned ASTContext::CountSynthesizedIvars(const ObjCInterfaceDecl *OI)
+{
+ unsigned count = 0;
+ for (ObjCInterfaceDecl::prop_iterator I = OI->prop_begin(*this),
+ E = OI->prop_end(*this); I != E; ++I) {
+ if ((*I)->getPropertyIvarDecl())
+ ++count;
+ }
+ // Also look into interface's protocol list for properties declared
+ // in the protocol and whose ivars are synthesized.
+ for (ObjCInterfaceDecl::protocol_iterator P = OI->protocol_begin(),
+ PE = OI->protocol_end(); P != PE; ++P) {
+ ObjCProtocolDecl *PD = (*P);
+ count += CountProtocolSynthesizedIvars(PD);
+ }
+ return count;
+}
+
/// getInterfaceLayoutImpl - Get or compute information about the
/// layout of the given interface.
///
@@ -664,14 +710,13 @@ ASTContext::getObjCLayout(const ObjCInte
unsigned FieldCount = D->ivar_size();
// Add in synthesized ivar count if laying out an implementation.
if (Impl) {
- llvm::SmallVector Ivars;
- CollectSynthesizedIvars(D, Ivars);
- FieldCount += Ivars.size();
+ unsigned SynthCount = CountSynthesizedIvars(D);
+ FieldCount += SynthCount;
// If there aren't any sythesized ivars then reuse the interface
// entry. Note we can't cache this because we simply free all
// entries later; however we shouldn't look up implementations
// frequently.
- if (FieldCount == D->ivar_size())
+ if (SynthCount == 0)
return getObjCLayout(D, 0);
}
@@ -701,20 +746,11 @@ ASTContext::getObjCLayout(const ObjCInte
// Layout each ivar sequentially.
unsigned i = 0;
- for (ObjCInterfaceDecl::ivar_iterator IVI = D->ivar_begin(),
- IVE = D->ivar_end(); IVI != IVE; ++IVI) {
- const ObjCIvarDecl* Ivar = (*IVI);
- NewEntry->LayoutField(Ivar, i++, false, StructPacking, *this);
- }
- // And synthesized ivars, if this is an implementation.
- if (Impl) {
- // FIXME. Do we need to colltect twice?
- llvm::SmallVector Ivars;
- CollectSynthesizedIvars(D, Ivars);
- for (unsigned k = 0, e = Ivars.size(); k != e; ++k)
- NewEntry->LayoutField(Ivars[k], i++, false, StructPacking, *this);
- }
-
+ llvm::SmallVector Ivars;
+ ShallowCollectObjCIvars(D, Ivars, Impl);
+ for (unsigned k = 0, e = Ivars.size(); k != e; ++k)
+ NewEntry->LayoutField(Ivars[k], i++, false, StructPacking, *this);
+
// Finally, round the size of the total struct up to the alignment of the
// struct itself.
NewEntry->FinalizeLayout();
Modified: vendor/clang/dist/lib/AST/Decl.cpp
==============================================================================
--- vendor/clang/dist/lib/AST/Decl.cpp Sat Jun 6 08:21:06 2009 (r193575)
+++ vendor/clang/dist/lib/AST/Decl.cpp Sat Jun 6 08:21:31 2009 (r193576)
@@ -489,7 +489,7 @@ void FunctionDecl::setParams(ASTContext&
unsigned FunctionDecl::getMinRequiredArguments() const {
unsigned NumRequiredArgs = getNumParams();
while (NumRequiredArgs > 0
- && getParamDecl(NumRequiredArgs-1)->getDefaultArg())
+ && getParamDecl(NumRequiredArgs-1)->hasDefaultArg())
--NumRequiredArgs;
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***