diff --git a/clang/lib/Basic/CMakeLists.txt b/clang/lib/Basic/CMakeLists.txt
index c71c1c6f0..a0c5fbb64 100644
--- a/clang/lib/Basic/CMakeLists.txt
+++ b/clang/lib/Basic/CMakeLists.txt
@@ -111,6 +111,7 @@ add_clang_library(clangBasic
   Targets/M68k.cpp
   Targets/MOS.cpp
   Targets/MSP430.cpp
+  Targets/W65816.cpp
   Targets/Mips.cpp
   Targets/NVPTX.cpp
   Targets/OSTargets.cpp
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index 4c0fdfdbc..fccc921de 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -28,6 +28,7 @@
 #include "Targets/M68k.h"
 #include "Targets/MOS.h"
 #include "Targets/MSP430.h"
+#include "Targets/W65816.h"
 #include "Targets/Mips.h"
 #include "Targets/NVPTX.h"
 #include "Targets/OSTargets.h"
@@ -287,6 +288,9 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
   case llvm::Triple::msp430:
     return std::make_unique<MSP430TargetInfo>(Triple, Opts);
 
+  case llvm::Triple::w65816:
+    return std::make_unique<W65816TargetInfo>(Triple, Opts);
+
   case llvm::Triple::mips:
     switch (os) {
     case llvm::Triple::Linux:
