Update clang to r339409b.

Change-Id: Ied8a188bb072c40035320acedc86164b66d920af
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h
index 9713dce..ac7f196 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h
@@ -43,11 +43,6 @@
 
   void reset() override { Enumerator->reset(); }
 
-  ConcreteSymbolEnumerator<ChildType> *clone() const override {
-    std::unique_ptr<IPDBEnumSymbols> WrappedClone(Enumerator->clone());
-    return new ConcreteSymbolEnumerator<ChildType>(std::move(WrappedClone));
-  }
-
 private:
 
   std::unique_ptr<IPDBEnumSymbols> Enumerator;
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIADataStream.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIADataStream.h
index 930bea6..881d732 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIADataStream.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIADataStream.h
@@ -24,7 +24,6 @@
   llvm::Optional<RecordType> getItemAtIndex(uint32_t Index) const override;
   bool getNext(RecordType &Record) override;
   void reset() override;
-  DIADataStream *clone() const override;
 
 private:
   CComPtr<IDiaEnumDebugStreamData> StreamData;
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumDebugStreams.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumDebugStreams.h
index ffae664..1f12905 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumDebugStreams.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumDebugStreams.h
@@ -27,7 +27,6 @@
   ChildTypePtr getChildAtIndex(uint32_t Index) const override;
   ChildTypePtr getNext() override;
   void reset() override;
-  DIAEnumDebugStreams *clone() const override;
 
 private:
   CComPtr<IDiaEnumDebugStreams> Enumerator;
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumInjectedSources.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumInjectedSources.h
index 39490a4..4669a8d 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumInjectedSources.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumInjectedSources.h
@@ -16,22 +16,18 @@
 
 namespace llvm {
 namespace pdb {
-class DIASession;
 
 class DIAEnumInjectedSources : public IPDBEnumChildren<IPDBInjectedSource> {
 public:
   explicit DIAEnumInjectedSources(
-      const DIASession &PDBSession,
       CComPtr<IDiaEnumInjectedSources> DiaEnumerator);
 
   uint32_t getChildCount() const override;
   ChildTypePtr getChildAtIndex(uint32_t Index) const override;
   ChildTypePtr getNext() override;
   void reset() override;
-  DIAEnumInjectedSources *clone() const override;
 
 private:
-  const DIASession &Session;
   CComPtr<IDiaEnumInjectedSources> Enumerator;
 };
 } // namespace pdb
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumLineNumbers.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumLineNumbers.h
index 08f0de1..f1cb626 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumLineNumbers.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumLineNumbers.h
@@ -26,7 +26,6 @@
   ChildTypePtr getChildAtIndex(uint32_t Index) const override;
   ChildTypePtr getNext() override;
   void reset() override;
-  DIAEnumLineNumbers *clone() const override;
 
 private:
   CComPtr<IDiaEnumLineNumbers> Enumerator;
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumSectionContribs.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumSectionContribs.h
index 52c9563..ac2ae31 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumSectionContribs.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumSectionContribs.h
@@ -28,7 +28,6 @@
   ChildTypePtr getChildAtIndex(uint32_t Index) const override;
   ChildTypePtr getNext() override;
   void reset() override;
-  DIAEnumSectionContribs *clone() const override;
 
 private:
   const DIASession &Session;
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumSourceFiles.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumSourceFiles.h
index e69d18f..dac3df0 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumSourceFiles.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumSourceFiles.h
@@ -27,7 +27,6 @@
   ChildTypePtr getChildAtIndex(uint32_t Index) const override;
   ChildTypePtr getNext() override;
   void reset() override;
-  DIAEnumSourceFiles *clone() const override;
 
 private:
   const DIASession &Session;
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumSymbols.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumSymbols.h
index f779cd1..9689859 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumSymbols.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumSymbols.h
@@ -27,7 +27,6 @@
   std::unique_ptr<PDBSymbol> getChildAtIndex(uint32_t Index) const override;
   std::unique_ptr<PDBSymbol> getNext() override;
   void reset() override;
-  DIAEnumSymbols *clone() const override;
 
 private:
   const DIASession &Session;
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumTables.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumTables.h
index 926fcfe..f4f856e 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumTables.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAEnumTables.h
@@ -26,7 +26,6 @@
   std::unique_ptr<IPDBTable> getChildAtIndex(uint32_t Index) const override;
   std::unique_ptr<IPDBTable> getNext() override;
   void reset() override;
-  DIAEnumTables *clone() const override;
 
 private:
   CComPtr<IDiaEnumTables> Enumerator;
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAError.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAError.h
index 35a39a0..2b33a65 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAError.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIAError.h
@@ -23,23 +23,29 @@
   already_loaded,
   debug_info_mismatch,
 };
+} // namespace pdb
+} // namespace llvm
+
+namespace std {
+template <>
+struct is_error_code_enum<llvm::pdb::dia_error_code> : std::true_type {};
+} // namespace std
+
+namespace llvm {
+namespace pdb {
+const std::error_category &DIAErrCategory();
+
+inline std::error_code make_error_code(dia_error_code E) {
+  return std::error_code(static_cast<int>(E), DIAErrCategory());
+}
 
 /// Base class for errors originating in DIA SDK, e.g. COM calls
-class DIAError : public ErrorInfo<DIAError> {
+class DIAError : public ErrorInfo<DIAError, StringError> {
 public:
+  using ErrorInfo<DIAError, StringError>::ErrorInfo;
+  DIAError(const Twine &S) : ErrorInfo(S, dia_error_code::unspecified) {}
   static char ID;
-  DIAError(dia_error_code C);
-  DIAError(StringRef Context);
-  DIAError(dia_error_code C, StringRef Context);
-
-  void log(raw_ostream &OS) const override;
-  StringRef getErrorMessage() const;
-  std::error_code convertToErrorCode() const override;
-
-private:
-  std::string ErrMsg;
-  dia_error_code Code;
 };
-}
-}
+} // namespace pdb
+} // namespace llvm
 #endif
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h
index dfb3564..5d4f855 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h
@@ -20,7 +20,8 @@
 public:
   DIARawSymbol(const DIASession &PDBSession, CComPtr<IDiaSymbol> DiaSymbol);
 
-  void dump(raw_ostream &OS, int Indent) const override;
+  void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields,
+            PdbSymbolIdField RecurseIdFields) const override;
 
   CComPtr<IDiaSymbol> getDiaSymbol() const { return Symbol; }
 
@@ -63,25 +64,25 @@
   uint32_t getAddressOffset() const override;
   uint32_t getAddressSection() const override;
   uint32_t getAge() const override;
-  uint32_t getArrayIndexTypeId() const override;
+  SymIndexId getArrayIndexTypeId() const override;
   uint32_t getBaseDataOffset() const override;
   uint32_t getBaseDataSlot() const override;
-  uint32_t getBaseSymbolId() const override;
+  SymIndexId getBaseSymbolId() const override;
   PDB_BuiltinType getBuiltinType() const override;
   uint32_t getBitPosition() const override;
   PDB_CallingConv getCallingConvention() const override;
-  uint32_t getClassParentId() const override;
+  SymIndexId getClassParentId() const override;
   std::string getCompilerName() const override;
   uint32_t getCount() const override;
   uint32_t getCountLiveRanges() const override;
   PDB_Lang getLanguage() const override;
-  uint32_t getLexicalParentId() const override;
+  SymIndexId getLexicalParentId() const override;
   std::string getLibraryName() const override;
   uint32_t getLiveRangeStartAddressOffset() const override;
   uint32_t getLiveRangeStartAddressSection() const override;
   uint32_t getLiveRangeStartRelativeVirtualAddress() const override;
   codeview::RegisterId getLocalBasePointerRegisterId() const override;
-  uint32_t getLowerBoundId() const override;
+  SymIndexId getLowerBoundId() const override;
   uint32_t getMemorySpaceKind() const override;
   std::string getName() const override;
   uint32_t getNumberOfAcceleratorPointerTags() const override;
@@ -91,7 +92,7 @@
   uint32_t getNumberOfRows() const override;
   std::string getObjectFileName() const override;
   uint32_t getOemId() const override;
-  uint32_t getOemSymbolId() const override;
+  SymIndexId getOemSymbolId() const override;
   uint32_t getOffsetInUdt() const override;
   PDB_Cpu getPlatform() const override;
   uint32_t getRank() const override;
@@ -105,9 +106,9 @@
   std::string getSourceFileName() const override;
   std::unique_ptr<IPDBLineNumber> getSrcLineOnTypeDefn() const override;
   uint32_t getStride() const override;
-  uint32_t getSubTypeId() const override;
+  SymIndexId getSubTypeId() const override;
   std::string getSymbolsFileName() const override;
-  uint32_t getSymIndexId() const override;
+  SymIndexId getSymIndexId() const override;
   uint32_t getTargetOffset() const override;
   uint32_t getTargetRelativeVirtualAddress() const override;
   uint64_t getTargetVirtualAddress() const override;
@@ -115,16 +116,16 @@
   uint32_t getTextureSlot() const override;
   uint32_t getTimeStamp() const override;
   uint32_t getToken() const override;
-  uint32_t getTypeId() const override;
+  SymIndexId getTypeId() const override;
   uint32_t getUavSlot() const override;
   std::string getUndecoratedName() const override;
   std::string getUndecoratedNameEx(PDB_UndnameFlags Flags) const override;
-  uint32_t getUnmodifiedTypeId() const override;
-  uint32_t getUpperBoundId() const override;
+  SymIndexId getUnmodifiedTypeId() const override;
+  SymIndexId getUpperBoundId() const override;
   Variant getValue() const override;
   uint32_t getVirtualBaseDispIndex() const override;
   uint32_t getVirtualBaseOffset() const override;
-  uint32_t getVirtualTableShapeId() const override;
+  SymIndexId getVirtualTableShapeId() const override;
   std::unique_ptr<PDBSymbolTypeBuiltin>
   getVirtualBaseTableType() const override;
   PDB_DataKind getDataKind() const override;
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIASession.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIASession.h
index a636594..e355605 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIASession.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/DIA/DIASession.h
@@ -32,7 +32,7 @@
   uint64_t getLoadAddress() const override;
   bool setLoadAddress(uint64_t Address) override;
   std::unique_ptr<PDBSymbolExe> getGlobalScope() override;
-  std::unique_ptr<PDBSymbol> getSymbolById(uint32_t SymbolId) const override;
+  std::unique_ptr<PDBSymbol> getSymbolById(SymIndexId SymbolId) const override;
 
   bool addressForVA(uint64_t VA, uint32_t &Section,
                     uint32_t &Offset) const override;
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/GenericError.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/GenericError.h
index 03205a9..4e2e8b1 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/GenericError.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/GenericError.h
@@ -16,29 +16,37 @@
 namespace llvm {
 namespace pdb {
 
-enum class generic_error_code {
-  invalid_path = 1,
+enum class pdb_error_code {
+  invalid_utf8_path = 1,
   dia_sdk_not_present,
+  dia_failed_loading,
+  signature_out_of_date,
   type_server_not_found,
   unspecified,
 };
+} // namespace codeview
+} // namespace llvm
+
+namespace std {
+    template <>
+    struct is_error_code_enum<llvm::pdb::pdb_error_code> : std::true_type {};
+} // namespace std
+
+namespace llvm {
+namespace pdb {
+    const std::error_category &PDBErrCategory();
+
+    inline std::error_code make_error_code(pdb_error_code E) {
+        return std::error_code(static_cast<int>(E), PDBErrCategory());
+    }
 
 /// Base class for errors originating when parsing raw PDB files
-class GenericError : public ErrorInfo<GenericError> {
+class PDBError : public ErrorInfo<PDBError, StringError> {
 public:
+  using ErrorInfo<PDBError, StringError>::ErrorInfo; // inherit constructors
+  PDBError(const Twine &S) : ErrorInfo(S, pdb_error_code::unspecified) {}
   static char ID;
-  GenericError(generic_error_code C);
-  GenericError(StringRef Context);
-  GenericError(generic_error_code C, StringRef Context);
-
-  void log(raw_ostream &OS) const override;
-  StringRef getErrorMessage() const;
-  std::error_code convertToErrorCode() const override;
-
-private:
-  std::string ErrMsg;
-  generic_error_code Code;
 };
-}
-}
+} // namespace pdb
+} // namespace llvm
 #endif
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/IPDBDataStream.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/IPDBDataStream.h
index 67b5a06..0d7a286 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/IPDBDataStream.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/IPDBDataStream.h
@@ -32,7 +32,6 @@
   virtual Optional<RecordType> getItemAtIndex(uint32_t Index) const = 0;
   virtual bool getNext(RecordType &Record) = 0;
   virtual void reset() = 0;
