| 1 | //===----------------------------------------------------------------------===// |
|---|---|
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #include "InstrumentationOptions.h" |
| 10 | #include "llvm/IR/Function.h" |
| 11 | #include "llvm/IR/LLVMContext.h" |
| 12 | #include "llvm/IR/Module.h" |
| 13 | #include "llvm/Option/LibraryOptions.h" |
| 14 | |
| 15 | #define OPTIONS_STRUCT_DEFS |
| 16 | #include "InstrumentationOptions.inc" |
| 17 | |
| 18 | using namespace llvm; |
| 19 | |
| 20 | LLVM_REGISTER_LIBRARY_OPTIONS(llvm::InstrumentationOptions) |
| 21 | |
| 22 | const InstrumentationOptions & |
| 23 | llvm::getInstrumentationOptions(const LLVMContext &C) { |
| 24 | return C.getLibraryOptions().get<InstrumentationOptions>(); |
| 25 | } |
| 26 | |
| 27 | const InstrumentationOptions &llvm::getInstrumentationOptions(const Module &M) { |
| 28 | return getInstrumentationOptions(C: M.getContext()); |
| 29 | } |
| 30 | |
| 31 | const InstrumentationOptions & |
| 32 | llvm::getInstrumentationOptions(const Function &F) { |
| 33 | return getInstrumentationOptions(C: F.getContext()); |
| 34 | } |
| 35 |