[llvm-branch-commits] [cfe-branch] r148801 - in /cfe/branches/tooling: ./ docs/ include/clang/Basic/ include/clang/Driver/ include/clang/Sema/ include/clang/StaticAnalyzer/Core/PathSensitive/ lib/AST/ lib/CodeGen/ lib/Driver/ lib/Headers/ lib/Parse/ lib/Sema/ test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/ test/CXX/expr/expr.post/expr.type.conv/ test/CXX/stmt.stmt/stmt.ambig/ test/Driver/ test/Sema/ test/SemaCXX/ test/SemaObjC/ test/SemaObjCXX/ tools/libclang/
Manuel Klimek
klimek at google.com
Tue Jan 24 05:11:31 PST 2012
Author: klimek
Date: Tue Jan 24 07:11:31 2012
New Revision: 148801
URL: http://llvm.org/viewvc/llvm-project?rev=148801&view=rev
Log:
Merging mainline.
Added:
cfe/branches/tooling/test/CXX/expr/expr.post/expr.type.conv/p1-0x.cpp
- copied unchanged from r148800, cfe/trunk/test/CXX/expr/expr.post/expr.type.conv/p1-0x.cpp
cfe/branches/tooling/test/CXX/stmt.stmt/stmt.ambig/p1-0x.cpp
- copied unchanged from r148800, cfe/trunk/test/CXX/stmt.stmt/stmt.ambig/p1-0x.cpp
cfe/branches/tooling/test/SemaObjC/forward-class-redeclare.m
- copied unchanged from r148800, cfe/trunk/test/SemaObjC/forward-class-redeclare.m
Removed:
cfe/branches/tooling/test/Sema/switch-enum.c
Modified:
cfe/branches/tooling/ (props changed)
cfe/branches/tooling/docs/AddressSanitizer.html
cfe/branches/tooling/include/clang/Basic/DiagnosticGroups.td
cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td
cfe/branches/tooling/include/clang/Driver/Driver.h
cfe/branches/tooling/include/clang/Driver/HostInfo.h
cfe/branches/tooling/include/clang/Sema/Sema.h
cfe/branches/tooling/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h
cfe/branches/tooling/lib/AST/DeclCXX.cpp
cfe/branches/tooling/lib/CodeGen/TargetInfo.cpp
cfe/branches/tooling/lib/Driver/Driver.cpp
cfe/branches/tooling/lib/Driver/HostInfo.cpp
cfe/branches/tooling/lib/Headers/xmmintrin.h
cfe/branches/tooling/lib/Parse/ParseDecl.cpp
cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp
cfe/branches/tooling/lib/Parse/ParseExpr.cpp
cfe/branches/tooling/lib/Parse/ParseExprCXX.cpp
cfe/branches/tooling/lib/Parse/ParseTentative.cpp
cfe/branches/tooling/lib/Sema/SemaDecl.cpp
cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp
cfe/branches/tooling/lib/Sema/SemaDeclObjC.cpp
cfe/branches/tooling/lib/Sema/SemaExpr.cpp
cfe/branches/tooling/lib/Sema/SemaExprCXX.cpp
cfe/branches/tooling/lib/Sema/SemaLookup.cpp
cfe/branches/tooling/lib/Sema/SemaOverload.cpp
cfe/branches/tooling/lib/Sema/SemaStmt.cpp
cfe/branches/tooling/lib/Sema/SemaTemplateDeduction.cpp
cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p6.cpp
cfe/branches/tooling/test/Driver/dragonfly.c
cfe/branches/tooling/test/Driver/freebsd.c
cfe/branches/tooling/test/Driver/openbsd.c
cfe/branches/tooling/test/Driver/pth.c
cfe/branches/tooling/test/Driver/rewrite-objc.m
cfe/branches/tooling/test/Sema/attr-availability.c
cfe/branches/tooling/test/Sema/switch.c
cfe/branches/tooling/test/Sema/warn-unreachable.c
cfe/branches/tooling/test/SemaCXX/class-base-member-init.cpp
cfe/branches/tooling/test/SemaCXX/constant-expression-cxx11.cpp
cfe/branches/tooling/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
cfe/branches/tooling/test/SemaCXX/gnu-case-ranges.cpp
cfe/branches/tooling/test/SemaCXX/return-noreturn.cpp
cfe/branches/tooling/test/SemaCXX/typo-correction.cpp
cfe/branches/tooling/test/SemaCXX/warn-unreachable.cpp (props changed)
cfe/branches/tooling/test/SemaObjC/forward-class-1.m
cfe/branches/tooling/test/SemaObjC/typedef-class.m
cfe/branches/tooling/test/SemaObjCXX/properties.mm
cfe/branches/tooling/tools/libclang/IndexingContext.cpp
Propchange: cfe/branches/tooling/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 24 07:11:31 2012
@@ -1,3 +1,3 @@
/cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:146581-148709
+/cfe/trunk:146581-148800
/cfe/trunk/test/SemaTemplate:126920
Modified: cfe/branches/tooling/docs/AddressSanitizer.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/docs/AddressSanitizer.html?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/docs/AddressSanitizer.html (original)
+++ cfe/branches/tooling/docs/AddressSanitizer.html Tue Jan 24 07:11:31 2012
@@ -50,6 +50,8 @@
To get a reasonable performance add <tt>-O1</tt> or higher. <BR>
To get nicer stack traces in error messages add
<tt>-fno-omit-frame-pointer</tt>. <BR>
+To get perfect stack traces you may need to disable inlining (just use <tt>-O1</tt>) and tail call
+elimination (</tt>-fno-optimize-sibling-calls</tt>).
<pre>
% cat example_UseAfterFree.cc
Modified: cfe/branches/tooling/include/clang/Basic/DiagnosticGroups.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Basic/DiagnosticGroups.td?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Basic/DiagnosticGroups.td (original)
+++ cfe/branches/tooling/include/clang/Basic/DiagnosticGroups.td Tue Jan 24 07:11:31 2012
@@ -184,8 +184,8 @@
def StrictSelector : DiagGroup<"strict-selector-match">;
def MethodDuplicate : DiagGroup<"duplicate-method-match">;
def SwitchEnum : DiagGroup<"switch-enum">;
-def SwitchRedundantDefault : DiagGroup<"switch-redundant-default">;
-def Switch : DiagGroup<"switch", [SwitchRedundantDefault]>;
+def CoveredSwitchDefault : DiagGroup<"covered-switch-default">;
+def Switch : DiagGroup<"switch", [CoveredSwitchDefault]>;
def Trigraphs : DiagGroup<"trigraphs">;
def : DiagGroup<"type-limits">;
Modified: cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td Tue Jan 24 07:11:31 2012
@@ -2809,6 +2809,9 @@
"redefinition of %0 with a different type">;
def err_redefinition_different_kind : Error<
"redefinition of %0 as different kind of symbol">;
+def warn_forward_class_redefinition : Warning<
+ "redefinition of forward class %0 of a typedef name of an object type is ignored">,
+ InGroup<DiagGroup<"objc-forward-class-redefinition">>;
def err_redefinition_different_typedef : Error<
"%select{typedef|type alias|type alias template}0 redefinition with different types (%1 vs %2)">;
def err_tag_reference_non_tag : Error<
@@ -4959,16 +4962,16 @@
Warning<"no case matching constant switch condition '%0'">;
def warn_def_missing_case1 : Warning<
- "enumeration value %0 not handled in switch">,
+ "enumeration value %0 not explicitly handled in switch">,
InGroup<SwitchEnum>, DefaultIgnore;
def warn_def_missing_case2 : Warning<
- "enumeration values %0 and %1 not handled in switch">,
+ "enumeration values %0 and %1 not explicitly handled in switch">,
InGroup<SwitchEnum>, DefaultIgnore;
def warn_def_missing_case3 : Warning<
- "enumeration values %0, %1, and %2 not handled in switch">,
+ "enumeration values %0, %1, and %2 not explicitly handled in switch">,
InGroup<SwitchEnum>, DefaultIgnore;
def warn_def_missing_cases : Warning<
- "%0 enumeration values not handled in switch: %1, %2, %3...">,
+ "%0 enumeration values not explicitly handled in switch: %1, %2, %3...">,
InGroup<SwitchEnum>, DefaultIgnore;
def warn_missing_case1 : Warning<"enumeration value %0 not handled in switch">,
@@ -4984,8 +4987,8 @@
InGroup<Switch>;
def warn_unreachable_default : Warning<
- "default is unreachable as all enumeration values are accounted for">,
- InGroup<SwitchRedundantDefault>;
+ "default label in switch which covers all enumeration values">,
+ InGroup<CoveredSwitchDefault>;
def warn_not_in_enum : Warning<"case value not in enumerated type %0">,
InGroup<Switch>;
def err_typecheck_statement_requires_scalar : Error<
Modified: cfe/branches/tooling/include/clang/Driver/Driver.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Driver/Driver.h?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Driver/Driver.h (original)
+++ cfe/branches/tooling/include/clang/Driver/Driver.h Tue Jan 24 07:11:31 2012
@@ -102,6 +102,11 @@
/// Information about the host which can be overridden by the user.
std::string HostBits, HostMachine, HostSystem, HostRelease;
+ /// \brief Target triple.
+ /// Represents which platforms this driver will target at each stage of the
+ /// compilation.
+ llvm::Triple TargetTriple;
+
/// The file to log CC_PRINT_OPTIONS output to, if enabled.
const char *CCPrintOptionsFilename;
@@ -381,7 +386,7 @@
/// GetHostInfo - Construct a new host info object for the given
/// host triple.
- const HostInfo *GetHostInfo(const char *HostTriple) const;
+ const HostInfo *GetHostInfo(const llvm::Triple &Triple) const;
/// ShouldUseClangCompilar - Should the clang compiler be used to
/// handle this action.
Modified: cfe/branches/tooling/include/clang/Driver/HostInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Driver/HostInfo.h?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Driver/HostInfo.h (original)
+++ cfe/branches/tooling/include/clang/Driver/HostInfo.h Tue Jan 24 07:11:31 2012
@@ -43,10 +43,6 @@
std::string getPlatformName() const { return Triple.getVendorName(); }
std::string getOSName() const { return Triple.getOSName(); }
- /// useDriverDriver - Whether the driver should act as a driver driver for
- /// this host and support -arch, -Xarch, etc.
- virtual bool useDriverDriver() const = 0;
-
/// CreateToolChain - Construct the toolchain to use for this host (which the
/// host retains ownership of).
///
Modified: cfe/branches/tooling/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Sema/Sema.h?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Sema/Sema.h (original)
+++ cfe/branches/tooling/include/clang/Sema/Sema.h Tue Jan 24 07:11:31 2012
@@ -1375,6 +1375,7 @@
QualType &ConvertedType);
bool IsBlockPointerConversion(QualType FromType, QualType ToType,
QualType& ConvertedType);
+ bool isSentinelNullExpr(const Expr *E) const;
bool FunctionArgTypesAreEqual(const FunctionProtoType *OldType,
const FunctionProtoType *NewType,
unsigned *ArgPos = 0);
@@ -3506,6 +3507,7 @@
CXXScopeSpec &SS,
IdentifierInfo *MemberOrBase,
ParsedType TemplateTypeTy,
+ const DeclSpec &DS,
SourceLocation IdLoc,
SourceLocation LParenLoc,
Expr **Args, unsigned NumArgs,
@@ -3517,6 +3519,7 @@
CXXScopeSpec &SS,
IdentifierInfo *MemberOrBase,
ParsedType TemplateTypeTy,
+ const DeclSpec &DS,
SourceLocation IdLoc,
Expr *InitList,
SourceLocation EllipsisLoc);
@@ -3526,6 +3529,7 @@
CXXScopeSpec &SS,
IdentifierInfo *MemberOrBase,
ParsedType TemplateTypeTy,
+ const DeclSpec &DS,
SourceLocation IdLoc,
const MultiInitializer &Init,
SourceLocation EllipsisLoc);
@@ -4643,8 +4647,15 @@
FunctionDecl *&Specialization,
sema::TemplateDeductionInfo &Info);
- bool DeduceAutoType(TypeSourceInfo *AutoType, Expr *&Initializer,
- TypeSourceInfo *&Result);
+ /// \brief Result type of DeduceAutoType.
+ enum DeduceAutoResult {
+ DAR_Succeeded,
+ DAR_Failed,
+ DAR_FailedAlreadyDiagnosed
+ };
+
+ DeduceAutoResult DeduceAutoType(TypeSourceInfo *AutoType, Expr *&Initializer,
+ TypeSourceInfo *&Result);
void DiagnoseAutoDeductionFailure(VarDecl *VDecl, Expr *Init);
FunctionTemplateDecl *getMoreSpecializedTemplate(FunctionTemplateDecl *FT1,
Modified: cfe/branches/tooling/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h (original)
+++ cfe/branches/tooling/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h Tue Jan 24 07:11:31 2012
@@ -63,7 +63,7 @@
virtual void dump() const;
- virtual void dumpToStream(raw_ostream &os) const {};
+ virtual void dumpToStream(raw_ostream &os) const {}
virtual QualType getType(ASTContext&) const = 0;
virtual void Profile(llvm::FoldingSetNodeID& profile) = 0;
Modified: cfe/branches/tooling/lib/AST/DeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/DeclCXX.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/DeclCXX.cpp (original)
+++ cfe/branches/tooling/lib/AST/DeclCXX.cpp Tue Jan 24 07:11:31 2012
@@ -967,7 +967,8 @@
if (!hasDefinition())
return true;
- return data().HasOnlyFields &&
+ return isPOD() &&
+ data().HasOnlyFields &&
!data().HasPrivateFields &&
!data().HasProtectedFields &&
!data().NumBases;
Modified: cfe/branches/tooling/lib/CodeGen/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/TargetInfo.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/TargetInfo.cpp Tue Jan 24 07:11:31 2012
@@ -3222,11 +3222,12 @@
}
ABIArgInfo MipsABIInfo::classifyReturnType(QualType RetTy) const {
- if (RetTy->isVoidType())
+ uint64_t Size = getContext().getTypeSize(RetTy);
+
+ if (RetTy->isVoidType() || Size == 0)
return ABIArgInfo::getIgnore();
if (isAggregateTypeForABI(RetTy)) {
- uint64_t Size = getContext().getTypeSize(RetTy);
if (Size <= 128) {
if (RetTy->isAnyComplexType())
return ABIArgInfo::getDirect();
@@ -3266,15 +3267,17 @@
CGBuilderTy &Builder = CGF.Builder;
llvm::Value *VAListAddrAsBPP = Builder.CreateBitCast(VAListAddr, BPP, "ap");
llvm::Value *Addr = Builder.CreateLoad(VAListAddrAsBPP, "ap.cur");
- unsigned TypeAlign = getContext().getTypeAlign(Ty) / 8;
+ int64_t TypeAlign = getContext().getTypeAlign(Ty) / 8;
llvm::Type *PTy = llvm::PointerType::getUnqual(CGF.ConvertType(Ty));
llvm::Value *AddrTyped;
+ unsigned PtrWidth = getContext().getTargetInfo().getPointerWidth(0);
+ llvm::IntegerType *IntTy = (PtrWidth == 32) ? CGF.Int32Ty : CGF.Int64Ty;
if (TypeAlign > MinABIStackAlignInBytes) {
- llvm::Value *AddrAsInt32 = CGF.Builder.CreatePtrToInt(Addr, CGF.Int32Ty);
- llvm::Value *Inc = llvm::ConstantInt::get(CGF.Int32Ty, TypeAlign - 1);
- llvm::Value *Mask = llvm::ConstantInt::get(CGF.Int32Ty, -TypeAlign);
- llvm::Value *Add = CGF.Builder.CreateAdd(AddrAsInt32, Inc);
+ llvm::Value *AddrAsInt = CGF.Builder.CreatePtrToInt(Addr, IntTy);
+ llvm::Value *Inc = llvm::ConstantInt::get(IntTy, TypeAlign - 1);
+ llvm::Value *Mask = llvm::ConstantInt::get(IntTy, -TypeAlign);
+ llvm::Value *Add = CGF.Builder.CreateAdd(AddrAsInt, Inc);
llvm::Value *And = CGF.Builder.CreateAnd(Add, Mask);
AddrTyped = CGF.Builder.CreateIntToPtr(And, PTy);
}
@@ -3282,11 +3285,11 @@
AddrTyped = Builder.CreateBitCast(Addr, PTy);
llvm::Value *AlignedAddr = Builder.CreateBitCast(AddrTyped, BP);
- TypeAlign = std::max(TypeAlign, MinABIStackAlignInBytes);
+ TypeAlign = std::max((unsigned)TypeAlign, MinABIStackAlignInBytes);
uint64_t Offset =
llvm::RoundUpToAlignment(CGF.getContext().getTypeSize(Ty) / 8, TypeAlign);
llvm::Value *NextAddr =
- Builder.CreateGEP(AlignedAddr, llvm::ConstantInt::get(CGF.Int32Ty, Offset),
+ Builder.CreateGEP(AlignedAddr, llvm::ConstantInt::get(IntTy, Offset),
"ap.next");
Builder.CreateStore(NextAddr, VAListAddrAsBPP);
Modified: cfe/branches/tooling/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Driver/Driver.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Driver/Driver.cpp (original)
+++ cfe/branches/tooling/lib/Driver/Driver.cpp Tue Jan 24 07:11:31 2012
@@ -57,6 +57,7 @@
DefaultImageName(DefaultImageName),
DriverTitle("clang \"gcc-compatible\" driver"),
Host(0),
+ TargetTriple(llvm::Triple::normalize(DefaultTargetTriple)),
CCPrintOptionsFilename(0), CCPrintHeadersFilename(0),
CCLogDiagnosticsFilename(0), CCCIsCXX(false),
CCCIsCPP(false),CCCEcho(false), CCCPrintBindings(false),
@@ -321,7 +322,11 @@
if (Args->hasArg(options::OPT_nostdlib))
UseStdLib = false;
- Host = GetHostInfo(DefaultTargetTriple.c_str());
+ // Reset the target triple here as we may have adjusted the
+ // DefaultTargetTriple string for flags above.
+ // FIXME: Same fix is needed here when the above flag management is fixed.
+ TargetTriple = llvm::Triple(llvm::Triple::normalize(DefaultTargetTriple));
+ Host = GetHostInfo(TargetTriple);
// Perform the default argument translations.
DerivedArgList *TranslatedArgs = TranslateInputArgs(*Args);
@@ -343,8 +348,9 @@
InputList Inputs;
BuildInputs(C->getDefaultToolChain(), C->getArgs(), Inputs);
- // Construct the list of abstract actions to perform for this compilation.
- if (Host->useDriverDriver())
+ // Construct the list of abstract actions to perform for this compilation. On
+ // Darwin target OSes this uses the driver-driver and universal actions.
+ if (TargetTriple.isOSDarwin())
BuildUniversalActions(C->getDefaultToolChain(), C->getArgs(),
Inputs, C->getActions());
else
@@ -432,8 +438,9 @@
return;
}
- // Construct the list of abstract actions to perform for this compilation.
- if (Host->useDriverDriver())
+ // Construct the list of abstract actions to perform for this compilation. On
+ // Darwin OSes this uses the driver-driver and builds universal actions.
+ if (TargetTriple.isOSDarwin())
BuildUniversalActions(C.getDefaultToolChain(), C.getArgs(),
Inputs, C.getActions());
else
@@ -1571,9 +1578,8 @@
return P.str();
}
-const HostInfo *Driver::GetHostInfo(const char *TripleStr) const {
+const HostInfo *Driver::GetHostInfo(const llvm::Triple &Triple) const {
llvm::PrettyStackTraceString CrashInfo("Constructing host");
- llvm::Triple Triple(llvm::Triple::normalize(TripleStr).c_str());
// TCE is an osless target
if (Triple.getArchName() == "tce")
Modified: cfe/branches/tooling/lib/Driver/HostInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Driver/HostInfo.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Driver/HostInfo.cpp (original)
+++ cfe/branches/tooling/lib/Driver/HostInfo.cpp Tue Jan 24 07:11:31 2012
@@ -45,8 +45,6 @@
DarwinHostInfo(const Driver &D, const llvm::Triple &Triple);
~DarwinHostInfo();
- virtual bool useDriverDriver() const;
-
virtual ToolChain *CreateToolChain(const ArgList &Args,
const char *ArchName) const;
};
@@ -61,10 +59,6 @@
delete it->second;
}
-bool DarwinHostInfo::useDriverDriver() const {
- return true;
-}
-
ToolChain *DarwinHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
llvm::Triple::ArchType Arch;
@@ -132,8 +126,6 @@
TCEHostInfo(const Driver &D, const llvm::Triple &Triple);
~TCEHostInfo() {}
- virtual bool useDriverDriver() const;
-
virtual ToolChain *CreateToolChain(const ArgList &Args,
const char *ArchName) const;
};
@@ -142,10 +134,6 @@
: HostInfo(D, Triple) {
}
-bool TCEHostInfo::useDriverDriver() const {
- return false;
-}
-
ToolChain *TCEHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
llvm::Triple TCTriple(getTriple());
@@ -165,8 +153,6 @@
UnknownHostInfo(const Driver &D, const llvm::Triple& Triple);
~UnknownHostInfo();
- virtual bool useDriverDriver() const;
-
virtual ToolChain *CreateToolChain(const ArgList &Args,
const char *ArchName) const;
};
@@ -181,10 +167,6 @@
delete it->second;
}
-bool UnknownHostInfo::useDriverDriver() const {
- return false;
-}
-
ToolChain *UnknownHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
assert(!ArchName &&
@@ -228,8 +210,6 @@
: HostInfo(D, Triple) {}
~OpenBSDHostInfo();
- virtual bool useDriverDriver() const;
-
virtual ToolChain *CreateToolChain(const ArgList &Args,
const char *ArchName) const;
};
@@ -240,10 +220,6 @@
delete it->second;
}
-bool OpenBSDHostInfo::useDriverDriver() const {
- return false;
-}
-
ToolChain *OpenBSDHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
assert(!ArchName &&
@@ -275,8 +251,6 @@
: HostInfo(D, Triple) {}
~AuroraUXHostInfo();
- virtual bool useDriverDriver() const;
-
virtual ToolChain *CreateToolChain(const ArgList &Args,
const char *ArchName) const;
};
@@ -287,10 +261,6 @@
delete it->second;
}
-bool AuroraUXHostInfo::useDriverDriver() const {
- return false;
-}
-
ToolChain *AuroraUXHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
assert(!ArchName &&
@@ -320,8 +290,6 @@
: HostInfo(D, Triple) {}
~FreeBSDHostInfo();
- virtual bool useDriverDriver() const;
-
virtual ToolChain *CreateToolChain(const ArgList &Args,
const char *ArchName) const;
};
@@ -332,10 +300,6 @@
delete it->second;
}
-bool FreeBSDHostInfo::useDriverDriver() const {
- return false;
-}
-
ToolChain *FreeBSDHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
assert(!ArchName &&
@@ -379,8 +343,6 @@
: HostInfo(D, Triple) {}
~NetBSDHostInfo();
- virtual bool useDriverDriver() const;
-
virtual ToolChain *CreateToolChain(const ArgList &Args,
const char *ArchName) const;
};
@@ -391,10 +353,6 @@
delete it->second;
}
-bool NetBSDHostInfo::useDriverDriver() const {
- return false;
-}
-
ToolChain *NetBSDHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
assert(!ArchName &&
@@ -443,8 +401,6 @@
: HostInfo(D, Triple) {}
~MinixHostInfo();
- virtual bool useDriverDriver() const;
-
virtual ToolChain *CreateToolChain(const ArgList &Args,
const char *ArchName) const;
};
@@ -456,10 +412,6 @@
}
}
-bool MinixHostInfo::useDriverDriver() const {
- return false;
-}
-
ToolChain *MinixHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
assert(!ArchName &&
@@ -491,8 +443,6 @@
: HostInfo(D, Triple) {}
~DragonFlyHostInfo();
- virtual bool useDriverDriver() const;
-
virtual ToolChain *CreateToolChain(const ArgList &Args,
const char *ArchName) const;
};
@@ -503,10 +453,6 @@
delete it->second;
}
-bool DragonFlyHostInfo::useDriverDriver() const {
- return false;
-}
-
ToolChain *DragonFlyHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
assert(!ArchName &&
@@ -536,8 +482,6 @@
: HostInfo(D, Triple) {}
~LinuxHostInfo();
- virtual bool useDriverDriver() const;
-
virtual ToolChain *CreateToolChain(const ArgList &Args,
const char *ArchName) const;
};
@@ -548,10 +492,6 @@
delete it->second;
}
-bool LinuxHostInfo::useDriverDriver() const {
- return false;
-}
-
ToolChain *LinuxHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
@@ -601,8 +541,6 @@
WindowsHostInfo(const Driver &D, const llvm::Triple& Triple);
~WindowsHostInfo();
- virtual bool useDriverDriver() const;
-
virtual types::ID lookupTypeForExtension(const char *Ext) const {
return types::lookupTypeForExtension(Ext);
}
@@ -621,10 +559,6 @@
delete it->second;
}
-bool WindowsHostInfo::useDriverDriver() const {
- return false;
-}
-
ToolChain *WindowsHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
assert(!ArchName &&
Modified: cfe/branches/tooling/lib/Headers/xmmintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Headers/xmmintrin.h?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Headers/xmmintrin.h (original)
+++ cfe/branches/tooling/lib/Headers/xmmintrin.h Tue Jan 24 07:11:31 2012
@@ -938,7 +938,7 @@
#define _MM_FLUSH_ZERO_MASK (0x8000)
#define _MM_FLUSH_ZERO_ON (0x8000)
-#define _MM_FLUSH_ZERO_OFF (0x8000)
+#define _MM_FLUSH_ZERO_OFF (0x0000)
#define _MM_GET_EXCEPTION_MASK() (_mm_getcsr() & _MM_MASK_MASK)
#define _MM_GET_EXCEPTION_STATE() (_mm_getcsr() & _MM_EXCEPT_MASK)
Modified: cfe/branches/tooling/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Parse/ParseDecl.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Parse/ParseDecl.cpp (original)
+++ cfe/branches/tooling/lib/Parse/ParseDecl.cpp Tue Jan 24 07:11:31 2012
@@ -690,7 +690,7 @@
// Record this attribute
attrs.addNew(&Availability,
SourceRange(AvailabilityLoc, T.getCloseLocation()),
- 0, SourceLocation(),
+ 0, AvailabilityLoc,
Platform, PlatformLoc,
Changes[Introduced],
Changes[Deprecated],
Modified: cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp Tue Jan 24 07:11:31 2012
@@ -2414,15 +2414,28 @@
TemplateTypeTy = getTypeAnnotation(Tok);
}
}
- if (!TemplateTypeTy && Tok.isNot(tok::identifier)) {
+ // Uses of decltype will already have been converted to annot_decltype by
+ // ParseOptionalCXXScopeSpecifier at this point.
+ if (!TemplateTypeTy && Tok.isNot(tok::identifier)
+ && Tok.isNot(tok::annot_decltype)) {
Diag(Tok, diag::err_expected_member_or_base_name);
return true;
}
- // Get the identifier. This may be a member name or a class name,
- // but we'll let the semantic analysis determine which it is.
- IdentifierInfo *II = Tok.is(tok::identifier) ? Tok.getIdentifierInfo() : 0;
- SourceLocation IdLoc = ConsumeToken();
+ IdentifierInfo *II = 0;
+ DeclSpec DS(AttrFactory);
+ SourceLocation IdLoc = Tok.getLocation();
+ if (Tok.is(tok::annot_decltype)) {
+ // Get the decltype expression, if there is one.
+ ParseDecltypeSpecifier(DS);
+ } else {
+ if (Tok.is(tok::identifier))
+ // Get the identifier. This may be a member name or a class name,
+ // but we'll let the semantic analysis determine which it is.
+ II = Tok.getIdentifierInfo();
+ ConsumeToken();
+ }
+
// Parse the '('.
if (getLang().CPlusPlus0x && Tok.is(tok::l_brace)) {
@@ -2437,8 +2450,8 @@
EllipsisLoc = ConsumeToken();
return Actions.ActOnMemInitializer(ConstructorDecl, getCurScope(), SS, II,
- TemplateTypeTy, IdLoc, InitList.take(),
- EllipsisLoc);
+ TemplateTypeTy, DS, IdLoc,
+ InitList.take(), EllipsisLoc);
} else if(Tok.is(tok::l_paren)) {
BalancedDelimiterTracker T(*this, tok::l_paren);
T.consumeOpen();
@@ -2458,7 +2471,7 @@
EllipsisLoc = ConsumeToken();
return Actions.ActOnMemInitializer(ConstructorDecl, getCurScope(), SS, II,
- TemplateTypeTy, IdLoc,
+ TemplateTypeTy, DS, IdLoc,
T.getOpenLocation(), ArgExprs.take(),
ArgExprs.size(), T.getCloseLocation(),
EllipsisLoc);
Modified: cfe/branches/tooling/lib/Parse/ParseExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Parse/ParseExpr.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Parse/ParseExpr.cpp (original)
+++ cfe/branches/tooling/lib/Parse/ParseExpr.cpp Tue Jan 24 07:11:31 2012
@@ -914,6 +914,7 @@
}
// Fall through
+ case tok::annot_decltype:
case tok::kw_char:
case tok::kw_wchar_t:
case tok::kw_char16_t:
Modified: cfe/branches/tooling/lib/Parse/ParseExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Parse/ParseExprCXX.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Parse/ParseExprCXX.cpp (original)
+++ cfe/branches/tooling/lib/Parse/ParseExprCXX.cpp Tue Jan 24 07:11:31 2012
@@ -1418,8 +1418,11 @@
case tok::kw_bool:
DS.SetTypeSpecType(DeclSpec::TST_bool, Loc, PrevSpec, DiagID);
break;
+ case tok::annot_decltype:
+ case tok::kw_decltype:
+ DS.SetRangeEnd(ParseDecltypeSpecifier(DS));
+ return DS.Finish(Diags, PP);
- // FIXME: C++0x decltype support.
// GNU typeof support.
case tok::kw_typeof:
ParseTypeofSpecifier(DS);
Modified: cfe/branches/tooling/lib/Parse/ParseTentative.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Parse/ParseTentative.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Parse/ParseTentative.cpp (original)
+++ cfe/branches/tooling/lib/Parse/ParseTentative.cpp Tue Jan 24 07:11:31 2012
@@ -1009,6 +1009,7 @@
case tok::kw_float:
case tok::kw_double:
case tok::kw_void:
+ case tok::annot_decltype:
if (NextToken().is(tok::l_paren))
return TPResult::Ambiguous();
@@ -1038,10 +1039,6 @@
return TPResult::True();
}
- // C++0x decltype support.
- case tok::annot_decltype:
- return TPResult::True();
-
// C++0x type traits support
case tok::kw___underlying_type:
return TPResult::True();
Modified: cfe/branches/tooling/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaDecl.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaDecl.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaDecl.cpp Tue Jan 24 07:11:31 2012
@@ -6011,7 +6011,8 @@
// C++11 [decl.spec.auto]p6. Deduce the type which 'auto' stands in for.
if (TypeMayContainAuto && VDecl->getType()->getContainedAutoType()) {
TypeSourceInfo *DeducedType = 0;
- if (!DeduceAutoType(VDecl->getTypeSourceInfo(), Init, DeducedType))
+ if (DeduceAutoType(VDecl->getTypeSourceInfo(), Init, DeducedType) ==
+ DAR_Failed)
DiagnoseAutoDeductionFailure(VDecl, Init);
if (!DeducedType) {
RealDecl->setInvalidDecl();
Modified: cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp Tue Jan 24 07:11:31 2012
@@ -1722,11 +1722,13 @@
CXXScopeSpec &SS,
IdentifierInfo *MemberOrBase,
ParsedType TemplateTypeTy,
+ const DeclSpec &DS,
SourceLocation IdLoc,
Expr *InitList,
SourceLocation EllipsisLoc) {
return BuildMemInitializer(ConstructorD, S, SS, MemberOrBase, TemplateTypeTy,
- IdLoc, MultiInitializer(InitList), EllipsisLoc);
+ DS, IdLoc, MultiInitializer(InitList),
+ EllipsisLoc);
}
/// \brief Handle a C++ member initializer using parentheses syntax.
@@ -1736,14 +1738,15 @@
CXXScopeSpec &SS,
IdentifierInfo *MemberOrBase,
ParsedType TemplateTypeTy,
+ const DeclSpec &DS,
SourceLocation IdLoc,
SourceLocation LParenLoc,
Expr **Args, unsigned NumArgs,
SourceLocation RParenLoc,
SourceLocation EllipsisLoc) {
return BuildMemInitializer(ConstructorD, S, SS, MemberOrBase, TemplateTypeTy,
- IdLoc, MultiInitializer(LParenLoc, Args, NumArgs,
- RParenLoc),
+ DS, IdLoc, MultiInitializer(LParenLoc, Args,
+ NumArgs, RParenLoc),
EllipsisLoc);
}
@@ -1779,6 +1782,7 @@
CXXScopeSpec &SS,
IdentifierInfo *MemberOrBase,
ParsedType TemplateTypeTy,
+ const DeclSpec &DS,
SourceLocation IdLoc,
const MultiInitializer &Args,
SourceLocation EllipsisLoc) {
@@ -1831,6 +1835,8 @@
if (TemplateTypeTy) {
BaseType = GetTypeFromParser(TemplateTypeTy, &TInfo);
+ } else if (DS.getTypeSpecType() == TST_decltype) {
+ BaseType = BuildDecltypeType(DS.getRepAsExpr(), DS.getTypeSpecTypeLoc());
} else {
LookupResult R(*this, MemberOrBase, IdLoc, LookupOrdinaryName);
LookupParsedName(R, S, &SS);
@@ -5809,12 +5815,13 @@
CXXRecordDecl *TemplateClass = Template->getTemplatedDecl();
if (TemplateClass->getIdentifier() !=
&PP.getIdentifierTable().get("initializer_list") ||
- !TemplateClass->getDeclContext()->Equals(getStdNamespace()))
+ !getStdNamespace()->InEnclosingNamespaceSetOf(
+ TemplateClass->getDeclContext()))
return false;
// This is a template called std::initializer_list, but is it the right
// template?
TemplateParameterList *Params = Template->getTemplateParameters();
- if (Params->size() != 1)
+ if (Params->getMinRequiredArguments() != 1)
return false;
if (!isa<TemplateTypeParmDecl>(Params->getParam(0)))
return false;
@@ -5857,7 +5864,8 @@
// We found some template called std::initializer_list. Now verify that it's
// correct.
TemplateParameterList *Params = Template->getTemplateParameters();
- if (Params->size() != 1 || !isa<TemplateTypeParmDecl>(Params->getParam(0))) {
+ if (Params->getMinRequiredArguments() != 1 ||
+ !isa<TemplateTypeParmDecl>(Params->getParam(0))) {
S.Diag(Template->getLocation(), diag::err_malformed_std_initializer_list);
return 0;
}
@@ -9102,7 +9110,8 @@
Expr *Init = Exprs.get()[0];
TypeSourceInfo *DeducedType = 0;
- if (!DeduceAutoType(VDecl->getTypeSourceInfo(), Init, DeducedType))
+ if (DeduceAutoType(VDecl->getTypeSourceInfo(), Init, DeducedType) ==
+ DAR_Failed)
DiagnoseAutoDeductionFailure(VDecl, Init);
if (!DeducedType) {
RealDecl->setInvalidDecl();
Modified: cfe/branches/tooling/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaDeclObjC.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaDeclObjC.cpp Tue Jan 24 07:11:31 2012
@@ -1776,17 +1776,22 @@
// typedef NSObject < XCElementTogglerP > XCElementToggler;
// @class XCElementToggler;
//
- // FIXME: Make an extension?
+ // Here we have chosen to ignore the forward class declaration
+ // with a warning. Since this is the implied behavior.
TypedefNameDecl *TDD = dyn_cast<TypedefNameDecl>(PrevDecl);
if (!TDD || !TDD->getUnderlyingType()->isObjCObjectType()) {
Diag(AtClassLoc, diag::err_redefinition_different_kind) << IdentList[i];
Diag(PrevDecl->getLocation(), diag::note_previous_definition);
} else {
// a forward class declaration matching a typedef name of a class refers
- // to the underlying class.
- if (const ObjCObjectType *OI =
- TDD->getUnderlyingType()->getAs<ObjCObjectType>())
- PrevDecl = OI->getInterface();
+ // to the underlying class. Just ignore the forward class with a warning
+ // as this will force the intended behavior which is to lookup the typedef
+ // name.
+ if (isa<ObjCObjectType>(TDD->getUnderlyingType())) {
+ Diag(AtClassLoc, diag::warn_forward_class_redefinition) << IdentList[i];
+ Diag(PrevDecl->getLocation(), diag::note_previous_definition);
+ continue;
+ }
}
}
Modified: cfe/branches/tooling/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaExpr.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaExpr.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaExpr.cpp Tue Jan 24 07:11:31 2012
@@ -249,17 +249,7 @@
Expr *sentinelExpr = args[numArgs - numArgsAfterSentinel - 1];
if (!sentinelExpr) return;
if (sentinelExpr->isValueDependent()) return;
-
- // nullptr_t is always treated as null.
- if (sentinelExpr->getType()->isNullPtrType()) return;
-
- if (sentinelExpr->getType()->isAnyPointerType() &&
- sentinelExpr->IgnoreParenCasts()->isNullPointerConstant(Context,
- Expr::NPC_ValueDependentIsNull))
- return;
-
- // Unfortunately, __null has type 'int'.
- if (isa<GNUNullExpr>(sentinelExpr)) return;
+ if (isSentinelNullExpr(sentinelExpr)) return;
// Pick a reasonable string to insert. Optimistically use 'nil' or
// 'NULL' if those are actually defined in the context. Only use
@@ -289,6 +279,24 @@
return E ? E->getSourceRange() : SourceRange();
}
+bool Sema::isSentinelNullExpr(const Expr *E) const {
+ if (!E)
+ return false;
+
+ // nullptr_t is always treated as null.
+ if (E->getType()->isNullPtrType()) return true;
+
+ if (E->getType()->isAnyPointerType() &&
+ E->IgnoreParenCasts()->isNullPointerConstant(Context,
+ Expr::NPC_ValueDependentIsNull))
+ return true;
+
+ // Unfortunately, __null has type 'int'.
+ if (isa<GNUNullExpr>(E)) return true;
+
+ return false;
+}
+
//===----------------------------------------------------------------------===//
// Standard Promotions and Conversions
//===----------------------------------------------------------------------===//
Modified: cfe/branches/tooling/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaExprCXX.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaExprCXX.cpp Tue Jan 24 07:11:31 2012
@@ -952,7 +952,8 @@
<< AllocType << TypeRange);
}
TypeSourceInfo *DeducedType = 0;
- if (!DeduceAutoType(AllocTypeInfo, ConstructorArgs.get()[0], DeducedType))
+ if (DeduceAutoType(AllocTypeInfo, ConstructorArgs.get()[0], DeducedType) ==
+ DAR_Failed)
return ExprError(Diag(StartLoc, diag::err_auto_new_deduction_failure)
<< AllocType
<< ConstructorArgs.get()[0]->getType()
Modified: cfe/branches/tooling/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaLookup.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaLookup.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaLookup.cpp Tue Jan 24 07:11:31 2012
@@ -3569,6 +3569,11 @@
TypoCorrectionConsumer Consumer(*this, Typo);
+ // If a callback object returns true for an empty typo correction candidate,
+ // assume it does not do any actual validation of the candidates.
+ TypoCorrection EmptyCorrection;
+ bool ValidatingCallback = CCC && !CCC->ValidateCandidate(EmptyCorrection);
+
// Perform name lookup to find visible, similarly-named entities.
bool IsUnqualifiedLookup = false;
if (MemberContext) {
@@ -3598,41 +3603,46 @@
IsUnqualifiedLookup = true;
UnqualifiedTyposCorrectedMap::iterator Cached
= UnqualifiedTyposCorrected.find(Typo);
- if (Cached == UnqualifiedTyposCorrected.end() ||
- (Cached->second && CCC && !CCC->ValidateCandidate(Cached->second))) {
+ if (Cached != UnqualifiedTyposCorrected.end()) {
+ // Add the cached value, unless it's a keyword or fails validation. In the
+ // keyword case, we'll end up adding the keyword below.
+ if (Cached->second) {
+ if (!Cached->second.isKeyword() &&
+ (!CCC || CCC->ValidateCandidate(Cached->second)))
+ Consumer.addCorrection(Cached->second);
+ } else {
+ // Only honor no-correction cache hits when a callback that will validate
+ // correction candidates is not being used.
+ if (!ValidatingCallback)
+ return TypoCorrection();
+ }
+ }
+ if (Cached == UnqualifiedTyposCorrected.end()) {
// Provide a stop gap for files that are just seriously broken. Trying
// to correct all typos can turn into a HUGE performance penalty, causing
// some files to take minutes to get rejected by the parser.
if (TyposCorrected + UnqualifiedTyposCorrected.size() >= 20)
return TypoCorrection();
+ }
- // For unqualified lookup, look through all of the names that we have
- // seen in this translation unit.
- for (IdentifierTable::iterator I = Context.Idents.begin(),
- IEnd = Context.Idents.end();
- I != IEnd; ++I)
- Consumer.FoundName(I->getKey());
-
- // Walk through identifiers in external identifier sources.
- if (IdentifierInfoLookup *External
- = Context.Idents.getExternalIdentifierLookup()) {
- llvm::OwningPtr<IdentifierIterator> Iter(External->getIdentifiers());
- do {
- StringRef Name = Iter->Next();
- if (Name.empty())
- break;
-
- Consumer.FoundName(Name);
- } while (true);
- }
- } else {
- // Use the cached value, unless it's a keyword. In the keyword case, we'll
- // end up adding the keyword below.
- if (!Cached->second)
- return TypoCorrection();
+ // For unqualified lookup, look through all of the names that we have
+ // seen in this translation unit.
+ for (IdentifierTable::iterator I = Context.Idents.begin(),
+ IEnd = Context.Idents.end();
+ I != IEnd; ++I)
+ Consumer.FoundName(I->getKey());
+
+ // Walk through identifiers in external identifier sources.
+ if (IdentifierInfoLookup *External
+ = Context.Idents.getExternalIdentifierLookup()) {
+ llvm::OwningPtr<IdentifierIterator> Iter(External->getIdentifiers());
+ do {
+ StringRef Name = Iter->Next();
+ if (Name.empty())
+ break;
- if (!Cached->second.isKeyword())
- Consumer.addCorrection(Cached->second);
+ Consumer.FoundName(Name);
+ } while (true);
}
}
@@ -3813,8 +3823,10 @@
ED = Consumer.begin()->first;
if (ED > 0 && Typo->getName().size() / ED < 3) {
- // If this was an unqualified lookup, note that no correction was found.
- if (IsUnqualifiedLookup)
+ // If this was an unqualified lookup and we believe the callback
+ // object wouldn't have filtered out possible corrections, note
+ // that no correction was found.
+ if (IsUnqualifiedLookup && !ValidatingCallback)
(void)UnqualifiedTyposCorrected[Typo];
return TypoCorrection();
@@ -3872,7 +3884,9 @@
return BestResults["super"];
}
- if (IsUnqualifiedLookup)
+ // If this was an unqualified lookup and we believe the callback object did
+ // not filter out possible corrections, note that no correction was found.
+ if (IsUnqualifiedLookup && !ValidatingCallback)
(void)UnqualifiedTyposCorrected[Typo];
return TypoCorrection();
Modified: cfe/branches/tooling/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaOverload.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaOverload.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaOverload.cpp Tue Jan 24 07:11:31 2012
@@ -4111,7 +4111,7 @@
Result.setBad(BadConversionSequence::no_conversion, From, ToType);
Result.setListInitializationSequence();
- // We need a complete type for what follows. Incomplete types can bever be
+ // We need a complete type for what follows. Incomplete types can never be
// initialized from init lists.
if (S.RequireCompleteType(From->getLocStart(), ToType, S.PDiag()))
return Result;
Modified: cfe/branches/tooling/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaStmt.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaStmt.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaStmt.cpp Tue Jan 24 07:11:31 2012
@@ -1201,7 +1201,8 @@
// AddInitializerToDecl, so we can produce a more suitable diagnostic.
TypeSourceInfo *InitTSI = 0;
if ((!isa<InitListExpr>(Init) && Init->getType()->isVoidType()) ||
- !SemaRef.DeduceAutoType(Decl->getTypeSourceInfo(), Init, InitTSI))
+ SemaRef.DeduceAutoType(Decl->getTypeSourceInfo(), Init, InitTSI) ==
+ Sema::DAR_Failed)
SemaRef.Diag(Loc, diag) << Init->getType();
if (!InitTSI) {
Decl->setInvalidDecl();
Modified: cfe/branches/tooling/lib/Sema/SemaTemplateDeduction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaTemplateDeduction.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaTemplateDeduction.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaTemplateDeduction.cpp Tue Jan 24 07:11:31 2012
@@ -3376,20 +3376,18 @@
/// dependent. This will be set to null if deduction succeeded, but auto
/// substitution failed; the appropriate diagnostic will already have been
/// produced in that case.
-///
-/// \returns true if deduction succeeded, false if it failed.
-bool
+Sema::DeduceAutoResult
Sema::DeduceAutoType(TypeSourceInfo *Type, Expr *&Init,
TypeSourceInfo *&Result) {
if (Init->getType()->isNonOverloadPlaceholderType()) {
ExprResult result = CheckPlaceholderExpr(Init);
- if (result.isInvalid()) return false;
+ if (result.isInvalid()) return DAR_FailedAlreadyDiagnosed;
Init = result.take();
}
if (Init->isTypeDependent()) {
Result = Type;
- return true;
+ return DAR_Succeeded;
}
SourceLocation Loc = Init->getExprLoc();
@@ -3418,7 +3416,7 @@
if (AdjustFunctionParmAndArgTypesForDeduction(*this, &TemplateParams,
FuncParam, InitType, Init,
TDF))
- return false;
+ return DAR_Failed;
TemplateDeductionInfo Info(Context, Loc);
@@ -3428,22 +3426,22 @@
if (DeduceTemplateArgumentsByTypeMatch(*this, &TemplateParams, FuncParam,
InitList->getInit(i)->getType(),
Info, Deduced, TDF))
- return false;
+ return DAR_Failed;
}
} else {
if (DeduceTemplateArgumentsByTypeMatch(*this, &TemplateParams, FuncParam,
InitType, Info, Deduced, TDF))
- return false;
+ return DAR_Failed;
}
QualType DeducedType = Deduced[0].getAsType();
if (DeducedType.isNull())
- return false;
+ return DAR_Failed;
if (InitList) {
DeducedType = BuildStdInitializerList(DeducedType, Loc);
if (DeducedType.isNull())
- return false;
+ return DAR_FailedAlreadyDiagnosed;
}
Result = SubstituteAutoTransform(*this, DeducedType).TransformType(Type);
@@ -3455,10 +3453,10 @@
Sema::OriginalCallArg(FuncParam,0,InitType),
Result->getType())) {
Result = 0;
- return false;
+ return DAR_Failed;
}
- return true;
+ return DAR_Succeeded;
}
void Sema::DiagnoseAutoDeductionFailure(VarDecl *VDecl, Expr *Init) {
Modified: cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p6.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p6.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p6.cpp (original)
+++ cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p6.cpp Tue Jan 24 07:11:31 2012
@@ -92,8 +92,7 @@
template<typename T> T g(T);
void f(X *x) {
- // FIXME: we should really only get the first diagnostic here.
- auto value = x->method; // expected-error {{reference to non-static member function must be called}} expected-error{{variable 'value' with type 'auto' has incompatible initializer of type '<bound member function type>'}}
+ auto value = x->method; // expected-error {{reference to non-static member function must be called}}
if (value) { }
auto funcptr = &g<int>;
@@ -101,4 +100,5 @@
}
}
-// TODO: if the initializer is a braced-init-list, deduce auto as std::initializer_list<T>.
+// if the initializer is a braced-init-list, deduce auto as std::initializer_list<T>:
+// see SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
Modified: cfe/branches/tooling/test/Driver/dragonfly.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/dragonfly.c?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/dragonfly.c (original)
+++ cfe/branches/tooling/test/Driver/dragonfly.c Tue Jan 24 07:11:31 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -target amd64-pc-dragonfly %s -### 2> %t.log
+// RUN: %clang -no-canonical-prefixes -target amd64-pc-dragonfly %s -### 2> %t.log
// RUN: FileCheck -input-file %t.log %s
// CHECK: clang{{.*}}" "-cc1" "-triple" "amd64-pc-dragonfly"
Modified: cfe/branches/tooling/test/Driver/freebsd.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/freebsd.c?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/freebsd.c (original)
+++ cfe/branches/tooling/test/Driver/freebsd.c Tue Jan 24 07:11:31 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -ccc-clang-archs "" -target powerpc64-pc-freebsd8 %s -### 2> %t
+// RUN: %clang -no-canonical-prefixes -ccc-clang-archs "" -target powerpc64-pc-freebsd8 %s -### 2> %t
// RUN: FileCheck --check-prefix=CHECK-PPC < %t %s
//
// CHECK-PPC: clang{{.*}}" "-cc1" "-triple" "powerpc64-pc-freebsd8"
@@ -7,7 +7,7 @@
// Check that -m32 properly adjusts the toolchain flags.
//
-// RUN: %clang -target x86_64-pc-freebsd8 -m32 -### %s 2> %t
+// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -m32 -### %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-LIB32 < %t %s
//
// CHECK-LIB32: clang{{.*}}" "-cc1" "-triple" "i386-pc-freebsd8"
Modified: cfe/branches/tooling/test/Driver/openbsd.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/openbsd.c?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/openbsd.c (original)
+++ cfe/branches/tooling/test/Driver/openbsd.c Tue Jan 24 07:11:31 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -ccc-clang-archs "" -target i686-pc-openbsd %s -### 2> %t.log
+// RUN: %clang -no-canonical-prefixes -ccc-clang-archs "" -target i686-pc-openbsd %s -### 2> %t.log
// RUN: FileCheck -input-file %t.log %s
// CHECK: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
Modified: cfe/branches/tooling/test/Driver/pth.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/pth.c?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/pth.c (original)
+++ cfe/branches/tooling/test/Driver/pth.c Tue Jan 24 07:11:31 2012
@@ -1,12 +1,12 @@
// Test transparent PTH support.
-// RUN: %clang -ccc-pch-is-pth -x c-header %s -o %t.h.pth -### 2> %t.log
+// RUN: %clang -no-canonical-prefixes -ccc-pch-is-pth -x c-header %s -o %t.h.pth -### 2> %t.log
// RUN: FileCheck -check-prefix CHECK1 -input-file %t.log %s
// CHECK1: "{{.*}}/clang{{.*}}" "-cc1" {{.*}} "-o" "{{.*}}.h.pth" "-x" "c-header" "{{.*}}pth.c"
// RUN: touch %t.h.pth
-// RUN: %clang -ccc-pch-is-pth -E -include %t.h %s -### 2> %t.log
+// RUN: %clang -no-canonical-prefixes -ccc-pch-is-pth -E -include %t.h %s -### 2> %t.log
// RUN: FileCheck -check-prefix CHECK2 -input-file %t.log %s
// CHECK2: "{{.*}}/clang{{.*}}" "-cc1" {{.*}}"-include-pth" "{{.*}}.h.pth" {{.*}}"-x" "c" "{{.*}}pth.c"
Modified: cfe/branches/tooling/test/Driver/rewrite-objc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/rewrite-objc.m?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/rewrite-objc.m (original)
+++ cfe/branches/tooling/test/Driver/rewrite-objc.m Tue Jan 24 07:11:31 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -target x86_64-apple-macosx10.7.0 -rewrite-objc %s -o - -### 2>&1 | \
+// RUN: %clang -no-canonical-prefixes -target x86_64-apple-macosx10.7.0 -rewrite-objc %s -o - -### 2>&1 | \
// RUN: FileCheck -check-prefix=TEST0 %s
// TEST0: clang{{.*}}" "-cc1"
// TEST0: "-rewrite-objc"
Modified: cfe/branches/tooling/test/Sema/attr-availability.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/attr-availability.c?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/attr-availability.c (original)
+++ cfe/branches/tooling/test/Sema/attr-availability.c Tue Jan 24 07:11:31 2012
@@ -17,3 +17,10 @@
ATSFontGetName("Hello"); // expected-warning {{'ATSFontGetName' is deprecated: first deprecated in Mac OS X 9.0 - use CTFontCopyFullName}}
ATSFontGetPostScriptName(100); // expected-error {{'ATSFontGetPostScriptName' is unavailable: obsoleted in Mac OS X 9.0 - use ATSFontGetFullPostScriptName}}
}
+
+// rdar://10711037
+__attribute__((availability(macos, unavailable))) // expected-warning {{attribute 'availability' is ignored}}
+enum {
+ NSDataWritingFileProtectionWriteOnly = 0x30000000,
+ NSDataWritingFileProtectionCompleteUntilUserAuthentication = 0x40000000,
+};
Removed: cfe/branches/tooling/test/Sema/switch-enum.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/switch-enum.c?rev=148800&view=auto
==============================================================================
--- cfe/branches/tooling/test/Sema/switch-enum.c (original)
+++ cfe/branches/tooling/test/Sema/switch-enum.c (removed)
@@ -1,18 +0,0 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -Wswitch-enum -Wno-switch-redundant-default %s
-
-int test1() {
- enum { A, B } a;
- switch (a) { //expected-warning{{enumeration value 'B' not handled in switch}}
- case A: return 1;
- default: return 2;
- }
-}
-
-int test2() {
- enum { A, B } a;
- switch (a) {
- case A: return 1;
- case B: return 2;
- default: return 3;
- }
-}
Modified: cfe/branches/tooling/test/Sema/switch.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/switch.c?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/switch.c (original)
+++ cfe/branches/tooling/test/Sema/switch.c Tue Jan 24 07:11:31 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wswitch-enum %s
void f (int z) {
while (z) {
default: z--; // expected-error {{statement not in switch}}
@@ -203,7 +203,7 @@
break;
}
- switch(a) {
+ switch(a) { //expected-warning{{enumeration value 'A' not explicitly handled in switch}}
case B:
case C:
break;
@@ -294,14 +294,7 @@
switch (a) {
case A: return 0;
case B: return 1;
- default: return 2; // expected-warning {{default is unreachable as all enumeration values are accounted for}}
- }
-}
-
-int test19() {
- enum { A, B } a;
- switch (a) {
case 7: return 1; // expected-warning {{case value not in enumerated type}}
- default: return 3;
+ default: return 2; // expected-warning {{default label in switch which covers all enumeration values}}
}
}
Modified: cfe/branches/tooling/test/Sema/warn-unreachable.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/warn-unreachable.c?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/warn-unreachable.c (original)
+++ cfe/branches/tooling/test/Sema/warn-unreachable.c Tue Jan 24 07:11:31 2012
@@ -1,4 +1,4 @@
-// RUN: %clang %s -fsyntax-only -Xclang -verify -fblocks -Wunreachable-code -Wno-unused-value -Wno-switch-redundant-default
+// RUN: %clang %s -fsyntax-only -Xclang -verify -fblocks -Wunreachable-code -Wno-unused-value -Wno-covered-switch-default
int halt() __attribute__((noreturn));
int live();
Modified: cfe/branches/tooling/test/SemaCXX/class-base-member-init.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/class-base-member-init.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/class-base-member-init.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/class-base-member-init.cpp Tue Jan 24 07:11:31 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
class S {
public:
@@ -74,3 +74,19 @@
A(long _) : a(0), d(0) {} // expected-error {{initializing multiple members of union}} expected-note {{previous initialization is here}}
};
}
+
+namespace test5 {
+ struct Base {
+ Base(int);
+ };
+ struct A : Base {
+ A() : decltype(Base(1))(3) {
+ }
+ A(int) : Base(3), // expected-note {{previous initialization is here}}
+ decltype(Base(1))(2), // expected-error {{multiple initializations given for base 'decltype(test5::Base(1))' (aka 'test5::Base')}}
+ decltype(int())() { // expected-error {{constructor initializer 'decltype(int())' (aka 'int') does not name a class}}
+ }
+ A(float) : decltype(A())(3) {
+ }
+ };
+}
Modified: cfe/branches/tooling/test/SemaCXX/constant-expression-cxx11.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/constant-expression-cxx11.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/constant-expression-cxx11.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/constant-expression-cxx11.cpp Tue Jan 24 07:11:31 2012
@@ -1027,3 +1027,22 @@
template<int x> int g(int c) { switch(c) { case f<x>(): return 1; } return 0; }
int gg(int c) { return g<4>(c); }
}
+
+namespace ConvertedConstantExpr {
+ extern int &m;
+ extern int &n;
+
+ constexpr int k = 4;
+ int &m = const_cast<int&>(k);
+
+ // If we have nothing more interesting to say, ensure we don't produce a
+ // useless note and instead just point to the non-constant subexpression.
+ enum class E {
+ em = m,
+ en = n, // expected-error {{not a constant expression}}
+ eo = (m +
+ n // expected-error {{not a constant expression}}
+ ),
+ eq = reinterpret_cast<int>((int*)0) // expected-error {{not a constant expression}} expected-note {{reinterpret_cast}}
+ };
+}
Modified: cfe/branches/tooling/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp Tue Jan 24 07:11:31 2012
@@ -1,5 +1,10 @@
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// This must obviously come before the definition of std::initializer_list.
+void missing_initializerlist() {
+ auto l = {1, 2, 3, 4}; // expected-error {{std::initializer_list was not found}}
+}
+
namespace std {
typedef decltype(sizeof(int)) size_t;
Modified: cfe/branches/tooling/test/SemaCXX/gnu-case-ranges.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/gnu-case-ranges.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/gnu-case-ranges.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/gnu-case-ranges.cpp Tue Jan 24 07:11:31 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -verify -Wno-switch-redundant-default %s
+// RUN: %clang_cc1 -verify -Wno-covered-switch-default %s
enum E {
one,
Modified: cfe/branches/tooling/test/SemaCXX/return-noreturn.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/return-noreturn.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/return-noreturn.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/return-noreturn.cpp Tue Jan 24 07:11:31 2012
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify -Wreturn-type -Wmissing-noreturn -Wno-unreachable-code -Wno-switch-redundant-default
-// RUN: %clang_cc1 %s -fsyntax-only -std=c++11 -verify -Wreturn-type -Wmissing-noreturn -Wno-unreachable-code -Wno-switch-redundant-default
+// RUN: %clang_cc1 %s -fsyntax-only -verify -Wreturn-type -Wmissing-noreturn -Wno-unreachable-code -Wno-covered-switch-default
+// RUN: %clang_cc1 %s -fsyntax-only -std=c++11 -verify -Wreturn-type -Wmissing-noreturn -Wno-unreachable-code -Wno-covered-switch-default
// A destructor may be marked noreturn and should still influence the CFG.
void pr6884_abort() __attribute__((noreturn));
Modified: cfe/branches/tooling/test/SemaCXX/typo-correction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/typo-correction.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/typo-correction.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/typo-correction.cpp Tue Jan 24 07:11:31 2012
@@ -85,11 +85,26 @@
// Test the typo-correction callback in Sema::DiagnoseUnknownTypeName.
namespace unknown_type_test {
- class StreamOut {}; // expected-note{{'StreamOut' declared here}}
- long stream_count;
+ class StreamOut {}; // expected-note 2 {{'StreamOut' declared here}}
+ long stream_count; // expected-note 2 {{'stream_count' declared here}}
};
unknown_type_test::stream_out out; // expected-error{{no type named 'stream_out' in namespace 'unknown_type_test'; did you mean 'StreamOut'?}}
+// Demonstrate a case where using only the cached value returns the wrong thing
+// when the cached value was the result of a previous callback object that only
+// accepts a subset of the current callback object.
+namespace {
+using namespace unknown_type_test;
+void bar(long i);
+void before_caching_classname() {
+ bar((stream_out)); // expected-error{{use of undeclared identifier 'stream_out'; did you mean 'stream_count'?}}
+}
+stream_out out; // expected-error{{unknown type name 'stream_out'; did you mean 'StreamOut'?}}
+void after_caching_classname() {
+ bar((stream_out)); // expected-error{{use of undeclared identifier 'stream_out'; did you mean 'stream_count'?}}
+}
+}
+
// Test the typo-correction callback in Sema::DiagnoseInvalidRedeclaration.
struct BaseDecl {
void add_in(int i);
Propchange: cfe/branches/tooling/test/SemaCXX/warn-unreachable.cpp
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 24 07:11:31 2012
@@ -1,2 +1,2 @@
/cfe/branches/type-system-rewrite/test/SemaCXX/warn-unreachable.cpp:134693-134817
-/cfe/trunk/test/SemaCXX/warn-unreachable.cpp:121961,146581-148709
+/cfe/trunk/test/SemaCXX/warn-unreachable.cpp:121961,146581-148800
Modified: cfe/branches/tooling/test/SemaObjC/forward-class-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/forward-class-1.m?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/forward-class-1.m (original)
+++ cfe/branches/tooling/test/SemaObjC/forward-class-1.m Tue Jan 24 07:11:31 2012
@@ -31,14 +31,14 @@
@protocol XCElementP @end
-typedef NSObject <XCElementP> XCElement;
+typedef NSObject <XCElementP> XCElement; // expected-note {{previous definition is here}}
@interface XCElementMainImp {
XCElement * _editingElement;
}
@end
- at class XCElement;
+ at class XCElement; // expected-warning {{redefinition of forward class 'XCElement' of a typedef name of an object type is ignored}}
@implementation XCElementMainImp
- (XCElement *)editingElement { return _editingElement; }
Modified: cfe/branches/tooling/test/SemaObjC/typedef-class.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/typedef-class.m?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/typedef-class.m (original)
+++ cfe/branches/tooling/test/SemaObjC/typedef-class.m Tue Jan 24 07:11:31 2012
@@ -48,13 +48,13 @@
@protocol XCElementTogglerP < XCElementP > -(void) setDisplayed:(BOOL) displayed;
@end
-typedef NSObject < XCElementTogglerP > XCElementToggler;
+typedef NSObject < XCElementTogglerP > XCElementToggler; // expected-note {{previous definition is here}}
@interface XCElementRootFace:NSObject {} @end
@interface XCElementFace:XCElementRootFace {} @end
- at class XCElementToggler;
+ at class XCElementToggler; // expected-warning {{redefinition of forward class 'XCElementToggler' of a typedef name of an object type is ignored}}
@interface XCRASlice:XCElementFace {} @end
Modified: cfe/branches/tooling/test/SemaObjCXX/properties.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjCXX/properties.mm?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjCXX/properties.mm (original)
+++ cfe/branches/tooling/test/SemaObjCXX/properties.mm Tue Jan 24 07:11:31 2012
@@ -28,7 +28,7 @@
- (int) z;
@end
void test2(Test2 *a) {
- auto y = a.y; // expected-error {{expected getter method not found on object of type 'Test2 *'}} expected-error {{variable 'y' with type 'auto' has incompatible initializer of type}}
+ auto y = a.y; // expected-error {{expected getter method not found on object of type 'Test2 *'}}
auto z = a.z;
}
Modified: cfe/branches/tooling/tools/libclang/IndexingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/IndexingContext.cpp?rev=148801&r1=148800&r2=148801&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/IndexingContext.cpp (original)
+++ cfe/branches/tooling/tools/libclang/IndexingContext.cpp Tue Jan 24 07:11:31 2012
@@ -465,6 +465,9 @@
SourceLocation CategoryLoc = D->getCategoryNameLoc();
getEntityInfo(IFaceD, ClassEntity, SA);
+ if (suppressRefs())
+ markEntityOccurrenceInFile(IFaceD, ClassLoc);
+
CatDInfo.ObjCCatDeclInfo.containerInfo = &CatDInfo.ObjCContDeclInfo;
if (IFaceD) {
CatDInfo.ObjCCatDeclInfo.objcClass = &ClassEntity;
More information about the llvm-branch-commits
mailing list