Nick Lewycky | fca2acb | 2012-12-26 22:00:49 +0000 | [diff] [blame] | 1 | //===-- LLVMContext.cpp - Implement LLVMContext ---------------------------===// |
Owen Anderson | 8e66e0b | 2009-06-30 00:48:55 +0000 | [diff] [blame] | 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 | //===----------------------------------------------------------------------===// |
Owen Anderson | 36f62e5 | 2009-06-30 17:06:46 +0000 | [diff] [blame] | 9 | // |
| 10 | // This file implements LLVMContext, as a wrapper around the opaque |
Benjamin Kramer | 78c3bcb | 2009-08-11 17:45:13 +0000 | [diff] [blame] | 11 | // class LLVMContextImpl. |
Owen Anderson | 36f62e5 | 2009-06-30 17:06:46 +0000 | [diff] [blame] | 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
Owen Anderson | 8e66e0b | 2009-06-30 00:48:55 +0000 | [diff] [blame] | 14 | |
Chandler Carruth | 9fb823b | 2013-01-02 11:36:10 +0000 | [diff] [blame] | 15 | #include "llvm/IR/LLVMContext.h" |
Eugene Zelenko | 5354a8a | 2016-04-28 18:04:41 +0000 | [diff] [blame] | 16 | #include "llvm/ADT/SmallVector.h" |
| 17 | #include "llvm/ADT/StringMap.h" |
| 18 | #include "llvm/ADT/StringRef.h" |
| 19 | #include "llvm/ADT/Twine.h" |
Chandler Carruth | ed0881b | 2012-12-03 16:50:05 +0000 | [diff] [blame] | 20 | #include "LLVMContextImpl.h" |
Quentin Colombet | b4c44d2 | 2013-12-17 17:47:22 +0000 | [diff] [blame] | 21 | #include "llvm/IR/DiagnosticInfo.h" |
| 22 | #include "llvm/IR/DiagnosticPrinter.h" |
Chandler Carruth | 9fb823b | 2013-01-02 11:36:10 +0000 | [diff] [blame] | 23 | #include "llvm/IR/Metadata.h" |
Eugene Zelenko | 5354a8a | 2016-04-28 18:04:41 +0000 | [diff] [blame] | 24 | #include "llvm/IR/Module.h" |
| 25 | #include "llvm/Support/Casting.h" |
| 26 | #include "llvm/Support/ErrorHandling.h" |
| 27 | #include "llvm/Support/raw_ostream.h" |
| 28 | #include <cassert> |
| 29 | #include <cstdlib> |
| 30 | #include <string> |
| 31 | #include <utility> |
| 32 | |
Owen Anderson | 8e66e0b | 2009-06-30 00:48:55 +0000 | [diff] [blame] | 33 | using namespace llvm; |
| 34 | |
Chris Lattner | c263b42 | 2010-03-30 23:03:27 +0000 | [diff] [blame] | 35 | LLVMContext::LLVMContext() : pImpl(new LLVMContextImpl(*this)) { |
Dan Gohman | 41f14cf | 2010-09-14 21:25:10 +0000 | [diff] [blame] | 36 | // Create the fixed metadata kinds. This is done in the same order as the |
| 37 | // MD_* enum values so that they correspond. |
Peter Collingbourne | 6f0b4f2 | 2016-12-06 23:53:01 +0000 | [diff] [blame^] | 38 | std::pair<unsigned, StringRef> MDKinds[] = { |
| 39 | {MD_dbg, "dbg"}, |
| 40 | {MD_tbaa, "tbaa"}, |
| 41 | {MD_prof, "prof"}, |
| 42 | {MD_fpmath, "fpmath"}, |
| 43 | {MD_range, "range"}, |
| 44 | {MD_tbaa_struct, "tbaa.struct"}, |
| 45 | {MD_invariant_load, "invariant.load"}, |
| 46 | {MD_alias_scope, "alias.scope"}, |
| 47 | {MD_noalias, "noalias"}, |
| 48 | {MD_nontemporal, "nontemporal"}, |
| 49 | {MD_mem_parallel_loop_access, "llvm.mem.parallel_loop_access"}, |
| 50 | {MD_nonnull, "nonnull"}, |
| 51 | {MD_dereferenceable, "dereferenceable"}, |
| 52 | {MD_dereferenceable_or_null, "dereferenceable_or_null"}, |
| 53 | {MD_make_implicit, "make.implicit"}, |
| 54 | {MD_unpredictable, "unpredictable"}, |
| 55 | {MD_invariant_group, "invariant.group"}, |
| 56 | {MD_align, "align"}, |
| 57 | {MD_loop, "llvm.loop"}, |
| 58 | {MD_type, "type"}, |
| 59 | {MD_section_prefix, "section_prefix"}, |
| 60 | }; |
Dan Gohman | 41f14cf | 2010-09-14 21:25:10 +0000 | [diff] [blame] | 61 | |
Peter Collingbourne | 6f0b4f2 | 2016-12-06 23:53:01 +0000 | [diff] [blame^] | 62 | for (auto &MDKind : MDKinds) { |
| 63 | unsigned ID = getMDKindID(MDKind.second); |
| 64 | assert(ID == MDKind.first && "metadata kind id drifted"); |
| 65 | (void)ID; |
| 66 | } |
Dehao Chen | 302b69c | 2016-10-18 20:42:47 +0000 | [diff] [blame] | 67 | |
Sanjoy Das | cdafd84 | 2015-11-11 21:38:02 +0000 | [diff] [blame] | 68 | auto *DeoptEntry = pImpl->getOrInsertBundleTag("deopt"); |
| 69 | assert(DeoptEntry->second == LLVMContext::OB_deopt && |
| 70 | "deopt operand bundle id drifted!"); |
| 71 | (void)DeoptEntry; |
David Majnemer | 3bb88c0 | 2015-12-15 21:27:27 +0000 | [diff] [blame] | 72 | |
| 73 | auto *FuncletEntry = pImpl->getOrInsertBundleTag("funclet"); |
| 74 | assert(FuncletEntry->second == LLVMContext::OB_funclet && |
| 75 | "funclet operand bundle id drifted!"); |
| 76 | (void)FuncletEntry; |
Sanjoy Das | a34ce95 | 2016-01-20 19:50:25 +0000 | [diff] [blame] | 77 | |
| 78 | auto *GCTransitionEntry = pImpl->getOrInsertBundleTag("gc-transition"); |
| 79 | assert(GCTransitionEntry->second == LLVMContext::OB_gc_transition && |
| 80 | "gc-transition operand bundle id drifted!"); |
| 81 | (void)GCTransitionEntry; |
Chris Lattner | c263b42 | 2010-03-30 23:03:27 +0000 | [diff] [blame] | 82 | } |
Eugene Zelenko | 5354a8a | 2016-04-28 18:04:41 +0000 | [diff] [blame] | 83 | |
Owen Anderson | 8e66e0b | 2009-06-30 00:48:55 +0000 | [diff] [blame] | 84 | LLVMContext::~LLVMContext() { delete pImpl; } |
Owen Anderson | afd0c4c | 2009-08-04 22:41:48 +0000 | [diff] [blame] | 85 | |
Owen Anderson | 8e89e41 | 2010-09-08 18:03:32 +0000 | [diff] [blame] | 86 | void LLVMContext::addModule(Module *M) { |
| 87 | pImpl->OwnedModules.insert(M); |
| 88 | } |
| 89 | |
| 90 | void LLVMContext::removeModule(Module *M) { |
| 91 | pImpl->OwnedModules.erase(M); |
| 92 | } |
| 93 | |
Chris Lattner | 1e45789 | 2010-04-07 23:40:44 +0000 | [diff] [blame] | 94 | //===----------------------------------------------------------------------===// |
| 95 | // Recoverable Backend Errors |
| 96 | //===----------------------------------------------------------------------===// |
| 97 | |
Bob Wilson | a594fab | 2013-02-11 05:37:07 +0000 | [diff] [blame] | 98 | void LLVMContext:: |
| 99 | setInlineAsmDiagnosticHandler(InlineAsmDiagHandlerTy DiagHandler, |
| 100 | void *DiagContext) { |
| 101 | pImpl->InlineAsmDiagHandler = DiagHandler; |
| 102 | pImpl->InlineAsmDiagContext = DiagContext; |
Chris Lattner | 60955d4 | 2010-04-06 00:44:45 +0000 | [diff] [blame] | 103 | } |
| 104 | |
Bob Wilson | a594fab | 2013-02-11 05:37:07 +0000 | [diff] [blame] | 105 | /// getInlineAsmDiagnosticHandler - Return the diagnostic handler set by |
| 106 | /// setInlineAsmDiagnosticHandler. |
| 107 | LLVMContext::InlineAsmDiagHandlerTy |
| 108 | LLVMContext::getInlineAsmDiagnosticHandler() const { |
| 109 | return pImpl->InlineAsmDiagHandler; |
Chris Lattner | 60955d4 | 2010-04-06 00:44:45 +0000 | [diff] [blame] | 110 | } |
| 111 | |
Bob Wilson | a594fab | 2013-02-11 05:37:07 +0000 | [diff] [blame] | 112 | /// getInlineAsmDiagnosticContext - Return the diagnostic context set by |
| 113 | /// setInlineAsmDiagnosticHandler. |
| 114 | void *LLVMContext::getInlineAsmDiagnosticContext() const { |
| 115 | return pImpl->InlineAsmDiagContext; |
Chris Lattner | 60955d4 | 2010-04-06 00:44:45 +0000 | [diff] [blame] | 116 | } |
Chris Lattner | a3b94ba | 2010-03-30 20:48:48 +0000 | [diff] [blame] | 117 | |
Quentin Colombet | b4c44d2 | 2013-12-17 17:47:22 +0000 | [diff] [blame] | 118 | void LLVMContext::setDiagnosticHandler(DiagnosticHandlerTy DiagnosticHandler, |
Duncan P. N. Exon Smith | 30c9242 | 2014-10-01 18:36:03 +0000 | [diff] [blame] | 119 | void *DiagnosticContext, |
| 120 | bool RespectFilters) { |
Quentin Colombet | b4c44d2 | 2013-12-17 17:47:22 +0000 | [diff] [blame] | 121 | pImpl->DiagnosticHandler = DiagnosticHandler; |
| 122 | pImpl->DiagnosticContext = DiagnosticContext; |
Duncan P. N. Exon Smith | 30c9242 | 2014-10-01 18:36:03 +0000 | [diff] [blame] | 123 | pImpl->RespectDiagnosticFilters = RespectFilters; |
Quentin Colombet | b4c44d2 | 2013-12-17 17:47:22 +0000 | [diff] [blame] | 124 | } |
| 125 | |
Adam Nemet | aad8160 | 2016-07-15 17:23:20 +0000 | [diff] [blame] | 126 | void LLVMContext::setDiagnosticHotnessRequested(bool Requested) { |
| 127 | pImpl->DiagnosticHotnessRequested = Requested; |
| 128 | } |
| 129 | bool LLVMContext::getDiagnosticHotnessRequested() const { |
| 130 | return pImpl->DiagnosticHotnessRequested; |
| 131 | } |
| 132 | |
Adam Nemet | a62b7e1 | 2016-09-27 20:55:07 +0000 | [diff] [blame] | 133 | yaml::Output *LLVMContext::getDiagnosticsOutputFile() { |
| 134 | return pImpl->DiagnosticsOutputFile.get(); |
| 135 | } |
| 136 | |
Mehdi Amini | 6f40836 | 2016-11-19 18:19:41 +0000 | [diff] [blame] | 137 | void LLVMContext::setDiagnosticsOutputFile(std::unique_ptr<yaml::Output> F) { |
| 138 | pImpl->DiagnosticsOutputFile = std::move(F); |
Adam Nemet | a62b7e1 | 2016-09-27 20:55:07 +0000 | [diff] [blame] | 139 | } |
| 140 | |
Quentin Colombet | b4c44d2 | 2013-12-17 17:47:22 +0000 | [diff] [blame] | 141 | LLVMContext::DiagnosticHandlerTy LLVMContext::getDiagnosticHandler() const { |
| 142 | return pImpl->DiagnosticHandler; |
| 143 | } |
| 144 | |
| 145 | void *LLVMContext::getDiagnosticContext() const { |
| 146 | return pImpl->DiagnosticContext; |
| 147 | } |
| 148 | |
Juergen Ributzka | 34390c7 | 2014-05-16 02:33:15 +0000 | [diff] [blame] | 149 | void LLVMContext::setYieldCallback(YieldCallbackTy Callback, void *OpaqueHandle) |
| 150 | { |
| 151 | pImpl->YieldCallback = Callback; |
| 152 | pImpl->YieldOpaqueHandle = OpaqueHandle; |
| 153 | } |
| 154 | |
| 155 | void LLVMContext::yield() { |
| 156 | if (pImpl->YieldCallback) |
| 157 | pImpl->YieldCallback(this, pImpl->YieldOpaqueHandle); |
| 158 | } |
| 159 | |
Chris Lattner | e22e613 | 2012-01-03 23:47:05 +0000 | [diff] [blame] | 160 | void LLVMContext::emitError(const Twine &ErrorStr) { |
Quentin Colombet | dec8d55 | 2014-02-22 00:34:11 +0000 | [diff] [blame] | 161 | diagnose(DiagnosticInfoInlineAsm(ErrorStr)); |
Chris Lattner | 1e45789 | 2010-04-07 23:40:44 +0000 | [diff] [blame] | 162 | } |
| 163 | |
Bob Wilson | bfb44ef | 2013-02-08 21:48:29 +0000 | [diff] [blame] | 164 | void LLVMContext::emitError(const Instruction *I, const Twine &ErrorStr) { |
Quentin Colombet | dec8d55 | 2014-02-22 00:34:11 +0000 | [diff] [blame] | 165 | assert (I && "Invalid instruction"); |
| 166 | diagnose(DiagnosticInfoInlineAsm(*I, ErrorStr)); |
Chris Lattner | 1e45789 | 2010-04-07 23:40:44 +0000 | [diff] [blame] | 167 | } |
| 168 | |
Duncan P. N. Exon Smith | 30c9242 | 2014-10-01 18:36:03 +0000 | [diff] [blame] | 169 | static bool isDiagnosticEnabled(const DiagnosticInfo &DI) { |
Diego Novillo | 7f8af8b | 2014-05-22 14:19:46 +0000 | [diff] [blame] | 170 | // Optimization remarks are selective. They need to check whether the regexp |
| 171 | // pattern, passed via one of the -pass-remarks* flags, matches the name of |
| 172 | // the pass that is emitting the diagnostic. If there is no match, ignore the |
| 173 | // diagnostic and return. |
Akira Hatanaka | e9148dd | 2016-04-01 00:34:39 +0000 | [diff] [blame] | 174 | if (auto *Remark = dyn_cast<DiagnosticInfoOptimizationBase>(&DI)) |
| 175 | return Remark->isEnabled(); |
| 176 | |
Duncan P. N. Exon Smith | 30c9242 | 2014-10-01 18:36:03 +0000 | [diff] [blame] | 177 | return true; |
| 178 | } |
| 179 | |
Renato Golin | 4b9c0d4 | 2016-05-16 14:28:02 +0000 | [diff] [blame] | 180 | const char * |
| 181 | LLVMContext::getDiagnosticMessagePrefix(DiagnosticSeverity Severity) { |
Alex Lorenz | 735c47e | 2015-06-15 20:30:22 +0000 | [diff] [blame] | 182 | switch (Severity) { |
| 183 | case DS_Error: |
| 184 | return "error"; |
| 185 | case DS_Warning: |
| 186 | return "warning"; |
| 187 | case DS_Remark: |
| 188 | return "remark"; |
| 189 | case DS_Note: |
| 190 | return "note"; |
| 191 | } |
Aaron Ballman | 5220476 | 2015-06-16 13:14:59 +0000 | [diff] [blame] | 192 | llvm_unreachable("Unknown DiagnosticSeverity"); |
Alex Lorenz | 735c47e | 2015-06-15 20:30:22 +0000 | [diff] [blame] | 193 | } |
| 194 | |
Duncan P. N. Exon Smith | 30c9242 | 2014-10-01 18:36:03 +0000 | [diff] [blame] | 195 | void LLVMContext::diagnose(const DiagnosticInfo &DI) { |
| 196 | // If there is a report handler, use it. |
| 197 | if (pImpl->DiagnosticHandler) { |
| 198 | if (!pImpl->RespectDiagnosticFilters || isDiagnosticEnabled(DI)) |
| 199 | pImpl->DiagnosticHandler(DI, pImpl->DiagnosticContext); |
| 200 | return; |
| 201 | } |
| 202 | |
| 203 | if (!isDiagnosticEnabled(DI)) |
| 204 | return; |
Diego Novillo | df65501 | 2014-04-16 16:53:41 +0000 | [diff] [blame] | 205 | |
Quentin Colombet | b4c44d2 | 2013-12-17 17:47:22 +0000 | [diff] [blame] | 206 | // Otherwise, print the message with a prefix based on the severity. |
Alex Lorenz | 735c47e | 2015-06-15 20:30:22 +0000 | [diff] [blame] | 207 | DiagnosticPrinterRawOStream DP(errs()); |
| 208 | errs() << getDiagnosticMessagePrefix(DI.getSeverity()) << ": "; |
Quentin Colombet | b4c44d2 | 2013-12-17 17:47:22 +0000 | [diff] [blame] | 209 | DI.print(DP); |
Alex Lorenz | 735c47e | 2015-06-15 20:30:22 +0000 | [diff] [blame] | 210 | errs() << "\n"; |
| 211 | if (DI.getSeverity() == DS_Error) |
Quentin Colombet | b4c44d2 | 2013-12-17 17:47:22 +0000 | [diff] [blame] | 212 | exit(1); |
Quentin Colombet | b4c44d2 | 2013-12-17 17:47:22 +0000 | [diff] [blame] | 213 | } |
| 214 | |
Chris Lattner | e22e613 | 2012-01-03 23:47:05 +0000 | [diff] [blame] | 215 | void LLVMContext::emitError(unsigned LocCookie, const Twine &ErrorStr) { |
Quentin Colombet | dec8d55 | 2014-02-22 00:34:11 +0000 | [diff] [blame] | 216 | diagnose(DiagnosticInfoInlineAsm(LocCookie, ErrorStr)); |
Chris Lattner | 1e45789 | 2010-04-07 23:40:44 +0000 | [diff] [blame] | 217 | } |
| 218 | |
| 219 | //===----------------------------------------------------------------------===// |
| 220 | // Metadata Kind Uniquing |
| 221 | //===----------------------------------------------------------------------===// |
| 222 | |
Filipe Cabecinhas | 1ac0d2d | 2015-06-02 21:25:00 +0000 | [diff] [blame] | 223 | /// Return a unique non-zero ID for the specified metadata kind. |
Chris Lattner | a3b94ba | 2010-03-30 20:48:48 +0000 | [diff] [blame] | 224 | unsigned LLVMContext::getMDKindID(StringRef Name) const { |
Chris Lattner | a3b94ba | 2010-03-30 20:48:48 +0000 | [diff] [blame] | 225 | // If this is new, assign it its ID. |
Filipe Cabecinhas | 1ac0d2d | 2015-06-02 21:25:00 +0000 | [diff] [blame] | 226 | return pImpl->CustomMDKindNames.insert( |
| 227 | std::make_pair( |
| 228 | Name, pImpl->CustomMDKindNames.size())) |
David Blaikie | 5106ce7 | 2014-11-19 05:49:42 +0000 | [diff] [blame] | 229 | .first->second; |
Chris Lattner | a3b94ba | 2010-03-30 20:48:48 +0000 | [diff] [blame] | 230 | } |
| 231 | |
Sanjay Patel | 4104337 | 2015-08-24 23:20:16 +0000 | [diff] [blame] | 232 | /// getHandlerNames - Populate client-supplied smallvector using custom |
Chris Lattner | a3b94ba | 2010-03-30 20:48:48 +0000 | [diff] [blame] | 233 | /// metadata name and ID. |
| 234 | void LLVMContext::getMDKindNames(SmallVectorImpl<StringRef> &Names) const { |
Dan Gohman | 43aa8f0 | 2010-07-20 21:42:28 +0000 | [diff] [blame] | 235 | Names.resize(pImpl->CustomMDKindNames.size()); |
Chris Lattner | a3b94ba | 2010-03-30 20:48:48 +0000 | [diff] [blame] | 236 | for (StringMap<unsigned>::const_iterator I = pImpl->CustomMDKindNames.begin(), |
| 237 | E = pImpl->CustomMDKindNames.end(); I != E; ++I) |
Chris Lattner | a3b94ba | 2010-03-30 20:48:48 +0000 | [diff] [blame] | 238 | Names[I->second] = I->first(); |
| 239 | } |
Sanjoy Das | 9303c24 | 2015-09-24 19:14:18 +0000 | [diff] [blame] | 240 | |
| 241 | void LLVMContext::getOperandBundleTags(SmallVectorImpl<StringRef> &Tags) const { |
| 242 | pImpl->getOperandBundleTags(Tags); |
| 243 | } |
| 244 | |
| 245 | uint32_t LLVMContext::getOperandBundleTagID(StringRef Tag) const { |
| 246 | return pImpl->getOperandBundleTagID(Tag); |
| 247 | } |
Mehdi Amini | 599ebf2 | 2016-01-08 02:28:20 +0000 | [diff] [blame] | 248 | |
| 249 | void LLVMContext::setGC(const Function &Fn, std::string GCName) { |
| 250 | auto It = pImpl->GCNames.find(&Fn); |
| 251 | |
| 252 | if (It == pImpl->GCNames.end()) { |
| 253 | pImpl->GCNames.insert(std::make_pair(&Fn, std::move(GCName))); |
| 254 | return; |
| 255 | } |
| 256 | It->second = std::move(GCName); |
| 257 | } |
Eugene Zelenko | 5354a8a | 2016-04-28 18:04:41 +0000 | [diff] [blame] | 258 | |
Mehdi Amini | 599ebf2 | 2016-01-08 02:28:20 +0000 | [diff] [blame] | 259 | const std::string &LLVMContext::getGC(const Function &Fn) { |
| 260 | return pImpl->GCNames[&Fn]; |
| 261 | } |
Eugene Zelenko | 5354a8a | 2016-04-28 18:04:41 +0000 | [diff] [blame] | 262 | |
Mehdi Amini | 599ebf2 | 2016-01-08 02:28:20 +0000 | [diff] [blame] | 263 | void LLVMContext::deleteGC(const Function &Fn) { |
| 264 | pImpl->GCNames.erase(&Fn); |
| 265 | } |
Mehdi Amini | 09b4a8d | 2016-03-10 01:28:54 +0000 | [diff] [blame] | 266 | |
Mehdi Amini | e709015 | 2016-04-02 03:59:58 +0000 | [diff] [blame] | 267 | bool LLVMContext::shouldDiscardValueNames() const { |
| 268 | return pImpl->DiscardValueNames; |
| 269 | } |
Mehdi Amini | 09b4a8d | 2016-03-10 01:28:54 +0000 | [diff] [blame] | 270 | |
Duncan P. N. Exon Smith | ed8fdb2 | 2016-04-19 04:55:25 +0000 | [diff] [blame] | 271 | bool LLVMContext::isODRUniquingDebugTypes() const { return !!pImpl->DITypeMap; } |
Duncan P. N. Exon Smith | 5ab2be0 | 2016-04-17 03:58:21 +0000 | [diff] [blame] | 272 | |
Duncan P. N. Exon Smith | ed8fdb2 | 2016-04-19 04:55:25 +0000 | [diff] [blame] | 273 | void LLVMContext::enableDebugTypeODRUniquing() { |
Duncan P. N. Exon Smith | 5ab2be0 | 2016-04-17 03:58:21 +0000 | [diff] [blame] | 274 | if (pImpl->DITypeMap) |
| 275 | return; |
| 276 | |
Duncan P. N. Exon Smith | e8b555c | 2016-04-19 16:06:50 +0000 | [diff] [blame] | 277 | pImpl->DITypeMap.emplace(); |
Duncan P. N. Exon Smith | 5ab2be0 | 2016-04-17 03:58:21 +0000 | [diff] [blame] | 278 | } |
| 279 | |
Duncan P. N. Exon Smith | ed8fdb2 | 2016-04-19 04:55:25 +0000 | [diff] [blame] | 280 | void LLVMContext::disableDebugTypeODRUniquing() { pImpl->DITypeMap.reset(); } |
Duncan P. N. Exon Smith | 5ab2be0 | 2016-04-17 03:58:21 +0000 | [diff] [blame] | 281 | |
Mehdi Amini | 09b4a8d | 2016-03-10 01:28:54 +0000 | [diff] [blame] | 282 | void LLVMContext::setDiscardValueNames(bool Discard) { |
| 283 | pImpl->DiscardValueNames = Discard; |
| 284 | } |
Andrew Kaylor | aa641a5 | 2016-04-22 22:06:11 +0000 | [diff] [blame] | 285 | |
| 286 | OptBisect &LLVMContext::getOptBisect() { |
| 287 | return pImpl->getOptBisect(); |
| 288 | } |