-  virtual IPDBDataStream *clone() const = 0;
 };
 
 } // end namespace pdb
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h
index b6b7d95..7017f26 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h
@@ -10,6 +10,7 @@
 #ifndef LLVM_DEBUGINFO_PDB_IPDBENUMCHILDREN_H
 #define LLVM_DEBUGINFO_PDB_IPDBENUMCHILDREN_H
 
+#include <cassert>
 #include <cstdint>
 #include <memory>
 
@@ -27,7 +28,19 @@
   virtual ChildTypePtr getChildAtIndex(uint32_t Index) const = 0;
   virtual ChildTypePtr getNext() = 0;
   virtual void reset() = 0;
-  virtual MyType *clone() const = 0;
+};
+
+template <typename ChildType>
+class NullEnumerator : public IPDBEnumChildren<ChildType> {
+  virtual uint32_t getChildCount() const override { return 0; }
+  virtual std::unique_ptr<ChildType>
+  getChildAtIndex(uint32_t Index) const override {
+    return nullptr;
+  }
+  virtual std::unique_ptr<ChildType> getNext() override {
+    return nullptr;
+  }
+  virtual void reset() override {}
 };
 
 } // end namespace pdb
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h
index bcb2eaa..7c818d7 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h
@@ -11,6 +11,7 @@
 #define LLVM_DEBUGINFO_PDB_IPDBRAWSYMBOL_H
 
 #include "PDBTypes.h"
+#include "llvm/ADT/BitmaskEnum.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/DebugInfo/CodeView/CodeView.h"
@@ -21,9 +22,26 @@
 
 namespace pdb {
 
+class IPDBSession;
 class PDBSymbolTypeVTable;
 class PDBSymbolTypeVTableShape;
 
+enum class PdbSymbolIdField : uint32_t {
+  None = 0,
+  SymIndexId = 1 << 0,
+  LexicalParent = 1 << 1,
+  ClassParent = 1 << 2,
+  Type = 1 << 3,
+  UnmodifiedType = 1 << 4,
+  All = 0xFFFFFFFF,
+  LLVM_MARK_AS_BITMASK_ENUM(/* LargestValue = */ All)
+};
+
+void dumpSymbolIdField(raw_ostream &OS, StringRef Name, SymIndexId Value,
+                       int Indent, const IPDBSession &Session,
+                       PdbSymbolIdField FieldId, PdbSymbolIdField ShowFlags,
+                       PdbSymbolIdField RecurseFlags);
+
 /// IPDBRawSymbol defines an interface used to represent an arbitrary symbol.
 /// It exposes a monolithic interface consisting of accessors for the union of
 /// all properties that are valid for any symbol type.  This interface is then
@@ -33,7 +51,8 @@
 public:
   virtual ~IPDBRawSymbol();
 
-  virtual void dump(raw_ostream &OS, int Indent) const = 0;
+  virtual void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields,
+                    PdbSymbolIdField RecurseIdFields) const = 0;
 
   virtual std::unique_ptr<IPDBEnumSymbols>
   findChildren(PDB_SymType Type) const = 0;
@@ -74,26 +93,26 @@
   virtual uint32_t getAddressOffset() const = 0;
   virtual uint32_t getAddressSection() const = 0;
   virtual uint32_t getAge() const = 0;
-  virtual uint32_t getArrayIndexTypeId() const = 0;
+  virtual SymIndexId getArrayIndexTypeId() const = 0;
   virtual uint32_t getBaseDataOffset() const = 0;
   virtual uint32_t getBaseDataSlot() const = 0;
-  virtual uint32_t getBaseSymbolId() const = 0;
+  virtual SymIndexId getBaseSymbolId() const = 0;
   virtual PDB_BuiltinType getBuiltinType() const = 0;
   virtual uint32_t getBitPosition() const = 0;
   virtual PDB_CallingConv getCallingConvention() const = 0;
-  virtual uint32_t getClassParentId() const = 0;
+  virtual SymIndexId getClassParentId() const = 0;
   virtual std::string getCompilerName() const = 0;
   virtual uint32_t getCount() const = 0;
   virtual uint32_t getCountLiveRanges() const = 0;
   virtual void getFrontEndVersion(VersionInfo &Version) const = 0;
   virtual PDB_Lang getLanguage() const = 0;
-  virtual uint32_t getLexicalParentId() const = 0;
+  virtual SymIndexId getLexicalParentId() const = 0;
   virtual std::string getLibraryName() const = 0;
   virtual uint32_t getLiveRangeStartAddressOffset() const = 0;
   virtual uint32_t getLiveRangeStartAddressSection() const = 0;
   virtual uint32_t getLiveRangeStartRelativeVirtualAddress() const = 0;
   virtual codeview::RegisterId getLocalBasePointerRegisterId() const = 0;
-  virtual uint32_t getLowerBoundId() const = 0;
+  virtual SymIndexId getLowerBoundId() const = 0;
   virtual uint32_t getMemorySpaceKind() const = 0;
   virtual std::string getName() const = 0;
   virtual uint32_t getNumberOfAcceleratorPointerTags() const = 0;
@@ -103,7 +122,7 @@
   virtual uint32_t getNumberOfRows() const = 0;
   virtual std::string getObjectFileName() const = 0;
   virtual uint32_t getOemId() const = 0;
-  virtual uint32_t getOemSymbolId() const = 0;
+  virtual SymIndexId getOemSymbolId() const = 0;
   virtual uint32_t getOffsetInUdt() const = 0;
   virtual PDB_Cpu getPlatform() const = 0;
   virtual uint32_t getRank() const = 0;
@@ -118,9 +137,9 @@
   virtual std::unique_ptr<IPDBLineNumber>
   getSrcLineOnTypeDefn() const = 0;
   virtual uint32_t getStride() const = 0;
-  virtual uint32_t getSubTypeId() const = 0;
+  virtual SymIndexId getSubTypeId() const = 0;
   virtual std::string getSymbolsFileName() const = 0;
-  virtual uint32_t getSymIndexId() const = 0;
+  virtual SymIndexId getSymIndexId() const = 0;
   virtual uint32_t getTargetOffset() const = 0;
   virtual uint32_t getTargetRelativeVirtualAddress() const = 0;
   virtual uint64_t getTargetVirtualAddress() const = 0;
@@ -128,18 +147,18 @@
   virtual uint32_t getTextureSlot() const = 0;
   virtual uint32_t getTimeStamp() const = 0;
   virtual uint32_t getToken() const = 0;
-  virtual uint32_t getTypeId() const = 0;
+  virtual SymIndexId getTypeId() const = 0;
   virtual uint32_t getUavSlot() const = 0;
   virtual std::string getUndecoratedName() const = 0;
   virtual std::string getUndecoratedNameEx(PDB_UndnameFlags Flags) const = 0;
-  virtual uint32_t getUnmodifiedTypeId() const = 0;
-  virtual uint32_t getUpperBoundId() const = 0;
+  virtual SymIndexId getUnmodifiedTypeId() const = 0;
+  virtual SymIndexId getUpperBoundId() const = 0;
   virtual Variant getValue() const = 0;
   virtual uint32_t getVirtualBaseDispIndex() const = 0;
   virtual uint32_t getVirtualBaseOffset() const = 0;
   virtual std::unique_ptr<PDBSymbolTypeBuiltin>
   getVirtualBaseTableType() const = 0;
-  virtual uint32_t getVirtualTableShapeId() const = 0;
+  virtual SymIndexId getVirtualTableShapeId() const = 0;
   virtual PDB_DataKind getDataKind() const = 0;
   virtual PDB_SymType getSymTag() const = 0;
   virtual codeview::GUID getGuid() const = 0;
@@ -237,6 +256,8 @@
   virtual std::string getUnused() const = 0;
 };
 
+LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();
+
 } // namespace pdb
 } // namespace llvm
 
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/IPDBSession.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/IPDBSession.h
index 88ec517..24573cd 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/IPDBSession.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/IPDBSession.h
@@ -30,7 +30,8 @@
   virtual uint64_t getLoadAddress() const = 0;
   virtual bool setLoadAddress(uint64_t Address) = 0;
   virtual std::unique_ptr<PDBSymbolExe> getGlobalScope() = 0;
-  virtual std::unique_ptr<PDBSymbol> getSymbolById(uint32_t SymbolId) const = 0;
+  virtual std::unique_ptr<PDBSymbol>
+  getSymbolById(SymIndexId SymbolId) const = 0;
 
   virtual bool addressForVA(uint64_t VA, uint32_t &Section,
                             uint32_t &Offset) const = 0;
@@ -38,7 +39,7 @@
                              uint32_t &Offset) const = 0;
 
   template <typename T>
-  std::unique_ptr<T> getConcreteSymbolById(uint32_t SymbolId) const {
+  std::unique_ptr<T> getConcreteSymbolById(SymIndexId SymbolId) const {
     return unique_dyn_cast_or_null<T>(getSymbolById(SymbolId));
   }
 
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/DbiStream.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/DbiStream.h
index 280615b..a3ca607 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/DbiStream.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/DbiStream.h
@@ -78,7 +78,7 @@
 
   const DbiModuleList &modules() const;
 
-  FixedStreamArray<object::coff_section> getSectionHeaders();
+  FixedStreamArray<object::coff_section> getSectionHeaders() const;
 
   FixedStreamArray<object::FpoData> getFpoRecords();
 
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h
index 51befcd..b538de5 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h
@@ -15,6 +15,7 @@
 #include "llvm/BinaryFormat/COFF.h"
 #include "llvm/Support/Error.h"
 
+#include "llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h"
 #include "llvm/DebugInfo/PDB/Native/PDBFile.h"
 #include "llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h"
 #include "llvm/DebugInfo/PDB/Native/RawConstants.h"
@@ -24,11 +25,15 @@
 #include "llvm/Support/Endian.h"
 
 namespace llvm {
+namespace codeview {
+struct FrameData;
+}
 namespace msf {
 class MSFBuilder;
 }
 namespace object {
 struct coff_section;
+struct FpoData;
 }
 namespace pdb {
 class DbiStream;
@@ -65,6 +70,8 @@
   void setGlobalsStreamIndex(uint32_t Index);
   void setPublicsStreamIndex(uint32_t Index);
   void setSymbolRecordStreamIndex(uint32_t Index);
+  void addNewFpoData(const codeview::FrameData &FD);
+  void addOldFpoData(const object::FpoData &Fpo);
 
   Expected<DbiModuleDescriptorBuilder &> addModuleInfo(StringRef ModuleName);
   Error addModuleSourceFile(DbiModuleDescriptorBuilder &Module, StringRef File);
@@ -84,7 +91,8 @@
 
 private:
   struct DebugStream {
-    ArrayRef<uint8_t> Data;
+    std::function<Error(BinaryStreamWriter &)> WriteFn;
+    uint32_t Size = 0;
     uint16_t StreamNumber = kInvalidStreamIndex;
   };
 
@@ -117,6 +125,9 @@
 
   std::vector<std::unique_ptr<DbiModuleDescriptorBuilder>> ModiList;
 
+  Optional<codeview::DebugFrameDataSubsection> NewFpoData;
+  std::vector<object::FpoData> OldFpoData;
+
   StringMap<uint32_t> SourceFileNames;
 
   PDBStringTableBuilder ECNamesBuilder;
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h
index fdc58dc..7f84564 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h
@@ -10,18 +10,20 @@
 #ifndef LLVM_DEBUGINFO_PDB_RAW_GLOBALS_STREAM_H
 #define LLVM_DEBUGINFO_PDB_RAW_GLOBALS_STREAM_H
 
+#include "llvm/ADT/iterator.h"
+#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
 #include "llvm/DebugInfo/MSF/MappedBlockStream.h"
 #include "llvm/DebugInfo/PDB/Native/RawConstants.h"
 #include "llvm/DebugInfo/PDB/Native/RawTypes.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
 #include "llvm/Support/BinaryStreamArray.h"
 #include "llvm/Support/Error.h"
-#include "llvm/ADT/iterator.h"
 
 namespace llvm {
 namespace pdb {
 class DbiStream;
 class PDBFile;
+class SymbolStream;
 
 /// Iterator over hash records producing symbol record offsets. Abstracts away
 /// the fact that symbol record offsets on disk are off-by-one.
@@ -30,8 +32,6 @@
           GSIHashIterator, FixedStreamArrayIterator<PSHashRecord>,
           std::random_access_iterator_tag, const uint32_t> {
 public:
-  GSIHashIterator() = default;
-
   template <typename T>
   GSIHashIterator(T &&v)
       : GSIHashIterator::iterator_adaptor_base(std::forward<T &&>(v)) {}
@@ -52,8 +52,9 @@
 public:
   const GSIHashHeader *HashHdr;
   FixedStreamArray<PSHashRecord> HashRecords;
-  ArrayRef<uint8_t> HashBitmap;
+  FixedStreamArray<support::ulittle32_t> HashBitmap;
   FixedStreamArray<support::ulittle32_t> HashBuckets;
+  std::array<int32_t, IPHR_HASH + 1> BucketMap;
 
   Error read(BinaryStreamReader &Reader);
 
@@ -74,6 +75,9 @@
   const GSIHashTable &getGlobalsTable() const { return GlobalsTable; }
   Error reload();
 
+  std::vector<std::pair<uint32_t, codeview::CVSymbol>>
+  findRecordsByName(StringRef Name, const SymbolStream &Symbols) const;
+
 private:
   GSIHashTable GlobalsTable;
   std::unique_ptr<msf::MappedBlockStream> Stream;
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h
index 419e8ad..101127a 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h
@@ -35,11 +35,18 @@
   InfoStreamBuilder &operator=(const InfoStreamBuilder &) = delete;
 
   void setVersion(PdbRaw_ImplVer V);
+  void addFeature(PdbRaw_FeatureSig Sig);
+
+  // If this is true, the PDB contents are hashed and this hash is used as
+  // PDB GUID and as Signature. The age is always 1.
+  void setHashPDBContentsToGUID(bool B);
+
+  // These only have an effect if hashPDBContentsToGUID() is false.
   void setSignature(uint32_t S);
   void setAge(uint32_t A);
   void setGuid(codeview::GUID G);
-  void addFeature(PdbRaw_FeatureSig Sig);
 
+  bool hashPDBContentsToGUID() const { return HashPDBContentsToGUID; }
   uint32_t getAge() const { return Age; }
   codeview::GUID getGuid() const { return Guid; }
   Optional<uint32_t> getSignature() const { return Signature; }
@@ -60,6 +67,8 @@
   Optional<uint32_t> Signature;
   codeview::GUID Guid;
 
+  bool HashPDBContentsToGUID = false;
+
   NamedStreamMap &NamedStreams;
 };
 }
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
index 6602264..19b0ebd 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
@@ -15,6 +15,7 @@
 #include "llvm/DebugInfo/CodeView/DebugSubsectionRecord.h"
 #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
 #include "llvm/DebugInfo/MSF/MappedBlockStream.h"
+#include "llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h"
 #include "llvm/Support/BinaryStreamRef.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
@@ -49,7 +50,9 @@
   BinarySubstreamRef getC13LinesSubstream() const;
   BinarySubstreamRef getGlobalRefsSubstream() const;
 
-  ModuleDebugStreamRef &operator=(ModuleDebugStreamRef &&Other) = default;
+  ModuleDebugStreamRef &operator=(ModuleDebugStreamRef &&Other) = delete;
+
+  codeview::CVSymbol readSymbolAtOffset(uint32_t Offset) const;
 
   iterator_range<DebugSubsectionIterator> subsections() const;
   codeview::DebugSubsectionArray getSubsectionsArray() const {
@@ -64,7 +67,7 @@
   findChecksumsSubsection() const;
 
 private:
-  const DbiModuleDescriptor &Mod;
+  DbiModuleDescriptor Mod;
 
   uint32_t Signature;
 
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeBuiltinSymbol.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeBuiltinSymbol.h
deleted file mode 100644
index 4f532c6..0000000
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeBuiltinSymbol.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//===- NativeBuiltinSymbol.h -------------------------------------- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_DEBUGINFO_PDB_NATIVE_NATIVEBUILTINSYMBOL_H
-#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVEBUILTINSYMBOL_H
-
-#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
-
-#include "llvm/DebugInfo/PDB/PDBTypes.h"
-
-namespace llvm {
-namespace pdb {
-
-class NativeSession;
-
-class NativeBuiltinSymbol : public NativeRawSymbol {
-public:
-  NativeBuiltinSymbol(NativeSession &PDBSession, SymIndexId Id,
-                      PDB_BuiltinType T, uint64_t L);
-  ~NativeBuiltinSymbol() override;
-
-  virtual std::unique_ptr<NativeRawSymbol> clone() const override;
-
-  void dump(raw_ostream &OS, int Indent) const override;
-
-  PDB_SymType getSymTag() const override;
-
-  PDB_BuiltinType getBuiltinType() const override;
-  bool isConstType() const override;
-  uint64_t getLength() const override;
-  bool isUnalignedType() const override;
-  bool isVolatileType() const override;
-
-protected:
-  NativeSession &Session;
-  PDB_BuiltinType Type;
-  uint64_t Length;
-};
-
-} // namespace pdb
-} // namespace llvm
-
-#endif
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h
index bd5c09e..3cd4655 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h
@@ -21,11 +21,12 @@
   NativeCompilandSymbol(NativeSession &Session, SymIndexId SymbolId,
                         DbiModuleDescriptor MI);
 
-  std::unique_ptr<NativeRawSymbol> clone() const override;
+  void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields,
+            PdbSymbolIdField RecurseIdFields) const override;
 
   PDB_SymType getSymTag() const override;
   bool isEditAndContinueEnabled() const override;
-  uint32_t getLexicalParentId() const override;
+  SymIndexId getLexicalParentId() const override;
   std::string getLibraryName() const override;
   std::string getName() const override;
 
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeEnumGlobals.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeEnumGlobals.h
new file mode 100644
index 0000000..4442a1e
--- /dev/null
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeEnumGlobals.h
@@ -0,0 +1,43 @@
+//==- NativeEnumGlobals.h - Native Global Enumerator impl --------*- C++ -*-==//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_PDB_NATIVE_NATIVEENUMGLOBALS_H
+#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVEENUMGLOBALS_H
+
+#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
+#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
+#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+
+#include <vector>
+
+namespace llvm {
+namespace pdb {
+
+class NativeSession;
+
+class NativeEnumGlobals : public IPDBEnumChildren<PDBSymbol> {
+public:
+  NativeEnumGlobals(NativeSession &Session,
+                    std::vector<codeview::SymbolKind> Kinds);
+
+  uint32_t getChildCount() const override;
+  std::unique_ptr<PDBSymbol> getChildAtIndex(uint32_t Index) const override;
+  std::unique_ptr<PDBSymbol> getNext() override;
+  void reset() override;
+
+private:
+  std::vector<uint32_t> MatchOffsets;
+  uint32_t Index;
+  NativeSession &Session;
+};
+
+} // namespace pdb
+} // namespace llvm
+
+#endif
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h
index 6aa1460..c268641 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h
@@ -11,28 +11,23 @@
 #define LLVM_DEBUGINFO_PDB_NATIVE_NATIVEENUMMODULES_H
 
 #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
-#include "llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h"
 #include "llvm/DebugInfo/PDB/PDBSymbol.h"
 namespace llvm {
 namespace pdb {
 
-class DbiModuleList;
 class NativeSession;
 
 class NativeEnumModules : public IPDBEnumChildren<PDBSymbol> {
 public:
-  NativeEnumModules(NativeSession &Session, const DbiModuleList &Modules,
-                    uint32_t Index = 0);
+  NativeEnumModules(NativeSession &Session, uint32_t Index = 0);
 
   uint32_t getChildCount() const override;
   std::unique_ptr<PDBSymbol> getChildAtIndex(uint32_t Index) const override;
   std::unique_ptr<PDBSymbol> getNext() override;
   void reset() override;
-  NativeEnumModules *clone() const override;
 
 private:
   NativeSession &Session;
-  const DbiModuleList &Modules;
   uint32_t Index;
 };
 }
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeEnumSymbol.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeEnumSymbol.h
deleted file mode 100644
index 41b7b78..0000000
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeEnumSymbol.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//===- NativeEnumSymbol.h - info about enum type ----------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_DEBUGINFO_PDB_NATIVE_NATIVEENUMSYMBOL_H
-#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVEENUMSYMBOL_H
-
-#include "llvm/DebugInfo/CodeView/CodeView.h"
-#include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h"
-#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
-#include "llvm/DebugInfo/PDB/Native/NativeSession.h"
-
-namespace llvm {
-namespace pdb {
-
-class NativeEnumSymbol : public NativeRawSymbol,
-                         public codeview::TypeVisitorCallbacks {
-public:
-  NativeEnumSymbol(NativeSession &Session, SymIndexId Id,
-                   const codeview::CVType &CV);
-  ~NativeEnumSymbol() override;
-
-  std::unique_ptr<NativeRawSymbol> clone() const override;
-
-  std::unique_ptr<IPDBEnumSymbols>
-  findChildren(PDB_SymType Type) const override;
-
-  Error visitKnownRecord(codeview::CVType &CVR,
-                         codeview::EnumRecord &Record) override;
-  Error visitKnownMember(codeview::CVMemberRecord &CVM,
-                         codeview::EnumeratorRecord &Record) override;
-
-  PDB_SymType getSymTag() const override;
-  uint32_t getClassParentId() const override;
-  uint32_t getUnmodifiedTypeId() const override;
-  bool hasConstructor() const override;
-  bool hasAssignmentOperator() const override;
-  bool hasCastOperator() const override;
-  uint64_t getLength() const override;
-  std::string getName() const override;
-  bool isNested() const override;
-  bool hasOverloadedOperator() const override;
-  bool isPacked() const override;
-  bool isScoped() const override;
-  uint32_t getTypeId() const override;
-
-protected:
-  codeview::CVType CV;
-  codeview::EnumRecord Record;
-};
-
-} // namespace pdb
-} // namespace llvm
-
-#endif // LLVM_DEBUGINFO_PDB_NATIVE_NATIVEENUMSYMBOL_H
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h
index e0a5c8d..f8ac165 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h
@@ -26,23 +26,20 @@
 public:
   NativeEnumTypes(NativeSession &Session,
                   codeview::LazyRandomTypeCollection &TypeCollection,
-                  codeview::TypeLeafKind Kind);
+                  std::vector<codeview::TypeLeafKind> Kinds);
+
+  NativeEnumTypes(NativeSession &Session,
+                  std::vector<codeview::TypeIndex> Indices);
 
   uint32_t getChildCount() const override;
   std::unique_ptr<PDBSymbol> getChildAtIndex(uint32_t Index) const override;
   std::unique_ptr<PDBSymbol> getNext() override;
   void reset() override;
-  NativeEnumTypes *clone() const override;
 
 private:
-  NativeEnumTypes(NativeSession &Session,
-                  const std::vector<codeview::TypeIndex> &Matches,
-                  codeview::TypeLeafKind Kind);
-
   std::vector<codeview::TypeIndex> Matches;
   uint32_t Index;
   NativeSession &Session;
-  codeview::TypeLeafKind Kind;
 };
 
 } // namespace pdb
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h
index 587c7ff..f4030da 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h
@@ -16,11 +16,14 @@
 namespace llvm {
 namespace pdb {
 
-class NativeExeSymbol : public NativeRawSymbol {
-public:
-  NativeExeSymbol(NativeSession &Session, SymIndexId SymbolId);
+class DbiStream;
 
-  std::unique_ptr<NativeRawSymbol> clone() const override;
+class NativeExeSymbol : public NativeRawSymbol {
+  // EXE symbol is the authority on the various symbol types.
+  DbiStream *Dbi = nullptr;
+
+public:
+  NativeExeSymbol(NativeSession &Session, SymIndexId Id);
 
   std::unique_ptr<IPDBEnumSymbols>
   findChildren(PDB_SymType Type) const override;
@@ -30,9 +33,6 @@
   codeview::GUID getGuid() const override;
   bool hasCTypes() const override;
   bool hasPrivateSymbols() const override;
-
-private:
-  PDBFile &File;
 };
 
 } // namespace pdb
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h
index 5b70ecf..6505a7d 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h
@@ -19,15 +19,16 @@
 
 class NativeSession;
 
-typedef uint32_t SymIndexId;
-
 class NativeRawSymbol : public IPDBRawSymbol {
+  friend class SymbolCache;
+  virtual void initialize() {}
+
 public:
-  NativeRawSymbol(NativeSession &PDBSession, SymIndexId SymbolId);
+  NativeRawSymbol(NativeSession &PDBSession, PDB_SymType Tag,
+                  SymIndexId SymbolId);
 
-  virtual std::unique_ptr<NativeRawSymbol> clone() const = 0;
-
-  void dump(raw_ostream &OS, int Indent) const override;
+  void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields,
+            PdbSymbolIdField RecurseIdFields) const override;
 
   std::unique_ptr<IPDBEnumSymbols>
     findChildren(PDB_SymType Type) const override;
@@ -68,25 +69,25 @@
   uint32_t getAddressOffset() const override;
   uint32_t getAddressSection() const override;
   uint32_t getAge() const override;
-  uint32_t getArrayIndexTypeId() const override;
+  SymIndexId getArrayIndexTypeId() const override;
   uint32_t getBaseDataOffset() const override;
   uint32_t getBaseDataSlot() const override;
-  uint32_t getBaseSymbolId() const override;
+  SymIndexId getBaseSymbolId() const override;
   PDB_BuiltinType getBuiltinType() const override;
   uint32_t getBitPosition() const override;
   PDB_CallingConv getCallingConvention() const override;
-  uint32_t getClassParentId() const override;
+  SymIndexId getClassParentId() const override;
   std::string getCompilerName() const override;
   uint32_t getCount() const override;
   uint32_t getCountLiveRanges() const override;
   PDB_Lang getLanguage() const override;
-  uint32_t getLexicalParentId() const override;
+  SymIndexId getLexicalParentId() const override;
   std::string getLibraryName() const override;
   uint32_t getLiveRangeStartAddressOffset() const override;
   uint32_t getLiveRangeStartAddressSection() const override;
   uint32_t getLiveRangeStartRelativeVirtualAddress() const override;
   codeview::RegisterId getLocalBasePointerRegisterId() const override;
-  uint32_t getLowerBoundId() const override;
+  SymIndexId getLowerBoundId() const override;
   uint32_t getMemorySpaceKind() const override;
   std::string getName() const override;
   uint32_t getNumberOfAcceleratorPointerTags() const override;
@@ -96,7 +97,7 @@
   uint32_t getNumberOfRows() const override;
   std::string getObjectFileName() const override;
   uint32_t getOemId() const override;
-  uint32_t getOemSymbolId() const override;
+  SymIndexId getOemSymbolId() const override;
   uint32_t getOffsetInUdt() const override;
   PDB_Cpu getPlatform() const override;
   uint32_t getRank() const override;
@@ -110,9 +111,9 @@
   std::string getSourceFileName() const override;
   std::unique_ptr<IPDBLineNumber> getSrcLineOnTypeDefn() const override;
   uint32_t getStride() const override;
-  uint32_t getSubTypeId() const override;
+  SymIndexId getSubTypeId() const override;
   std::string getSymbolsFileName() const override;
-  uint32_t getSymIndexId() const override;
+  SymIndexId getSymIndexId() const override;
   uint32_t getTargetOffset() const override;
   uint32_t getTargetRelativeVirtualAddress() const override;
   uint64_t getTargetVirtualAddress() const override;
@@ -120,16 +121,16 @@
   uint32_t getTextureSlot() const override;
   uint32_t getTimeStamp() const override;
   uint32_t getToken() const override;
-  uint32_t getTypeId() const override;
+  SymIndexId getTypeId() const override;
   uint32_t getUavSlot() const override;
   std::string getUndecoratedName() const override;
   std::string getUndecoratedNameEx(PDB_UndnameFlags Flags) const override;
-  uint32_t getUnmodifiedTypeId() const override;
-  uint32_t getUpperBoundId() const override;
+  SymIndexId getUnmodifiedTypeId() const override;
+  SymIndexId getUpperBoundId() const override;
   Variant getValue() const override;
   uint32_t getVirtualBaseDispIndex() const override;
   uint32_t getVirtualBaseOffset() const override;
-  uint32_t getVirtualTableShapeId() const override;
+  SymIndexId getVirtualTableShapeId() const override;
   std::unique_ptr<PDBSymbolTypeBuiltin>
   getVirtualBaseTableType() const override;
   PDB_DataKind getDataKind() const override;
@@ -230,6 +231,7 @@
 
 protected:
   NativeSession &Session;
+  PDB_SymType Tag;
   SymIndexId SymbolId;
 };
 
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeSession.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeSession.h
index aff7ef2..07ce85e 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeSession.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeSession.h
@@ -15,9 +15,8 @@
 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
 #include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
 #include "llvm/DebugInfo/PDB/IPDBSession.h"
-#include "llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h"
-#include "llvm/DebugInfo/PDB/Native/NativeBuiltinSymbol.h"
 #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
+#include "llvm/DebugInfo/PDB/Native/SymbolCache.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/Error.h"
 
@@ -25,6 +24,7 @@
 class MemoryBuffer;
 namespace pdb {
 class PDBFile;
+class NativeExeSymbol;
 
 class NativeSession : public IPDBSession {
 public:
@@ -37,21 +37,10 @@
   static Error createFromExe(StringRef Path,
                              std::unique_ptr<IPDBSession> &Session);
 
-  std::unique_ptr<PDBSymbolCompiland>
-  createCompilandSymbol(DbiModuleDescriptor MI);
-
-  std::unique_ptr<PDBSymbolTypeEnum>
-  createEnumSymbol(codeview::TypeIndex Index);
-
-  std::unique_ptr<IPDBEnumSymbols>
-  createTypeEnumerator(codeview::TypeLeafKind Kind);
-
-  SymIndexId findSymbolByTypeIndex(codeview::TypeIndex TI);
-
   uint64_t getLoadAddress() const override;
   bool setLoadAddress(uint64_t Address) override;
   std::unique_ptr<PDBSymbolExe> getGlobalScope() override;
-  std::unique_ptr<PDBSymbol> getSymbolById(uint32_t SymbolId) const override;
+  std::unique_ptr<PDBSymbol> getSymbolById(SymIndexId SymbolId) const override;
 
   bool addressForVA(uint64_t VA, uint32_t &Section,
                     uint32_t &Offset) const override;
@@ -107,11 +96,18 @@
   PDBFile &getPDBFile() { return *Pdb; }
   const PDBFile &getPDBFile() const { return *Pdb; }
 
+  NativeExeSymbol &getNativeGlobalScope() const;
+  SymbolCache &getSymbolCache() { return Cache; }
+  const SymbolCache &getSymbolCache() const { return Cache; }
+
 private:
+  void initializeExeSymbol();
+
   std::unique_ptr<PDBFile> Pdb;
   std::unique_ptr<BumpPtrAllocator> Allocator;
-  std::vector<std::unique_ptr<NativeRawSymbol>> SymbolCache;
-  DenseMap<codeview::TypeIndex, SymIndexId> TypeIndexToSymbolId;
+
+  SymbolCache Cache;
+  SymIndexId ExeSymbol = 0;
 };
 } // namespace pdb
 } // namespace llvm
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeSymbolEnumerator.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeSymbolEnumerator.h
new file mode 100644
index 0000000..acc5eb8
--- /dev/null
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeSymbolEnumerator.h
@@ -0,0 +1,51 @@
+//===- NativeSymbolEnumerator.h - info about enumerator values --*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_PDB_NATIVE_NATIVESYMBOLENUMERATOR_H
+#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVESYMBOLENUMERATOR_H
+
+#include "llvm/DebugInfo/CodeView/CodeView.h"
+#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
+#include "llvm/DebugInfo/PDB/Native/NativeSession.h"
+
+namespace llvm {
+namespace pdb {
+class NativeTypeEnum;
+
+class NativeSymbolEnumerator : public NativeRawSymbol {
+public:
+  NativeSymbolEnumerator(NativeSession &Session, SymIndexId Id,
+                         const NativeTypeEnum &Parent,
+                         codeview::EnumeratorRecord Record);
+
+  ~NativeSymbolEnumerator() override;
+
+  void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields,
+            PdbSymbolIdField RecurseIdFields) const override;
+
+  SymIndexId getClassParentId() const override;
+  SymIndexId getLexicalParentId() const override;
+  std::string getName() const override;
+  SymIndexId getTypeId() const override;
+  PDB_DataKind getDataKind() const override;
+  PDB_LocType getLocationType() const override;
+  bool isConstType() const override;
+  bool isVolatileType() const override;
+  bool isUnalignedType() const override;
+  Variant getValue() const override;
+
+protected:
+  const NativeTypeEnum &Parent;
+  codeview::EnumeratorRecord Record;
+};
+
+} // namespace pdb
+} // namespace llvm
+
+#endif // LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEENUM_H
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypeArray.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypeArray.h
new file mode 100644
index 0000000..10e68e6
--- /dev/null
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypeArray.h
@@ -0,0 +1,50 @@
+//===- NativeTypeArray.h ------------------------------------------ C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEARRAY_H
+#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEARRAY_H
+
+#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
+
+#include "llvm/DebugInfo/CodeView/TypeRecord.h"
+#include "llvm/DebugInfo/PDB/PDBTypes.h"
+
+namespace llvm {
+namespace pdb {
+
+class NativeSession;
+
+class NativeTypeArray : public NativeRawSymbol {
+public:
+  NativeTypeArray(NativeSession &Session, SymIndexId Id, codeview::TypeIndex TI,
+                  codeview::ArrayRecord Record);
+  ~NativeTypeArray() override;
+
+  void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields,
+            PdbSymbolIdField RecurseIdFields) const override;
+
+  SymIndexId getArrayIndexTypeId() const override;
+
+  bool isConstType() const override;
+  bool isUnalignedType() const override;
+  bool isVolatileType() const override;
+
+  uint32_t getCount() const override;
+  SymIndexId getTypeId() const override;
+  uint64_t getLength() const override;
+
+protected:
+  codeview::ArrayRecord Record;
+  codeview::TypeIndex Index;
+};
+
+} // namespace pdb
+} // namespace llvm
+
+#endif
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h
new file mode 100644
index 0000000..725dfb8
--- /dev/null
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h
@@ -0,0 +1,50 @@
+//===- NativeTypeBuiltin.h ---------------------------------------- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEBUILTIN_H
+#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEBUILTIN_H
+
+#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
+
+#include "llvm/DebugInfo/PDB/PDBTypes.h"
+
+namespace llvm {
+namespace pdb {
+
+class NativeSession;
+
+class NativeTypeBuiltin : public NativeRawSymbol {
+public:
+  NativeTypeBuiltin(NativeSession &PDBSession, SymIndexId Id,
+                    codeview::ModifierOptions Mods, PDB_BuiltinType T,
+                    uint64_t L);
+  ~NativeTypeBuiltin() override;
+
+  void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields,
+            PdbSymbolIdField RecurseIdFields) const override;
+
+  PDB_SymType getSymTag() const override;
+
+  PDB_BuiltinType getBuiltinType() const override;
+  bool isConstType() const override;
+  uint64_t getLength() const override;
+  bool isUnalignedType() const override;
+  bool isVolatileType() const override;
+
+protected:
+  NativeSession &Session;
+  codeview::ModifierOptions Mods;
+  PDB_BuiltinType Type;
+  uint64_t Length;
+};
+
+} // namespace pdb
+} // namespace llvm
+
+#endif
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypeEnum.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypeEnum.h
new file mode 100644
index 0000000..a5cbefc
--- /dev/null
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypeEnum.h
@@ -0,0 +1,75 @@
+//===- NativeTypeEnum.h - info about enum type ------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEENUM_H
+#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEENUM_H
+
+#include "llvm/ADT/Optional.h"
+#include "llvm/DebugInfo/CodeView/CodeView.h"
+#include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h"
+#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
+#include "llvm/DebugInfo/PDB/Native/NativeSession.h"
+
+namespace llvm {
+namespace pdb {
+
+class NativeTypeBuiltin;
+
+class NativeTypeEnum : public NativeRawSymbol {
+public:
+  NativeTypeEnum(NativeSession &Session, SymIndexId Id, codeview::TypeIndex TI,
+                 codeview::EnumRecord Record);
+
+  NativeTypeEnum(NativeSession &Session, SymIndexId Id,
+                 NativeTypeEnum &UnmodifiedType,
+                 codeview::ModifierRecord Modifier);
+  ~NativeTypeEnum() override;
+
+  void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields,
+            PdbSymbolIdField RecurseIdFields) const override;
+
+  std::unique_ptr<IPDBEnumSymbols>
+  findChildren(PDB_SymType Type) const override;
+
+  PDB_BuiltinType getBuiltinType() const override;
+  PDB_SymType getSymTag() const override;
+  SymIndexId getUnmodifiedTypeId() const override;
+  bool hasConstructor() const override;
+  bool hasAssignmentOperator() const override;
+  bool hasCastOperator() const override;
+  uint64_t getLength() const override;
+  std::string getName() const override;
+  bool isConstType() const override;
+  bool isVolatileType() const override;
+  bool isUnalignedType() const override;
+  bool isNested() const override;
+  bool hasOverloadedOperator() const override;
+  bool hasNestedTypes() const override;
+  bool isIntrinsic() const override;
+  bool isPacked() const override;
+  bool isScoped() const override;
+  SymIndexId getTypeId() const override;
+  bool isRefUdt() const override;
+  bool isValueUdt() const override;
+  bool isInterfaceUdt() const override;
+
+  const NativeTypeBuiltin &getUnderlyingBuiltinType() const;
+  const codeview::EnumRecord &getEnumRecord() const { return *Record; }
+
+protected:
+  codeview::TypeIndex Index;
+  Optional<codeview::EnumRecord> Record;
+  NativeTypeEnum *UnmodifiedType = nullptr;
+  Optional<codeview::ModifierRecord> Modifiers;
+};
+
+} // namespace pdb
+} // namespace llvm
+
+#endif // LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEENUM_H
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypeFunctionSig.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypeFunctionSig.h
new file mode 100644
index 0000000..1b1b87f
--- /dev/null
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypeFunctionSig.h
@@ -0,0 +1,74 @@
+//===- NativeTypeFunctionSig.h - info about function signature ---*- C++-*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEFUNCTIONSIG_H
+#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEFUNCTIONSIG_H
+
+#include "llvm/ADT/Optional.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/DebugInfo/CodeView/CodeView.h"
+#include "llvm/DebugInfo/CodeView/TypeRecord.h"
+#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
+#include "llvm/DebugInfo/PDB/Native/NativeSession.h"
+
+namespace llvm {
+namespace pdb {
+
+class NativeTypeUDT;
+
+class NativeTypeFunctionSig : public NativeRawSymbol {
+protected:
+  void initialize() override;
+
+public:
+  NativeTypeFunctionSig(NativeSession &Session, SymIndexId Id,
+                        codeview::TypeIndex TI, codeview::ProcedureRecord Proc);
+
+  NativeTypeFunctionSig(NativeSession &Session, SymIndexId Id,
+                        codeview::TypeIndex TI,
+                        codeview::MemberFunctionRecord MemberFunc);
+
+  ~NativeTypeFunctionSig() override;
+
+  void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields,
+            PdbSymbolIdField RecurseIdFields) const override;
+
+  std::unique_ptr<IPDBEnumSymbols>
+  findChildren(PDB_SymType Type) const override;
+
+  SymIndexId getClassParentId() const override;
+  PDB_CallingConv getCallingConvention() const override;
+  uint32_t getCount() const override;
+  SymIndexId getTypeId() const override;
+  int32_t getThisAdjust() const override;
+  bool hasConstructor() const override;
+  bool isConstType() const override;
+  bool isConstructorVirtualBase() const override;
+  bool isCxxReturnUdt() const override;
+  bool isUnalignedType() const override;
+  bool isVolatileType() const override;
+
+private:
+  void initializeArgList(codeview::TypeIndex ArgListTI);
+
+  union {
+    codeview::MemberFunctionRecord MemberFunc;
+    codeview::ProcedureRecord Proc;
+  };
+
+  SymIndexId ClassParentId = 0;
+  codeview::TypeIndex Index;
+  codeview::ArgListRecord ArgList;
+  bool IsMemberFunction = false;
+};
+
+} // namespace pdb
+} // namespace llvm
+
+#endif // LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEPOINTER_H
\ No newline at end of file
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypePointer.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypePointer.h
new file mode 100644
index 0000000..bcb7431
--- /dev/null
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypePointer.h
@@ -0,0 +1,61 @@
+//===- NativeTypePointer.h - info about pointer type -------------*- C++-*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEPOINTER_H
+#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEPOINTER_H
+
+#include "llvm/ADT/Optional.h"
+#include "llvm/DebugInfo/CodeView/CodeView.h"
+#include "llvm/DebugInfo/CodeView/TypeRecord.h"
+#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
+#include "llvm/DebugInfo/PDB/Native/NativeSession.h"
+
+namespace llvm {
+namespace pdb {
+
+class NativeTypePointer : public NativeRawSymbol {
+public:
+  // Create a pointer record for a simple type.
+  NativeTypePointer(NativeSession &Session, SymIndexId Id,
+                    codeview::TypeIndex TI);
+
+  // Create a pointer record for a non-simple type.
+  NativeTypePointer(NativeSession &Session, SymIndexId Id,
+                    codeview::TypeIndex TI, codeview::PointerRecord PR);
+  ~NativeTypePointer() override;
+
+  void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields,
+            PdbSymbolIdField RecurseIdFields) const override;
+
+  SymIndexId getClassParentId() const override;
+  bool isConstType() const override;
+  uint64_t getLength() const override;
+  bool isReference() const override;
+  bool isRValueReference() const override;
+  bool isPointerToDataMember() const override;
+  bool isPointerToMemberFunction() const override;
+  SymIndexId getTypeId() const override;
+  bool isRestrictedType() const override;
+  bool isVolatileType() const override;
+  bool isUnalignedType() const override;
+
+  bool isSingleInheritance() const override;
+  bool isMultipleInheritance() const override;
+  bool isVirtualInheritance() const override;
+
+protected:
+  bool isMemberPointer() const;
+  codeview::TypeIndex TI;
+  Optional<codeview::PointerRecord> Record;
+};
+
+} // namespace pdb
+} // namespace llvm
+
+#endif // LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEPOINTER_H
\ No newline at end of file
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypeTypedef.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypeTypedef.h
new file mode 100644
index 0000000..06eb6fc
--- /dev/null
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypeTypedef.h
@@ -0,0 +1,42 @@
+//===- NativeTypeTypedef.h - info about typedef ------------------*- C++-*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPETYPEDEF_H
+#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPETYPEDEF_H
+
+#include "llvm/DebugInfo/CodeView/CodeView.h"
+#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
+#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
+#include "llvm/DebugInfo/PDB/Native/NativeSession.h"
+
+namespace llvm {
+namespace pdb {
+
+class NativeTypeTypedef : public NativeRawSymbol {
+public:
+  // Create a pointer record for a non-simple type.
+  NativeTypeTypedef(NativeSession &Session, SymIndexId Id,
+                    codeview::UDTSym Typedef);
+
+  ~NativeTypeTypedef() override;
+
+  void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields,
+            PdbSymbolIdField RecurseIdFields) const override;
+
+  std::string getName() const override;
+  SymIndexId getTypeId() const override;
+
+protected:
+  codeview::UDTSym Record;
+};
+
+} // namespace pdb
+} // namespace llvm
+
+#endif // LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEPOINTER_H
\ No newline at end of file
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypeUDT.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypeUDT.h
new file mode 100644
index 0000000..84821d8
--- /dev/null
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypeUDT.h
@@ -0,0 +1,74 @@
+//===- NativeTypeUDT.h - info about class/struct type ------------*- C++-*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEUDT_H
+#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEUDT_H
+
+#include "llvm/ADT/Optional.h"
+#include "llvm/DebugInfo/CodeView/CodeView.h"
+#include "llvm/DebugInfo/CodeView/TypeRecord.h"
+#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
+#include "llvm/DebugInfo/PDB/Native/NativeSession.h"
+
+namespace llvm {
+namespace pdb {
+
+class NativeTypeUDT : public NativeRawSymbol {
+public:
+  NativeTypeUDT(NativeSession &Session, SymIndexId Id, codeview::TypeIndex TI,
+                codeview::ClassRecord Class);
+
+  NativeTypeUDT(NativeSession &Session, SymIndexId Id, codeview::TypeIndex TI,
+                codeview::UnionRecord Union);
+
+  NativeTypeUDT(NativeSession &Session, SymIndexId Id,
+                NativeTypeUDT &UnmodifiedType,
+                codeview::ModifierRecord Modifier);
+
+  ~NativeTypeUDT() override;
+
+  void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields,
+            PdbSymbolIdField RecurseIdFields) const override;
+
+  std::string getName() const override;
+  SymIndexId getLexicalParentId() const override;
+  SymIndexId getUnmodifiedTypeId() const override;
+  SymIndexId getVirtualTableShapeId() const override;
+  uint64_t getLength() const override;
+  PDB_UdtType getUdtKind() const override;
+  bool hasConstructor() const override;
+  bool isConstType() const override;
+  bool hasAssignmentOperator() const override;
+  bool hasCastOperator() const override;
+  bool hasNestedTypes() const override;
+  bool hasOverloadedOperator() const override;
+  bool isInterfaceUdt() const override;
+  bool isIntrinsic() const override;
+  bool isNested() const override;
+  bool isPacked() const override;
+  bool isRefUdt() const override;
+  bool isScoped() const override;
+  bool isValueUdt() const override;
+  bool isUnalignedType() const override;
+  bool isVolatileType() const override;
+
+protected:
+  codeview::TypeIndex Index;
+
+  Optional<codeview::ClassRecord> Class;
+  Optional<codeview::UnionRecord> Union;
+  NativeTypeUDT *UnmodifiedType = nullptr;
+  codeview::TagRecord *Tag = nullptr;
+  Optional<codeview::ModifierRecord> Modifiers;
+};
+
+} // namespace pdb
+} // namespace llvm
+
+#endif // LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEUDT_H
\ No newline at end of file
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypeVTShape.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypeVTShape.h
new file mode 100644
index 0000000..a996f34
--- /dev/null
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/NativeTypeVTShape.h
@@ -0,0 +1,46 @@
+//===- NativeTypeVTShape.h - info about virtual table shape ------*- C++-*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEVTSHAPE_H
+#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEVTSHAPE_H
+
+#include "llvm/ADT/Optional.h"
+#include "llvm/DebugInfo/CodeView/CodeView.h"
+#include "llvm/DebugInfo/CodeView/TypeRecord.h"
+#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
+#include "llvm/DebugInfo/PDB/Native/NativeSession.h"
+
+namespace llvm {
+namespace pdb {
+
+class NativeTypeVTShape : public NativeRawSymbol {
+public:
+  // Create a pointer record for a non-simple type.
+  NativeTypeVTShape(NativeSession &Session, SymIndexId Id,
+                    codeview::TypeIndex TI, codeview::VFTableShapeRecord SR);
+
+  ~NativeTypeVTShape() override;
+
+  void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields,
+            PdbSymbolIdField RecurseIdFields) const override;
+
+  bool isConstType() const override;
+  bool isVolatileType() const override;
+  bool isUnalignedType() const override;
+  uint32_t getCount() const override;
+
+protected:
+  codeview::TypeIndex TI;
+  codeview::VFTableShapeRecord Record;
+};
+
+} // namespace pdb
+} // namespace llvm
+
+#endif // LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEVTSHAPE_H
\ No newline at end of file
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h
index 7f9c4cf..3745874 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h
@@ -53,7 +53,9 @@
   PDBStringTableBuilder &getStringTableBuilder();
   GSIStreamBuilder &getGsiBuilder();
 
-  Error commit(StringRef Filename);
+  // If HashPDBContentsToGUID is true on the InfoStreamBuilder, Guid is filled
+  // with the computed PDB GUID on return.
+  Error commit(StringRef Filename, codeview::GUID *Guid);
 
   Expected<uint32_t> getNamedStreamIndex(StringRef Name) const;
   Error addNamedStream(StringRef Name, StringRef Data);
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/RawError.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/RawError.h
index 3624a76..97d11b4 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/RawError.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/RawError.h
@@ -31,23 +31,29 @@
   stream_too_long,
   invalid_tpi_hash,
 };
+} // namespace pdb
+} // namespace llvm
+
+namespace std {
+template <>
+struct is_error_code_enum<llvm::pdb::raw_error_code> : std::true_type {};
+} // namespace std
+
+namespace llvm {
+namespace pdb {
+const std::error_category &RawErrCategory();
+
+inline std::error_code make_error_code(raw_error_code E) {
+  return std::error_code(static_cast<int>(E), RawErrCategory());
+}
 
 /// Base class for errors originating when parsing raw PDB files
-class RawError : public ErrorInfo<RawError> {
+class RawError : public ErrorInfo<RawError, StringError> {
 public:
+  using ErrorInfo<RawError, StringError>::ErrorInfo; // inherit constructors
+  RawError(const Twine &S) : ErrorInfo(S, raw_error_code::unspecified) {}
   static char ID;
-  RawError(raw_error_code C);
-  RawError(const std::string &Context);
-  RawError(raw_error_code C, const std::string &Context);
-
-  void log(raw_ostream &OS) const override;
-  const std::string &getErrorMessage() const;
-  std::error_code convertToErrorCode() const override;
-
-private:
-  std::string ErrMsg;
-  raw_error_code Code;
 };
-}
-}
+} // namespace pdb
+} // namespace llvm
 #endif
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/RawTypes.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/RawTypes.h
index 19f592d..8f6d661 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/RawTypes.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/RawTypes.h
@@ -343,7 +343,6 @@
   char Reserved[8];
 };
 
