From ce6c4e94ffcc4e4ecabd7d64c8f7c65433d5eb0c Mon Sep 17 00:00:00 2001 From: LaMont Jones Date: Mon, 30 Aug 2021 23:20:07 +0000 Subject: Stop using `group_static_libs` property This property is now ignored, so there is no need to set it. For more details, see the bug and/or "Effecient archive file handling" in https://lld.llvm.org/NewLLD.html#key-concepts Bug: 189475744 Test: Manual build succeeds Change-Id: I16f1e1549201646e4eb530916beb217ef236d3bf --- tools/mcld/Android.bp | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/mcld/Android.bp b/tools/mcld/Android.bp index 3342f36..6681aae 100644 --- a/tools/mcld/Android.bp +++ b/tools/mcld/Android.bp @@ -42,7 +42,6 @@ cc_binary { // arch-specific static libraries depend on libmcldTarget. // Can be removed once soong supports transitive static library dependencies - group_static_libs: true, static_libs: [ "libmcldADT", "libmcldCore", -- cgit v1.2.3 From 662e477731de0dc2c81172bb87a56299d8df7d8a Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 13 Jan 2022 15:01:43 -0800 Subject: Use nullptr instead of NULL for make_pair musl libc defines NULL as nullptr, which is explicitly allowed by C++11. nullptr_t cannot be cast to a pointer with reinterpret_cast, static_cast must be used instead. Using nullptr directly without any cast works better, as nullptr will only implicitly cast to a pointer type, which avoids the method overload resolution problems with NULL. Bug: 190084016 Test: m USE_HOST_MUSL=true host-native Change-Id: I11bfe2c2916a4d757d0cea76a45f37b4fde9ad25 --- lib/LD/IdenticalCodeFolding.cpp | 3 +-- lib/Object/SectionMap.cpp | 3 +-- lib/Script/Assignment.cpp | 12 ++++-------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/lib/LD/IdenticalCodeFolding.cpp b/lib/LD/IdenticalCodeFolding.cpp index 5ba0fc1..a899bb0 100644 --- a/lib/LD/IdenticalCodeFolding.cpp +++ b/lib/LD/IdenticalCodeFolding.cpp @@ -126,8 +126,7 @@ void IdenticalCodeFolding::findCandidates(FoldingCandidates& pCandidateList) { for (sect = (*obj)->context()->sectBegin(); sect != sectEnd; ++sect) { switch ((*sect)->kind()) { case LDFileFormat::TEXT: { - candidate_map.insert( - std::make_pair(*sect, reinterpret_cast(NULL))); + candidate_map.insert(std::make_pair(*sect, nullptr)); break; } case LDFileFormat::Relocation: { diff --git a/lib/Object/SectionMap.cpp b/lib/Object/SectionMap.cpp index 615c493..9cba895 100644 --- a/lib/Object/SectionMap.cpp +++ b/lib/Object/SectionMap.cpp @@ -193,8 +193,7 @@ SectionMap::mapping SectionMap::find(const std::string& pInputFile, return std::make_pair(*out, *in); } } - return std::make_pair(reinterpret_cast(NULL), - reinterpret_cast(NULL)); + return std::make_pair(nullptr, nullptr); } SectionMap::const_iterator SectionMap::find( diff --git a/lib/Script/Assignment.cpp b/lib/Script/Assignment.cpp index 333b366..1df7817 100644 --- a/lib/Script/Assignment.cpp +++ b/lib/Script/Assignment.cpp @@ -80,8 +80,7 @@ void Assignment::activate(Module& pModule) { switch (m_Level) { case OUTSIDE_SECTIONS: assert(!isLhsDot); - script.assignments().push_back( - std::make_pair(reinterpret_cast(NULL), *this)); + script.assignments().push_back(std::make_pair(nullptr, *this)); break; case OUTPUT_SECTION: { @@ -122,8 +121,7 @@ void Assignment::activate(Module& pModule) { if (isLhsDot) { out->dotAssignments().push_back(*this); } else { - script.assignments().push_back( - std::make_pair(reinterpret_cast(NULL), *this)); + script.assignments().push_back(std::make_pair(nullptr, *this)); } break; } @@ -138,8 +136,7 @@ void Assignment::activate(Module& pModule) { in->getSection()->getSectionData()->front()); Assignment assign( INPUT_SECTION, HIDDEN, *SymOperand::create("."), *expr); - in->dotAssignments().push_back( - std::make_pair(reinterpret_cast(NULL), assign)); + in->dotAssignments().push_back(std::make_pair(nullptr, assign)); } Assignment& prevDotAssign = in->dotAssignments().back().second; @@ -158,8 +155,7 @@ void Assignment::activate(Module& pModule) { in->dotAssignments().push_back(std::make_pair( in->getSection()->getSectionData()->front().getNextNode(), *this)); } else { - script.assignments().push_back( - std::make_pair(reinterpret_cast(NULL), *this)); + script.assignments().push_back(std::make_pair(nullptr, *this)); } break; } -- cgit v1.2.3