[llvm-rc] Implement the BITMAP resource type

Differential Revision: https://reviews.llvm.org/D46509

llvm-svn: 331670
diff --git a/llvm/tools/llvm-rc/ResourceScriptStmt.h b/llvm/tools/llvm-rc/ResourceScriptStmt.h
index e44120b..485b7ca 100644
--- a/llvm/tools/llvm-rc/ResourceScriptStmt.h
+++ b/llvm/tools/llvm-rc/ResourceScriptStmt.h
@@ -121,6 +121,7 @@
   // kind is equal to this type ID.
   RkNull = 0,
   RkSingleCursor = 1,
+  RkBitmap = 2,
   RkSingleIcon = 3,
   RkMenu = 4,
   RkDialog = 5,
@@ -305,6 +306,29 @@
   }
 };
 
+// BITMAP resource. Represents a bitmap (".bmp") file.
+//
+// Ref: msdn.microsoft.com/en-us/library/windows/desktop/aa380680(v=vs.85).aspx
+class BitmapResource : public RCResource {
+public:
+  StringRef BitmapLoc;
+
+  BitmapResource(StringRef Location) : BitmapLoc(Location) {}
+  raw_ostream &log(raw_ostream &) const override;
+
+  IntOrString getResourceType() const override { return RkBitmap; }
+  uint16_t getMemoryFlags() const override { return MfPure | MfMoveable; }
+
+  Twine getResourceTypeName() const override { return "BITMAP"; }
+  Error visit(Visitor *V) const override {
+    return V->visitBitmapResource(this);
+  }
+  ResourceKind getKind() const override { return RkBitmap; }
+  static bool classof(const RCResource *Res) {
+    return Res->getKind() == RkBitmap;
+  }
+};
+
 // CURSOR resource. Represents a single cursor (".cur") file.
 //
 // Ref: msdn.microsoft.com/en-us/library/windows/desktop/aa380920(v=vs.85).aspx