1f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot//===- OptSpecifier.h - Option Specifiers -----------------------*- C++ -*-===// 2f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot// 3f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot// The LLVM Compiler Infrastructure 4f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot// 5f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot// This file is distributed under the University of Illinois Open Source 6f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot// License. See LICENSE.TXT for details. 7f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot// 8f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot//===----------------------------------------------------------------------===// 9f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot 10f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot#ifndef LLVM_OPTION_OPTSPECIFIER_H 11f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot#define LLVM_OPTION_OPTSPECIFIER_H 12f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot 13f3014761c955345d6e05491608e73228d014afbandroid-build-team Robotnamespace llvm { 14f3014761c955345d6e05491608e73228d014afbandroid-build-team Robotnamespace opt { 15f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot 16f3014761c955345d6e05491608e73228d014afbandroid-build-team Robotclass Option; 17f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot 18f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot/// OptSpecifier - Wrapper class for abstracting references to option IDs. 19f3014761c955345d6e05491608e73228d014afbandroid-build-team Robotclass OptSpecifier { 20f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot unsigned ID = 0; 21f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot 22f3014761c955345d6e05491608e73228d014afbandroid-build-team Robotpublic: 23f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot OptSpecifier() = default; 24f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot explicit OptSpecifier(bool) = delete; 25f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot /*implicit*/ OptSpecifier(unsigned ID) : ID(ID) {} 26f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot /*implicit*/ OptSpecifier(const Option *Opt); 27f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot 28f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot bool isValid() const { return ID != 0; } 29f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot 30f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot unsigned getID() const { return ID; } 31f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot 32f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot bool operator==(OptSpecifier Opt) const { return ID == Opt.getID(); } 33f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot bool operator!=(OptSpecifier Opt) const { return !(*this == Opt); } 34f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot}; 35f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot 36f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot} // end namespace opt 37f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot} // end namespace llvm 38f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot 39f3014761c955345d6e05491608e73228d014afbandroid-build-team Robot#endif // LLVM_OPTION_OPTSPECIFIER_H 40