Skip to content

Commit

Permalink
Merge pull request #18 from llvm/main
Browse files Browse the repository at this point in the history
[pull] main from llvm:main
  • Loading branch information
devkadirselcuk authored Jul 7, 2021
2 parents 7b0c636 + 81ee495 commit 71efe5d
Show file tree
Hide file tree
Showing 186 changed files with 8,092 additions and 6,614 deletions.
38 changes: 38 additions & 0 deletions clang/docs/DataFlowSanitizer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,44 @@ the correct labels are propagated.
return 0;
}

Origin Tracking
===============

DataFlowSanitizer can track origins of labeled values. This feature is enabled by
``-mllvm -dfsan-track-origins=1``. For example,

.. code-block:: console
% cat test.cc
#include <sanitizer/dfsan_interface.h>
#include <stdio.h>
int main(int argc, char** argv) {
int i = 0;
dfsan_set_label(i_label, &i, sizeof(i));
int j = i + 1;
dfsan_print_origin_trace(&j, "A flow from i to j");
return 0;
}
% clang++ -fsanitize=dataflow -mllvm -dfsan-track-origins=1 -fno-omit-frame-pointer -g -O2 test.cc
% ./a.out
Taint value 0x1 (at 0x7ffd42bf415c) origin tracking (A flow from i to j)
Origin value: 0x13900001, Taint value was stored to memory at
#0 0x55676db85a62 in main test.cc:7:7
#1 0x7f0083611bbc in __libc_start_main libc-start.c:285
Origin value: 0x9e00001, Taint value was created at
#0 0x55676db85a08 in main test.cc:6:3
#1 0x7f0083611bbc in __libc_start_main libc-start.c:285
By ``-mllvm -dfsan-track-origins=1`` DataFlowSanitizer collects only
intermediate stores a labeled value went through. Origin tracking slows down
program execution by a factor of 2x on top of the usual DataFlowSanitizer
slowdown and increases memory overhead by 1x. By ``-mllvm -dfsan-track-origins=2``
DataFlowSanitizer also collects intermediate loads a labeled value went through.
This mode slows down program execution by a factor of 4x.

Current status
==============

