diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp
index 8aef55224..1ab00ce9f 100644
--- a/llvm/lib/TargetParser/Triple.cpp
+++ b/llvm/lib/TargetParser/Triple.cpp
@@ -80,6 +80,8 @@ StringRef Triple::getArchTypeName(ArchType Kind) {
     return "mipsel";
   case mos:
     return "mos";
+  case w65816:
+    return "w65816";
   case msp430:
     return "msp430";
   case nvptx64:
@@ -678,6 +680,7 @@ Triple::ArchType Triple::getArchTypeForLLVMName(StringRef Name) {
       .Case("mips64", mips64)
       .Case("mips64el", mips64el)
       .Case("msp430", msp430)
+      .Case("w65816", w65816)
       .Case("ppc64", ppc64)
       .Case("ppc32", ppc)
       .Case("ppc", ppc)
@@ -828,6 +831,7 @@ Triple::ArchType Triple::parseArch(StringRef ArchName) {
           .Case("m68k", Triple::m68k)
           .Case("mos", Triple::mos)
           .Case("msp430", Triple::msp430)
+          .Case("w65816", Triple::w65816)
           .Cases({"mips", "mipseb", "mipsallegrex", "mipsisa32r6", "mipsr6"},
                  Triple::mips)
           .Cases({"mipsel", "mipsallegrexel", "mipsisa32r6el", "mipsr6el"},
@@ -1223,6 +1227,7 @@ static Triple::ObjectFormatType getDefaultFormat(const Triple &T) {
   case Triple::mips:
   case Triple::mos:
   case Triple::msp430:
+  case Triple::w65816:
   case Triple::nvptx64:
   case Triple::nvptx:
   case Triple::ppc64le:
@@ -1948,6 +1953,7 @@ unsigned Triple::getArchPointerBitWidth(llvm::Triple::ArchType Arch) {
   case llvm::Triple::avr:
   case llvm::Triple::mos:
   case llvm::Triple::msp430:
+  case llvm::Triple::w65816:
     return 16;
 
   case llvm::Triple::aarch64_32:
@@ -2057,6 +2063,7 @@ Triple Triple::get32BitArchVariant() const {
   case Triple::bpfel:
   case Triple::mos:
   case Triple::msp430:
+  case Triple::w65816:
   case Triple::systemz:
   case Triple::ve:
     T.setArch(UnknownArch);
@@ -2176,6 +2183,7 @@ Triple Triple::get64BitArchVariant() const {
   case Triple::m68k:
   case Triple::mos:
   case Triple::msp430:
+  case Triple::w65816:
   case Triple::r600:
   case Triple::shave:
   case Triple::sparcel:
@@ -2303,6 +2311,7 @@ Triple Triple::getBigEndianArchVariant() const {
   case Triple::loongarch64:
   case Triple::mos:
   case Triple::msp430:
+  case Triple::w65816:
   case Triple::nvptx64:
   case Triple::nvptx:
   case Triple::r600:
@@ -2444,6 +2453,7 @@ bool Triple::isLittleEndian() const {
   case Triple::mipsel:
   case Triple::mos:
   case Triple::msp430:
+  case Triple::w65816:
   case Triple::nvptx64:
   case Triple::nvptx:
   case Triple::ppcle:
@@ -2704,6 +2714,8 @@ ExceptionHandling Triple::getDefaultExceptionHandling() const {
   case Triple::xcore:
   case Triple::xtensa:
     return ExceptionHandling::DwarfCFI;
+  case Triple::w65816:
+    return ExceptionHandling::SjLj;
   default:
     break;
   }
