Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/llvm/dist/clang Import Clang 3.6.1.
details: https://anonhg.NetBSD.org/src/rev/87bca9cd6ceb
branches: trunk
changeset: 338541:87bca9cd6ceb
user: joerg <joerg%NetBSD.org@localhost>
date: Fri May 29 17:21:44 2015 +0000
description:
Import Clang 3.6.1.
diffstat:
external/bsd/llvm/dist/clang/include/clang/Basic/TargetCXXABI.h | 10 +
external/bsd/llvm/dist/clang/include/clang/Sema/Template.h | 7 +
external/bsd/llvm/dist/clang/lib/AST/ASTContext.cpp | 4 +-
external/bsd/llvm/dist/clang/lib/AST/ASTDiagnostic.cpp | 53 ++++----
external/bsd/llvm/dist/clang/lib/AST/Decl.cpp | 3 +-
external/bsd/llvm/dist/clang/lib/Analysis/ThreadSafety.cpp | 4 +-
external/bsd/llvm/dist/clang/lib/Basic/TargetInfo.cpp | 1 +
external/bsd/llvm/dist/clang/lib/Basic/Targets.cpp | 12 +-
external/bsd/llvm/dist/clang/lib/CodeGen/CodeGenModule.cpp | 1 +
external/bsd/llvm/dist/clang/lib/CodeGen/ItaniumCXXABI.cpp | 3 +
external/bsd/llvm/dist/clang/lib/Driver/ToolChains.cpp | 2 +
external/bsd/llvm/dist/clang/lib/Frontend/InitPreprocessor.cpp | 7 +-
external/bsd/llvm/dist/clang/lib/Sema/DeclSpec.cpp | 5 +-
external/bsd/llvm/dist/clang/lib/Sema/SemaExpr.cpp | 7 +-
external/bsd/llvm/dist/clang/lib/Sema/SemaExprCXX.cpp | 10 +
external/bsd/llvm/dist/clang/lib/Sema/SemaTemplate.cpp | 56 ++++++---
external/bsd/llvm/dist/clang/test/CodeGen/mangle-windows.c | 15 ++
external/bsd/llvm/dist/clang/test/CodeGen/mcount.c | 18 ++-
external/bsd/llvm/dist/clang/test/CodeGenCXX/inline-functions.cpp | 15 ++
external/bsd/llvm/dist/clang/test/CodeGenCXX/member-function-pointers.cpp | 2 +
external/bsd/llvm/dist/clang/test/CodeGenCXX/trivial-constructor-init.cpp | 14 ++
external/bsd/llvm/dist/clang/test/Driver/android-standalone.cpp | 16 ++
external/bsd/llvm/dist/clang/test/Misc/diag-template-diffing.cpp | 27 ++++
external/bsd/llvm/dist/clang/test/Preprocessor/init.c | 4 +-
external/bsd/llvm/dist/clang/test/SemaCXX/cxx0x-noexcept-expression.cpp | 19 +++
external/bsd/llvm/dist/clang/test/SemaCXX/thread-safety-reference-handling.cpp | 17 +++
external/bsd/llvm/dist/clang/test/SemaCXX/warn-thread-safety-negative.cpp | 17 +++
external/bsd/llvm/dist/clang/test/SemaTemplate/overloaded-functions.cpp | 32 +++++
28 files changed, 311 insertions(+), 70 deletions(-)
diffs (truncated from 902 to 300 lines):
diff -r 06d260bb0a2a -r 87bca9cd6ceb external/bsd/llvm/dist/clang/include/clang/Basic/TargetCXXABI.h
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/TargetCXXABI.h Fri May 29 17:18:11 2015 +0000
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/TargetCXXABI.h Fri May 29 17:21:44 2015 +0000
@@ -79,6 +79,12 @@
/// - guard variables are smaller.
GenericAArch64,
+ /// The generic Mips ABI is a modified version of the Itanium ABI.
+ ///
+ /// At the moment, only change from the generic ABI in this case is:
+ /// - representation of member function pointers adjusted as in ARM.
+ GenericMIPS,
+
/// The Microsoft ABI is the ABI used by Microsoft Visual Studio (and
/// compatible compilers).
///
@@ -114,6 +120,7 @@
case GenericARM:
case iOS:
case iOS64:
+ case GenericMIPS:
return true;
case Microsoft:
@@ -130,6 +137,7 @@
case GenericARM:
case iOS:
case iOS64:
+ case GenericMIPS:
return false;
case Microsoft:
@@ -212,6 +220,7 @@
case GenericItanium:
case iOS: // old iOS compilers did not follow this rule
case Microsoft:
+ case GenericMIPS:
return true;
}
llvm_unreachable("bad ABI kind");
@@ -257,6 +266,7 @@
case GenericAArch64:
case GenericARM:
case iOS:
+ case GenericMIPS:
return UseTailPaddingUnlessPOD03;
// iOS on ARM64 uses the C++11 POD rules. It does not honor the
diff -r 06d260bb0a2a -r 87bca9cd6ceb external/bsd/llvm/dist/clang/include/clang/Sema/Template.h
--- a/external/bsd/llvm/dist/clang/include/clang/Sema/Template.h Fri May 29 17:18:11 2015 +0000
+++ b/external/bsd/llvm/dist/clang/include/clang/Sema/Template.h Fri May 29 17:21:44 2015 +0000
@@ -273,6 +273,11 @@
/// outermost scope.
LocalInstantiationScope *cloneScopes(LocalInstantiationScope *Outermost) {
if (this == Outermost) return this;
+
+ // Save the current scope from SemaRef since the LocalInstantiationScope
+ // will overwrite it on construction
+ LocalInstantiationScope *oldScope = SemaRef.CurrentInstantiationScope;
+
LocalInstantiationScope *newScope =
new LocalInstantiationScope(SemaRef, CombineWithOuterScope);
@@ -299,6 +304,8 @@
newScope->ArgumentPacks.push_back(NewPack);
}
}
+ // Restore the saved scope to SemaRef
+ SemaRef.CurrentInstantiationScope = oldScope;
return newScope;
}
diff -r 06d260bb0a2a -r 87bca9cd6ceb external/bsd/llvm/dist/clang/lib/AST/ASTContext.cpp
--- a/external/bsd/llvm/dist/clang/lib/AST/ASTContext.cpp Fri May 29 17:18:11 2015 +0000
+++ b/external/bsd/llvm/dist/clang/lib/AST/ASTContext.cpp Fri May 29 17:21:44 2015 +0000
@@ -682,6 +682,7 @@
case TargetCXXABI::iOS:
case TargetCXXABI::iOS64:
case TargetCXXABI::GenericAArch64:
+ case TargetCXXABI::GenericMIPS:
case TargetCXXABI::GenericItanium:
return CreateItaniumCXXABI(*this);
case TargetCXXABI::Microsoft:
@@ -7873,7 +7874,7 @@
// Functions specified with extern and inline in -fms-compatibility mode
// forcibly get emitted. While the body of the function cannot be later
// replaced, the function definition cannot be discarded.
- if (FD->getMostRecentDecl()->isMSExternInline())
+ if (FD->isMSExternInline())
return GVA_StrongODR;
return GVA_DiscardableODR;
@@ -8064,6 +8065,7 @@
case TargetCXXABI::GenericAArch64:
case TargetCXXABI::GenericItanium:
case TargetCXXABI::GenericARM:
+ case TargetCXXABI::GenericMIPS:
case TargetCXXABI::iOS:
case TargetCXXABI::iOS64:
return ItaniumMangleContext::create(*this, getDiagnostics());
diff -r 06d260bb0a2a -r 87bca9cd6ceb external/bsd/llvm/dist/clang/lib/AST/ASTDiagnostic.cpp
--- a/external/bsd/llvm/dist/clang/lib/AST/ASTDiagnostic.cpp Fri May 29 17:18:11 2015 +0000
+++ b/external/bsd/llvm/dist/clang/lib/AST/ASTDiagnostic.cpp Fri May 29 17:21:44 2015 +0000
@@ -998,29 +998,27 @@
(!HasFromValueDecl && !HasToValueDecl)) &&
"Template argument cannot be both integer and declaration");
- unsigned ParamWidth = 128; // Safe default
- if (FromDefaultNonTypeDecl->getType()->isIntegralOrEnumerationType())
- ParamWidth = Context.getIntWidth(FromDefaultNonTypeDecl->getType());
-
if (!HasFromInt && !HasToInt && !HasFromValueDecl && !HasToValueDecl) {
Tree.SetNode(FromExpr, ToExpr);
Tree.SetDefault(FromIter.isEnd() && FromExpr, ToIter.isEnd() && ToExpr);
if (FromDefaultNonTypeDecl->getType()->isIntegralOrEnumerationType()) {
if (FromExpr)
- HasFromInt = GetInt(Context, FromIter, FromExpr, FromInt);
+ HasFromInt = GetInt(Context, FromIter, FromExpr, FromInt,
+ FromDefaultNonTypeDecl->getType());
if (ToExpr)
- HasToInt = GetInt(Context, ToIter, ToExpr, ToInt);
+ HasToInt = GetInt(Context, ToIter, ToExpr, ToInt,
+ ToDefaultNonTypeDecl->getType());
}
if (HasFromInt && HasToInt) {
Tree.SetNode(FromInt, ToInt, HasFromInt, HasToInt);
- Tree.SetSame(IsSameConvertedInt(ParamWidth, FromInt, ToInt));
+ Tree.SetSame(FromInt == ToInt);
Tree.SetKind(DiffTree::Integer);
} else if (HasFromInt || HasToInt) {
Tree.SetNode(FromInt, ToInt, HasFromInt, HasToInt);
Tree.SetSame(false);
Tree.SetKind(DiffTree::Integer);
} else {
- Tree.SetSame(IsEqualExpr(Context, ParamWidth, FromExpr, ToExpr) ||
+ Tree.SetSame(IsEqualExpr(Context, FromExpr, ToExpr) ||
(FromNullPtr && ToNullPtr));
Tree.SetNullPtr(FromNullPtr, ToNullPtr);
Tree.SetKind(DiffTree::Expression);
@@ -1030,11 +1028,17 @@
if (HasFromInt || HasToInt) {
if (!HasFromInt && FromExpr)
- HasFromInt = GetInt(Context, FromIter, FromExpr, FromInt);
+ HasFromInt = GetInt(Context, FromIter, FromExpr, FromInt,
+ FromDefaultNonTypeDecl->getType());
if (!HasToInt && ToExpr)
- HasToInt = GetInt(Context, ToIter, ToExpr, ToInt);
+ HasToInt = GetInt(Context, ToIter, ToExpr, ToInt,
+ ToDefaultNonTypeDecl->getType());
Tree.SetNode(FromInt, ToInt, HasFromInt, HasToInt);
- Tree.SetSame(IsSameConvertedInt(ParamWidth, FromInt, ToInt));
+ if (HasFromInt && HasToInt) {
+ Tree.SetSame(FromInt == ToInt);
+ } else {
+ Tree.SetSame(false);
+ }
Tree.SetDefault(FromIter.isEnd() && HasFromInt,
ToIter.isEnd() && HasToInt);
Tree.SetKind(DiffTree::Integer);
@@ -1210,9 +1214,11 @@
}
/// GetInt - Retrieves the template integer argument, including evaluating
- /// default arguments.
+ /// default arguments. If the value comes from an expression, extend the
+ /// APSInt to size of IntegerType to match the behavior in
+ /// Sema::CheckTemplateArgument
static bool GetInt(ASTContext &Context, const TSTiterator &Iter,
- Expr *ArgExpr, llvm::APInt &Int) {
+ Expr *ArgExpr, llvm::APSInt &Int, QualType IntegerType) {
// Default, value-depenedent expressions require fetching
// from the desugared TemplateArgument, otherwise expression needs to
// be evaluatable.
@@ -1224,12 +1230,14 @@
case TemplateArgument::Expression:
ArgExpr = Iter.getDesugar().getAsExpr();
Int = ArgExpr->EvaluateKnownConstInt(Context);
+ Int = Int.extOrTrunc(Context.getTypeSize(IntegerType));
return true;
default:
llvm_unreachable("Unexpected template argument kind");
}
} else if (ArgExpr->isEvaluatable(Context)) {
Int = ArgExpr->EvaluateKnownConstInt(Context);
+ Int = Int.extOrTrunc(Context.getTypeSize(IntegerType));
return true;
}
@@ -1302,18 +1310,8 @@
return nullptr;
}
- /// IsSameConvertedInt - Returns true if both integers are equal when
- /// converted to an integer type with the given width.
- static bool IsSameConvertedInt(unsigned Width, const llvm::APSInt &X,
- const llvm::APSInt &Y) {
- llvm::APInt ConvertedX = X.extOrTrunc(Width);
- llvm::APInt ConvertedY = Y.extOrTrunc(Width);
- return ConvertedX == ConvertedY;
- }
-
/// IsEqualExpr - Returns true if the expressions evaluate to the same value.
- static bool IsEqualExpr(ASTContext &Context, unsigned ParamWidth,
- Expr *FromExpr, Expr *ToExpr) {
+ static bool IsEqualExpr(ASTContext &Context, Expr *FromExpr, Expr *ToExpr) {
if (FromExpr == ToExpr)
return true;
@@ -1345,7 +1343,7 @@
switch (FromVal.getKind()) {
case APValue::Int:
- return IsSameConvertedInt(ParamWidth, FromVal.getInt(), ToVal.getInt());
+ return FromVal.getInt() == ToVal.getInt();
case APValue::LValue: {
APValue::LValueBase FromBase = FromVal.getLValueBase();
APValue::LValueBase ToBase = ToVal.getLValueBase();
@@ -1655,11 +1653,14 @@
}
Unbold();
}
-
+
/// HasExtraInfo - Returns true if E is not an integer literal or the
/// negation of an integer literal
bool HasExtraInfo(Expr *E) {
if (!E) return false;
+
+ E = E->IgnoreImpCasts();
+
if (isa<IntegerLiteral>(E)) return false;
if (UnaryOperator *UO = dyn_cast<UnaryOperator>(E))
diff -r 06d260bb0a2a -r 87bca9cd6ceb external/bsd/llvm/dist/clang/lib/AST/Decl.cpp
--- a/external/bsd/llvm/dist/clang/lib/AST/Decl.cpp Fri May 29 17:18:11 2015 +0000
+++ b/external/bsd/llvm/dist/clang/lib/AST/Decl.cpp Fri May 29 17:21:44 2015 +0000
@@ -2674,7 +2674,8 @@
if (!Context.getLangOpts().MSVCCompat && !hasAttr<DLLExportAttr>())
return false;
- for (const FunctionDecl *FD = this; FD; FD = FD->getPreviousDecl())
+ for (const FunctionDecl *FD = getMostRecentDecl(); FD;
+ FD = FD->getPreviousDecl())
if (FD->getStorageClass() == SC_Extern)
return true;
diff -r 06d260bb0a2a -r 87bca9cd6ceb external/bsd/llvm/dist/clang/lib/Analysis/ThreadSafety.cpp
--- a/external/bsd/llvm/dist/clang/lib/Analysis/ThreadSafety.cpp Fri May 29 17:18:11 2015 +0000
+++ b/external/bsd/llvm/dist/clang/lib/Analysis/ThreadSafety.cpp Fri May 29 17:21:44 2015 +0000
@@ -2108,8 +2108,8 @@
// Create a dummy expression,
VarDecl *VD = const_cast<VarDecl*>(AD.getVarDecl());
- DeclRefExpr DRE(VD, false, VD->getType(), VK_LValue,
- AD.getTriggerStmt()->getLocEnd());
+ DeclRefExpr DRE(VD, false, VD->getType().getNonReferenceType(),
+ VK_LValue, AD.getTriggerStmt()->getLocEnd());
LocksetBuilder.handleCall(&DRE, DD);
break;
}
diff -r 06d260bb0a2a -r 87bca9cd6ceb external/bsd/llvm/dist/clang/lib/Basic/TargetInfo.cpp
--- a/external/bsd/llvm/dist/clang/lib/Basic/TargetInfo.cpp Fri May 29 17:18:11 2015 +0000
+++ b/external/bsd/llvm/dist/clang/lib/Basic/TargetInfo.cpp Fri May 29 17:21:44 2015 +0000
@@ -655,6 +655,7 @@
.Case("ios", iOS)
.Case("itanium", GenericItanium)
.Case("microsoft", Microsoft)
+ .Case("mips", GenericMIPS)
.Default(unknown);
if (kind == unknown) return false;
diff -r 06d260bb0a2a -r 87bca9cd6ceb external/bsd/llvm/dist/clang/lib/Basic/Targets.cpp
--- a/external/bsd/llvm/dist/clang/lib/Basic/Targets.cpp Fri May 29 17:18:11 2015 +0000
+++ b/external/bsd/llvm/dist/clang/lib/Basic/Targets.cpp Fri May 29 17:21:44 2015 +0000
@@ -419,6 +419,7 @@
public:
NetBSDTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) {
this->UserLabelPrefix = "";
+ this->MCountName = "_mcount";
}
};
@@ -3362,7 +3363,10 @@
: WindowsTargetInfo<X86_32TargetInfo>(Triple) {
WCharType = UnsignedShort;
DoubleAlign = LongLongAlign = 64;
- DescriptionString = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32";
+ bool IsWinCOFF =
+ getTriple().isOSWindows() && getTriple().isOSBinFormatCOFF();
+ DescriptionString = IsWinCOFF ? "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
+ : "e-m:e-p:32:32-i64:64-f80:32-n8:16:32-S32";
}
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override {
@@ -5636,7 +5640,9 @@
const std::string &CPUStr)
: TargetInfo(Triple), CPU(CPUStr), IsMips16(false), IsMicromips(false),
IsNan2008(false), IsSingleFloat(false), FloatABI(HardFloat),
- DspRev(NoDSP), HasMSA(false), HasFP64(false), ABI(ABIStr) {}
Home |
Main Index |
Thread Index |
Old Index