-constexpr int I = sizeof(SrcHeaderBlockEntry);
 static_assert(sizeof(SrcHeaderBlockEntry) == 40, "Incorrect struct size!");
 
 } // namespace pdb
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/SymbolCache.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/SymbolCache.h
new file mode 100644
index 0000000..08e1d41
--- /dev/null
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/SymbolCache.h
@@ -0,0 +1,148 @@
+//==- SymbolCache.h - Cache of native symbols and ids ------------*- C++ -*-==//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_PDB_NATIVE_SYMBOLCACHE_H
+#define LLVM_DEBUGINFO_PDB_NATIVE_SYMBOLCACHE_H
+
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/DebugInfo/CodeView/TypeDeserializer.h"
+#include "llvm/DebugInfo/CodeView/TypeIndex.h"
+#include "llvm/DebugInfo/CodeView/TypeRecord.h"
+#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
+#include "llvm/Support/Allocator.h"
+
+#include <memory>
+#include <vector>
+
+namespace llvm {
+namespace pdb {
+class DbiStream;
+class PDBFile;
+
+class SymbolCache {
+  NativeSession &Session;
+  DbiStream *Dbi = nullptr;
+
+  /// Cache of all stable symbols, indexed by SymIndexId.  Just because a
+  /// symbol has been parsed does not imply that it will be stable and have
+  /// an Id.  Id allocation is an implementation, with the only guarantee
+  /// being that once an Id is allocated, the symbol can be assumed to be
+  /// cached.
+  std::vector<std::unique_ptr<NativeRawSymbol>> Cache;
+
+  /// For type records from the TPI stream which have been paresd and cached,
+  /// stores a mapping to SymIndexId of the cached symbol.
+  DenseMap<codeview::TypeIndex, SymIndexId> TypeIndexToSymbolId;
+
+  /// For field list members which have been parsed and cached, stores a mapping
+  /// from (IndexOfClass, MemberIndex) to the corresponding SymIndexId of the
+  /// cached symbol.
+  DenseMap<std::pair<codeview::TypeIndex, uint32_t>, SymIndexId>
+      FieldListMembersToSymbolId;
+
+  /// List of SymIndexIds for each compiland, indexed by compiland index as they
+  /// appear in the PDB file.
+  std::vector<SymIndexId> Compilands;
+
+  /// Map from global symbol offset to SymIndexId.
+  DenseMap<uint32_t, SymIndexId> GlobalOffsetToSymbolId;
+
+  SymIndexId createSymbolPlaceholder() {
+    SymIndexId Id = Cache.size();
+    Cache.push_back(nullptr);
+    return Id;
+  }
+
+  template <typename ConcreteSymbolT, typename CVRecordT, typename... Args>
+  SymIndexId createSymbolForType(codeview::TypeIndex TI, codeview::CVType CVT,
+                                 Args &&... ConstructorArgs) {
+    CVRecordT Record;
+    if (auto EC =
+            codeview::TypeDeserializer::deserializeAs<CVRecordT>(CVT, Record)) {
+      consumeError(std::move(EC));
+      return 0;
+    }
+
+    return createSymbol<ConcreteSymbolT>(
+        TI, std::move(Record), std::forward<Args>(ConstructorArgs)...);
+  }
+
+  SymIndexId createSymbolForModifiedType(codeview::TypeIndex ModifierTI,
+                                         codeview::CVType CVT);
+
+  SymIndexId createSimpleType(codeview::TypeIndex TI,
+                              codeview::ModifierOptions Mods);
+
+public:
+  SymbolCache(NativeSession &Session, DbiStream *Dbi);
+
+  template <typename ConcreteSymbolT, typename... Args>
+  SymIndexId createSymbol(Args &&... ConstructorArgs) {
+    SymIndexId Id = Cache.size();
+
+    // Initial construction must not access the cache, since it must be done
+    // atomically.
+    auto Result = llvm::make_unique<ConcreteSymbolT>(
+        Session, Id, std::forward<Args>(ConstructorArgs)...);
+    Result->SymbolId = Id;
+
+    NativeRawSymbol *NRS = static_cast<NativeRawSymbol *>(Result.get());
+    Cache.push_back(std::move(Result));
+
+    // After the item is in the cache, we can do further initialization which
+    // is then allowed to access the cache.
+    NRS->initialize();
+    return Id;
+  }
+
+  std::unique_ptr<IPDBEnumSymbols>
+  createTypeEnumerator(codeview::TypeLeafKind Kind);
+
+  std::unique_ptr<IPDBEnumSymbols>
+  createTypeEnumerator(std::vector<codeview::TypeLeafKind> Kinds);
+
+  std::unique_ptr<IPDBEnumSymbols>
+  createGlobalsEnumerator(codeview::SymbolKind Kind);
+
+  SymIndexId findSymbolByTypeIndex(codeview::TypeIndex TI);
+
+  template <typename ConcreteSymbolT, typename... Args>
+  SymIndexId getOrCreateFieldListMember(codeview::TypeIndex FieldListTI,
+                                        uint32_t Index,
+                                        Args &&... ConstructorArgs) {
+    SymIndexId SymId = Cache.size();
+    std::pair<codeview::TypeIndex, uint32_t> Key{FieldListTI, Index};
+    auto Result = FieldListMembersToSymbolId.try_emplace(Key, SymId);
+    if (Result.second)
+      SymId =
+          createSymbol<ConcreteSymbolT>(std::forward<Args>(ConstructorArgs)...);
+    else
+      SymId = Result.first->second;
+    return SymId;
+  }
+
+  SymIndexId getOrCreateGlobalSymbolByOffset(uint32_t Offset);
+
+  std::unique_ptr<PDBSymbolCompiland> getOrCreateCompiland(uint32_t Index);
+  uint32_t getNumCompilands() const;
+
+  std::unique_ptr<PDBSymbol> getSymbolById(SymIndexId SymbolId) const;
+
+  NativeRawSymbol &getNativeSymbolById(SymIndexId SymbolId) const;
+
+  template <typename ConcreteT>
+  ConcreteT &getNativeSymbolById(SymIndexId SymbolId) const {
+    return static_cast<ConcreteT &>(getNativeSymbolById(SymbolId));
+  }
+};
+
+} // namespace pdb
+} // namespace llvm
+
+#endif
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/TpiHashing.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/TpiHashing.h
index c1edec7..c2996cc 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/TpiHashing.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/TpiHashing.h
@@ -18,6 +18,54 @@
 
 Expected<uint32_t> hashTypeRecord(const llvm::codeview::CVType &Type);
 
