Skip to content

Commit

Permalink
Merged master:e1af54296c52 into amd-gfx:1c7c56ddc669
Browse files Browse the repository at this point in the history
Local branch amd-gfx 1c7c56d Merged master:6e008cb554b3 into amd-gfx:2e254597ecd9
Remote branch master e1af542 [compiler-rt][profile][AIX]: Enable compiler-rt profile build on AIX
  • Loading branch information
Sw authored and Sw committed Nov 3, 2020
2 parents 1c7c56d + e1af542 commit c198fcc
Show file tree
Hide file tree
Showing 74 changed files with 1,073 additions and 744 deletions.
2 changes: 2 additions & 0 deletions clang/include/clang/Basic/Cuda.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,14 @@ enum class CudaArch {
GFX906,
GFX908,
GFX909,
GFX90c,
GFX1010,
GFX1011,
GFX1012,
GFX1030,
GFX1031,
GFX1032,
GFX1033,
LAST,
};

Expand Down
4 changes: 2 additions & 2 deletions clang/lib/Basic/Cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ CudaArchToStringMap arch_names[] = {
GFX(805), // tongapro
GFX(810), // stoney
GFX(900), // vega, instinct
GFX(902), GFX(904), GFX(906), GFX(908), GFX(909),
GFX(1010), GFX(1011), GFX(1012), GFX(1030), GFX(1031)
GFX(902), GFX(904), GFX(906), GFX(908), GFX(909), GFX(90c),
GFX(1010), GFX(1011), GFX(1012), GFX(1030), GFX(1031), GFX(1032), GFX(1033)
// clang-format on
};
#undef SM
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Basic/Targets/AMDGPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ bool AMDGPUTargetInfo::initFeatureMap(
// XXX - What does the member GPU mean if device name string passed here?
if (isAMDGCN(getTriple())) {
switch (llvm::AMDGPU::parseArchAMDGCN(CPU)) {
case GK_GFX1033:
case GK_GFX1032:
case GK_GFX1031:
case GK_GFX1030:
Expand Down Expand Up @@ -222,6 +223,7 @@ bool AMDGPUTargetInfo::initFeatureMap(
Features["dot1-insts"] = true;
Features["dot2-insts"] = true;
LLVM_FALLTHROUGH;
case GK_GFX90C:
case GK_GFX909:
case GK_GFX904:
case GK_GFX902:
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Basic/Targets/NVPTX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,14 @@ void NVPTXTargetInfo::getTargetDefines(const LangOptions &Opts,
case CudaArch::GFX906:
case CudaArch::GFX908:
case CudaArch::GFX909:
case CudaArch::GFX90c:
case CudaArch::GFX1010:
case CudaArch::GFX1011:
case CudaArch::GFX1012:
case CudaArch::GFX1030:
case CudaArch::GFX1031:
case CudaArch::GFX1032:
case CudaArch::GFX1033:
case CudaArch::LAST:
break;
case CudaArch::UNUSED:
Expand Down
4 changes: 4 additions & 0 deletions clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4640,12 +4640,14 @@ void CGOpenMPRuntimeGPU::processRequiresDirective(
case CudaArch::GFX906:
case CudaArch::GFX908:
case CudaArch::GFX909:
case CudaArch::GFX90c:
case CudaArch::GFX1010:
case CudaArch::GFX1011:
case CudaArch::GFX1012:
case CudaArch::GFX1030:
case CudaArch::GFX1031:
case CudaArch::GFX1032:
case CudaArch::GFX1033:
case CudaArch::UNUSED:
case CudaArch::UNKNOWN:
break;
Expand Down Expand Up @@ -4706,12 +4708,14 @@ static std::pair<unsigned, unsigned> getSMsBlocksPerSM(CodeGenModule &CGM) {
case CudaArch::GFX906:
case CudaArch::GFX908:
case CudaArch::GFX909:
case CudaArch::GFX90c:
case CudaArch::GFX1010:
case CudaArch::GFX1011:
case CudaArch::GFX1012:
case CudaArch::GFX1030:
case CudaArch::GFX1031:
case CudaArch::GFX1032:
case CudaArch::GFX1033:
case CudaArch::UNUSED:
case CudaArch::UNKNOWN:
break;
Expand Down
4 changes: 4 additions & 0 deletions clang/test/CodeGenOpenCL/amdgpu-features.cl
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx906 -S -emit-llvm -o - %s | FileCheck --check-prefix=GFX906 %s
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx908 -S -emit-llvm -o - %s | FileCheck --check-prefix=GFX908 %s
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx909 -S -emit-llvm -o - %s | FileCheck --check-prefix=GFX909 %s
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx90c -S -emit-llvm -o - %s | FileCheck --check-prefix=GFX90C %s
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx1010 -S -emit-llvm -o - %s | FileCheck --check-prefix=GFX1010 %s
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx1011 -S -emit-llvm -o - %s | FileCheck --check-prefix=GFX1011 %s
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx1012 -S -emit-llvm -o - %s | FileCheck --check-prefix=GFX1012 %s
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx1030 -S -emit-llvm -o - %s | FileCheck --check-prefix=GFX1030 %s
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx1031 -S -emit-llvm -o - %s | FileCheck --check-prefix=GFX1031 %s
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx1032 -S -emit-llvm -o - %s | FileCheck --check-prefix=GFX1032 %s
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx1033 -S -emit-llvm -o - %s | FileCheck --check-prefix=GFX1033 %s

// GFX600-NOT: "target-features"
// GFX601-NOT: "target-features"
Expand All @@ -39,11 +41,13 @@
// GFX906: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dot1-insts,+dot2-insts,+dpp,+flat-address-space,+gfx8-insts,+gfx9-insts,+s-memrealtime"
// GFX908: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dot1-insts,+dot2-insts,+dot3-insts,+dot4-insts,+dot5-insts,+dot6-insts,+dpp,+flat-address-space,+gfx8-insts,+gfx9-insts,+mai-insts,+s-memrealtime"
// GFX909: "target-features"="+16-bit-insts,+ci-insts,+dpp,+flat-address-space,+gfx8-insts,+gfx9-insts,+s-memrealtime"
// GFX90C: "target-features"="+16-bit-insts,+ci-insts,+dpp,+flat-address-space,+gfx8-insts,+gfx9-insts,+s-memrealtime"
// GFX1010: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dpp,+flat-address-space,+gfx10-insts,+gfx8-insts,+gfx9-insts,+s-memrealtime"
// GFX1011: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dot1-insts,+dot2-insts,+dot5-insts,+dot6-insts,+dpp,+flat-address-space,+gfx10-insts,+gfx8-insts,+gfx9-insts,+s-memrealtime"
// GFX1012: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dot1-insts,+dot2-insts,+dot5-insts,+dot6-insts,+dpp,+flat-address-space,+gfx10-insts,+gfx8-insts,+gfx9-insts,+s-memrealtime"
// GFX1030: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dot1-insts,+dot2-insts,+dot5-insts,+dot6-insts,+dpp,+flat-address-space,+gfx10-3-insts,+gfx10-insts,+gfx8-insts,+gfx9-insts,+s-memrealtime"
// GFX1031: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dot1-insts,+dot2-insts,+dot5-insts,+dot6-insts,+dpp,+flat-address-space,+gfx10-3-insts,+gfx10-insts,+gfx8-insts,+gfx9-insts,+s-memrealtime"
// GFX1032: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dot1-insts,+dot2-insts,+dot5-insts,+dot6-insts,+dpp,+flat-address-space,+gfx10-3-insts,+gfx10-insts,+gfx8-insts,+gfx9-insts,+s-memrealtime"
// GFX1033: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dot1-insts,+dot2-insts,+dot5-insts,+dot6-insts,+dpp,+flat-address-space,+gfx10-3-insts,+gfx10-insts,+gfx8-insts,+gfx9-insts,+s-memrealtime"

kernel void test() {}
17 changes: 17 additions & 0 deletions clang/test/Driver/amdgpu-macros.cl
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,14 @@
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx906 %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,GFX906 %s
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx908 %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,GFX908 %s
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx909 %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,GFX909 %s
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx90c %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,GFX90C %s
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,GFX1010 %s
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx1011 %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,GFX1011 %s
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx1012 %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,GFX1012 %s
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx1030 %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,GFX1030 %s
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx1031 %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,GFX1031 %s
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx1032 %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,GFX1032 %s
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx1033 %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,GFX1033 %s

// GFX600-DAG: #define FP_FAST_FMA 1
// GFX601-DAG: #define FP_FAST_FMA 1
Expand All @@ -208,12 +210,14 @@
// GFX906-DAG: #define FP_FAST_FMA 1
// GFX908-DAG: #define FP_FAST_FMA 1
// GFX909-DAG: #define FP_FAST_FMA 1
// GFX90C-DAG: #define FP_FAST_FMA 1
// GFX1010-DAG: #define FP_FAST_FMA 1
// GFX1011-DAG: #define FP_FAST_FMA 1
// GFX1012-DAG: #define FP_FAST_FMA 1
// GFX1030-DAG: #define FP_FAST_FMA 1
// GFX1031-DAG: #define FP_FAST_FMA 1
// GFX1032-DAG: #define FP_FAST_FMA 1
// GFX1033-DAG: #define FP_FAST_FMA 1

// GFX600-DAG: #define FP_FAST_FMAF 1
// GFX601-NOT: #define FP_FAST_FMAF 1
Expand All @@ -235,12 +239,14 @@
// GFX906-DAG: #define FP_FAST_FMAF 1
// GFX908-DAG: #define FP_FAST_FMAF 1
// GFX909-DAG: #define FP_FAST_FMAF 1
// GFX90C-DAG: #define FP_FAST_FMAF 1
// GFX1010-DAG: #define FP_FAST_FMAF 1
// GFX1011-DAG: #define FP_FAST_FMAF 1
// GFX1012-DAG: #define FP_FAST_FMAF 1
// GFX1030-DAG: #define FP_FAST_FMAF 1
// GFX1031-DAG: #define FP_FAST_FMAF 1
// GFX1032-DAG: #define FP_FAST_FMAF 1
// GFX1033-DAG: #define FP_FAST_FMAF 1

// ARCH-GCN-DAG: #define __AMDGCN__ 1
// ARCH-GCN-DAG: #define __AMDGPU__ 1
Expand All @@ -266,12 +272,14 @@
// GFX906-DAG: #define __HAS_FMAF__ 1
// GFX908-DAG: #define __HAS_FMAF__ 1
// GFX909-DAG: #define __HAS_FMAF__ 1
// GFX90C-DAG: #define __HAS_FMAF__ 1
// GFX1010-DAG: #define __HAS_FMAF__ 1
// GFX1011-DAG: #define __HAS_FMAF__ 1
// GFX1012-DAG: #define __HAS_FMAF__ 1
// GFX1030-DAG: #define __HAS_FMAF__ 1
// GFX1031-DAG: #define __HAS_FMAF__ 1
// GFX1032-DAG: #define __HAS_FMAF__ 1
// GFX1033-DAG: #define __HAS_FMAF__ 1

// GFX600-DAG: #define __HAS_FP64__ 1
// GFX601-DAG: #define __HAS_FP64__ 1
Expand All @@ -293,12 +301,14 @@
// GFX906-DAG: #define __HAS_FP64__ 1
// GFX908-DAG: #define __HAS_FP64__ 1
// GFX909-DAG: #define __HAS_FP64__ 1
// GFX90C-DAG: #define __HAS_FP64__ 1
// GFX1010-DAG: #define __HAS_FP64__ 1
// GFX1011-DAG: #define __HAS_FP64__ 1
// GFX1012-DAG: #define __HAS_FP64__ 1
// GFX1030-DAG: #define __HAS_FP64__ 1
// GFX1031-DAG: #define __HAS_FP64__ 1
// GFX1032-DAG: #define __HAS_FP64__ 1
// GFX1033-DAG: #define __HAS_FP64__ 1

// GFX600-DAG: #define __HAS_LDEXPF__ 1
// GFX601-DAG: #define __HAS_LDEXPF__ 1
Expand All @@ -320,12 +330,14 @@
// GFX906-DAG: #define __HAS_LDEXPF__ 1
// GFX908-DAG: #define __HAS_LDEXPF__ 1
// GFX909-DAG: #define __HAS_LDEXPF__ 1
// GFX90C-DAG: #define __HAS_LDEXPF__ 1
// GFX1010-DAG: #define __HAS_LDEXPF__ 1
// GFX1011-DAG: #define __HAS_LDEXPF__ 1
// GFX1012-DAG: #define __HAS_LDEXPF__ 1
// GFX1030-DAG: #define __HAS_LDEXPF__ 1
// GFX1031-DAG: #define __HAS_LDEXPF__ 1
// GFX1032-DAG: #define __HAS_LDEXPF__ 1
// GFX1033-DAG: #define __HAS_LDEXPF__ 1

// GFX600-DAG: #define __gfx600__ 1
// GFX601-DAG: #define __gfx601__ 1
Expand All @@ -347,12 +359,14 @@
// GFX906-DAG: #define __gfx906__ 1
// GFX908-DAG: #define __gfx908__ 1
// GFX909-DAG: #define __gfx909__ 1
// GFX90C-DAG: #define __gfx90c__ 1
// GFX1010-DAG: #define __gfx1010__ 1
// GFX1011-DAG: #define __gfx1011__ 1
// GFX1012-DAG: #define __gfx1012__ 1
// GFX1030-DAG: #define __gfx1030__ 1
// GFX1031-DAG: #define __gfx1031__ 1
// GFX1032-DAG: #define __gfx1032__ 1
// GFX1033-DAG: #define __gfx1033__ 1

// GFX600-DAG: #define __amdgcn_processor__ "gfx600"
// GFX601-DAG: #define __amdgcn_processor__ "gfx601"
Expand All @@ -374,12 +388,14 @@
// GFX906-DAG: #define __amdgcn_processor__ "gfx906"
// GFX908-DAG: #define __amdgcn_processor__ "gfx908"
// GFX909-DAG: #define __amdgcn_processor__ "gfx909"
// GFX90C-DAG: #define __amdgcn_processor__ "gfx90c"
// GFX1010-DAG: #define __amdgcn_processor__ "gfx1010"
// GFX1011-DAG: #define __amdgcn_processor__ "gfx1011"
// GFX1012-DAG: #define __amdgcn_processor__ "gfx1012"
// GFX1030-DAG: #define __amdgcn_processor__ "gfx1030"
// GFX1031-DAG: #define __amdgcn_processor__ "gfx1031"
// GFX1032-DAG: #define __amdgcn_processor__ "gfx1032"
// GFX1033-DAG: #define __amdgcn_processor__ "gfx1033"

// GFX600-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64
// GFX601-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64
Expand All @@ -401,6 +417,7 @@
// GFX906-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64
// GFX908-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64
// GFX909-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64
// GFX90C-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64
// GFX1010-DAG: #define __AMDGCN_WAVEFRONT_SIZE 32
// GFX1011-DAG: #define __AMDGCN_WAVEFRONT_SIZE 32
// GFX1012-DAG: #define __AMDGCN_WAVEFRONT_SIZE 32
Expand Down
4 changes: 4 additions & 0 deletions clang/test/Driver/amdgpu-mcpu.cl
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,14 @@
// RUN: %clang -### -target amdgcn -mcpu=gfx906 %s 2>&1 | FileCheck --check-prefix=GFX906 %s
// RUN: %clang -### -target amdgcn -mcpu=gfx908 %s 2>&1 | FileCheck --check-prefix=GFX908 %s
// RUN: %clang -### -target amdgcn -mcpu=gfx909 %s 2>&1 | FileCheck --check-prefix=GFX909 %s
// RUN: %clang -### -target amdgcn -mcpu=gfx90c %s 2>&1 | FileCheck --check-prefix=GFX90C %s
// RUN: %clang -### -target amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck --check-prefix=GFX1010 %s
// RUN: %clang -### -target amdgcn -mcpu=gfx1011 %s 2>&1 | FileCheck --check-prefix=GFX1011 %s
// RUN: %clang -### -target amdgcn -mcpu=gfx1012 %s 2>&1 | FileCheck --check-prefix=GFX1012 %s
// RUN: %clang -### -target amdgcn -mcpu=gfx1030 %s 2>&1 | FileCheck --check-prefix=GFX1030 %s
// RUN: %clang -### -target amdgcn -mcpu=gfx1031 %s 2>&1 | FileCheck --check-prefix=GFX1031 %s
// RUN: %clang -### -target amdgcn -mcpu=gfx1032 %s 2>&1 | FileCheck --check-prefix=GFX1032 %s
// RUN: %clang -### -target amdgcn -mcpu=gfx1033 %s 2>&1 | FileCheck --check-prefix=GFX1033 %s

// GCNDEFAULT-NOT: -target-cpu
// GFX600: "-target-cpu" "gfx600"
Expand All @@ -118,9 +120,11 @@
// GFX906: "-target-cpu" "gfx906"
// GFX908: "-target-cpu" "gfx908"
// GFX909: "-target-cpu" "gfx909"
// GFX90C: "-target-cpu" "gfx90c"
// GFX1010: "-target-cpu" "gfx1010"
// GFX1011: "-target-cpu" "gfx1011"
// GFX1012: "-target-cpu" "gfx1012"
// GFX1030: "-target-cpu" "gfx1030"
// GFX1031: "-target-cpu" "gfx1031"
// GFX1032: "-target-cpu" "gfx1032"
// GFX1033: "-target-cpu" "gfx1033"
4 changes: 2 additions & 2 deletions compiler-rt/cmake/config-ix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ endif()
set(ALL_MSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64} ${PPC64} ${S390X})
set(ALL_HWASAN_SUPPORTED_ARCH ${X86_64} ${ARM64})
set(ALL_MEMPROF_SUPPORTED_ARCH ${X86_64})
set(ALL_PROFILE_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${PPC64}
set(ALL_PROFILE_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${PPC32} ${PPC64}
${MIPS32} ${MIPS64} ${S390X} ${SPARC} ${SPARCV9})
set(ALL_TSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64} ${PPC64})
set(ALL_UBSAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${RISCV64}
Expand Down Expand Up @@ -715,7 +715,7 @@ else()
endif()

if (PROFILE_SUPPORTED_ARCH AND NOT LLVM_USE_SANITIZER AND
OS_NAME MATCHES "Darwin|Linux|FreeBSD|Windows|Android|Fuchsia|SunOS|NetBSD")
OS_NAME MATCHES "Darwin|Linux|FreeBSD|Windows|Android|Fuchsia|SunOS|NetBSD|AIX")
set(COMPILER_RT_HAS_PROFILE TRUE)
else()
set(COMPILER_RT_HAS_PROFILE FALSE)
Expand Down
6 changes: 6 additions & 0 deletions libcxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,12 @@ if (DEFINED WIN32 AND LIBCXX_ENABLE_STATIC AND NOT LIBCXX_ENABLE_SHARED)
config_define(ON _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
endif()

if (WIN32 AND LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
# If linking libcxxabi statically into libcxx, skip the dllimport attributes
# on symbols we refer to from libcxxabi.
add_definitions(-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS)
endif()

# Setup all common build flags =================================================
function(cxx_add_common_build_flags target)
cxx_add_basic_build_flags(${target})
Expand Down
8 changes: 4 additions & 4 deletions libcxx/src/locale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5128,15 +5128,15 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
mb = mbstate_t();
const char* bb = buf;
size_t j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
if (j == size_t(-1))
if (j == size_t(-1) || j == 0)
__throw_runtime_error("locale not supported");
wbe = wbuf + j;
__weeks_[i].assign(wbuf, wbe);
strftime_l(buf, countof(buf), "%a", &t, __loc_);
mb = mbstate_t();
bb = buf;
j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
if (j == size_t(-1))
if (j == size_t(-1) || j == 0)
__throw_runtime_error("locale not supported");
wbe = wbuf + j;
__weeks_[i+7].assign(wbuf, wbe);
Expand All @@ -5149,15 +5149,15 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
mb = mbstate_t();
const char* bb = buf;
size_t j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
if (j == size_t(-1))
if (j == size_t(-1) || j == 0)
__throw_runtime_error("locale not supported");
wbe = wbuf + j;
__months_[i].assign(wbuf, wbe);
strftime_l(buf, countof(buf), "%b", &t, __loc_);
mb = mbstate_t();
bb = buf;
j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
if (j == size_t(-1))
if (j == size_t(-1) || j == 0)
__throw_runtime_error("locale not supported");
wbe = wbuf + j;
__months_[i+12].assign(wbuf, wbe);
Expand Down
9 changes: 8 additions & 1 deletion libcxxabi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,14 @@ add_definitions(-D_LIBCPP_BUILDING_LIBRARY)

# Disable DLL annotations on Windows for static builds.
if (WIN32 AND LIBCXXABI_ENABLE_STATIC AND NOT LIBCXXABI_ENABLE_SHARED)
add_definitions(-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS)
if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
# Building libcxxabi statically, but intending for it to be statically
# linked into a shared libcxx; keep dllexport enabled within libcxxabi,
# as the symbols will need to be exported from libcxx.
else()
# Regular static build; disable dllexports.
add_definitions(-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS)
endif()
endif()

add_compile_flags_if_supported(-Werror=return-type)
Expand Down
4 changes: 2 additions & 2 deletions lldb/include/lldb/Utility/RegisterValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ class RegisterValue {
m_scalar = value;
}

explicit RegisterValue(uint8_t *bytes, size_t length,
explicit RegisterValue(llvm::ArrayRef<uint8_t> bytes,
lldb::ByteOrder byte_order) {
SetBytes(bytes, length, byte_order);
SetBytes(bytes.data(), bytes.size(), byte_order);
}

RegisterValue::Type GetType() const { return m_type; }
Expand Down
5 changes: 2 additions & 3 deletions lldb/source/Expression/Materializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1282,9 +1282,8 @@ class EntityRegister : public Materializer::Entity {

m_register_contents.reset();

RegisterValue register_value(
const_cast<uint8_t *>(register_data.GetDataStart()),
register_data.GetByteSize(), register_data.GetByteOrder());
RegisterValue register_value(register_data.GetData(),
register_data.GetByteOrder());

if (!reg_context_sp->WriteRegister(&m_register_info, register_value)) {
err.SetErrorStringWithFormat("couldn't write the value of register %s",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@ NativeProcessFreeBSD::Factory::Attach(
if (!status.Success())
return status.ToError();

status = process_up->SetupTrace();
if (status.Fail())
return status.ToError();

return std::move(process_up);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2091,7 +2091,7 @@ GDBRemoteCommunicationServerLLGS::Handle_P(StringExtractorGDBRemote &packet) {
StreamGDBRemote response;

RegisterValue reg_value(
reg_bytes, reg_size,
makeArrayRef(reg_bytes, reg_size),
m_debugged_process_up->GetArchitecture().GetByteOrder());
Status error = reg_context.WriteRegister(reg_info, reg_value);
if (error.Fail()) {
Expand Down
Loading

0 comments on commit c198fcc

Please sign in to comment.