Comdat.cpp 815 B

12345678910111213141516171819202122232425
  1. //===-- Comdat.cpp - Implement Metadata classes --------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. //
  10. // This file implements the Comdat class.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #include "llvm/IR/Comdat.h"
  14. #include "llvm/ADT/StringMap.h"
  15. using namespace llvm;
  16. Comdat::Comdat(SelectionKind SK, StringMapEntry<Comdat> *Name)
  17. : Name(Name), SK(SK) {}
  18. Comdat::Comdat(Comdat &&C) : Name(C.Name), SK(C.SK) {}
  19. Comdat::Comdat() : Name(nullptr), SK(Comdat::Any) {}
  20. StringRef Comdat::getName() const { return Name->first(); }