+struct TagRecordHash {
+  explicit TagRecordHash(codeview::ClassRecord CR, uint32_t Full,
+                         uint32_t Forward)
+      : FullRecordHash(Full), ForwardDeclHash(Forward), Class(std::move(CR)) {
+    State = 0;
+  }
+
+  explicit TagRecordHash(codeview::EnumRecord ER, uint32_t Full,
+                         uint32_t Forward)
+      : FullRecordHash(Full), ForwardDeclHash(Forward), Enum(std::move(ER)) {
+    State = 1;
+  }
+
+  explicit TagRecordHash(codeview::UnionRecord UR, uint32_t Full,
+                         uint32_t Forward)
+      : FullRecordHash(Full), ForwardDeclHash(Forward), Union(std::move(UR)) {
+    State = 2;
+  }
+
+  uint32_t FullRecordHash;
+  uint32_t ForwardDeclHash;
+
+  codeview::TagRecord &getRecord() {
+    switch (State) {
+    case 0:
+      return Class;
+    case 1:
+      return Enum;
+    case 2:
+      return Union;
+    }
+    llvm_unreachable("unreachable!");
+  }
+
+private:
+  union {
+    codeview::ClassRecord Class;
+    codeview::EnumRecord Enum;
+    codeview::UnionRecord Union;
+  };
+
+  uint8_t State = 0;
+};
+
+/// Given a CVType referring to a class, structure, union, or enum, compute
+/// the hash of its forward decl and full decl.
+Expected<TagRecordHash> hashTagRecord(const codeview::CVType &Type);
+
 } // end namespace pdb
 } // end namespace llvm
 
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/TpiStream.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/TpiStream.h
index b779399..00cc720 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/TpiStream.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/Native/TpiStream.h
@@ -58,10 +58,17 @@
 
   codeview::LazyRandomTypeCollection &typeCollection() { return *Types; }
 
