Skip to content

Commit

Permalink
Merged master:17df5373e617 into amd-gfx:518c72adb33f
Browse files Browse the repository at this point in the history
Local branch amd-gfx 518c72a Merged master:20c926e0797e into amd-gfx:14c209a16d0d
Remote branch master 17df537 [X86] Regenerate i64-to-float.ll tests with avx512 coverage
  • Loading branch information
Sw authored and Sw committed Nov 26, 2020
2 parents 518c72a + 17df537 commit b578807
Show file tree
Hide file tree
Showing 69 changed files with 759 additions and 350 deletions.
10 changes: 8 additions & 2 deletions clang/lib/AST/ASTImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5158,8 +5158,6 @@ ASTNodeImporter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) {
// context. This context will be fixed when the actual template declaration
// is created.

// FIXME: Import default argument and constraint expression.

ExpectedSLoc BeginLocOrErr = import(D->getBeginLoc());
if (!BeginLocOrErr)
return BeginLocOrErr.takeError();
Expand Down Expand Up @@ -5206,6 +5204,14 @@ ASTNodeImporter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) {
ToIDC);
}

if (D->hasDefaultArgument()) {
Expected<TypeSourceInfo *> ToDefaultArgOrErr =
import(D->getDefaultArgumentInfo());
if (!ToDefaultArgOrErr)
return ToDefaultArgOrErr.takeError();
ToD->setDefaultArgument(*ToDefaultArgOrErr);
}

return ToD;
}

Expand Down
19 changes: 19 additions & 0 deletions clang/unittests/AST/ASTImporterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,25 @@ TEST_P(ImportExpr, DependentSizedArrayType) {
has(fieldDecl(hasType(dependentSizedArrayType())))))));
}

TEST_P(ASTImporterOptionSpecificTestBase, TemplateTypeParmDeclNoDefaultArg) {
Decl *FromTU = getTuDecl("template<typename T> struct X {};", Lang_CXX03);
auto From = FirstDeclMatcher<TemplateTypeParmDecl>().match(
FromTU, templateTypeParmDecl(hasName("T")));
TemplateTypeParmDecl *To = Import(From, Lang_CXX03);
ASSERT_FALSE(To->hasDefaultArgument());
}

TEST_P(ASTImporterOptionSpecificTestBase, TemplateTypeParmDeclDefaultArg) {
Decl *FromTU =
getTuDecl("template<typename T = int> struct X {};", Lang_CXX03);
auto From = FirstDeclMatcher<TemplateTypeParmDecl>().match(
FromTU, templateTypeParmDecl(hasName("T")));
TemplateTypeParmDecl *To = Import(From, Lang_CXX03);
ASSERT_TRUE(To->hasDefaultArgument());
QualType ToArg = To->getDefaultArgument();
ASSERT_EQ(ToArg, QualType(To->getASTContext().IntTy));
}

