svn commit: r210128 - in vendor/clang/dist: include/clang/AST
include/clang/Basic include/clang/Driver
include/clang/Frontend include/clang/Rewrite lib/AST
lib/Basic lib/Checker lib/CodeGen lib/Dri...
Roman Divacky
rdivacky at FreeBSD.org
Thu Jul 15 17:07:13 UTC 2010
Author: rdivacky
Date: Thu Jul 15 17:07:12 2010
New Revision: 210128
URL: http://svn.freebsd.org/changeset/base/210128
Log:
Update clang to r108428.
Added:
vendor/clang/dist/include/clang/Frontend/PCHDeserializationListener.h
vendor/clang/dist/runtime/
vendor/clang/dist/runtime/Makefile
vendor/clang/dist/test/CodeCompletion/Inputs/reserved.h
vendor/clang/dist/test/CodeGenCXX/lvalue-bitcasts.cpp
vendor/clang/dist/test/CodeGenCXX/member-qual-debug-info.cpp
vendor/clang/dist/test/PCH/pchpch.c
vendor/clang/dist/test/PCH/pchpch1.h
vendor/clang/dist/test/PCH/pchpch2.h
vendor/clang/dist/test/SemaCXX/cv-unqual-rvalues.cpp
vendor/clang/dist/test/SemaTemplate/deduction-crash.cpp
Modified:
vendor/clang/dist/include/clang/AST/DeclBase.h
vendor/clang/dist/include/clang/AST/DeclObjC.h
vendor/clang/dist/include/clang/AST/Expr.h
vendor/clang/dist/include/clang/AST/Type.h
vendor/clang/dist/include/clang/Basic/Builtins.def
vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td
vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td
vendor/clang/dist/include/clang/Basic/FileManager.h
vendor/clang/dist/include/clang/Basic/TargetInfo.h
vendor/clang/dist/include/clang/Driver/ArgList.h
vendor/clang/dist/include/clang/Driver/Driver.h
vendor/clang/dist/include/clang/Driver/Options.td
vendor/clang/dist/include/clang/Driver/ToolChain.h
vendor/clang/dist/include/clang/Driver/Types.def
vendor/clang/dist/include/clang/Frontend/ASTConsumers.h
vendor/clang/dist/include/clang/Frontend/PCHReader.h
vendor/clang/dist/include/clang/Frontend/PCHWriter.h
vendor/clang/dist/include/clang/Rewrite/Rewriter.h
vendor/clang/dist/lib/AST/DeclTemplate.cpp
vendor/clang/dist/lib/AST/Expr.cpp
vendor/clang/dist/lib/AST/ExprConstant.cpp
vendor/clang/dist/lib/AST/Type.cpp
vendor/clang/dist/lib/Basic/FileManager.cpp
vendor/clang/dist/lib/Basic/TargetInfo.cpp
vendor/clang/dist/lib/Basic/Targets.cpp
vendor/clang/dist/lib/Checker/GRExprEngine.cpp
vendor/clang/dist/lib/Checker/LLVMConventionsChecker.cpp
vendor/clang/dist/lib/CodeGen/CGBlocks.cpp
vendor/clang/dist/lib/CodeGen/CGCall.cpp
vendor/clang/dist/lib/CodeGen/CGClass.cpp
vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp
vendor/clang/dist/lib/CodeGen/CGDecl.cpp
vendor/clang/dist/lib/CodeGen/CGException.cpp
vendor/clang/dist/lib/CodeGen/CGException.h
vendor/clang/dist/lib/CodeGen/CGExpr.cpp
vendor/clang/dist/lib/CodeGen/CGExprAgg.cpp
vendor/clang/dist/lib/CodeGen/CGExprComplex.cpp
vendor/clang/dist/lib/CodeGen/CGExprScalar.cpp
vendor/clang/dist/lib/CodeGen/CGObjCGNU.cpp
vendor/clang/dist/lib/CodeGen/CGObjCMac.cpp
vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp
vendor/clang/dist/lib/CodeGen/CodeGenFunction.h
vendor/clang/dist/lib/CodeGen/CodeGenModule.h
vendor/clang/dist/lib/CodeGen/Mangle.cpp
vendor/clang/dist/lib/CodeGen/TargetInfo.cpp
vendor/clang/dist/lib/Driver/ArgList.cpp
vendor/clang/dist/lib/Driver/Driver.cpp
vendor/clang/dist/lib/Driver/ToolChain.cpp
vendor/clang/dist/lib/Driver/ToolChains.cpp
vendor/clang/dist/lib/Driver/Tools.cpp
vendor/clang/dist/lib/Frontend/ASTUnit.cpp
vendor/clang/dist/lib/Frontend/FrontendActions.cpp
vendor/clang/dist/lib/Frontend/GeneratePCH.cpp
vendor/clang/dist/lib/Frontend/PCHReader.cpp
vendor/clang/dist/lib/Frontend/PCHWriter.cpp
vendor/clang/dist/lib/Rewrite/Rewriter.cpp
vendor/clang/dist/lib/Sema/Sema.h
vendor/clang/dist/lib/Sema/SemaCXXCast.cpp
vendor/clang/dist/lib/Sema/SemaCodeComplete.cpp
vendor/clang/dist/lib/Sema/SemaDecl.cpp
vendor/clang/dist/lib/Sema/SemaExpr.cpp
vendor/clang/dist/lib/Sema/SemaExprCXX.cpp
vendor/clang/dist/lib/Sema/SemaInit.cpp
vendor/clang/dist/lib/Sema/SemaObjCProperty.cpp
vendor/clang/dist/lib/Sema/SemaOverload.cpp
vendor/clang/dist/lib/Sema/SemaTemplate.cpp
vendor/clang/dist/lib/Sema/SemaTemplateInstantiate.cpp
vendor/clang/dist/lib/Sema/TreeTransform.h
vendor/clang/dist/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3.cpp
vendor/clang/dist/test/CodeCompletion/ordinary-name.c
vendor/clang/dist/test/CodeGenCXX/condition.cpp
vendor/clang/dist/test/CodeGenCXX/eh.cpp
vendor/clang/dist/test/CodeGenCXX/instantiate-blocks.cpp
vendor/clang/dist/test/CodeGenCXX/mangle.cpp
vendor/clang/dist/test/CodeGenCXX/nrvo.cpp
vendor/clang/dist/test/CodeGenCXX/static-init-2.cpp
vendor/clang/dist/test/CodeGenObjC/metadata_symbols.m
vendor/clang/dist/test/CodeGenObjC/unwind-fn.m
vendor/clang/dist/test/Driver/darwin-iphone-defaults.m
vendor/clang/dist/test/Driver/darwin-ld.c
vendor/clang/dist/test/Frontend/darwin-version.c
vendor/clang/dist/test/Index/c-index-api-loadTU-test.m
vendor/clang/dist/test/Makefile
vendor/clang/dist/test/Sema/block-call.c
vendor/clang/dist/test/Sema/block-return.c
vendor/clang/dist/test/Sema/exprs.c
vendor/clang/dist/test/Sema/i-c-e.c
vendor/clang/dist/test/Sema/return.c
vendor/clang/dist/test/Sema/struct-cast.c
vendor/clang/dist/test/Sema/switch.c
vendor/clang/dist/test/SemaCXX/ambig-user-defined-conversions.cpp
vendor/clang/dist/test/SemaCXX/bool.cpp
vendor/clang/dist/test/SemaCXX/conditional-expr.cpp
vendor/clang/dist/test/SemaCXX/friend.cpp
vendor/clang/dist/test/SemaCXX/return.cpp
vendor/clang/dist/test/SemaCXX/switch.cpp
vendor/clang/dist/test/SemaObjC/default-synthesize.m
vendor/clang/dist/test/SemaObjC/method-sentinel-attr.m
vendor/clang/dist/test/SemaObjC/property-10.m
vendor/clang/dist/test/SemaTemplate/deduction.cpp
vendor/clang/dist/utils/TestUtils/pch-test.pl
Modified: vendor/clang/dist/include/clang/AST/DeclBase.h
==============================================================================
--- vendor/clang/dist/include/clang/AST/DeclBase.h Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/include/clang/AST/DeclBase.h Thu Jul 15 17:07:12 2010 (r210128)
@@ -92,7 +92,7 @@ public:
/// These are meant as bitmasks, so that searches in
/// C++ can look into the "tag" namespace during ordinary lookup.
///
- /// Decl currently provides 16 bits of IDNS bits.
+ /// Decl currently provides 15 bits of IDNS bits.
enum IdentifierNamespace {
/// Labels, declared with 'x:' and referenced with 'goto x'.
IDNS_Label = 0x0001,
@@ -225,10 +225,10 @@ protected:
// PCHLevel - the "level" of precompiled header/AST file from which this
// declaration was built.
- unsigned PCHLevel : 2;
+ unsigned PCHLevel : 3;
/// IdentifierNamespace - This specifies what IDNS_* namespace this lives in.
- unsigned IdentifierNamespace : 16;
+ unsigned IdentifierNamespace : 15;
private:
#ifndef NDEBUG
@@ -358,14 +358,14 @@ public:
unsigned getPCHLevel() const { return PCHLevel; }
/// \brief The maximum PCH level that any declaration may have.
- static const unsigned MaxPCHLevel = 3;
-
+ static const unsigned MaxPCHLevel = 7;
+
/// \brief Set the PCH level of this declaration.
void setPCHLevel(unsigned Level) {
- assert(Level < MaxPCHLevel && "PCH level exceeds the maximum");
+ assert(Level <= MaxPCHLevel && "PCH level exceeds the maximum");
PCHLevel = Level;
}
-
+
unsigned getIdentifierNamespace() const {
return IdentifierNamespace;
}
Modified: vendor/clang/dist/include/clang/AST/DeclObjC.h
==============================================================================
--- vendor/clang/dist/include/clang/AST/DeclObjC.h Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/include/clang/AST/DeclObjC.h Thu Jul 15 17:07:12 2010 (r210128)
@@ -242,7 +242,7 @@ public:
/// \brief Determine the type of an expression that sends a message to this
/// function.
QualType getSendResultType() const {
- return getResultType().getCallResultType(getASTContext());
+ return getResultType().getNonLValueExprType(getASTContext());
}
TypeSourceInfo *getResultTypeSourceInfo() const { return ResultTInfo; }
Modified: vendor/clang/dist/include/clang/AST/Expr.h
==============================================================================
--- vendor/clang/dist/include/clang/AST/Expr.h Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/include/clang/AST/Expr.h Thu Jul 15 17:07:12 2010 (r210128)
@@ -1854,6 +1854,10 @@ public:
/// CK_BitCast - Used for reinterpret_cast.
CK_BitCast,
+ /// CK_LValueBitCast - Used for reinterpret_cast of expressions to
+ /// a reference type.
+ CK_LValueBitCast,
+
/// CK_NoOp - Used for const_cast.
CK_NoOp,
@@ -1957,6 +1961,7 @@ private:
// These should not have an inheritance path.
case CK_Unknown:
case CK_BitCast:
+ case CK_LValueBitCast:
case CK_NoOp:
case CK_Dynamic:
case CK_ToUnion:
Modified: vendor/clang/dist/include/clang/AST/Type.h
==============================================================================
--- vendor/clang/dist/include/clang/AST/Type.h Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/include/clang/AST/Type.h Thu Jul 15 17:07:12 2010 (r210128)
@@ -629,13 +629,15 @@ public:
bool isAtLeastAsQualifiedAs(QualType Other) const;
QualType getNonReferenceType() const;
- /// \brief Determine the type of an expression that calls a function of
- /// with the given result type.
+ /// \brief Determine the type of a (typically non-lvalue) expression with the
+ /// specified result type.
///
- /// This routine removes a top-level reference (since there are no
+ /// This routine should be used for expressions for which the return type is
+ /// explicitly specified (e.g., in a cast or call) and isn't necessarily
+ /// an lvalue. It removes a top-level reference (since there are no
/// expressions of reference type) and deletes top-level cvr-qualifiers
/// from non-class types (in C++) or all types (in C).
- QualType getCallResultType(ASTContext &Context) const;
+ QualType getNonLValueExprType(ASTContext &Context) const;
/// getDesugaredType - Return the specified type with any "sugar" removed from
/// the type. This takes off typedefs, typeof's etc. If the outer level of
@@ -784,19 +786,27 @@ private:
/// \brief Linkage of this type.
mutable unsigned CachedLinkage : 2;
-
+
+ /// \brief FromPCH - Whether this type comes from a PCH file.
+ mutable bool FromPCH : 1;
+
+ /// \brief Set whether this type comes from a PCH file.
+ void setFromPCH(bool V = true) const {
+ FromPCH = V;
+ }
+
protected:
/// \brief Compute the linkage of this type.
virtual Linkage getLinkageImpl() const;
- enum { BitsRemainingInType = 20 };
+ enum { BitsRemainingInType = 19 };
// silence VC++ warning C4355: 'this' : used in base member initializer list
Type *this_() { return this; }
Type(TypeClass tc, QualType Canonical, bool dependent)
: CanonicalType(Canonical.isNull() ? QualType(this_(), 0) : Canonical),
TC(tc), Dependent(dependent), LinkageKnown(false),
- CachedLinkage(NoLinkage) {}
+ CachedLinkage(NoLinkage), FromPCH(false) {}
virtual ~Type() {}
virtual void Destroy(ASTContext& C);
friend class ASTContext;
@@ -804,6 +814,9 @@ protected:
public:
TypeClass getTypeClass() const { return static_cast<TypeClass>(TC); }
+ /// \brief Whether this type comes from a PCH file.
+ bool isFromPCH() const { return FromPCH; }
+
bool isCanonicalUnqualified() const {
return CanonicalType.getTypePtr() == this;
}
@@ -1907,7 +1920,7 @@ public:
/// \brief Determine the type of an expression that calls a function of
/// this type.
QualType getCallResultType(ASTContext &Context) const {
- return getResultType().getCallResultType(Context);
+ return getResultType().getNonLValueExprType(Context);
}
static llvm::StringRef getNameForCallConv(CallingConv CC);
Modified: vendor/clang/dist/include/clang/Basic/Builtins.def
==============================================================================
--- vendor/clang/dist/include/clang/Basic/Builtins.def Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/include/clang/Basic/Builtins.def Thu Jul 15 17:07:12 2010 (r210128)
@@ -314,6 +314,7 @@ BUILTIN(__builtin_setjmp, "iv**", "")
BUILTIN(__builtin_longjmp, "vv**i", "r")
BUILTIN(__builtin_unwind_init, "v", "")
BUILTIN(__builtin_eh_return_data_regno, "ii", "nc")
+BUILTIN(__builtin_snprintf, "ic*zcC*.", "nFp:2:")
BUILTIN(__builtin_vsprintf, "ic*cC*a", "nFP:1:")
BUILTIN(__builtin_vsnprintf, "ic*zcC*a", "nFP:2:")
Modified: vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td
==============================================================================
--- vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td Thu Jul 15 17:07:12 2010 (r210128)
@@ -48,6 +48,7 @@ def CXXHexFloats : DiagGroup<"c++-hex-fl
def : DiagGroup<"c++0x-compat", [CXXHexFloats]>;
def FourByteMultiChar : DiagGroup<"four-char-constants">;
def : DiagGroup<"idiomatic-parentheses">;
+def IgnoredQualifiers : DiagGroup<"ignored-qualifiers">;
def : DiagGroup<"import">;
def : DiagGroup<"init-self">;
def : DiagGroup<"inline">;
@@ -167,6 +168,7 @@ def Format2 : DiagGroup<"format=2",
def Extra : DiagGroup<"extra", [
MissingFieldInitializers,
+ IgnoredQualifiers,
InitializerOverrides,
SemiBeforeMethodBody,
SignCompare,
Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td
==============================================================================
--- vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Thu Jul 15 17:07:12 2010 (r210128)
@@ -121,7 +121,8 @@ def warn_use_out_of_scope_declaration :
def err_inline_non_function : Error<
"'inline' can only appear on functions">;
def warn_qual_return_type : Warning<
- "'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">;
+ "'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">,
+ InGroup<IgnoredQualifiers>, DefaultIgnore;
def warn_decl_shadow :
Warning<"declaration shadows a %select{"
@@ -1986,6 +1987,10 @@ def note_precedence_bitwise_first : Note
"place parentheses around the %0 expression to evaluate it first">;
def note_precedence_bitwise_silence : Note<
"place parentheses around the %0 expression to silence this warning">;
+
+def warn_logical_instead_of_bitwise : Warning<
+ "use of logical %0 with constant operand; switch to bitwise %1 or "
+ "remove constant">, InGroup<DiagGroup<"logical-bitwise-confusion">>;
def err_sizeof_nonfragile_interface : Error<
"invalid application of '%select{alignof|sizeof}1' to interface %0 in "
Modified: vendor/clang/dist/include/clang/Basic/FileManager.h
==============================================================================
--- vendor/clang/dist/include/clang/Basic/FileManager.h Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/include/clang/Basic/FileManager.h Thu Jul 15 17:07:12 2010 (r210128)
@@ -189,7 +189,7 @@ public:
/// getDirectory - Lookup, cache, and verify the specified directory. This
/// returns null if the directory doesn't exist.
///
- const DirectoryEntry *getDirectory(const llvm::StringRef &Filename) {
+ const DirectoryEntry *getDirectory(llvm::StringRef Filename) {
return getDirectory(Filename.begin(), Filename.end());
}
const DirectoryEntry *getDirectory(const char *FileStart,const char *FileEnd);
@@ -197,7 +197,7 @@ public:
/// getFile - Lookup, cache, and verify the specified file. This returns null
/// if the file doesn't exist.
///
- const FileEntry *getFile(const llvm::StringRef &Filename) {
+ const FileEntry *getFile(llvm::StringRef Filename) {
return getFile(Filename.begin(), Filename.end());
}
const FileEntry *getFile(const char *FilenameStart,
@@ -206,8 +206,8 @@ public:
/// \brief Retrieve a file entry for a "virtual" file that acts as
/// if there were a file with the given name on disk. The file
/// itself is not accessed.
- const FileEntry *getVirtualFile(const llvm::StringRef &Filename,
- off_t Size, time_t ModificationTime);
+ const FileEntry *getVirtualFile(llvm::StringRef Filename, off_t Size,
+ time_t ModificationTime);
void PrintStats() const;
};
Modified: vendor/clang/dist/include/clang/Basic/TargetInfo.h
==============================================================================
--- vendor/clang/dist/include/clang/Basic/TargetInfo.h Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/include/clang/Basic/TargetInfo.h Thu Jul 15 17:07:12 2010 (r210128)
@@ -61,6 +61,7 @@ protected:
std::string CXXABI;
unsigned HasAlignMac68kSupport : 1;
+ unsigned RealTypeUsesObjCFPRet : 3;
// TargetInfo Constructor. Default initializes all fields.
TargetInfo(const std::string &T);
@@ -87,6 +88,13 @@ public:
SignedLongLong,
UnsignedLongLong
};
+
+ enum RealType {
+ Float = 0,
+ Double,
+ LongDouble
+ };
+
protected:
IntType SizeType, IntMaxType, UIntMaxType, PtrDiffType, IntPtrType, WCharType,
WIntType, Char16Type, Char32Type, Int64Type, SigAtomicType;
@@ -233,6 +241,12 @@ public:
/// integer type enum. For example, SignedLong -> "L".
static const char *getTypeConstantSuffix(IntType T);
+ /// \brief Check whether the given real type should use the "fpret" flavor of
+ /// Obj-C message passing on this target.
+ bool useObjCFPRetForRealType(RealType T) const {
+ return RealTypeUsesObjCFPRet & (1 << T);
+ }
+
///===---- Other target property query methods --------------------------===//
/// getTargetDefines - Appends the target-specific #define values for this
Modified: vendor/clang/dist/include/clang/Driver/ArgList.h
==============================================================================
--- vendor/clang/dist/include/clang/Driver/ArgList.h Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/include/clang/Driver/ArgList.h Thu Jul 15 17:07:12 2010 (r210128)
@@ -179,6 +179,8 @@ namespace driver {
Arg *getLastArg(OptSpecifier Id) const;
Arg *getLastArg(OptSpecifier Id0, OptSpecifier Id1) const;
Arg *getLastArg(OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2) const;
+ Arg *getLastArg(OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2,
+ OptSpecifier Id3) const;
/// getArgString - Return the input argument string at \arg Index.
virtual const char *getArgString(unsigned Index) const = 0;
Modified: vendor/clang/dist/include/clang/Driver/Driver.h
==============================================================================
--- vendor/clang/dist/include/clang/Driver/Driver.h Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/include/clang/Driver/Driver.h Thu Jul 15 17:07:12 2010 (r210128)
@@ -62,6 +62,9 @@ public:
/// command line.
std::string Dir;
+ /// The original path to the clang executable.
+ std::string ClangExecutable;
+
/// The path to the compiler resource directory.
std::string ResourceDir;
@@ -163,6 +166,11 @@ public:
const std::string &getTitle() { return DriverTitle; }
void setTitle(std::string Value) { DriverTitle = Value; }
+ /// \brief Get the path to the main clang executable.
+ std::string getClangProgramPath() const {
+ return ClangExecutable;
+ }
+
/// @}
/// @name Primary Functionality
/// @{
Modified: vendor/clang/dist/include/clang/Driver/Options.td
==============================================================================
--- vendor/clang/dist/include/clang/Driver/Options.td Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/include/clang/Driver/Options.td Thu Jul 15 17:07:12 2010 (r210128)
@@ -230,6 +230,7 @@ def exported__symbols__list : Separate<"
def e : JoinedOrSeparate<"-e">;
def fPIC : Flag<"-fPIC">, Group<f_Group>;
def fPIE : Flag<"-fPIE">, Group<f_Group>;
+def fno_PIE : Flag<"-fno-PIE">, Group<f_Group>;
def faccess_control : Flag<"-faccess-control">, Group<f_Group>;
def fapple_kext : Flag<"-fapple-kext">, Group<f_Group>;
def fasm : Flag<"-fasm">, Group<f_Group>;
@@ -356,6 +357,7 @@ def fpascal_strings : Flag<"-fpascal-str
def fpch_preprocess : Flag<"-fpch-preprocess">, Group<f_Group>;
def fpic : Flag<"-fpic">, Group<f_Group>;
def fpie : Flag<"-fpie">, Group<f_Group>;
+def fno_pie : Flag<"-fno-pie">, Group<f_Group>;
def fprofile_arcs : Flag<"-fprofile-arcs">, Group<f_Group>;
def fprofile_generate : Flag<"-fprofile-generate">, Group<f_Group>;
def framework : Separate<"-framework">, Flags<[LinkerInput]>;
@@ -436,11 +438,11 @@ def mfix_and_continue : Flag<"-mfix-and-
def mfloat_abi_EQ : Joined<"-mfloat-abi=">, Group<m_Group>;
def mfpu_EQ : Joined<"-mfpu=">, Group<m_Group>;
def mhard_float : Flag<"-mhard-float">, Group<m_Group>;
-def miphoneos_version_min_EQ : Joined<"-miphoneos-version-min=">, Group<m_Group>, Flags<[DriverOption]>;
+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>;
def mkernel : Flag<"-mkernel">, Group<m_Group>;
def mllvm : Separate<"-mllvm">;
-def mmacosx_version_min_EQ : Joined<"-mmacosx-version-min=">, Group<m_Group>, Flags<[DriverOption]>;
+def mmacosx_version_min_EQ : Joined<"-mmacosx-version-min=">, Group<m_Group>;
def mmmx : Flag<"-mmmx">, Group<m_x86_Features_Group>;
def mno_3dnowa : Flag<"-mno-3dnowa">, Group<m_x86_Features_Group>;
def mno_3dnow : Flag<"-mno-3dnow">, Group<m_x86_Features_Group>;
Modified: vendor/clang/dist/include/clang/Driver/ToolChain.h
==============================================================================
--- vendor/clang/dist/include/clang/Driver/ToolChain.h Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/include/clang/Driver/ToolChain.h Thu Jul 15 17:07:12 2010 (r210128)
@@ -84,9 +84,8 @@ public:
// Helper methods
- std::string GetFilePath(const Compilation &C, const char *Name) const;
- std::string GetProgramPath(const Compilation &C, const char *Name,
- bool WantFile = false) const;
+ std::string GetFilePath(const char *Name) const;
+ std::string GetProgramPath(const char *Name, bool WantFile = false) const;
// Platform defaults information
Modified: vendor/clang/dist/include/clang/Driver/Types.def
==============================================================================
--- vendor/clang/dist/include/clang/Driver/Types.def Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/include/clang/Driver/Types.def Thu Jul 15 17:07:12 2010 (r210128)
@@ -69,8 +69,8 @@ TYPE("java", Java,
// LLVM IR/LTO types. We define separate types for IR and LTO because LTO
// outputs should use the standard suffixes.
-TYPE("ir", LLVM_IR, INVALID, "ll", "")
-TYPE("ir", LLVM_BC, INVALID, "bc", "")
+TYPE("ir", LLVM_IR, INVALID, "ll", "u")
+TYPE("ir", LLVM_BC, INVALID, "bc", "u")
TYPE("lto-ir", LTO_IR, INVALID, "s", "")
TYPE("lto-bc", LTO_BC, INVALID, "o", "")
Modified: vendor/clang/dist/include/clang/Frontend/ASTConsumers.h
==============================================================================
--- vendor/clang/dist/include/clang/Frontend/ASTConsumers.h Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/include/clang/Frontend/ASTConsumers.h Thu Jul 15 17:07:12 2010 (r210128)
@@ -63,7 +63,7 @@ ASTConsumer *CreateDeclContextPrinter();
// times.
ASTConsumer *CreatePCHGenerator(const Preprocessor &PP,
llvm::raw_ostream *OS,
- const PCHReader *Chain,
+ PCHReader *Chain,
const char *isysroot = 0);
// Inheritance viewer: for C++ code, creates a graph of the inheritance
Added: vendor/clang/dist/include/clang/Frontend/PCHDeserializationListener.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ vendor/clang/dist/include/clang/Frontend/PCHDeserializationListener.h Thu Jul 15 17:07:12 2010 (r210128)
@@ -0,0 +1,36 @@
+//===- PCHDeserializationListener.h - Decl/Type PCH Read Events -*- 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 PCHDeserializationListener class, which is notified
+// by the PCHReader whenever a type or declaration is deserialized.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_FRONTEND_PCH_DESERIALIZATION_LISTENER_H
+#define LLVM_CLANG_FRONTEND_PCH_DESERIALIZATION_LISTENER_H
+
+#include "clang/Frontend/PCHBitCodes.h"
+
+namespace clang {
+
+class Decl;
+class QualType;
+
+class PCHDeserializationListener {
+protected:
+ ~PCHDeserializationListener() {}
+
+public:
+ virtual void TypeRead(pch::TypeID ID, QualType T) = 0;
+ virtual void DeclRead(pch::DeclID ID, const Decl *D) = 0;
+};
+
+}
+
+#endif
Modified: vendor/clang/dist/include/clang/Frontend/PCHReader.h
==============================================================================
--- vendor/clang/dist/include/clang/Frontend/PCHReader.h Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/include/clang/Frontend/PCHReader.h Thu Jul 15 17:07:12 2010 (r210128)
@@ -59,12 +59,22 @@ class GotoStmt;
class LabelStmt;
class MacroDefinition;
class NamedDecl;
+class PCHDeserializationListener;
class Preprocessor;
class Sema;
class SwitchCase;
class PCHReader;
struct HeaderFileInfo;
+struct PCHPredefinesBlock {
+ /// \brief The file ID for this predefines buffer in a PCH file.
+ FileID BufferID;
+
+ /// \brief This predefines buffer in a PCH file.
+ llvm::StringRef Data;
+};
+typedef llvm::SmallVector<PCHPredefinesBlock, 2> PCHPredefinesBlocks;
+
/// \brief Abstract interface for callback invocations by the PCHReader.
///
/// While reading a PCH file, the PCHReader will call the methods of the
@@ -91,10 +101,7 @@ public:
/// \brief Receives the contents of the predefines buffer.
///
- /// \param PCHPredef The start of the predefines buffer in the PCH
- /// file.
- ///
- /// \param PCHBufferID The FileID for the PCH predefines buffer.
+ /// \param Buffers Information about the predefines buffers.
///
/// \param OriginalFileName The original file name for the PCH, which will
/// appear as an entry in the predefines buffer.
@@ -103,8 +110,7 @@ public:
/// here.
///
/// \returns true to indicate the predefines are invalid or false otherwise.
- virtual bool ReadPredefinesBuffer(llvm::StringRef PCHPredef,
- FileID PCHBufferID,
+ virtual bool ReadPredefinesBuffer(const PCHPredefinesBlocks &Buffers,
llvm::StringRef OriginalFileName,
std::string &SuggestedPredefines) {
return false;
@@ -131,8 +137,7 @@ public:
virtual bool ReadLanguageOptions(const LangOptions &LangOpts);
virtual bool ReadTargetTriple(llvm::StringRef Triple);
- virtual bool ReadPredefinesBuffer(llvm::StringRef PCHPredef,
- FileID PCHBufferID,
+ virtual bool ReadPredefinesBuffer(const PCHPredefinesBlocks &Buffers,
llvm::StringRef OriginalFileName,
std::string &SuggestedPredefines);
virtual void ReadHeaderFileInfo(const HeaderFileInfo &HFI, unsigned ID);
@@ -165,9 +170,12 @@ public:
enum PCHReadResult { Success, Failure, IgnorePCH };
friend class PCHValidator;
private:
- /// \ brief The receiver of some callbacks invoked by PCHReader.
+ /// \brief The receiver of some callbacks invoked by PCHReader.
llvm::OwningPtr<PCHReaderListener> Listener;
+ /// \brief The receiver of deserialization events.
+ PCHDeserializationListener *DeserializationListener;
+
SourceManager &SourceMgr;
FileManager &FileMgr;
Diagnostic &Diags;
@@ -483,15 +491,9 @@ private:
~ReadingKindTracker() { Reader.ReadingKind = PrevKind; }
};
- /// \brief The file ID for the predefines buffer in the PCH file.
- FileID PCHPredefinesBufferID;
-
- /// \brief Pointer to the beginning of the predefines buffer in the
- /// PCH file.
- const char *PCHPredefines;
-
- /// \brief Length of the predefines buffer in the PCH file.
- unsigned PCHPredefinesLen;
+ /// \brief All predefines buffers in all PCH files, to be treated as if
+ /// concatenated.
+ PCHPredefinesBlocks PCHPredefinesBuffers;
/// \brief Suggested contents of the predefines buffer, after this
/// PCH file has been processed.
@@ -509,7 +511,7 @@ private:
void MaybeAddSystemRootToFilename(std::string &Filename);
PCHReadResult ReadPCHBlock();
- bool CheckPredefinesBuffer(llvm::StringRef PCHPredef, FileID PCHBufferID);
+ bool CheckPredefinesBuffers();
bool ParseLineTable(llvm::SmallVectorImpl<uint64_t> &Record);
PCHReadResult ReadSourceManagerBlock();
PCHReadResult ReadSLocEntryRecord(unsigned ID);
@@ -576,6 +578,10 @@ public:
Listener.reset(listener);
}
+ void setDeserializationListener(PCHDeserializationListener *Listener) {
+ DeserializationListener = Listener;
+ }
+
/// \brief Set the Preprocessor to use.
void setPreprocessor(Preprocessor &pp);
@@ -602,6 +608,16 @@ public:
/// \brief Read preprocessed entities into the
virtual void ReadPreprocessedEntities();
+ /// \brief Returns the number of types found in this file.
+ unsigned getTotalNumTypes() const {
+ return static_cast<unsigned>(TypesLoaded.size());
+ }
+
+ /// \brief Returns the number of declarations found in this file.
+ unsigned getTotalNumDecls() const {
+ return static_cast<unsigned>(DeclsLoaded.size());
+ }
+
/// \brief Reads a TemplateArgumentLocInfo appropriate for the
/// given TemplateArgument kind.
TemplateArgumentLocInfo
Modified: vendor/clang/dist/include/clang/Frontend/PCHWriter.h
==============================================================================
--- vendor/clang/dist/include/clang/Frontend/PCHWriter.h Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/include/clang/Frontend/PCHWriter.h Thu Jul 15 17:07:12 2010 (r210128)
@@ -19,6 +19,7 @@
#include "clang/AST/DeclarationName.h"
#include "clang/AST/TemplateBase.h"
#include "clang/Frontend/PCHBitCodes.h"
+#include "clang/Frontend/PCHDeserializationListener.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
#include <map>
@@ -71,7 +72,7 @@ struct UnsafeQualTypeDenseMapInfo {
/// representation of a given abstract syntax tree and its supporting
/// data structures. This bitstream can be de-serialized via an
/// instance of the PCHReader class.
-class PCHWriter {
+class PCHWriter : public PCHDeserializationListener {
public:
typedef llvm::SmallVector<uint64_t, 64> RecordData;
@@ -79,6 +80,9 @@ private:
/// \brief The bitstream writer used to emit this precompiled header.
llvm::BitstreamWriter &Stream;
+ /// \brief The reader of existing PCH files, if we're chaining.
+ PCHReader *Chain;
+
/// \brief Stores a declaration or a type to be written to the PCH file.
class DeclOrType {
public:
@@ -220,7 +224,7 @@ private:
void WriteSubStmt(Stmt *S);
void WriteBlockInfoBlock();
- void WriteMetadata(ASTContext &Context, const PCHReader *Chain, const char *isysroot);
+ void WriteMetadata(ASTContext &Context, const char *isysroot);
void WriteLanguageOptions(const LangOptions &LangOpts);
void WriteStatCache(MemorizeStatCalls &StatCalls);
void WriteSourceManagerBlock(SourceManager &SourceMgr,
@@ -242,12 +246,12 @@ private:
void WritePCHCore(Sema &SemaRef, MemorizeStatCalls *StatCalls,
const char* isysroot);
void WritePCHChain(Sema &SemaRef, MemorizeStatCalls *StatCalls,
- const PCHReader *Chain, const char* isysroot);
+ const char* isysroot);
public:
/// \brief Create a new precompiled header writer that outputs to
/// the given bitstream.
- PCHWriter(llvm::BitstreamWriter &Stream);
+ PCHWriter(llvm::BitstreamWriter &Stream, PCHReader *Chain);
/// \brief Write a precompiled header for the given semantic analysis.
///
@@ -263,7 +267,7 @@ public:
/// \param PPRec Record of the preprocessing actions that occurred while
/// preprocessing this file, e.g., macro instantiations
void WritePCH(Sema &SemaRef, MemorizeStatCalls *StatCalls,
- const PCHReader *Chain, const char* isysroot);
+ const char* isysroot);
/// \brief Emit a source location.
void AddSourceLocation(SourceLocation Loc, RecordData &Record);
@@ -393,6 +397,10 @@ public:
unsigned GetLabelID(LabelStmt *S);
unsigned getParmVarDeclAbbrev() const { return ParmVarDeclAbbrev; }
+
+ // PCHDeserializationListener implementation
+ void TypeRead(pch::TypeID ID, QualType T);
+ void DeclRead(pch::DeclID ID, const Decl *D);
};
} // end namespace clang
Modified: vendor/clang/dist/include/clang/Rewrite/Rewriter.h
==============================================================================
--- vendor/clang/dist/include/clang/Rewrite/Rewriter.h Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/include/clang/Rewrite/Rewriter.h Thu Jul 15 17:07:12 2010 (r210128)
@@ -64,7 +64,7 @@ public:
/// the buffer is specified relative to the original SourceBuffer. The
/// text is inserted after the specified location.
///
- void InsertText(unsigned OrigOffset, const llvm::StringRef &Str,
+ void InsertText(unsigned OrigOffset, llvm::StringRef Str,
bool InsertAfter = true);
@@ -72,14 +72,14 @@ public:
/// offset in the buffer is specified relative to the original
/// SourceBuffer. The text is inserted before the specified location. This is
/// method is the same as InsertText with "InsertAfter == false".
- void InsertTextBefore(unsigned OrigOffset, const llvm::StringRef &Str) {
+ void InsertTextBefore(unsigned OrigOffset, llvm::StringRef Str) {
InsertText(OrigOffset, Str, false);
}
/// InsertTextAfter - Insert some text at the specified point, where the
/// offset in the buffer is specified relative to the original SourceBuffer.
/// The text is inserted after the specified location.
- void InsertTextAfter(unsigned OrigOffset, const llvm::StringRef &Str) {
+ void InsertTextAfter(unsigned OrigOffset, llvm::StringRef Str) {
InsertText(OrigOffset, Str);
}
@@ -87,7 +87,7 @@ public:
/// buffer with a new string. This is effectively a combined "remove/insert"
/// operation.
void ReplaceText(unsigned OrigOffset, unsigned OrigLength,
- const llvm::StringRef &NewStr);
+ llvm::StringRef NewStr);
private: // Methods only usable by Rewriter.
@@ -164,7 +164,7 @@ public:
/// InsertText - Insert the specified string at the specified location in the
/// original buffer. This method returns true (and does nothing) if the input
/// location was not rewritable, false otherwise.
- bool InsertText(SourceLocation Loc, const llvm::StringRef &Str,
+ bool InsertText(SourceLocation Loc, llvm::StringRef Str,
bool InsertAfter = true);
/// InsertTextAfter - Insert the specified string at the specified location in
@@ -172,7 +172,7 @@ public:
/// the input location was not rewritable, false otherwise. Text is
/// inserted after any other text that has been previously inserted
/// at the some point (the default behavior for InsertText).
- bool InsertTextAfter(SourceLocation Loc, const llvm::StringRef &Str) {
+ bool InsertTextAfter(SourceLocation Loc, llvm::StringRef Str) {
return InsertText(Loc, Str);
}
@@ -181,7 +181,7 @@ public:
/// location was not rewritable, false otherwise. Text is
/// inserted before any other text that has been previously inserted
/// at the some point.
- bool InsertTextBefore(SourceLocation Loc, const llvm::StringRef &Str) {
+ bool InsertTextBefore(SourceLocation Loc, llvm::StringRef Str) {
return InsertText(Loc, Str, false);
}
@@ -192,7 +192,7 @@ public:
/// buffer with a new string. This is effectively a combined "remove/insert"
/// operation.
bool ReplaceText(SourceLocation Start, unsigned OrigLength,
- const llvm::StringRef &NewStr);
+ llvm::StringRef NewStr);
/// ReplaceStmt - This replaces a Stmt/Expr with another, using the pretty
/// printer to generate the replacement code. This returns true if the input
Modified: vendor/clang/dist/lib/AST/DeclTemplate.cpp
==============================================================================
--- vendor/clang/dist/lib/AST/DeclTemplate.cpp Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/lib/AST/DeclTemplate.cpp Thu Jul 15 17:07:12 2010 (r210128)
@@ -223,7 +223,7 @@ ClassTemplateDecl::getInjectedClassNameS
} else if (NonTypeTemplateParmDecl *NTTP =
dyn_cast<NonTypeTemplateParmDecl>(*Param)) {
Expr *E = new (Context) DeclRefExpr(NTTP,
- NTTP->getType().getNonReferenceType(),
+ NTTP->getType().getNonLValueExprType(Context),
NTTP->getLocation());
TemplateArgs.push_back(TemplateArgument(E));
} else {
Modified: vendor/clang/dist/lib/AST/Expr.cpp
==============================================================================
--- vendor/clang/dist/lib/AST/Expr.cpp Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/lib/AST/Expr.cpp Thu Jul 15 17:07:12 2010 (r210128)
@@ -684,6 +684,8 @@ const char *CastExpr::getCastKindName()
return "Unknown";
case CastExpr::CK_BitCast:
return "BitCast";
+ case CastExpr::CK_LValueBitCast:
+ return "LValueBitCast";
case CastExpr::CK_NoOp:
return "NoOp";
case CastExpr::CK_BaseToDerived:
Modified: vendor/clang/dist/lib/AST/ExprConstant.cpp
==============================================================================
--- vendor/clang/dist/lib/AST/ExprConstant.cpp Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/lib/AST/ExprConstant.cpp Thu Jul 15 17:07:12 2010 (r210128)
@@ -563,6 +563,7 @@ bool PointerExprEvaluator::VisitCastExpr
case CastExpr::CK_NoOp:
case CastExpr::CK_BitCast:
+ case CastExpr::CK_LValueBitCast:
case CastExpr::CK_AnyPointerToObjCPointerCast:
case CastExpr::CK_AnyPointerToBlockPointerCast:
return Visit(SubExpr);
Modified: vendor/clang/dist/lib/AST/Type.cpp
==============================================================================
--- vendor/clang/dist/lib/AST/Type.cpp Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/lib/AST/Type.cpp Thu Jul 15 17:07:12 2010 (r210128)
@@ -992,7 +992,7 @@ const char *BuiltinType::getName(const L
void FunctionType::ANCHOR() {} // Key function for FunctionType.
-QualType QualType::getCallResultType(ASTContext &Context) const {
+QualType QualType::getNonLValueExprType(ASTContext &Context) const {
if (const ReferenceType *RefType = getTypePtr()->getAs<ReferenceType>())
return RefType->getPointeeType();
@@ -1002,7 +1002,7 @@ QualType QualType::getCallResultType(AST
//
// See also C99 6.3.2.1p2.
if (!Context.getLangOptions().CPlusPlus ||
- !getTypePtr()->isDependentType() && !getTypePtr()->isRecordType())
+ (!getTypePtr()->isDependentType() && !getTypePtr()->isRecordType()))
return getUnqualifiedType();
return *this;
Modified: vendor/clang/dist/lib/Basic/FileManager.cpp
==============================================================================
--- vendor/clang/dist/lib/Basic/FileManager.cpp Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/lib/Basic/FileManager.cpp Thu Jul 15 17:07:12 2010 (r210128)
@@ -331,8 +331,8 @@ const FileEntry *FileManager::getFile(co
}
const FileEntry *
-FileManager::getVirtualFile(const llvm::StringRef &Filename,
- off_t Size, time_t ModificationTime) {
+FileManager::getVirtualFile(llvm::StringRef Filename, off_t Size,
+ time_t ModificationTime) {
const char *NameStart = Filename.begin(), *NameEnd = Filename.end();
++NumFileLookups;
Modified: vendor/clang/dist/lib/Basic/TargetInfo.cpp
==============================================================================
--- vendor/clang/dist/lib/Basic/TargetInfo.cpp Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/lib/Basic/TargetInfo.cpp Thu Jul 15 17:07:12 2010 (r210128)
@@ -55,6 +55,9 @@ TargetInfo::TargetInfo(const std::string
"i64:64:64-f32:32:32-f64:64:64-n32";
UserLabelPrefix = "_";
HasAlignMac68kSupport = false;
+
+ // Default to no types using fpret.
+ RealTypeUsesObjCFPRet = 0;
}
// Out of line virtual dtor for TargetInfo.
Modified: vendor/clang/dist/lib/Basic/Targets.cpp
==============================================================================
--- vendor/clang/dist/lib/Basic/Targets.cpp Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/lib/Basic/Targets.cpp Thu Jul 15 17:07:12 2010 (r210128)
@@ -1245,6 +1245,11 @@ public:
PtrDiffType = SignedInt;
IntPtrType = SignedInt;
RegParmMax = 3;
+
+ // Use fpret for all types.
+ RealTypeUsesObjCFPRet = ((1 << TargetInfo::Float) |
+ (1 << TargetInfo::Double) |
+ (1 << TargetInfo::LongDouble));
}
virtual const char *getVAListDeclaration() const {
return "typedef char* __builtin_va_list;";
@@ -1411,6 +1416,9 @@ public:
DescriptionString = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-"
"i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-"
"a0:0:64-s0:64:64-f80:128:128-n8:16:32:64";
+
+ // Use fpret only for long double.
+ RealTypeUsesObjCFPRet = (1 << TargetInfo::LongDouble);
}
virtual const char *getVAListDeclaration() const {
return "typedef struct __va_list_tag {"
Modified: vendor/clang/dist/lib/Checker/GRExprEngine.cpp
==============================================================================
--- vendor/clang/dist/lib/Checker/GRExprEngine.cpp Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/lib/Checker/GRExprEngine.cpp Thu Jul 15 17:07:12 2010 (r210128)
@@ -2438,6 +2438,7 @@ void GRExprEngine::VisitCast(CastExpr *C
case CastExpr::CK_Unknown:
case CastExpr::CK_ArrayToPointerDecay:
case CastExpr::CK_BitCast:
+ case CastExpr::CK_LValueBitCast:
case CastExpr::CK_IntegralCast:
case CastExpr::CK_IntegralToPointer:
case CastExpr::CK_PointerToIntegral:
Modified: vendor/clang/dist/lib/Checker/LLVMConventionsChecker.cpp
==============================================================================
--- vendor/clang/dist/lib/Checker/LLVMConventionsChecker.cpp Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/lib/Checker/LLVMConventionsChecker.cpp Thu Jul 15 17:07:12 2010 (r210128)
@@ -36,7 +36,7 @@ static bool IsLLVMStringRef(QualType T)
/// Check whether the declaration is semantically inside the top-level
/// namespace named by ns.
-static bool InNamespace(const Decl *D, const llvm::StringRef &NS) {
+static bool InNamespace(const Decl *D, llvm::StringRef NS) {
const DeclContext *DC = D->getDeclContext();
const NamespaceDecl *ND = dyn_cast<NamespaceDecl>(D->getDeclContext());
if (!ND)
Modified: vendor/clang/dist/lib/CodeGen/CGBlocks.cpp
==============================================================================
--- vendor/clang/dist/lib/CodeGen/CGBlocks.cpp Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/lib/CodeGen/CGBlocks.cpp Thu Jul 15 17:07:12 2010 (r210128)
@@ -253,7 +253,7 @@ llvm::Value *CodeGenFunction::BuildBlock
CodeGenTypes &Types = CGM.getTypes();
const CGFunctionInfo &FnInfo = Types.getFunctionInfo(ResultType, Args,
FunctionType::ExtInfo());
- if (CGM.ReturnTypeUsesSret(FnInfo))
+ if (CGM.ReturnTypeUsesSRet(FnInfo))
flags |= BLOCK_USE_STRET;
}
const llvm::IntegerType *IntTy = cast<llvm::IntegerType>(
Modified: vendor/clang/dist/lib/CodeGen/CGCall.cpp
==============================================================================
--- vendor/clang/dist/lib/CodeGen/CGCall.cpp Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/lib/CodeGen/CGCall.cpp Thu Jul 15 17:07:12 2010 (r210128)
@@ -564,10 +564,28 @@ static void CreateCoercedStore(llvm::Val
/***/
-bool CodeGenModule::ReturnTypeUsesSret(const CGFunctionInfo &FI) {
+bool CodeGenModule::ReturnTypeUsesSRet(const CGFunctionInfo &FI) {
return FI.getReturnInfo().isIndirect();
}
+bool CodeGenModule::ReturnTypeUsesFPRet(QualType ResultType) {
+ if (const BuiltinType *BT = ResultType->getAs<BuiltinType>()) {
+ switch (BT->getKind()) {
+ default:
+ return false;
+ case BuiltinType::Float:
+ return getContext().Target.useObjCFPRetForRealType(TargetInfo::Float);
+ case BuiltinType::Double:
+ return getContext().Target.useObjCFPRetForRealType(TargetInfo::Double);
+ case BuiltinType::LongDouble:
+ return getContext().Target.useObjCFPRetForRealType(
+ TargetInfo::LongDouble);
+ }
+ }
+
+ return false;
+}
+
const llvm::FunctionType *CodeGenTypes::GetFunctionType(GlobalDecl GD) {
const CGFunctionInfo &FI = getFunctionInfo(GD);
@@ -841,7 +859,7 @@ void CodeGenFunction::EmitFunctionProlog
llvm::Function::arg_iterator AI = Fn->arg_begin();
// Name the struct return argument.
- if (CGM.ReturnTypeUsesSret(FI)) {
+ if (CGM.ReturnTypeUsesSRet(FI)) {
AI->setName("agg.result");
++AI;
}
@@ -1116,7 +1134,7 @@ RValue CodeGenFunction::EmitCall(const C
// If the call returns a temporary with struct return, create a temporary
// alloca to hold the result, unless one is given to us.
- if (CGM.ReturnTypeUsesSret(CallInfo)) {
+ if (CGM.ReturnTypeUsesSRet(CallInfo)) {
llvm::Value *Value = ReturnValue.getValue();
if (!Value)
Value = CreateMemTemp(RetTy);
Modified: vendor/clang/dist/lib/CodeGen/CGClass.cpp
==============================================================================
--- vendor/clang/dist/lib/CodeGen/CGClass.cpp Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/lib/CodeGen/CGClass.cpp Thu Jul 15 17:07:12 2010 (r210128)
@@ -340,7 +340,7 @@ static void EmitBaseInitializer(CodeGenF
if (CGF.Exceptions && !BaseClassDecl->hasTrivialDestructor()) {
// FIXME: Is this OK for C++0x delegating constructors?
- CodeGenFunction::CleanupBlock Cleanup(CGF, CodeGenFunction::EHCleanup);
+ CodeGenFunction::CleanupBlock Cleanup(CGF, EHCleanup);
CXXDestructorDecl *DD = BaseClassDecl->getDestructor();
CGF.EmitCXXDestructorCall(DD, Dtor_Base, isBaseVirtual, V);
@@ -534,7 +534,7 @@ static void EmitMemberInitializer(CodeGe
CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
if (!RD->hasTrivialDestructor()) {
// FIXME: Is this OK for C++0x delegating constructors?
- CodeGenFunction::CleanupBlock Cleanup(CGF, CodeGenFunction::EHCleanup);
+ CodeGenFunction::CleanupBlock Cleanup(CGF, EHCleanup);
llvm::Value *ThisPtr = CGF.LoadCXXThis();
LValue LHS = CGF.EmitLValueForField(ThisPtr, Field, 0);
Modified: vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp
==============================================================================
--- vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp Thu Jul 15 17:07:12 2010 (r210128)
@@ -537,11 +537,17 @@ CGDebugInfo::getOrCreateMethodType(const
llvm::DIType ThisPtrType =
DebugFactory.CreateArtificialType(getOrCreateType(ThisPtr, Unit));
- if (Method->getTypeQualifiers() && Qualifiers::Const)
+ unsigned Quals = Method->getTypeQualifiers();
+ if (Quals & Qualifiers::Const)
ThisPtrType =
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_const_type,
Unit, "", Unit,
0, 0, 0, 0, 0, ThisPtrType);
+ if (Quals & Qualifiers::Volatile)
+ ThisPtrType =
+ DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_volatile_type,
+ Unit, "", Unit,
+ 0, 0, 0, 0, 0, ThisPtrType);
TypeCache[ThisPtr.getAsOpaquePtr()] = ThisPtrType;
Elts.push_back(ThisPtrType);
Modified: vendor/clang/dist/lib/CodeGen/CGDecl.cpp
==============================================================================
--- vendor/clang/dist/lib/CodeGen/CGDecl.cpp Thu Jul 15 17:06:11 2010 (r210127)
+++ vendor/clang/dist/lib/CodeGen/CGDecl.cpp Thu Jul 15 17:07:12 2010 (r210128)
@@ -388,6 +388,58 @@ const llvm::Type *CodeGenFunction::Build
return Info.first;
}
+namespace {
+ struct CallArrayDtor : EHScopeStack::LazyCleanup {
+ CallArrayDtor(const CXXDestructorDecl *Dtor,
+ const ConstantArrayType *Type,
+ llvm::Value *Loc)
+ : Dtor(Dtor), Type(Type), Loc(Loc) {}
+
+ const CXXDestructorDecl *Dtor;
+ const ConstantArrayType *Type;
+ llvm::Value *Loc;
+
+ void Emit(CodeGenFunction &CGF, bool IsForEH) {
+ QualType BaseElementTy = CGF.getContext().getBaseElementType(Type);
+ const llvm::Type *BasePtr = CGF.ConvertType(BaseElementTy);
+ BasePtr = llvm::PointerType::getUnqual(BasePtr);
+ llvm::Value *BaseAddrPtr = CGF.Builder.CreateBitCast(Loc, BasePtr);
+ CGF.EmitCXXAggrDestructorCall(Dtor, Type, BaseAddrPtr);
+ }
+ };
+
+ struct CallVarDtor : EHScopeStack::LazyCleanup {
+ CallVarDtor(const CXXDestructorDecl *Dtor,
+ llvm::Value *NRVOFlag,
+ llvm::Value *Loc)
+ : Dtor(Dtor), NRVOFlag(NRVOFlag), Loc(Loc) {}
+
+ const CXXDestructorDecl *Dtor;
+ llvm::Value *NRVOFlag;
+ llvm::Value *Loc;
+
+ void Emit(CodeGenFunction &CGF, bool IsForEH) {
+ // Along the exceptions path we always execute the dtor.
+ bool NRVO = !IsForEH && NRVOFlag;
+
+ llvm::BasicBlock *SkipDtorBB = 0;
+ if (NRVO) {
+ // If we exited via NRVO, we skip the destructor call.
+ llvm::BasicBlock *RunDtorBB = CGF.createBasicBlock("nrvo.unused");
+ SkipDtorBB = CGF.createBasicBlock("nrvo.skipdtor");
+ llvm::Value *DidNRVO = CGF.Builder.CreateLoad(NRVOFlag, "nrvo.val");
+ CGF.Builder.CreateCondBr(DidNRVO, SkipDtorBB, RunDtorBB);
+ CGF.EmitBlock(RunDtorBB);
+ }
+
+ CGF.EmitCXXDestructorCall(Dtor, Dtor_Complete,
+ /*ForVirtualBase=*/false, Loc);
+
+ if (NRVO) CGF.EmitBlock(SkipDtorBB);
+ }
+ };
+}
+
/// EmitLocalBlockVarDecl - Emit code and set up an entry in LocalDeclMap for a
/// variable declaration with auto, register, or no storage class specifier.
/// These turn into simple stack objects, or GlobalValues depending on target.
@@ -686,53 +738,11 @@ void CodeGenFunction::EmitLocalBlockVarD
if (const ConstantArrayType *Array =
getContext().getAsConstantArrayType(Ty)) {
- CleanupBlock Scope(*this, NormalCleanup);
-
- QualType BaseElementTy = getContext().getBaseElementType(Array);
- const llvm::Type *BasePtr = ConvertType(BaseElementTy);
- BasePtr = llvm::PointerType::getUnqual(BasePtr);
- llvm::Value *BaseAddrPtr =
- Builder.CreateBitCast(Loc, BasePtr);
- EmitCXXAggrDestructorCall(D, Array, BaseAddrPtr);
-
- if (Exceptions) {
- Scope.beginEHCleanup();
-
- QualType BaseElementTy = getContext().getBaseElementType(Array);
- const llvm::Type *BasePtr = ConvertType(BaseElementTy);
- BasePtr = llvm::PointerType::getUnqual(BasePtr);
- llvm::Value *BaseAddrPtr =
- Builder.CreateBitCast(Loc, BasePtr);
- EmitCXXAggrDestructorCall(D, Array, BaseAddrPtr);
- }
+ EHStack.pushLazyCleanup<CallArrayDtor>(NormalAndEHCleanup,
+ D, Array, Loc);
} else {
- // Normal destruction.
- CleanupBlock Scope(*this, NormalCleanup);
-
- llvm::BasicBlock *SkipDtor = 0;
- if (NRVO) {
- // If we exited via NRVO, we skip the destructor call.
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-vendor
mailing list