+  Expected<codeview::TypeIndex>
+  findFullDeclForForwardRef(codeview::TypeIndex ForwardRefTI) const;
+
   BinarySubstreamRef getTypeRecordsSubstream() const;
 
   Error commit();
 
+  void buildHashMap();
+
+  bool supportsTypeLookup() const;
+
 private:
   PDBFile &Pdb;
   std::unique_ptr<msf::MappedBlockStream> Stream;
@@ -77,6 +84,8 @@
   FixedStreamArray<codeview::TypeIndexOffset> TypeIndexOffsets;
   HashTable<support::ulittle32_t> HashAdjusters;
 
+  std::vector<std::vector<codeview::TypeIndex>> HashMap;
+
   const TpiStreamHeader *Header;
 };
 }
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBExtras.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBExtras.h
index 3c9a198..aaec71a 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBExtras.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBExtras.h
@@ -12,6 +12,8 @@
 
 #include "llvm/DebugInfo/CodeView/CodeView.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
+#include "llvm/Support/raw_ostream.h"
+
 #include <unordered_map>
 
 namespace llvm {
@@ -24,6 +26,7 @@
 
 raw_ostream &operator<<(raw_ostream &OS, const PDB_VariantType &Value);
 raw_ostream &operator<<(raw_ostream &OS, const PDB_CallingConv &Conv);
+raw_ostream &operator<<(raw_ostream &OS, const PDB_BuiltinType &Type);
 raw_ostream &operator<<(raw_ostream &OS, const PDB_DataKind &Data);
 raw_ostream &operator<<(raw_ostream &OS, const codeview::RegisterId &Reg);
 raw_ostream &operator<<(raw_ostream &OS, const PDB_LocType &Loc);
@@ -41,6 +44,15 @@
 raw_ostream &operator<<(raw_ostream &OS, const VersionInfo &Version);
 raw_ostream &operator<<(raw_ostream &OS, const TagStats &Stats);
 
+
+template <typename T>
+void dumpSymbolField(raw_ostream &OS, StringRef Name, T Value, int Indent) {
+  OS << "\n";
+  OS.indent(Indent);
+  OS << Name << ": " << Value;
+}
+
+
 } // end namespace pdb
 
 } // end namespace llvm
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbol.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbol.h
index 0437346..3a74f7c 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbol.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbol.h
@@ -49,9 +49,22 @@
 class IPDBSession;
 
 #define DECLARE_PDB_SYMBOL_CONCRETE_TYPE(TagValue)                             \
+private:                                                                       \
+  using PDBSymbol::PDBSymbol;                                                  \
+  friend class PDBSymbol;                                                      \
+                                                                               \
+public:                                                                        \
   static const PDB_SymType Tag = TagValue;                                     \
   static bool classof(const PDBSymbol *S) { return S->getSymTag() == Tag; }
 
+#define DECLARE_PDB_SYMBOL_CUSTOM_TYPE(Condition)                              \
+private:                                                                       \
+  using PDBSymbol::PDBSymbol;                                                  \
+  friend class PDBSymbol;                                                      \
+                                                                               \
+public:                                                                        \
+  static bool classof(const PDBSymbol *S) { return Condition; }
+
 /// PDBSymbol defines the base of the inheritance hierarchy for concrete symbol
 /// types (e.g. functions, executables, vtables, etc).  All concrete symbol
 /// types inherit from PDBSymbol and expose the exact set of methods that are
@@ -59,14 +72,33 @@
 /// reference "Lexical and Class Hierarchy of Symbol Types":
 /// https://msdn.microsoft.com/en-us/library/370hs6k4.aspx
 class PDBSymbol {
+  static std::unique_ptr<PDBSymbol> createSymbol(const IPDBSession &PDBSession,
+                                                 PDB_SymType Tag);
+
 protected:
-  PDBSymbol(const IPDBSession &PDBSession,
-            std::unique_ptr<IPDBRawSymbol> Symbol);
-  PDBSymbol(PDBSymbol &Symbol);
+  explicit PDBSymbol(const IPDBSession &PDBSession);
+  PDBSymbol(PDBSymbol &&Other);
 
 public:
   static std::unique_ptr<PDBSymbol>
-  create(const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol);
+  create(const IPDBSession &PDBSession,
+         std::unique_ptr<IPDBRawSymbol> RawSymbol);
+  static std::unique_ptr<PDBSymbol> create(const IPDBSession &PDBSession,
+                                           IPDBRawSymbol &RawSymbol);
+
+  template <typename ConcreteT>
+  static std::unique_ptr<ConcreteT>
+  createAs(const IPDBSession &PDBSession,
+           std::unique_ptr<IPDBRawSymbol> RawSymbol) {
+    std::unique_ptr<PDBSymbol> S = create(PDBSession, std::move(RawSymbol));
+    return unique_dyn_cast_or_null<ConcreteT>(std::move(S));
+  }
+  template <typename ConcreteT>
+  static std::unique_ptr<ConcreteT> createAs(const IPDBSession &PDBSession,
+                                             IPDBRawSymbol &RawSymbol) {
+    std::unique_ptr<PDBSymbol> S = create(PDBSession, RawSymbol);
+    return unique_dyn_cast_or_null<ConcreteT>(std::move(S));
+  }
 
   virtual ~PDBSymbol();
 
@@ -80,7 +112,8 @@
   /// normally goes on the right side of the symbol.
   virtual void dumpRight(PDBSymDumper &Dumper) const {}
 
-  void defaultDump(raw_ostream &OS, int Indent) const;
+  void defaultDump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowFlags,
+                   PdbSymbolIdField RecurseFlags) const;
   void dumpProperties() const;
   void dumpChildStats() const;
 
@@ -94,8 +127,6 @@
     return Enumerator->getNext();
   }
 
-  std::unique_ptr<PDBSymbol> clone() const;
-
   template <typename T>
   std::unique_ptr<ConcreteSymbolEnumerator<T>> findAllChildren() const {
     auto BaseIter = RawSymbol->findChildren(T::Tag);
@@ -131,7 +162,8 @@
   }
 
   const IPDBSession &Session;