Expand Down
74 changes: 8 additions & 66 deletions clang/lib/CodeGen/CGOpenMPRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8224,10 +8224,6 @@ class MappableExprsHandler {
// 'private ptr' and 'map to' flag. Return the right flags if the captured
// declaration is known as first-private in this handler.
if (FirstPrivateDecls.count(Cap.getCapturedVar())) {
if (Cap.getCapturedVar()->getType().isConstant(CGF.getContext()) &&
Cap.getCaptureKind() == CapturedStmt::VCK_ByRef)
return MappableExprsHandler::OMP_MAP_ALWAYS |
MappableExprsHandler::OMP_MAP_TO;
if (Cap.getCapturedVar()->getType()->isAnyPointerType())
return MappableExprsHandler::OMP_MAP_TO |
MappableExprsHandler::OMP_MAP_PTR_AND_OBJ;
Expand Down Expand Up @@ -9163,30 +9159,15 @@ class MappableExprsHandler {
CombinedInfo.Types.push_back(getMapModifiersForPrivateClauses(CI));
const VarDecl *VD = CI.getCapturedVar();
auto I = FirstPrivateDecls.find(VD);
if (I != FirstPrivateDecls.end() &&
VD->getType().isConstant(CGF.getContext())) {
llvm::Constant *Addr =
CGF.CGM.getOpenMPRuntime().registerTargetFirstprivateCopy(CGF, VD);
// Copy the value of the original variable to the new global copy.
CGF.Builder.CreateMemCpy(
CGF.MakeNaturalAlignAddrLValue(Addr, ElementType).getAddress(CGF),
Address(CV, CGF.getContext().getTypeAlignInChars(ElementType)),
CombinedInfo.Sizes.back(), /*IsVolatile=*/false);
// Use new global variable as the base pointers.
CombinedInfo.Exprs.push_back(VD->getCanonicalDecl());
CombinedInfo.BasePointers.push_back(Addr);
CombinedInfo.Pointers.push_back(Addr);
CombinedInfo.Exprs.push_back(VD->getCanonicalDecl());
CombinedInfo.BasePointers.push_back(CV);
if (I != FirstPrivateDecls.end() && ElementType->isAnyPointerType()) {
Address PtrAddr = CGF.EmitLoadOfReference(CGF.MakeAddrLValue(
CV, ElementType, CGF.getContext().getDeclAlign(VD),
AlignmentSource::Decl));
CombinedInfo.Pointers.push_back(PtrAddr.getPointer());
} else {
CombinedInfo.Exprs.push_back(VD->getCanonicalDecl());
CombinedInfo.BasePointers.push_back(CV);
if (I != FirstPrivateDecls.end() && ElementType->isAnyPointerType()) {
Address PtrAddr = CGF.EmitLoadOfReference(CGF.MakeAddrLValue(
CV, ElementType, CGF.getContext().getDeclAlign(VD),
AlignmentSource::Decl));
CombinedInfo.Pointers.push_back(PtrAddr.getPointer());
} else {
CombinedInfo.Pointers.push_back(CV);
}
CombinedInfo.Pointers.push_back(CV);
}
if (I != FirstPrivateDecls.end())
IsImplicit = I->getSecond();
Expand Down Expand Up @@ -10579,45 +10560,6 @@ bool CGOpenMPRuntime::emitTargetGlobalVariable(GlobalDecl GD) {
return false;
}

llvm::Constant *
CGOpenMPRuntime::registerTargetFirstprivateCopy(CodeGenFunction &CGF,
const VarDecl *VD) {
assert(VD->getType().isConstant(CGM.getContext()) &&
"Expected constant variable.");
StringRef VarName;
llvm::Constant *Addr;
llvm::GlobalValue::LinkageTypes Linkage;
QualType Ty = VD->getType();
SmallString<128> Buffer;
{
unsigned DeviceID;
unsigned FileID;
unsigned Line;
getTargetEntryUniqueInfo(CGM.getContext(), VD->getLocation(), DeviceID,
FileID, Line);
llvm::raw_svector_ostream OS(Buffer);
OS << "__omp_offloading_firstprivate_" << llvm::format("_%x", DeviceID)
<< llvm::format("_%x_", FileID);
if (CGM.getLangOpts().CPlusPlus) {
CGM.getCXXABI().getMangleContext().mangleTypeName(VD->getType(), OS);
OS << "_";
}
OS << VD->getName() << "_l" << Line;
VarName = OS.str();
}
Linkage = llvm::GlobalValue::InternalLinkage;
Addr =
getOrCreateInternalVariable(CGM.getTypes().ConvertTypeForMem(Ty), VarName,
getDefaultFirstprivateAddressSpace());
cast<llvm::GlobalValue>(Addr)->setLinkage(Linkage);
CharUnits VarSize = CGM.getContext().getTypeSizeInChars(Ty);
CGM.addCompilerUsedGlobal(cast<llvm::GlobalValue>(Addr));
OffloadEntriesInfoManager.registerDeviceGlobalVarEntryInfo(
VarName, Addr, VarSize,
OffloadEntriesInfoManagerTy::OMPTargetGlobalVarEntryTo, Linkage);
return Addr;
}

void CGOpenMPRuntime::registerTargetGlobalVariable(const VarDecl *VD,
llvm::Constant *Addr) {
if (CGM.getLangOpts().OMPTargetTriples.empty() &&
Expand Down
9 changes: 0 additions & 9 deletions clang/lib/CodeGen/CGOpenMPRuntime.h
Original file line number Diff line number Diff line change
Expand Up @@ -862,10 +862,6 @@ class CGOpenMPRuntime {
llvm::Function *TaskFunction, QualType SharedsTy,
Address Shareds, const OMPTaskDataTy &Data);

/// Returns default address space for the constant firstprivates, 0 by
/// default.
virtual unsigned getDefaultFirstprivateAddressSpace() const { return 0; }

/// Emit code that pushes the trip count of loops associated with constructs
/// 'target teams distribute' and 'teams distribute parallel for'.
/// \param SizeEmitter Emits the int64 value for the number of iterations of
Expand Down Expand Up @@ -1591,11 +1587,6 @@ class CGOpenMPRuntime {
virtual void registerTargetGlobalVariable(const VarDecl *VD,
llvm::Constant *Addr);

/// Registers provided target firstprivate variable as global on the
/// target.
llvm::Constant *registerTargetFirstprivateCopy(CodeGenFunction &CGF,
const VarDecl *VD);

/// Emit the global \a GD if it is meaningful for the target. Returns
/// if it was emitted successfully.
/// \param GD Global to scan.
Expand Down
8 changes: 0 additions & 8 deletions clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3646,10 +3646,6 @@ CGOpenMPRuntimeGPU::translateParameter(const FieldDecl *FD,
if (Attr->getCaptureKind() == OMPC_map) {
PointeeTy = CGM.getContext().getAddrSpaceQualType(PointeeTy,
LangAS::opencl_global);
} else if (Attr->getCaptureKind() == OMPC_firstprivate &&
PointeeTy.isConstant(CGM.getContext())) {
PointeeTy = CGM.getContext().getAddrSpaceQualType(PointeeTy,
LangAS::opencl_generic);
}
}
ArgType = CGM.getContext().getPointerType(PointeeTy);
Expand Down Expand Up @@ -4084,10 +4080,6 @@ void CGOpenMPRuntimeGPU::adjustTargetSpecificDataForLambdas(
}
}

unsigned CGOpenMPRuntimeGPU::getDefaultFirstprivateAddressSpace() const {
return CGM.getContext().getTargetAddressSpace(LangAS::cuda_constant);
}

bool CGOpenMPRuntimeGPU::hasAllocateAttributeForGlobalVar(const VarDecl *VD,
LangAS &AS) {
if (!VD || !VD->hasAttr<OMPAllocateDeclAttr>())
Expand Down
4 changes: 0 additions & 4 deletions clang/lib/CodeGen/CGOpenMPRuntimeGPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,6 @@ class CGOpenMPRuntimeGPU : public CGOpenMPRuntime {
/// supports unified addressing
void processRequiresDirective(const OMPRequiresDecl *D) override;

/// Returns default address space for the constant firstprivates, __constant__
/// address space by default.
unsigned getDefaultFirstprivateAddressSpace() const override;

/// Checks if the variable has associated OMPAllocateDeclAttr attribute with
/// the predefined allocator and translates it into the corresponding address
/// space.
Expand Down
14 changes: 0 additions & 14 deletions clang/lib/CodeGen/CGStmtOpenMP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -786,9 +786,6 @@ bool CodeGenFunction::EmitOMPFirstprivateClause(const OMPExecutableDirective &D,
OMPPrivateScope &PrivateScope) {
if (!HaveInsertPoint())
return false;
bool DeviceConstTarget =
getLangOpts().OpenMPIsDevice &&
isOpenMPTargetExecutionDirective(D.getDirectiveKind());
bool FirstprivateIsLastprivate = false;
llvm::DenseMap<const VarDecl *, OpenMPLastprivateModifier> Lastprivates;
for (const auto *C : D.getClausesOfKind<OMPLastprivateClause>()) {
Expand Down Expand Up @@ -821,17 +818,6 @@ bool CodeGenFunction::EmitOMPFirstprivateClause(const OMPExecutableDirective &D,
++InitsRef;
continue;
}
// Do not emit copy for firstprivate constant variables in target regions,
// captured by reference.
if (DeviceConstTarget && OrigVD->getType().isConstant(getContext()) &&
FD && FD->getType()->isReferenceType() &&
(!VD || !VD->hasAttr<OMPAllocateDeclAttr>())) {
(void)CGM.getOpenMPRuntime().registerTargetFirstprivateCopy(*this,
OrigVD);
++IRef;
++InitsRef;
continue;
}
FirstprivateIsLastprivate =
FirstprivateIsLastprivate || ThisFirstprivateIsLastprivate;
if (EmittedAsFirstprivate.insert(OrigVD->getCanonicalDecl()).second) {
Expand Down
3 changes: 2 additions & 1 deletion clang/lib/Sema/SemaChecking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14477,7 +14477,8 @@ static getBaseAlignmentAndOffsetFromLValue(const Expr *E, ASTContext &Ctx) {
case Stmt::MemberExprClass: {
auto *ME = cast<MemberExpr>(E);
auto *FD = dyn_cast<FieldDecl>(ME->getMemberDecl());
if (!FD || FD->getType()->isReferenceType())
if (!FD || FD->getType()->isReferenceType() ||
FD->getParent()->isInvalidDecl())
break;
Optional<std::pair<CharUnits, CharUnits>> P;
if (ME->isArrow())
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Tooling/Transformer/SourceCodeBuilders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ tooling::buildDereference(const Expr &E, const ASTContext &Context) {

llvm::Optional<std::string> tooling::buildAddressOf(const Expr &E,
const ASTContext &Context) {
if (E.isImplicitCXXThis())
return std::string("this");
if (const auto *Op = dyn_cast<UnaryOperator>(&E))
if (Op->getOpcode() == UO_Deref) {
// Strip leading '*'.
Expand Down
9 changes: 2 additions & 7 deletions clang/test/OpenMP/nvptx_target_firstprivate_codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ struct TT {
// TCHECK-DAG: [[TT:%.+]] = type { i64, i8 }
// TCHECK-DAG: [[S1:%.+]] = type { double }

// TCHECK: @__omp_offloading_firstprivate__{{.+}}_e_l30 = internal addrspace(4) global [[TTII]] zeroinitializer
// TCHECK: @__omp_offloading_firstprivate__{{.+}}_ZTSK2TTIiiE_t_l143 = internal addrspace(4) global [[TTII]] zeroinitializer
// TCHECK: @__omp_offloading_firstprivate__{{.+}}_ZTSK2TTIccE_t_l143 = internal addrspace(4) global [[TTIC]] zeroinitializer
int foo(int n, double *ptr) {
int a = 0;
short aa = 0;
Expand All @@ -37,11 +34,9 @@ int foo(int n, double *ptr) {
}

// TCHECK: define {{.*}}void @__omp_offloading_{{.+}}([10 x float] addrspace(1)* noalias [[B_IN:%.+]], i{{[0-9]+}} [[A_IN:%.+]], [[TTII]]* noalias [[E_IN:%.+]])
// TCHECK-NOT: alloca [[TTII]],
// TCHECK: [[A_ADDR:%.+]] = alloca i{{[0-9]+}},
// TCHECK-NOT: alloca [[TTII]],
// TCHECK-NOT: alloca i{{[0-9]+}},
// TCHECK-64: call void @llvm.dbg.declare(metadata [10 x float] addrspace(1)** %{{.+}}, metadata !{{[0-9]+}}, metadata !DIExpression())
// TCHECK: alloca [[TTII]],
// TCHECK: alloca i{{[0-9]+}},
// TCHECK: store i{{[0-9]+}} [[A_IN]], i{{[0-9]+}}* [[A_ADDR]],
// TCHECK: ret void

Expand Down
9 changes: 3 additions & 6 deletions clang/test/OpenMP/target_firstprivate_codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ int ga = 5;
// TCHECK-DAG: [[TTII:%.+]] = type { i32, i32 }
// TCHECK-DAG: [[S1:%.+]] = type { double }

// CHECK-DAG: [[FP_E:@__omp_offloading_firstprivate_.+_e_l79]] = internal global [[TTII]] zeroinitializer
// CHECK-DAG: [[SIZET:@.+]] = private unnamed_addr constant [3 x i{{32|64}}] [i[[SZ:32|64]] 4, i{{64|32}} {{8|4}}, i[[SZ:32|64]] 4]
// CHECK-DAG: [[MAPT:@.+]] = private unnamed_addr constant [3 x i64] [i64 288, i64 49, i64 288]
// CHECK-DAG: [[MAPT2:@.+]] = private unnamed_addr constant [9 x i64] [i64 288, i64 161, i64 800, i64 161, i64 161, i64 800, i64 800, i64 161, i64 161]
// CHECK-DAG: [[SIZET3:@.+]] = private unnamed_addr constant [2 x i{{32|64}}] [i{{32|64}} 0, i{{32|64}} 8]
// CHECK-DAG: [[MAPT3:@.+]] = private unnamed_addr constant [2 x i64] [i64 32, i64 37]
// CHECK-DAG: [[MAPT3:@.+]] = private unnamed_addr constant [2 x i64] [i64 32, i64 161]
// CHECK-DAG: [[MAPT4:@.+]] = private unnamed_addr constant [5 x i64] [i64 547, i64 288, i64 800, i64 800, i64 161]
// CHECK-DAG: [[SIZET5:@.+]] = private unnamed_addr constant [3 x i{{32|64}}] [i[[SZ]] 4, i[[SZ]] 1, i[[SZ]] 40]
// CHECK-DAG: [[MAPT5:@.+]] = private unnamed_addr constant [3 x i64] [i64 288, i64 288, i64 161]
Expand Down Expand Up @@ -92,6 +91,7 @@ int foo(int n, double *ptr) {
// CHECK: [[SSTACK:%.+]] = alloca i8*,
// CHECK: [[C:%.+]] = alloca [5 x [10 x double]],
// CHECK: [[D:%.+]] = alloca [[TT]],
// CHECK: [[FP_E:%.+]] = alloca [[TTII]],
// CHECK: [[P:%.+]] = alloca i32*, align 64
// CHECK: [[ACAST:%.+]] = alloca i{{[0-9]+}},
// CHECK: [[BASE_PTR_ARR:%.+]] = alloca [3 x i8*],
Expand Down Expand Up @@ -347,8 +347,6 @@ int foo(int n, double *ptr) {
}
// CHECK: [[PTR_ADDR_REF:%.+]] = load double*, double** [[PTR_ADDR]],

// CHECK: [[E_BC:%.+]] = bitcast [[TTII]]* [[E:%.+]] to i8*
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i{{64|32}}(i8* {{.*}} bitcast ([[TTII]]* [[FP_E]] to i8*), i8* {{.*}} [[E_BC]], i{{64|32}} 8, i1 false)
// CHECK: [[BASE_PTR_GEP3_0:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[BASE_PTR_ARR3]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
// CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTR_GEP3_0]] to double**
// CHECK: store double* [[PTR_ADDR_REF]], double** [[BCAST_TOPTR]],
Expand All @@ -367,9 +365,8 @@ int foo(int n, double *ptr) {
// CHECK: {{.+}} = call i32 @__tgt_target_mapper(%struct.ident_t* @{{.+}}, i64 -1, {{.+}}, i32 2, i8** [[BASE_PTR_GEP_ARG3]], i8** [[PTR_GEP_ARG3]], i[[SZ]]* getelementptr inbounds ([2 x i[[SZ]]], [2 x i[[SZ]]]* [[SIZET3]], i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* [[MAPT3]], i32 0, i32 0), i8** null, i8** null)

// TCHECK: define weak void @__omp_offloading_{{.+}}(double* [[PTR_IN:%.+]], [[TTII]]* nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) [[E:%.+]])
// TCHECK-NOT: alloca [[TTII]],
// TCHECK: [[PTR_ADDR:%.+]] = alloca double*,
// TCHECK-NOT: alloca [[TTII]],
// TCHECK: alloca [[TTII]],
// TCHECK-NOT: alloca double*,
// TCHECK: store double* [[PTR_IN]], double** [[PTR_ADDR]],
// TCHECK-NOT: store double* %
Expand Down
8 changes: 8 additions & 0 deletions clang/test/Sema/warn-cast-align.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,11 @@ unsigned int func5(void);
FnTy test5(void) {
return (FnTy)&func5;
}

void test6() {
struct {
int hello;
doesnotexist world; // expected-error {{unknown type name 'doesnotexist'}}
} foo;
void **repro = (void **)&foo.hello; // expected-warning {{cast from 'int *' to 'void **' increases required alignment from 4 to 8}}
}
18 changes: 18 additions & 0 deletions clang/unittests/Tooling/SourceCodeBuildersTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,24 @@ TEST(SourceCodeBuildersTest, BuildAddressOfBinaryOperation) {
testBuilder(buildAddressOf, "S x; x + x;", "&(x + x)");
}

TEST(SourceCodeBuildersTest, BuildAddressOfImplicitThis) {
StringRef Snippet = R"cc(
struct Struct {
void foo() {}
void bar() {
foo();
}
};
)cc";
auto StmtMatch = matchStmt(
Snippet,
cxxMemberCallExpr(onImplicitObjectArgument(cxxThisExpr().bind("expr"))));
ASSERT_TRUE(StmtMatch);
EXPECT_THAT(buildAddressOf(*StmtMatch->Result.Nodes.getNodeAs<Expr>("expr"),
*StmtMatch->Result.Context),
ValueIs(std::string("this")));
}

TEST(SourceCodeBuildersTest, BuildDereferencePointer) {
testBuilder(buildDereference, "S *x; x;", "*x");
}
Expand Down
2 changes: 1 addition & 1 deletion flang/docs/GettingInvolved.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ To understand the status of various developments in Flang please join the respec
### Flang Community Biweekly Call

- General updates on the Flang Project, both LLVM Flang and current Flang.
- Join [Flang Community Biweekly Call](https://lanl-us.webex.com/lanl-us/j.php?MTID=m44f29d1fa15eab5cbedc54a5df6c12ae)
- Join [Flang Community Biweekly Call](https://lanl-us.webex.com/lanl-us/j.php?MTID=mdce13c9bd55202e8071d8128fb953614)
- Time: On Wednesdays 8:30 Pacific Time, on the weeks alternating with regular Flang Community Technical Biweekly Call.
- Meeting minutes are available in this [Google Doc](https://docs.google.com/document/d/10T-S2J3GrahpG4Ooif93NSTz2zBW0MQc_RlwHi0-afY/edit?usp=sharing).
If you can not access the Google Doc, please send an email to Alexis Perry-Holby at aperry@lanl.gov requesting to be added to the access list.
Expand Down
8 changes: 7 additions & 1 deletion libc/src/string/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ endif()

function(add_memcmp memcmp_name)
add_implementation(memcmp ${memcmp_name}
SRCS ${LIBC_SOURCE_DIR}/src/string/memcmp.cpp
SRCS ${LIBC_MEMCMP_SRC}
HDRS ${LIBC_SOURCE_DIR}/src/string/memcmp.h
DEPENDS
.memory_utils.memory_utils
Expand All @@ -307,13 +307,19 @@ function(add_memcmp memcmp_name)
endfunction()

if(${LIBC_TARGET_ARCHITECTURE_IS_X86})
set(LIBC_MEMCMP_SRC ${LIBC_SOURCE_DIR}/src/string/memcmp.cpp)
add_memcmp(memcmp_x86_64_opt_sse2 COMPILE_OPTIONS -march=k8 REQUIRE SSE2)
add_memcmp(memcmp_x86_64_opt_sse4 COMPILE_OPTIONS -march=nehalem REQUIRE SSE4_2)
add_memcmp(memcmp_x86_64_opt_avx2 COMPILE_OPTIONS -march=haswell REQUIRE AVX2)
add_memcmp(memcmp_x86_64_opt_avx512 COMPILE_OPTIONS -march=skylake-avx512 REQUIRE AVX512F)
add_memcmp(memcmp_opt_host COMPILE_OPTIONS ${LIBC_COMPILE_OPTIONS_NATIVE})
add_memcmp(memcmp)
elseif(${LIBC_TARGET_ARCHITECTURE_IS_AARCH64})
set(LIBC_MEMCMP_SRC ${LIBC_SOURCE_DIR}/src/string/aarch64/memcmp.cpp)
add_memcmp(memcmp)
add_memcmp(memcmp_opt_host COMPILE_OPTIONS ${LIBC_COMPILE_OPTIONS_NATIVE})
else()
set(LIBC_MEMCMP_SRC ${LIBC_SOURCE_DIR}/src/string/memcmp.cpp)
add_memcmp(memcmp_opt_host COMPILE_OPTIONS ${LIBC_COMPILE_OPTIONS_NATIVE})
add_memcmp(memcmp)
endif()
Loading

0 comments on commit 71efe5d

Please sign in to comment.