TEST_P(ASTImporterOptionSpecificTestBase, ImportBeginLocOfDeclRefExpr) {
Decl *FromTU =
getTuDecl("class A { public: static int X; }; void f() { (void)A::X; }",
Expand Down
22 changes: 2 additions & 20 deletions libcxx/src/thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,8 @@
#include "future"
#include "limits"

#if __has_include(<sys/types.h>)
# include <sys/types.h>
#endif

#if __has_include(<sys/param.h>)
# include <sys/param.h>
#endif

#if __has_include(<sys/sysctl.h>)
# include <sys/sysctl.h>
#endif

#if __has_include(<unistd.h>)
# include <unistd.h>
# include <unistd.h> // for sysconf
#endif

#if defined(__NetBSD__)
Expand Down Expand Up @@ -84,13 +72,7 @@ thread::detach()
unsigned
thread::hardware_concurrency() _NOEXCEPT
{
#if defined(CTL_HW) && defined(HW_NCPU)
unsigned n;
int mib[2] = {CTL_HW, HW_NCPU};
std::size_t s = sizeof(n);
sysctl(mib, 2, &n, &s, 0, 0);
return n;
#elif defined(_SC_NPROCESSORS_ONLN)
#if defined(_SC_NPROCESSORS_ONLN)
long result = sysconf(_SC_NPROCESSORS_ONLN);
// sysconf returns -1 if the name is invalid, the option does not exist or
// does not have a definite limit.
Expand Down
10 changes: 9 additions & 1 deletion libcxx/utils/libcxx/test/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@
Feature(name='has-fobjc-arc', when=lambda cfg: hasCompileFlag(cfg, '-xobjective-c++ -fobjc-arc') and
sys.platform.lower().strip() == 'darwin'), # TODO: this doesn't handle cross-compiling to Apple platforms.
Feature(name='objective-c++', when=lambda cfg: hasCompileFlag(cfg, '-xobjective-c++ -fobjc-arc')),
Feature(name='modules-support', when=lambda cfg: hasCompileFlag(cfg, '-fmodules')),

# Note: We use a custom modules cache path to make sure that we don't reuse
# the default one, which can be shared across builds. This is important
# because we define macros in headers files, and a change in these macros
# doesn't seem to invalidate modules cache entries, which means we could
# build against now-invalid cached headers from a previous build.
Feature(name='modules-support',
when=lambda cfg: hasCompileFlag(cfg, '-fmodules'),
actions=lambda cfg: [AddCompileFlag('-fmodules-cache-path=%t/ModuleCache')]),

Feature(name='non-lockfree-atomics',
when=lambda cfg: sourceBuilds(cfg, """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test(self):

self.runCmd("settings set target.import-std-module true")

deque_type = "std::deque<int, std::allocator<int> >"
deque_type = "std::deque<int>"
size_type = deque_type + "::size_type"
value_type = "std::__deque_base<int, std::allocator<int> >::value_type"
iterator = deque_type + "::iterator"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test(self):

self.runCmd("settings set target.import-std-module true")

deque_type = "std::deque<Foo, std::allocator<Foo> >"
deque_type = "std::deque<Foo>"
size_type = deque_type + "::size_type"
value_type = "std::__deque_base<Foo, std::allocator<Foo> >::value_type"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test(self):

self.runCmd("settings set target.import-std-module true")

list_type = "std::forward_list<Foo, std::allocator<Foo> >"
list_type = "std::forward_list<Foo>"
value_type = list_type + "::value_type"

# FIXME: This has three elements in it but the formatter seems to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test(self):

self.runCmd("settings set target.import-std-module true")

list_type = "std::forward_list<int, std::allocator<int> >"
list_type = "std::forward_list<int>"
value_type = list_type + "::value_type"

# FIXME: This has three elements in it but the formatter seems to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test(self):

self.runCmd("settings set target.import-std-module true")

list_type = "std::list<Foo, std::allocator<Foo> >"
list_type = "std::list<Foo>"
size_type = list_type + "::size_type"
value_type = list_type + "::value_type"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test(self):

self.runCmd("settings set target.import-std-module true")

list_type = "std::list<int, std::allocator<int> >"
list_type = "std::list<int>"
size_type = list_type + "::size_type"
value_type = list_type + "::value_type"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test(self):

self.runCmd("settings set target.import-std-module true")

queue_type = "std::queue<C, std::deque<C, std::allocator<C> > >"
queue_type = "std::queue<C>"
size_type = queue_type + "::size_type"
value_type = "std::__deque_base<C, std::allocator<C> >::value_type"

Expand Down Expand Up @@ -54,9 +54,9 @@ def test(self):
result_value="5")

# Test std::queue functionality with a std::list.
queue_type = "std::queue<C, std::list<C, std::allocator<C> > >"
queue_type = "std::queue<C, std::list<C> >"
size_type = queue_type + "::size_type"
value_type = "std::list<C, std::allocator<C> >::value_type"
value_type = "std::list<C>::value_type"
self.expect_expr(
"q_list",
result_type=queue_type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test(self):
self.runCmd("settings set target.import-std-module true")

# Test std::stack functionality with a std::deque.
stack_type = "std::stack<C, std::deque<C, std::allocator<C> > >"
stack_type = "std::stack<C>"
size_type = stack_type + "::size_type"

self.expect_expr("s_deque", result_type=stack_type)
Expand All @@ -40,7 +40,7 @@ def test(self):
result_value="5")

# Test std::stack functionality with a std::vector.
stack_type = "std::stack<C, std::vector<C, std::allocator<C> > >"
stack_type = "std::stack<C, std::vector<C> >"
size_type = stack_type + "::size_type"

self.expect_expr("s_vector", result_type=stack_type)
Expand All @@ -58,7 +58,7 @@ def test(self):
result_value="5")

# Test std::stack functionality with a std::list.
stack_type = "std::stack<C, std::list<C, std::allocator<C> > >"
stack_type = "std::stack<C, std::list<C> >"
size_type = stack_type + "::size_type"
self.expect_expr("s_list", result_type=stack_type)
self.expect("expr s_list.pop()")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test(self):

self.expect_expr(
"s",
result_type="std::unique_ptr<Foo, std::default_delete<Foo> >",
result_type="std::unique_ptr<Foo>",
result_children=[ValueCheck(children=[ValueCheck(value="3")])])
self.expect_expr("s->a", result_type="int", result_value="3")
self.expect_expr("s->a = 5", result_type="int", result_value="5")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test(self):

self.expect_expr(
"s",
result_type="std::unique_ptr<int, std::default_delete<int> >",
result_type="std::unique_ptr<int>",
result_summary="3",
result_children=[ValueCheck(name="__value_")])
self.expect_expr("*s", result_type="int", result_value="3")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test(self):
"// Set break point at this line.",
lldb.SBFileSpec("main.cpp"))

vector_type = "std::vector<bool, std::allocator<bool> >"
vector_type = "std::vector<bool>"
size_type = vector_type + "::size_type"

self.runCmd("settings set target.import-std-module true")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test(self):

self.runCmd("settings set target.import-std-module true")

vector_type = "std::vector<Foo, std::allocator<Foo> >"
vector_type = "std::vector<Foo>"
size_type = vector_type + "::size_type"
value_type = vector_type + "::value_type"
iterator = vector_type + "::iterator"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,9 @@ def test(self):
"// Set break point at this line.",
lldb.SBFileSpec("main.cpp"))

vector_type = "std::vector<int, std::allocator<int> >"
vector_of_vector_type = "std::vector<" + vector_type + \
", std::allocator<std::vector<int, std::allocator<int> > > >"
size_type = (
"std::vector<std::vector<int, std::allocator<int> >, " +
"std::allocator<std::vector<int, std::allocator<int> > >" +
" >::size_type")
vector_type = "std::vector<int>"
vector_of_vector_type = "std::vector<" + vector_type + " >"
size_type = vector_of_vector_type + "::size_type"
value_type = "std::__vector_base<int, std::allocator<int> >::value_type"

self.runCmd("settings set target.import-std-module true")
Expand All @@ -35,13 +31,13 @@ def test(self):
"a",
result_type=vector_of_vector_type,
result_children=[
ValueCheck(type="std::vector<int, std::allocator<int> >",
ValueCheck(type="std::vector<int>",
children=[
ValueCheck(value='1'),
ValueCheck(value='2'),
ValueCheck(value='3'),
]),
ValueCheck(type="std::vector<int, std::allocator<int> >",
ValueCheck(type="std::vector<int>",
children=[
ValueCheck(value='3'),
ValueCheck(value='2'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test(self):

self.runCmd("settings set target.import-std-module true")

vector_type = "std::vector<int, std::allocator<int> >"
vector_type = "std::vector<int>"
size_type = vector_type + "::size_type"
value_type = "std::__vector_base<int, std::allocator<int> >::value_type"
iterator = vector_type + "::iterator"
Expand Down
10 changes: 5 additions & 5 deletions llvm/include/llvm/Analysis/AliasAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,8 @@ class AAResults {

/// A convenience wrapper around the primary \c alias interface.
AliasResult alias(const Value *V1, const Value *V2) {
return alias(V1, LocationSize::unknown(), V2, LocationSize::unknown());
return alias(MemoryLocation::getBeforeOrAfter(V1),
MemoryLocation::getBeforeOrAfter(V2));
}

/// A trivial helper function to check to see if the specified pointers are
Expand All @@ -424,8 +425,8 @@ class AAResults {

/// A convenience wrapper around the \c isNoAlias helper interface.
bool isNoAlias(const Value *V1, const Value *V2) {
return isNoAlias(MemoryLocation(V1, LocationSize::unknown()),
MemoryLocation(V2, LocationSize::unknown()));
return isNoAlias(MemoryLocation::getBeforeOrAfter(V1),
MemoryLocation::getBeforeOrAfter(V2));
}

/// A trivial helper function to check to see if the specified pointers are
Expand All @@ -447,8 +448,7 @@ class AAResults {
/// A convenience wrapper around the primary \c pointsToConstantMemory
/// interface.
bool pointsToConstantMemory(const Value *P, bool OrLocal = false) {
return pointsToConstantMemory(MemoryLocation(P, LocationSize::unknown()),
OrLocal);
return pointsToConstantMemory(MemoryLocation::getBeforeOrAfter(P), OrLocal);
}

/// @}
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class MemoryDependenceResults {
/// The maximum size of the dereferences of the pointer.
///
/// May be UnknownSize if the sizes are unknown.
LocationSize Size = LocationSize::unknown();
LocationSize Size = LocationSize::afterPointer();
/// The AA tags associated with dereferences of the pointer.
///
/// The members may be null if there are no tags or conflicting tags.
Expand Down
Loading

0 comments on commit b578807

Please sign in to comment.