-  std::unique_ptr<IPDBRawSymbol> RawSymbol;
+  std::unique_ptr<IPDBRawSymbol> OwnedRawSymbol;
+  IPDBRawSymbol *RawSymbol = nullptr;
 };
 
 } // namespace llvm
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h
index 3169146..ef00df1 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h
@@ -18,12 +18,9 @@
 namespace pdb {
 
 class PDBSymbolAnnotation : public PDBSymbol {
-public:
-  PDBSymbolAnnotation(const IPDBSession &PDBSession,
-                      std::unique_ptr<IPDBRawSymbol> Symbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Annotation)
 
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_METHOD(getAddressOffset)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h
index d81da1e..2cf9c72 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h
@@ -19,12 +19,8 @@
 namespace pdb {
 
 class PDBSymbolBlock : public PDBSymbol {
-public:
-  PDBSymbolBlock(const IPDBSession &PDBSession,
-                 std::unique_ptr<IPDBRawSymbol> Symbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Block)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_METHOD(getAddressOffset)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h
index 9549089..04dbd96 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h
@@ -20,12 +20,8 @@
 namespace pdb {
 
 class PDBSymbolCompiland : public PDBSymbol {
-public:
-  PDBSymbolCompiland(const IPDBSession &PDBSession,
-                     std::unique_ptr<IPDBRawSymbol> CompilandSymbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Compiland)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_METHOD(isEditAndContinueEnabled)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h
index dba50c4..3d651a4 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h
@@ -19,12 +19,8 @@
 namespace pdb {
 
 class PDBSymbolCompilandDetails : public PDBSymbol {
-public:
-  PDBSymbolCompilandDetails(const IPDBSession &PDBSession,
-                            std::unique_ptr<IPDBRawSymbol> Symbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::CompilandDetails)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   void getFrontEndVersion(VersionInfo &Version) const {
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h
index 7868f04..ffc4083 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h
@@ -18,12 +18,8 @@
 class raw_ostream;
 namespace pdb {
 class PDBSymbolCompilandEnv : public PDBSymbol {
-public:
-  PDBSymbolCompilandEnv(const IPDBSession &PDBSession,
-                        std::unique_ptr<IPDBRawSymbol> Symbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::CompilandEnv)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h
index 54f0894..c29e4c3 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h
@@ -23,12 +23,8 @@
 /// fit anywhere else in the lexical hierarchy.
 /// https://msdn.microsoft.com/en-us/library/d88sf09h.aspx
 class PDBSymbolCustom : public PDBSymbol {
-public:
-  PDBSymbolCustom(const IPDBSession &PDBSession,
-                  std::unique_ptr<IPDBRawSymbol> CustomSymbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Custom)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   void getDataBytes(llvm::SmallVector<uint8_t, 32> &bytes);
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolData.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolData.h
index 76b14bf..217e1e9 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolData.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolData.h
@@ -21,12 +21,8 @@
 namespace pdb {
 
 class PDBSymbolData : public PDBSymbol {
-public:
-  PDBSymbolData(const IPDBSession &PDBSession,
-                std::unique_ptr<IPDBRawSymbol> DataSymbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Data)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_METHOD(getAccess)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolExe.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolExe.h
index 2c2d746..366d0cf 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolExe.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolExe.h
@@ -20,12 +20,8 @@
 namespace pdb {
 
 class PDBSymbolExe : public PDBSymbol {
-public:
-  PDBSymbolExe(const IPDBSession &PDBSession,
-               std::unique_ptr<IPDBRawSymbol> ExeSymbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Exe)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_METHOD(getAge)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h
index 05d585d..129e557 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h
@@ -22,18 +22,14 @@
 namespace pdb {
 
 class PDBSymbolFunc : public PDBSymbol {
+  DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Function)
 public:
-  PDBSymbolFunc(const IPDBSession &PDBSession,
-                std::unique_ptr<IPDBRawSymbol> FuncSymbol);
-
   void dump(PDBSymDumper &Dumper) const override;
 
   bool isDestructor() const;
 
   std::unique_ptr<IPDBEnumChildren<PDBSymbolData>> getArguments() const;
 
-  DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Function)
-
   FORWARD_SYMBOL_METHOD(getAccess)
   FORWARD_SYMBOL_METHOD(getAddressOffset)
   FORWARD_SYMBOL_METHOD(getAddressSection)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h
index 3341bd9..18db8a5 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h
@@ -20,12 +20,8 @@
 namespace pdb {
 
 class PDBSymbolFuncDebugEnd : public PDBSymbol {
-public:
-  PDBSymbolFuncDebugEnd(const IPDBSession &PDBSession,
-                        std::unique_ptr<IPDBRawSymbol> FuncDebugEndSymbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::FuncDebugEnd)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_METHOD(getAddressOffset)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h
index 6729838..83d82f0 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h
@@ -19,12 +19,8 @@
 namespace pdb {
 
 class PDBSymbolFuncDebugStart : public PDBSymbol {
-public:
-  PDBSymbolFuncDebugStart(const IPDBSession &PDBSession,
-                          std::unique_ptr<IPDBRawSymbol> FuncDebugStartSymbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::FuncDebugStart)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_METHOD(getAddressOffset)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h
index c2b1c28..8b2617f 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h
@@ -19,12 +19,8 @@
 namespace pdb {
 
 class PDBSymbolLabel : public PDBSymbol {
-public:
-  PDBSymbolLabel(const IPDBSession &PDBSession,
-                 std::unique_ptr<IPDBRawSymbol> LabelSymbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Label)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_METHOD(getAddressOffset)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h
index c9e6ee6..9def3ed 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h
@@ -19,12 +19,8 @@
 namespace pdb {
 
 class PDBSymbolPublicSymbol : public PDBSymbol {
-public:
-  PDBSymbolPublicSymbol(const IPDBSession &PDBSession,
-                        std::unique_ptr<IPDBRawSymbol> PublicSymbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::PublicSymbol)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_METHOD(getAddressOffset)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h
index 614fad8..7bb0555 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h
@@ -19,12 +19,8 @@
 namespace pdb {
 
 class PDBSymbolThunk : public PDBSymbol {
-public:
-  PDBSymbolThunk(const IPDBSession &PDBSession,
-                 std::unique_ptr<IPDBRawSymbol> ThunkSymbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Thunk)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_METHOD(getAccess)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h
index 39b7d3b..488f668 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h
@@ -19,12 +19,8 @@
 namespace pdb {
 
 class PDBSymbolTypeArray : public PDBSymbol {
-public:
-  PDBSymbolTypeArray(const IPDBSession &PDBSession,
-                     std::unique_ptr<IPDBRawSymbol> ArrayTypeSymbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::ArrayType)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
   void dumpRight(PDBSymDumper &Dumper) const override;
 
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h
index d607a3d..550deed 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h
@@ -22,12 +22,8 @@
 namespace pdb {
 
 class PDBSymbolTypeBaseClass : public PDBSymbol {
-public:
-  PDBSymbolTypeBaseClass(const IPDBSession &PDBSession,
-                         std::unique_ptr<IPDBRawSymbol> Symbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::BaseClass)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_METHOD(getAccess)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h
index 5b1863c..e07e888 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h
@@ -19,12 +19,8 @@
 namespace pdb {
 
 class PDBSymbolTypeBuiltin : public PDBSymbol {
-public:
-  PDBSymbolTypeBuiltin(const IPDBSession &PDBSession,
-                       std::unique_ptr<IPDBRawSymbol> Symbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::BuiltinType)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_METHOD(getBuiltinType)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h
index 199b3f8..0d8979c 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h
@@ -19,12 +19,8 @@
 namespace pdb {
 
 class PDBSymbolTypeCustom : public PDBSymbol {
-public:
-  PDBSymbolTypeCustom(const IPDBSession &PDBSession,
-                      std::unique_ptr<IPDBRawSymbol> Symbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::CustomType)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_METHOD(getOemId)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h
index e635eb5..58292a6 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h
@@ -19,12 +19,8 @@
 namespace pdb {
 
 class PDBSymbolTypeDimension : public PDBSymbol {
-public:
-  PDBSymbolTypeDimension(const IPDBSession &PDBSession,
-                         std::unique_ptr<IPDBRawSymbol> Symbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Dimension)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_METHOD(getLowerBoundId)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h
index ddbe7e5..f463047 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h
@@ -21,12 +21,8 @@
 namespace pdb {
 
 class PDBSymbolTypeEnum : public PDBSymbol {
-public:
-  PDBSymbolTypeEnum(const IPDBSession &PDBSession,
-                    std::unique_ptr<IPDBRawSymbol> EnumTypeSymbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Enum)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_METHOD(getBuiltinType)
@@ -38,6 +34,7 @@
   FORWARD_SYMBOL_METHOD(hasNestedTypes)
   FORWARD_SYMBOL_METHOD(getLength)
   FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
+  FORWARD_SYMBOL_ID_METHOD(getUnmodifiedType)
   FORWARD_SYMBOL_METHOD(getName)
   FORWARD_SYMBOL_METHOD(getSrcLineOnTypeDefn)
   FORWARD_SYMBOL_METHOD(isNested)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h
index 24c1312..5b940b0 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h
@@ -19,12 +19,8 @@
 namespace pdb {
 
 class PDBSymbolTypeFriend : public PDBSymbol {
-public:
-  PDBSymbolTypeFriend(const IPDBSession &PDBSession,
-                      std::unique_ptr<IPDBRawSymbol> Symbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Friend)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_ID_METHOD(getClassParent)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h
index 3855999..074cb41 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h
@@ -19,12 +19,8 @@
 namespace pdb {
 
 class PDBSymbolTypeFunctionArg : public PDBSymbol {
-public:
-  PDBSymbolTypeFunctionArg(const IPDBSession &PDBSession,
-                           std::unique_ptr<IPDBRawSymbol> Symbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::FunctionArg)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_ID_METHOD(getClassParent)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h
index abd4cf5..dfdf436 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h
@@ -19,12 +19,8 @@
 namespace pdb {
 
 class PDBSymbolTypeFunctionSig : public PDBSymbol {
-public:
-  PDBSymbolTypeFunctionSig(const IPDBSession &PDBSession,
-                           std::unique_ptr<IPDBRawSymbol> Symbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::FunctionSig)
-
+public:
   std::unique_ptr<IPDBEnumSymbols> getArguments() const;
 
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h
index 31cf536..d716abd 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h
@@ -19,12 +19,8 @@
 namespace pdb {
 
 class PDBSymbolTypeManaged : public PDBSymbol {
-public:
-  PDBSymbolTypeManaged(const IPDBSession &PDBSession,
-                       std::unique_ptr<IPDBRawSymbol> Symbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::ManagedType)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_METHOD(getName)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h
index 7612eba..300d672 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h
@@ -19,16 +19,13 @@
 namespace pdb {
 
 class PDBSymbolTypePointer : public PDBSymbol {
-public:
-  PDBSymbolTypePointer(const IPDBSession &PDBSession,
-                       std::unique_ptr<IPDBRawSymbol> Symbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::PointerType)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
   void dumpRight(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_METHOD(isConstType)
+  FORWARD_SYMBOL_ID_METHOD(getClassParent)
   FORWARD_SYMBOL_METHOD(getLength)
   FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
   FORWARD_SYMBOL_METHOD(isReference)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h
index 16c1d1b..d6e2a36 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h
@@ -19,12 +19,8 @@
 namespace pdb {
 
 class PDBSymbolTypeTypedef : public PDBSymbol {
-public:
-  PDBSymbolTypeTypedef(const IPDBSession &PDBSession,
-                       std::unique_ptr<IPDBRawSymbol> Symbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Typedef)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_METHOD(getBuiltinType)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h
index e259b6d..937dd6c 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h
@@ -23,17 +23,8 @@
 namespace pdb {
 
 class PDBSymbolTypeUDT : public PDBSymbol {
-public:
-  PDBSymbolTypeUDT(const IPDBSession &PDBSession,
-                   std::unique_ptr<IPDBRawSymbol> UDTSymbol);
-
-  std::unique_ptr<PDBSymbolTypeUDT> clone() const {
-    return getSession().getConcreteSymbolById<PDBSymbolTypeUDT>(
-        getSymIndexId());
-  }
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::UDT)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_ID_METHOD(getClassParent)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h
index e270c2b..6efce4b 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h
@@ -19,12 +19,8 @@
 namespace pdb {
 
 class PDBSymbolTypeVTable : public PDBSymbol {
-public:
-  PDBSymbolTypeVTable(const IPDBSession &PDBSession,
-                      std::unique_ptr<IPDBRawSymbol> VtblSymbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::VTable)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_ID_METHOD(getClassParent)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h
index 8acaabe..8949052 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h
@@ -19,12 +19,8 @@
 namespace pdb {
 
 class PDBSymbolTypeVTableShape : public PDBSymbol {
-public:
-  PDBSymbolTypeVTableShape(const IPDBSession &PDBSession,
-                           std::unique_ptr<IPDBRawSymbol> VtblShapeSymbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::VTableShape)
-
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_METHOD(isConstType)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h
index de43e47..e935ac6 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h
@@ -18,16 +18,11 @@
 namespace pdb {
 
 class PDBSymbolUnknown : public PDBSymbol {
+  DECLARE_PDB_SYMBOL_CUSTOM_TYPE(S->getSymTag() == PDB_SymType::None ||
+                                 S->getSymTag() >= PDB_SymType::Max)
+
 public:
-  PDBSymbolUnknown(const IPDBSession &PDBSession,
-                   std::unique_ptr<IPDBRawSymbol> UnknownSymbol);
-
   void dump(PDBSymDumper &Dumper) const override;
-
-  static bool classof(const PDBSymbol *S) {
-    return (S->getSymTag() == PDB_SymType::None ||
-            S->getSymTag() >= PDB_SymType::Max);
-  }
 };
 
 } // namespace llvm
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h
index 70fbd5b..4e8c99f 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h
@@ -19,12 +19,9 @@
 namespace pdb {
 
 class PDBSymbolUsingNamespace : public PDBSymbol {
-public:
-  PDBSymbolUsingNamespace(const IPDBSession &PDBSession,
-                          std::unique_ptr<IPDBRawSymbol> Symbol);
-
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::UsingNamespace)
 
+public:
   void dump(PDBSymDumper &Dumper) const override;
 
   FORWARD_SYMBOL_ID_METHOD(getLexicalParent)
diff --git a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBTypes.h b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBTypes.h
index da6cb1d..6247018 100644
--- a/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBTypes.h
+++ b/linux-x64/clang/include/llvm/DebugInfo/PDB/PDBTypes.h
@@ -22,6 +22,8 @@
 namespace llvm {
 namespace pdb {
 
+typedef uint32_t SymIndexId;
+
 class IPDBDataStream;
 class IPDBInjectedSource;
 class IPDBLineNumber;
@@ -208,6 +210,18 @@
   CustomType,
   ManagedType,
   Dimension,
+  CallSite,
+  InlineSite,
+  BaseInterface,
+  VectorType,
+  MatrixType,
+  HLSLType,
+  Caller,
+  Callee,
+  Export,
+  HeapAllocationSite,
+  CoffGroup,
+  Inlinee,
   Max
 };
 
@@ -334,6 +348,36 @@
 struct Variant {
   Variant() = default;
 
+  explicit Variant(bool V) : Type(PDB_VariantType::Bool) { Value.Bool = V; }
+  explicit Variant(int8_t V) : Type(PDB_VariantType::Int8) { Value.Int8 = V; }
+  explicit Variant(int16_t V) : Type(PDB_VariantType::Int16) {
+    Value.Int16 = V;
+  }
+  explicit Variant(int32_t V) : Type(PDB_VariantType::Int32) {
+    Value.Int32 = V;
+  }
+  explicit Variant(int64_t V) : Type(PDB_VariantType::Int64) {
+    Value.Int64 = V;
+  }
+  explicit Variant(float V) : Type(PDB_VariantType::Single) {
+    Value.Single = V;
+  }
+  explicit Variant(double V) : Type(PDB_VariantType::Double) {
+    Value.Double = V;
+  }
+  explicit Variant(uint8_t V) : Type(PDB_VariantType::UInt8) {
+    Value.UInt8 = V;
+  }
+  explicit Variant(uint16_t V) : Type(PDB_VariantType::UInt16) {
+    Value.UInt16 = V;
+  }
+  explicit Variant(uint32_t V) : Type(PDB_VariantType::UInt32) {
+    Value.UInt32 = V;
+  }
+  explicit Variant(uint64_t V) : Type(PDB_VariantType::UInt64) {
+    Value.UInt64 = V;
+  }
+
   Variant(const Variant &Other) {
     *this = Other;
   }