1ef860a24SChandler Carruth //===-- LLVMContext.cpp - Implement LLVMContext ---------------------------===//
2ef860a24SChandler Carruth //
3ef860a24SChandler Carruth //                     The LLVM Compiler Infrastructure
4ef860a24SChandler Carruth //
5ef860a24SChandler Carruth // This file is distributed under the University of Illinois Open Source
6ef860a24SChandler Carruth // License. See LICENSE.TXT for details.
7ef860a24SChandler Carruth //
8ef860a24SChandler Carruth //===----------------------------------------------------------------------===//
9ef860a24SChandler Carruth //
10ef860a24SChandler Carruth //  This file implements LLVMContext, as a wrapper around the opaque
11ef860a24SChandler Carruth //  class LLVMContextImpl.
12ef860a24SChandler Carruth //
13ef860a24SChandler Carruth //===----------------------------------------------------------------------===//
14ef860a24SChandler Carruth 
159fb823bbSChandler Carruth #include "llvm/IR/LLVMContext.h"
16ef860a24SChandler Carruth #include "LLVMContextImpl.h"
179fb823bbSChandler Carruth #include "llvm/IR/Constants.h"
18a9298b22SDiego Novillo #include "llvm/IR/DebugLoc.h"
19b4c44d23SQuentin Colombet #include "llvm/IR/DiagnosticInfo.h"
20b4c44d23SQuentin Colombet #include "llvm/IR/DiagnosticPrinter.h"
219fb823bbSChandler Carruth #include "llvm/IR/Instruction.h"
229fb823bbSChandler Carruth #include "llvm/IR/Metadata.h"
23ef860a24SChandler Carruth #include "llvm/Support/ManagedStatic.h"
24ef860a24SChandler Carruth #include "llvm/Support/SourceMgr.h"
25ef860a24SChandler Carruth #include <cctype>
26ef860a24SChandler Carruth using namespace llvm;
27ef860a24SChandler Carruth 
28ef860a24SChandler Carruth LLVMContext::LLVMContext() : pImpl(new LLVMContextImpl(*this)) {
29ef860a24SChandler Carruth   // Create the fixed metadata kinds. This is done in the same order as the
30ef860a24SChandler Carruth   // MD_* enum values so that they correspond.
31ef860a24SChandler Carruth 
32ef860a24SChandler Carruth   // Create the 'dbg' metadata kind.
33ef860a24SChandler Carruth   unsigned DbgID = getMDKindID("dbg");
34ef860a24SChandler Carruth   assert(DbgID == MD_dbg && "dbg kind id drifted"); (void)DbgID;
35ef860a24SChandler Carruth 
36ef860a24SChandler Carruth   // Create the 'tbaa' metadata kind.
37ef860a24SChandler Carruth   unsigned TBAAID = getMDKindID("tbaa");
38ef860a24SChandler Carruth   assert(TBAAID == MD_tbaa && "tbaa kind id drifted"); (void)TBAAID;
39ef860a24SChandler Carruth 
40ef860a24SChandler Carruth   // Create the 'prof' metadata kind.
41ef860a24SChandler Carruth   unsigned ProfID = getMDKindID("prof");
42ef860a24SChandler Carruth   assert(ProfID == MD_prof && "prof kind id drifted"); (void)ProfID;
43ef860a24SChandler Carruth 
44ef860a24SChandler Carruth   // Create the 'fpmath' metadata kind.
45ef860a24SChandler Carruth   unsigned FPAccuracyID = getMDKindID("fpmath");
46ef860a24SChandler Carruth   assert(FPAccuracyID == MD_fpmath && "fpmath kind id drifted");
47ef860a24SChandler Carruth   (void)FPAccuracyID;
48ef860a24SChandler Carruth 
49ef860a24SChandler Carruth   // Create the 'range' metadata kind.
50ef860a24SChandler Carruth   unsigned RangeID = getMDKindID("range");
51ef860a24SChandler Carruth   assert(RangeID == MD_range && "range kind id drifted");
52ef860a24SChandler Carruth   (void)RangeID;
53ef860a24SChandler Carruth 
54ef860a24SChandler Carruth   // Create the 'tbaa.struct' metadata kind.
55ef860a24SChandler Carruth   unsigned TBAAStructID = getMDKindID("tbaa.struct");
56ef860a24SChandler Carruth   assert(TBAAStructID == MD_tbaa_struct && "tbaa.struct kind id drifted");
57ef860a24SChandler Carruth   (void)TBAAStructID;
58408bdad5SShuxin Yang 
59408bdad5SShuxin Yang   // Create the 'invariant.load' metadata kind.
60408bdad5SShuxin Yang   unsigned InvariantLdId = getMDKindID("invariant.load");
61408bdad5SShuxin Yang   assert(InvariantLdId == MD_invariant_load && "invariant.load kind id drifted");
62408bdad5SShuxin Yang   (void)InvariantLdId;
639414665aSHal Finkel 
649414665aSHal Finkel   // Create the 'alias.scope' metadata kind.
659414665aSHal Finkel   unsigned AliasScopeID = getMDKindID("alias.scope");
669414665aSHal Finkel   assert(AliasScopeID == MD_alias_scope && "alias.scope kind id drifted");
679414665aSHal Finkel   (void)AliasScopeID;
689414665aSHal Finkel 
699414665aSHal Finkel   // Create the 'noalias' metadata kind.
709414665aSHal Finkel   unsigned NoAliasID = getMDKindID("noalias");
719414665aSHal Finkel   assert(NoAliasID == MD_noalias && "noalias kind id drifted");
729414665aSHal Finkel   (void)NoAliasID;
735a3f5f75SPhilip Reames 
745a3f5f75SPhilip Reames   // Create the 'nontemporal' metadata kind.
755a3f5f75SPhilip Reames   unsigned NonTemporalID = getMDKindID("nontemporal");
765a3f5f75SPhilip Reames   assert(NonTemporalID == MD_nontemporal && "nontemporal kind id drifted");
775a3f5f75SPhilip Reames   (void)NonTemporalID;
785a3f5f75SPhilip Reames 
795a3f5f75SPhilip Reames   // Create the 'llvm.mem.parallel_loop_access' metadata kind.
805a3f5f75SPhilip Reames   unsigned MemParallelLoopAccessID = getMDKindID("llvm.mem.parallel_loop_access");
815a3f5f75SPhilip Reames   assert(MemParallelLoopAccessID == MD_mem_parallel_loop_access &&
825a3f5f75SPhilip Reames          "mem_parallel_loop_access kind id drifted");
835a3f5f75SPhilip Reames   (void)MemParallelLoopAccessID;
845a3f5f75SPhilip Reames 
855a3f5f75SPhilip Reames   // Create the 'nonnull' metadata kind.
865a3f5f75SPhilip Reames   unsigned NonNullID = getMDKindID("nonnull");
875a3f5f75SPhilip Reames   assert(NonNullID == MD_nonnull && "nonnull kind id drifted");
885a3f5f75SPhilip Reames   (void)NonNullID;
89f999547dSSanjoy Das 
90f999547dSSanjoy Das   // Create the 'dereferenceable' metadata kind.
91f999547dSSanjoy Das   unsigned DereferenceableID = getMDKindID("dereferenceable");
92f999547dSSanjoy Das   assert(DereferenceableID == MD_dereferenceable &&
93f999547dSSanjoy Das          "dereferenceable kind id drifted");
94f999547dSSanjoy Das   (void)DereferenceableID;
95f999547dSSanjoy Das 
96f999547dSSanjoy Das   // Create the 'dereferenceable_or_null' metadata kind.
97f999547dSSanjoy Das   unsigned DereferenceableOrNullID = getMDKindID("dereferenceable_or_null");
98f999547dSSanjoy Das   assert(DereferenceableOrNullID == MD_dereferenceable_or_null &&
99f999547dSSanjoy Das          "dereferenceable_or_null kind id drifted");
100f999547dSSanjoy Das   (void)DereferenceableOrNullID;
10100038784SChen Li 
10200038784SChen Li   // Create the 'make.implicit' metadata kind.
10300038784SChen Li   unsigned MakeImplicitID = getMDKindID("make.implicit");
10400038784SChen Li   assert(MakeImplicitID == MD_make_implicit &&
10500038784SChen Li          "make.implicit kind id drifted");
10600038784SChen Li   (void)MakeImplicitID;
107a99ab1f5SSanjay Patel 
108a99ab1f5SSanjay Patel   // Create the 'unpredictable' metadata kind.
109a99ab1f5SSanjay Patel   unsigned UnpredictableID = getMDKindID("unpredictable");
110a99ab1f5SSanjay Patel   assert(UnpredictableID == MD_unpredictable &&
111a99ab1f5SSanjay Patel          "unpredictable kind id drifted");
112a99ab1f5SSanjay Patel   (void)UnpredictableID;
113ea09288eSPiotr Padlewski 
114ea09288eSPiotr Padlewski   // Create the 'invariant.group' metadata kind.
115ea09288eSPiotr Padlewski   unsigned InvariantGroupId = getMDKindID("invariant.group");
116ea09288eSPiotr Padlewski   assert(InvariantGroupId == MD_invariant_group &&
117ea09288eSPiotr Padlewski          "invariant.group kind id drifted");
118ea09288eSPiotr Padlewski   (void)InvariantGroupId;
119ea09288eSPiotr Padlewski 
120b4d00904SArtur Pilipenko   // Create the 'align' metadata kind.
121b4d00904SArtur Pilipenko   unsigned AlignID = getMDKindID("align");
122b4d00904SArtur Pilipenko   assert(AlignID == MD_align && "align kind id drifted");
123b4d00904SArtur Pilipenko   (void)AlignID;
124cdafd849SSanjoy Das 
1251d15a9f0SDuncan P. N. Exon Smith   // Create the 'llvm.loop' metadata kind.
1261d15a9f0SDuncan P. N. Exon Smith   unsigned LoopID = getMDKindID("llvm.loop");
1271d15a9f0SDuncan P. N. Exon Smith   assert(LoopID == MD_loop && "llvm.loop kind id drifted");
1281d15a9f0SDuncan P. N. Exon Smith   (void)LoopID;
1291d15a9f0SDuncan P. N. Exon Smith 
130cdafd849SSanjoy Das   auto *DeoptEntry = pImpl->getOrInsertBundleTag("deopt");
131cdafd849SSanjoy Das   assert(DeoptEntry->second == LLVMContext::OB_deopt &&
132cdafd849SSanjoy Das          "deopt operand bundle id drifted!");
133cdafd849SSanjoy Das   (void)DeoptEntry;
1343bb88c02SDavid Majnemer 
1353bb88c02SDavid Majnemer   auto *FuncletEntry = pImpl->getOrInsertBundleTag("funclet");
1363bb88c02SDavid Majnemer   assert(FuncletEntry->second == LLVMContext::OB_funclet &&
1373bb88c02SDavid Majnemer          "funclet operand bundle id drifted!");
1383bb88c02SDavid Majnemer   (void)FuncletEntry;
139a34ce95bSSanjoy Das 
140a34ce95bSSanjoy Das   auto *GCTransitionEntry = pImpl->getOrInsertBundleTag("gc-transition");
141a34ce95bSSanjoy Das   assert(GCTransitionEntry->second == LLVMContext::OB_gc_transition &&
142a34ce95bSSanjoy Das          "gc-transition operand bundle id drifted!");
143a34ce95bSSanjoy Das   (void)GCTransitionEntry;
144ef860a24SChandler Carruth }
145ef860a24SChandler Carruth LLVMContext::~LLVMContext() { delete pImpl; }
146ef860a24SChandler Carruth 
147ef860a24SChandler Carruth void LLVMContext::addModule(Module *M) {
148ef860a24SChandler Carruth   pImpl->OwnedModules.insert(M);
149ef860a24SChandler Carruth }
150ef860a24SChandler Carruth 
151ef860a24SChandler Carruth void LLVMContext::removeModule(Module *M) {
152ef860a24SChandler Carruth   pImpl->OwnedModules.erase(M);
153ef860a24SChandler Carruth }
154ef860a24SChandler Carruth 
155ef860a24SChandler Carruth //===----------------------------------------------------------------------===//
156ef860a24SChandler Carruth // Recoverable Backend Errors
157ef860a24SChandler Carruth //===----------------------------------------------------------------------===//
158ef860a24SChandler Carruth 
159a594fab4SBob Wilson void LLVMContext::
160a594fab4SBob Wilson setInlineAsmDiagnosticHandler(InlineAsmDiagHandlerTy DiagHandler,
161ef860a24SChandler Carruth                               void *DiagContext) {
162a594fab4SBob Wilson   pImpl->InlineAsmDiagHandler = DiagHandler;
163a594fab4SBob Wilson   pImpl->InlineAsmDiagContext = DiagContext;
164ef860a24SChandler Carruth }
165ef860a24SChandler Carruth 
166a594fab4SBob Wilson /// getInlineAsmDiagnosticHandler - Return the diagnostic handler set by
167a594fab4SBob Wilson /// setInlineAsmDiagnosticHandler.
168a594fab4SBob Wilson LLVMContext::InlineAsmDiagHandlerTy
169a594fab4SBob Wilson LLVMContext::getInlineAsmDiagnosticHandler() const {
170a594fab4SBob Wilson   return pImpl->InlineAsmDiagHandler;
171ef860a24SChandler Carruth }
172ef860a24SChandler Carruth 
173a594fab4SBob Wilson /// getInlineAsmDiagnosticContext - Return the diagnostic context set by
174a594fab4SBob Wilson /// setInlineAsmDiagnosticHandler.
175a594fab4SBob Wilson void *LLVMContext::getInlineAsmDiagnosticContext() const {
176a594fab4SBob Wilson   return pImpl->InlineAsmDiagContext;
177ef860a24SChandler Carruth }
178ef860a24SChandler Carruth 
179b4c44d23SQuentin Colombet void LLVMContext::setDiagnosticHandler(DiagnosticHandlerTy DiagnosticHandler,
18030c9242cSDuncan P. N. Exon Smith                                        void *DiagnosticContext,
18130c9242cSDuncan P. N. Exon Smith                                        bool RespectFilters) {
182b4c44d23SQuentin Colombet   pImpl->DiagnosticHandler = DiagnosticHandler;
183b4c44d23SQuentin Colombet   pImpl->DiagnosticContext = DiagnosticContext;
18430c9242cSDuncan P. N. Exon Smith   pImpl->RespectDiagnosticFilters = RespectFilters;
185b4c44d23SQuentin Colombet }
186b4c44d23SQuentin Colombet 
187b4c44d23SQuentin Colombet LLVMContext::DiagnosticHandlerTy LLVMContext::getDiagnosticHandler() const {
188b4c44d23SQuentin Colombet   return pImpl->DiagnosticHandler;
189b4c44d23SQuentin Colombet }
190b4c44d23SQuentin Colombet 
191b4c44d23SQuentin Colombet void *LLVMContext::getDiagnosticContext() const {
192b4c44d23SQuentin Colombet   return pImpl->DiagnosticContext;
193b4c44d23SQuentin Colombet }
194b4c44d23SQuentin Colombet 
19534390c70SJuergen Ributzka void LLVMContext::setYieldCallback(YieldCallbackTy Callback, void *OpaqueHandle)
19634390c70SJuergen Ributzka {
19734390c70SJuergen Ributzka   pImpl->YieldCallback = Callback;
19834390c70SJuergen Ributzka   pImpl->YieldOpaqueHandle = OpaqueHandle;
19934390c70SJuergen Ributzka }
20034390c70SJuergen Ributzka 
20134390c70SJuergen Ributzka void LLVMContext::yield() {
20234390c70SJuergen Ributzka   if (pImpl->YieldCallback)
20334390c70SJuergen Ributzka     pImpl->YieldCallback(this, pImpl->YieldOpaqueHandle);
20434390c70SJuergen Ributzka }
20534390c70SJuergen Ributzka 
206ef860a24SChandler Carruth void LLVMContext::emitError(const Twine &ErrorStr) {
207dec8d55bSQuentin Colombet   diagnose(DiagnosticInfoInlineAsm(ErrorStr));
208ef860a24SChandler Carruth }
209ef860a24SChandler Carruth 
210bfb44ef9SBob Wilson void LLVMContext::emitError(const Instruction *I, const Twine &ErrorStr) {
211dec8d55bSQuentin Colombet   assert (I && "Invalid instruction");
212dec8d55bSQuentin Colombet   diagnose(DiagnosticInfoInlineAsm(*I, ErrorStr));
213ef860a24SChandler Carruth }
214ef860a24SChandler Carruth 
21530c9242cSDuncan P. N. Exon Smith static bool isDiagnosticEnabled(const DiagnosticInfo &DI) {
2167f8af8bfSDiego Novillo   // Optimization remarks are selective. They need to check whether the regexp
2177f8af8bfSDiego Novillo   // pattern, passed via one of the -pass-remarks* flags, matches the name of
2187f8af8bfSDiego Novillo   // the pass that is emitting the diagnostic. If there is no match, ignore the
2197f8af8bfSDiego Novillo   // diagnostic and return.
220e9148dd6SAkira Hatanaka   if (auto *Remark = dyn_cast<DiagnosticInfoOptimizationBase>(&DI))
221e9148dd6SAkira Hatanaka     return Remark->isEnabled();
222e9148dd6SAkira Hatanaka 
22330c9242cSDuncan P. N. Exon Smith   return true;
22430c9242cSDuncan P. N. Exon Smith }
22530c9242cSDuncan P. N. Exon Smith 
226735c47ecSAlex Lorenz static const char *getDiagnosticMessagePrefix(DiagnosticSeverity Severity) {
227735c47ecSAlex Lorenz   switch (Severity) {
228735c47ecSAlex Lorenz   case DS_Error:
229735c47ecSAlex Lorenz     return "error";
230735c47ecSAlex Lorenz   case DS_Warning:
231735c47ecSAlex Lorenz     return "warning";
232735c47ecSAlex Lorenz   case DS_Remark:
233735c47ecSAlex Lorenz     return "remark";
234735c47ecSAlex Lorenz   case DS_Note:
235735c47ecSAlex Lorenz     return "note";
236735c47ecSAlex Lorenz   }
2375220476aSAaron Ballman   llvm_unreachable("Unknown DiagnosticSeverity");
238735c47ecSAlex Lorenz }
239735c47ecSAlex Lorenz 
24030c9242cSDuncan P. N. Exon Smith void LLVMContext::diagnose(const DiagnosticInfo &DI) {
24130c9242cSDuncan P. N. Exon Smith   // If there is a report handler, use it.
24230c9242cSDuncan P. N. Exon Smith   if (pImpl->DiagnosticHandler) {
24330c9242cSDuncan P. N. Exon Smith     if (!pImpl->RespectDiagnosticFilters || isDiagnosticEnabled(DI))
24430c9242cSDuncan P. N. Exon Smith       pImpl->DiagnosticHandler(DI, pImpl->DiagnosticContext);
24530c9242cSDuncan P. N. Exon Smith     return;
24630c9242cSDuncan P. N. Exon Smith   }
24730c9242cSDuncan P. N. Exon Smith 
24830c9242cSDuncan P. N. Exon Smith   if (!isDiagnosticEnabled(DI))
24930c9242cSDuncan P. N. Exon Smith     return;
250df655013SDiego Novillo 
251b4c44d23SQuentin Colombet   // Otherwise, print the message with a prefix based on the severity.
252735c47ecSAlex Lorenz   DiagnosticPrinterRawOStream DP(errs());
253735c47ecSAlex Lorenz   errs() << getDiagnosticMessagePrefix(DI.getSeverity()) << ": ";
254b4c44d23SQuentin Colombet   DI.print(DP);
255735c47ecSAlex Lorenz   errs() << "\n";
256735c47ecSAlex Lorenz   if (DI.getSeverity() == DS_Error)
257b4c44d23SQuentin Colombet     exit(1);
258b4c44d23SQuentin Colombet }
259b4c44d23SQuentin Colombet 
260ef860a24SChandler Carruth void LLVMContext::emitError(unsigned LocCookie, const Twine &ErrorStr) {
261dec8d55bSQuentin Colombet   diagnose(DiagnosticInfoInlineAsm(LocCookie, ErrorStr));
262ef860a24SChandler Carruth }
263ef860a24SChandler Carruth 
264ef860a24SChandler Carruth //===----------------------------------------------------------------------===//
265ef860a24SChandler Carruth // Metadata Kind Uniquing
266ef860a24SChandler Carruth //===----------------------------------------------------------------------===//
267ef860a24SChandler Carruth 
2681ac0d2deSFilipe Cabecinhas /// Return a unique non-zero ID for the specified metadata kind.
269ef860a24SChandler Carruth unsigned LLVMContext::getMDKindID(StringRef Name) const {
270ef860a24SChandler Carruth   // If this is new, assign it its ID.
2711ac0d2deSFilipe Cabecinhas   return pImpl->CustomMDKindNames.insert(
2721ac0d2deSFilipe Cabecinhas                                      std::make_pair(
2731ac0d2deSFilipe Cabecinhas                                          Name, pImpl->CustomMDKindNames.size()))
2745106ce78SDavid Blaikie       .first->second;
275ef860a24SChandler Carruth }
276ef860a24SChandler Carruth 
2774104337dSSanjay Patel /// getHandlerNames - Populate client-supplied smallvector using custom
278ef860a24SChandler Carruth /// metadata name and ID.
279ef860a24SChandler Carruth void LLVMContext::getMDKindNames(SmallVectorImpl<StringRef> &Names) const {
280ef860a24SChandler Carruth   Names.resize(pImpl->CustomMDKindNames.size());
281ef860a24SChandler Carruth   for (StringMap<unsigned>::const_iterator I = pImpl->CustomMDKindNames.begin(),
282ef860a24SChandler Carruth        E = pImpl->CustomMDKindNames.end(); I != E; ++I)
283ef860a24SChandler Carruth     Names[I->second] = I->first();
284ef860a24SChandler Carruth }
2859303c246SSanjoy Das 
2869303c246SSanjoy Das void LLVMContext::getOperandBundleTags(SmallVectorImpl<StringRef> &Tags) const {
2879303c246SSanjoy Das   pImpl->getOperandBundleTags(Tags);
2889303c246SSanjoy Das }
2899303c246SSanjoy Das 
2909303c246SSanjoy Das uint32_t LLVMContext::getOperandBundleTagID(StringRef Tag) const {
2919303c246SSanjoy Das   return pImpl->getOperandBundleTagID(Tag);
2929303c246SSanjoy Das }
293599ebf27SMehdi Amini 
294599ebf27SMehdi Amini void LLVMContext::setGC(const Function &Fn, std::string GCName) {
295599ebf27SMehdi Amini   auto It = pImpl->GCNames.find(&Fn);
296599ebf27SMehdi Amini 
297599ebf27SMehdi Amini   if (It == pImpl->GCNames.end()) {
298599ebf27SMehdi Amini     pImpl->GCNames.insert(std::make_pair(&Fn, std::move(GCName)));
299599ebf27SMehdi Amini     return;
300599ebf27SMehdi Amini   }
301599ebf27SMehdi Amini   It->second = std::move(GCName);
302599ebf27SMehdi Amini }
303599ebf27SMehdi Amini const std::string &LLVMContext::getGC(const Function &Fn) {
304599ebf27SMehdi Amini   return pImpl->GCNames[&Fn];
305599ebf27SMehdi Amini }
306599ebf27SMehdi Amini void LLVMContext::deleteGC(const Function &Fn) {
307599ebf27SMehdi Amini   pImpl->GCNames.erase(&Fn);
308599ebf27SMehdi Amini }
30909b4a8daSMehdi Amini 
310e7090155SMehdi Amini bool LLVMContext::shouldDiscardValueNames() const {
311e7090155SMehdi Amini   return pImpl->DiscardValueNames;
312e7090155SMehdi Amini }
31309b4a8daSMehdi Amini 
314ed8fdb2aSDuncan P. N. Exon Smith bool LLVMContext::isODRUniquingDebugTypes() const { return !!pImpl->DITypeMap; }
3155ab2be09SDuncan P. N. Exon Smith 
316ed8fdb2aSDuncan P. N. Exon Smith void LLVMContext::enableDebugTypeODRUniquing() {
3175ab2be09SDuncan P. N. Exon Smith   if (pImpl->DITypeMap)
3185ab2be09SDuncan P. N. Exon Smith     return;
3195ab2be09SDuncan P. N. Exon Smith 
320*e8b555c6SDuncan P. N. Exon Smith   pImpl->DITypeMap.emplace();
3215ab2be09SDuncan P. N. Exon Smith }
3225ab2be09SDuncan P. N. Exon Smith 
323ed8fdb2aSDuncan P. N. Exon Smith void LLVMContext::disableDebugTypeODRUniquing() { pImpl->DITypeMap.reset(); }
3245ab2be09SDuncan P. N. Exon Smith 
32509b4a8daSMehdi Amini void LLVMContext::setDiscardValueNames(bool Discard) {
32609b4a8daSMehdi Amini   pImpl->DiscardValueNames = Discard;
32709b4a8daSMehdi Amini }
328