LLVM  3.7.0
Options.cpp
Go to the documentation of this file.
1 //===- llvm/Support/Options.cpp - Debug options support ---------*- C++ -*-===//
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 helper objects for defining debug options using the
11 // new API built on cl::opt, but not requiring the use of static globals.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #include "llvm/Support/Options.h"
17 
18 using namespace llvm;
19 
21  for (auto IT = Options.begin(); IT != Options.end(); ++IT)
22  delete IT->second;
23 }
24 
25 void OptionRegistry::addOption(void *Key, cl::Option *O) {
26  assert(Options.find(Key) == Options.end() &&
27  "Argument with this key already registerd");
28  Options.insert(std::make_pair(Key, O));
29 }
30 
32 
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
Definition: DenseMap.h:169
static cl::opt< ITMode > IT(cl::desc("IT block support"), cl::Hidden, cl::init(DefaultIT), cl::ZeroOrMore, cl::values(clEnumValN(DefaultIT,"arm-default-it","Generate IT block based on arch"), clEnumValN(RestrictedIT,"arm-restrict-it","Disallow deprecated IT based on ARMv8"), clEnumValN(NoRestrictedIT,"arm-no-restrict-it","Allow IT blocks based on ARMv7"), clEnumValEnd))
static OptionRegistry & instance()
Returns a reference to the singleton instance.
Definition: Options.cpp:33
static ManagedStatic< OptionRegistry > OR
Definition: Options.cpp:31
Singleton class used to register debug options.
Definition: Options.h:65
This file declares helper objects for defining debug options that can be configured via the command l...
iterator begin()
Definition: DenseMap.h:64
iterator end()
Definition: DenseMap.h:68
iterator find(const KeyT &Val)
Definition: DenseMap.h:124
ManagedStatic - This transparently changes the behavior of global statics to be lazily constructed on...
Definition: ManagedStatic.h:61