Vendor import of clang release_90 branch r370514:

https://llvm.org/svn/llvm-project/cfe/branches/release_90@370514
This commit is contained in:
Dimitry Andric 2019-09-02 17:49:08 +00:00
parent e489f4451b
commit 24632cab8a
7 changed files with 39 additions and 5 deletions

View File

@ -165,7 +165,7 @@ LANGSTANDARD(opencl12, "cl1.2",
LANGSTANDARD(opencl20, "cl2.0",
OpenCL, "OpenCL 2.0",
LineComment | C99 | Digraphs | HexFloat | OpenCL)
LANGSTANDARD(openclcpp, "c++",
LANGSTANDARD(openclcpp, "clc++",
OpenCL, "C++ for OpenCL",
LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
Digraphs | HexFloat | OpenCL)

View File

@ -60,6 +60,10 @@ bool RISCVTargetInfo::validateAsmConstraint(
// A floating-point register.
Info.setAllowsRegister();
return true;
case 'A':
// An address that is held in a general-purpose register.
Info.setAllowsMemory();
return true;
}
}

View File

@ -93,6 +93,13 @@ public:
}
return false;
}
void setMaxAtomicWidth() override {
MaxAtomicPromoteWidth = 128;
if (HasA)
MaxAtomicInlineWidth = 32;
}
};
class LLVM_LIBRARY_VISIBILITY RISCV64TargetInfo : public RISCVTargetInfo {
public:
@ -110,6 +117,13 @@ public:
}
return false;
}
void setMaxAtomicWidth() override {
MaxAtomicPromoteWidth = 128;
if (HasA)
MaxAtomicInlineWidth = 64;
}
};
} // namespace targets
} // namespace clang

View File

@ -15350,7 +15350,7 @@ ndrange_t __ovld ndrange_3D(const size_t[3]);
ndrange_t __ovld ndrange_3D(const size_t[3], const size_t[3]);
ndrange_t __ovld ndrange_3D(const size_t[3], const size_t[3], const size_t[3]);
int __ovld enqueue_marker(queue_t, uint, const __private clk_event_t*, __private clk_event_t*);
int __ovld enqueue_marker(queue_t, uint, const clk_event_t*, clk_event_t*);
void __ovld retain_event(clk_event_t);

View File

@ -1225,7 +1225,8 @@ static bool checkTupleLikeDecomposition(Sema &S,
if (E.isInvalid())
return true;
RefVD->setInit(E.get());
RefVD->checkInitIsICE();
if (!E.get()->isValueDependent())
RefVD->checkInitIsICE();
E = S.BuildDeclarationNameExpr(CXXScopeSpec(),
DeclarationNameInfo(B->getDeclName(), Loc),

View File

@ -4692,6 +4692,7 @@ SubstDefaultTemplateArgument(Sema &SemaRef,
for (unsigned i = 0, e = Param->getDepth(); i != e; ++i)
TemplateArgLists.addOuterTemplateArguments(None);
Sema::ContextRAII SavedContext(SemaRef, Template->getDeclContext());
EnterExpressionEvaluationContext ConstantEvaluated(
SemaRef, Sema::ExpressionEvaluationContext::ConstantEvaluated);
return SemaRef.SubstExpr(Param->getDefaultArgument(), TemplateArgLists);

View File

@ -7390,8 +7390,22 @@ static void deduceOpenCLImplicitAddrSpace(TypeProcessingState &State,
bool IsPointee =
ChunkIndex > 0 &&
(D.getTypeObject(ChunkIndex - 1).Kind == DeclaratorChunk::Pointer ||
D.getTypeObject(ChunkIndex - 1).Kind == DeclaratorChunk::BlockPointer ||
D.getTypeObject(ChunkIndex - 1).Kind == DeclaratorChunk::Reference);
D.getTypeObject(ChunkIndex - 1).Kind == DeclaratorChunk::Reference ||
D.getTypeObject(ChunkIndex - 1).Kind == DeclaratorChunk::BlockPointer);
// For pointers/references to arrays the next chunk is always an array
// followed by any number of parentheses.
if (!IsPointee && ChunkIndex > 1) {
auto AdjustedCI = ChunkIndex - 1;
if (D.getTypeObject(AdjustedCI).Kind == DeclaratorChunk::Array)
AdjustedCI--;
// Skip over all parentheses.
while (AdjustedCI > 0 &&
D.getTypeObject(AdjustedCI).Kind == DeclaratorChunk::Paren)
AdjustedCI--;
if (D.getTypeObject(AdjustedCI).Kind == DeclaratorChunk::Pointer ||
D.getTypeObject(AdjustedCI).Kind == DeclaratorChunk::Reference)
IsPointee = true;
}
bool IsFuncReturnType =
ChunkIndex > 0 &&
D.getTypeObject(ChunkIndex - 1).Kind == DeclaratorChunk::Function;