564a6be9e629bab0e0afe81ff67601278995c3cc
[oota-llvm.git] / include / llvm / MC / MCContext.h
1 //===- MCContext.h - Machine Code Context -----------------------*- 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 #ifndef LLVM_MC_MCCONTEXT_H
11 #define LLVM_MC_MCCONTEXT_H
12
13 #include "llvm/ADT/DenseMap.h"
14 #include "llvm/ADT/SetVector.h"
15 #include "llvm/ADT/SmallString.h"
16 #include "llvm/ADT/SmallVector.h"
17 #include "llvm/ADT/StringMap.h"
18 #include "llvm/ADT/Twine.h"
19 #include "llvm/MC/MCDwarf.h"
20 #include "llvm/MC/SectionKind.h"
21 #include "llvm/Support/Allocator.h"
22 #include "llvm/Support/Compiler.h"
23 #include "llvm/Support/raw_ostream.h"
24 #include <map>
25 #include <tuple>
26 #include <vector> // FIXME: Shouldn't be needed.
27
28 namespace llvm {
29   class MCAsmInfo;
30   class MCExpr;
31   class MCSection;
32   class MCSymbol;
33   class MCSymbolELF;
34   class MCLabel;
35   struct MCDwarfFile;
36   class MCDwarfLoc;
37   class MCObjectFileInfo;
38   class MCRegisterInfo;
39   class MCLineSection;
40   class SMLoc;
41   class MCSectionMachO;
42   class MCSectionELF;
43   class MCSectionCOFF;
44
45   /// Context object for machine code objects.  This class owns all of the
46   /// sections that it creates.
47   ///
48   class MCContext {
49     MCContext(const MCContext &) = delete;
50     MCContext &operator=(const MCContext &) = delete;
51
52   public:
53     typedef StringMap<MCSymbol *, BumpPtrAllocator &> SymbolTable;
54
55   private:
56     /// The SourceMgr for this object, if any.
57     const SourceMgr *SrcMgr;
58
59     /// The MCAsmInfo for this target.
60     const MCAsmInfo *MAI;
61
62     /// The MCRegisterInfo for this target.
63     const MCRegisterInfo *MRI;
64
65     /// The MCObjectFileInfo for this target.
66     const MCObjectFileInfo *MOFI;
67
68     /// Allocator object used for creating machine code objects.
69     ///
70     /// We use a bump pointer allocator to avoid the need to track all allocated
71     /// objects.
72     BumpPtrAllocator Allocator;
73
74     /// Bindings of names to symbols.
75     SymbolTable Symbols;
76
77     /// ELF sections can have a corresponding symbol. This maps one to the
78     /// other.
79     DenseMap<const MCSectionELF *, MCSymbolELF *> SectionSymbols;
80
81     /// A mapping from a local label number and an instance count to a symbol.
82     /// For example, in the assembly
83     ///     1:
84     ///     2:
85     ///     1:
86     /// We have three labels represented by the pairs (1, 0), (2, 0) and (1, 1)
87     DenseMap<std::pair<unsigned, unsigned>, MCSymbol *> LocalSymbols;
88
89     /// Keeps tracks of names that were used both for used declared and
90     /// artificial symbols.
91     StringMap<bool, BumpPtrAllocator &> UsedNames;
92
93     /// The next ID to dole out to an unnamed assembler temporary symbol with
94     /// a given prefix.
95     StringMap<unsigned> NextID;
96
97     /// Instances of directional local labels.
98     DenseMap<unsigned, MCLabel *> Instances;
99     /// NextInstance() creates the next instance of the directional local label
100     /// for the LocalLabelVal and adds it to the map if needed.
101     unsigned NextInstance(unsigned LocalLabelVal);
102     /// GetInstance() gets the current instance of the directional local label
103     /// for the LocalLabelVal and adds it to the map if needed.
104     unsigned GetInstance(unsigned LocalLabelVal);
105
106     /// The file name of the log file from the environment variable
107     /// AS_SECURE_LOG_FILE.  Which must be set before the .secure_log_unique
108     /// directive is used or it is an error.
109     char *SecureLogFile;
110     /// The stream that gets written to for the .secure_log_unique directive.
111     raw_ostream *SecureLog;
112     /// Boolean toggled when .secure_log_unique / .secure_log_reset is seen to
113     /// catch errors if .secure_log_unique appears twice without
114     /// .secure_log_reset appearing between them.
115     bool SecureLogUsed;
116
117     /// The compilation directory to use for DW_AT_comp_dir.
118     SmallString<128> CompilationDir;
119
120     /// The main file name if passed in explicitly.
121     std::string MainFileName;
122
123     /// The dwarf file and directory tables from the dwarf .file directive.
124     /// We now emit a line table for each compile unit. To reduce the prologue
125     /// size of each line table, the files and directories used by each compile
126     /// unit are separated.
127     std::map<unsigned, MCDwarfLineTable> MCDwarfLineTablesCUMap;
128
129     /// The current dwarf line information from the last dwarf .loc directive.
130     MCDwarfLoc CurrentDwarfLoc;
131     bool DwarfLocSeen;
132
133     /// Generate dwarf debugging info for assembly source files.
134     bool GenDwarfForAssembly;
135
136     /// The current dwarf file number when generate dwarf debugging info for
137     /// assembly source files.
138     unsigned GenDwarfFileNumber;
139
140     /// Sections for generating the .debug_ranges and .debug_aranges sections.
141     SetVector<MCSection *> SectionsForRanges;
142
143     /// The information gathered from labels that will have dwarf label
144     /// entries when generating dwarf assembly source files.
145     std::vector<MCGenDwarfLabelEntry> MCGenDwarfLabelEntries;
146
147     /// The string to embed in the debug information for the compile unit, if
148     /// non-empty.
149     StringRef DwarfDebugFlags;
150
151     /// The string to embed in as the dwarf AT_producer for the compile unit, if
152     /// non-empty.
153     StringRef DwarfDebugProducer;
154
155     /// The maximum version of dwarf that we should emit.
156     uint16_t DwarfVersion;
157
158     /// Honor temporary labels, this is useful for debugging semantic
159     /// differences between temporary and non-temporary labels (primarily on
160     /// Darwin).
161     bool AllowTemporaryLabels;
162     bool UseNamesOnTempLabels = true;
163
164     /// The Compile Unit ID that we are currently processing.
165     unsigned DwarfCompileUnitID;
166
167     struct ELFSectionKey {
168       std::string SectionName;
169       StringRef GroupName;
170       unsigned UniqueID;
171       ELFSectionKey(StringRef SectionName, StringRef GroupName,
172                     unsigned UniqueID)
173           : SectionName(SectionName), GroupName(GroupName), UniqueID(UniqueID) {
174       }
175       bool operator<(const ELFSectionKey &Other) const {
176         if (SectionName != Other.SectionName)
177           return SectionName < Other.SectionName;
178         if (GroupName != Other.GroupName)
179           return GroupName < Other.GroupName;
180         return UniqueID < Other.UniqueID;
181       }
182     };
183
184     struct COFFSectionKey {
185       std::string SectionName;
186       StringRef GroupName;
187       int SelectionKey;
188       COFFSectionKey(StringRef SectionName, StringRef GroupName,
189                      int SelectionKey)
190           : SectionName(SectionName), GroupName(GroupName),
191             SelectionKey(SelectionKey) {}
192       bool operator<(const COFFSectionKey &Other) const {
193         if (SectionName != Other.SectionName)
194           return SectionName < Other.SectionName;
195         if (GroupName != Other.GroupName)
196           return GroupName < Other.GroupName;
197         return SelectionKey < Other.SelectionKey;
198       }
199     };
200
201     StringMap<MCSectionMachO *> MachOUniquingMap;
202     std::map<ELFSectionKey, MCSectionELF *> ELFUniquingMap;
203     std::map<COFFSectionKey, MCSectionCOFF *> COFFUniquingMap;
204     StringMap<bool> ELFRelSecNames;
205
206     /// Do automatic reset in destructor
207     bool AutoReset;
208
209     MCSymbol *createSymbolImpl(const StringMapEntry<bool> *Name,
210                                bool IsTemporary);
211     MCSymbol *CreateSymbol(StringRef Name, bool AlwaysAddSuffix);
212
213     MCSymbol *getOrCreateDirectionalLocalSymbol(unsigned LocalLabelVal,
214                                                 unsigned Instance);
215
216   public:
217     explicit MCContext(const MCAsmInfo *MAI, const MCRegisterInfo *MRI,
218                        const MCObjectFileInfo *MOFI,
219                        const SourceMgr *Mgr = nullptr, bool DoAutoReset = true);
220     ~MCContext();
221
222     const SourceMgr *getSourceManager() const { return SrcMgr; }
223
224     const MCAsmInfo *getAsmInfo() const { return MAI; }
225
226     const MCRegisterInfo *getRegisterInfo() const { return MRI; }
227
228     const MCObjectFileInfo *getObjectFileInfo() const { return MOFI; }
229
230     void setAllowTemporaryLabels(bool Value) { AllowTemporaryLabels = Value; }
231     void setUseNamesOnTempLabels(bool Value) { UseNamesOnTempLabels = Value; }
232
233     /// \name Module Lifetime Management
234     /// @{
235
236     /// reset - return object to right after construction state to prepare
237     /// to process a new module
238     void reset();
239
240     /// @}
241
242     /// \name Symbol Management
243     /// @{
244
245     /// Create and return a new linker temporary symbol with a unique but
246     /// unspecified name.
247     MCSymbol *createLinkerPrivateTempSymbol();
248
249     /// Create and return a new assembler temporary symbol with a unique but
250     /// unspecified name.
251     MCSymbol *createTempSymbol();
252
253     MCSymbol *createTempSymbol(const Twine &Name, bool AlwaysAddSuffix);
254
255     /// Create the definition of a directional local symbol for numbered label
256     /// (used for "1:" definitions).
257     MCSymbol *createDirectionalLocalSymbol(unsigned LocalLabelVal);
258
259     /// Create and return a directional local symbol for numbered label (used
260     /// for "1b" or 1f" references).
261     MCSymbol *getDirectionalLocalSymbol(unsigned LocalLabelVal, bool Before);
262
263     /// Lookup the symbol inside with the specified \p Name.  If it exists,
264     /// return it.  If not, create a forward reference and return it.
265     ///
266     /// \param Name - The symbol name, which must be unique across all symbols.
267     MCSymbol *getOrCreateSymbol(const Twine &Name);
268
269     MCSymbolELF *getOrCreateSectionSymbol(const MCSectionELF &Section);
270
271     /// Gets a symbol that will be defined to the final stack offset of a local
272     /// variable after codegen.
273     ///
274     /// \param Idx - The index of a local variable passed to @llvm.frameescape.
275     MCSymbol *getOrCreateFrameAllocSymbol(StringRef FuncName, unsigned Idx);
276
277     MCSymbol *getOrCreateParentFrameOffsetSymbol(StringRef FuncName);
278
279     MCSymbol *getOrCreateLSDASymbol(StringRef FuncName);
280
281     /// Get the symbol for \p Name, or null.
282     MCSymbol *lookupSymbol(const Twine &Name) const;
283
284     /// getSymbols - Get a reference for the symbol table for clients that
285     /// want to, for example, iterate over all symbols. 'const' because we
286     /// still want any modifications to the table itself to use the MCContext
287     /// APIs.
288     const SymbolTable &getSymbols() const { return Symbols; }
289
290     /// @}
291
292     /// \name Section Management
293     /// @{
294
295     /// Return the MCSection for the specified mach-o section.  This requires
296     /// the operands to be valid.
297     MCSectionMachO *getMachOSection(StringRef Segment, StringRef Section,
298                                     unsigned TypeAndAttributes,
299                                     unsigned Reserved2, SectionKind K,
300                                     const char *BeginSymName = nullptr);
301
302     MCSectionMachO *getMachOSection(StringRef Segment, StringRef Section,
303                                     unsigned TypeAndAttributes, SectionKind K,
304                                     const char *BeginSymName = nullptr) {
305       return getMachOSection(Segment, Section, TypeAndAttributes, 0, K,
306                              BeginSymName);
307     }
308
309     MCSectionELF *getELFSection(StringRef Section, unsigned Type,
310                                 unsigned Flags) {
311       return getELFSection(Section, Type, Flags, nullptr);
312     }
313
314     MCSectionELF *getELFSection(StringRef Section, unsigned Type,
315                                 unsigned Flags, const char *BeginSymName) {
316       return getELFSection(Section, Type, Flags, 0, "", BeginSymName);
317     }
318
319     MCSectionELF *getELFSection(StringRef Section, unsigned Type,
320                                 unsigned Flags, unsigned EntrySize,
321                                 StringRef Group) {
322       return getELFSection(Section, Type, Flags, EntrySize, Group, nullptr);
323     }
324
325     MCSectionELF *getELFSection(StringRef Section, unsigned Type,
326                                 unsigned Flags, unsigned EntrySize,
327                                 StringRef Group, const char *BeginSymName) {
328       return getELFSection(Section, Type, Flags, EntrySize, Group, ~0,
329                            BeginSymName);
330     }
331
332     MCSectionELF *getELFSection(StringRef Section, unsigned Type,
333                                 unsigned Flags, unsigned EntrySize,
334                                 StringRef Group, unsigned UniqueID) {
335       return getELFSection(Section, Type, Flags, EntrySize, Group, UniqueID,
336                            nullptr);
337     }
338
339     MCSectionELF *getELFSection(StringRef Section, unsigned Type,
340                                 unsigned Flags, unsigned EntrySize,
341                                 StringRef Group, unsigned UniqueID,
342                                 const char *BeginSymName);
343
344     MCSectionELF *getELFSection(StringRef Section, unsigned Type,
345                                 unsigned Flags, unsigned EntrySize,
346                                 const MCSymbolELF *Group, unsigned UniqueID,
347                                 const char *BeginSymName,
348                                 const MCSectionELF *Associated);
349
350     MCSectionELF *createELFRelSection(StringRef Name, unsigned Type,
351                                       unsigned Flags, unsigned EntrySize,
352                                       const MCSymbolELF *Group,
353                                       const MCSectionELF *Associated);
354
355     void renameELFSection(MCSectionELF *Section, StringRef Name);
356
357     MCSectionELF *createELFGroupSection(const MCSymbolELF *Group);
358
359     MCSectionCOFF *getCOFFSection(StringRef Section, unsigned Characteristics,
360                                   SectionKind Kind, StringRef COMDATSymName,
361                                   int Selection,
362                                   const char *BeginSymName = nullptr);
363
364     MCSectionCOFF *getCOFFSection(StringRef Section, unsigned Characteristics,
365                                   SectionKind Kind,
366                                   const char *BeginSymName = nullptr);
367
368     MCSectionCOFF *getCOFFSection(StringRef Section);
369
370     /// Gets or creates a section equivalent to Sec that is associated with the
371     /// section containing KeySym. For example, to create a debug info section
372     /// associated with an inline function, pass the normal debug info section
373     /// as Sec and the function symbol as KeySym.
374     MCSectionCOFF *getAssociativeCOFFSection(MCSectionCOFF *Sec,
375                                              const MCSymbol *KeySym);
376
377     /// @}
378
379     /// \name Dwarf Management
380     /// @{
381
382     /// \brief Get the compilation directory for DW_AT_comp_dir
383     /// This can be overridden by clients which want to control the reported
384     /// compilation directory and have it be something other than the current
385     /// working directory.
386     /// Returns an empty string if the current directory cannot be determined.
387     StringRef getCompilationDir() const { return CompilationDir; }
388
389     /// \brief Set the compilation directory for DW_AT_comp_dir
390     /// Override the default (CWD) compilation directory.
391     void setCompilationDir(StringRef S) { CompilationDir = S.str(); }
392
393     /// \brief Get the main file name for use in error messages and debug
394     /// info. This can be set to ensure we've got the correct file name
395     /// after preprocessing or for -save-temps.
396     const std::string &getMainFileName() const { return MainFileName; }
397
398     /// \brief Set the main file name and override the default.
399     void setMainFileName(StringRef S) { MainFileName = S; }
400
401     /// Creates an entry in the dwarf file and directory tables.
402     unsigned getDwarfFile(StringRef Directory, StringRef FileName,
403                           unsigned FileNumber, unsigned CUID);
404
405     bool isValidDwarfFileNumber(unsigned FileNumber, unsigned CUID = 0);
406
407     const std::map<unsigned, MCDwarfLineTable> &getMCDwarfLineTables() const {
408       return MCDwarfLineTablesCUMap;
409     }
410
411     MCDwarfLineTable &getMCDwarfLineTable(unsigned CUID) {
412       return MCDwarfLineTablesCUMap[CUID];
413     }
414
415     const MCDwarfLineTable &getMCDwarfLineTable(unsigned CUID) const {
416       auto I = MCDwarfLineTablesCUMap.find(CUID);
417       assert(I != MCDwarfLineTablesCUMap.end());
418       return I->second;
419     }
420
421     const SmallVectorImpl<MCDwarfFile> &getMCDwarfFiles(unsigned CUID = 0) {
422       return getMCDwarfLineTable(CUID).getMCDwarfFiles();
423     }
424     const SmallVectorImpl<std::string> &getMCDwarfDirs(unsigned CUID = 0) {
425       return getMCDwarfLineTable(CUID).getMCDwarfDirs();
426     }
427
428     bool hasMCLineSections() const {
429       for (const auto &Table : MCDwarfLineTablesCUMap)
430         if (!Table.second.getMCDwarfFiles().empty() || Table.second.getLabel())
431           return true;
432       return false;
433     }
434     unsigned getDwarfCompileUnitID() { return DwarfCompileUnitID; }
435     void setDwarfCompileUnitID(unsigned CUIndex) {
436       DwarfCompileUnitID = CUIndex;
437     }
438     void setMCLineTableCompilationDir(unsigned CUID, StringRef CompilationDir) {
439       getMCDwarfLineTable(CUID).setCompilationDir(CompilationDir);
440     }
441
442     /// Saves the information from the currently parsed dwarf .loc directive
443     /// and sets DwarfLocSeen.  When the next instruction is assembled an entry
444     /// in the line number table with this information and the address of the
445     /// instruction will be created.
446     void setCurrentDwarfLoc(unsigned FileNum, unsigned Line, unsigned Column,
447                             unsigned Flags, unsigned Isa,
448                             unsigned Discriminator) {
449       CurrentDwarfLoc.setFileNum(FileNum);
450       CurrentDwarfLoc.setLine(Line);
451       CurrentDwarfLoc.setColumn(Column);
452       CurrentDwarfLoc.setFlags(Flags);
453       CurrentDwarfLoc.setIsa(Isa);
454       CurrentDwarfLoc.setDiscriminator(Discriminator);
455       DwarfLocSeen = true;
456     }
457     void clearDwarfLocSeen() { DwarfLocSeen = false; }
458
459     bool getDwarfLocSeen() { return DwarfLocSeen; }
460     const MCDwarfLoc &getCurrentDwarfLoc() { return CurrentDwarfLoc; }
461
462     bool getGenDwarfForAssembly() { return GenDwarfForAssembly; }
463     void setGenDwarfForAssembly(bool Value) { GenDwarfForAssembly = Value; }
464     unsigned getGenDwarfFileNumber() { return GenDwarfFileNumber; }
465     void setGenDwarfFileNumber(unsigned FileNumber) {
466       GenDwarfFileNumber = FileNumber;
467     }
468     const SetVector<MCSection *> &getGenDwarfSectionSyms() {
469       return SectionsForRanges;
470     }
471     bool addGenDwarfSection(MCSection *Sec) {
472       return SectionsForRanges.insert(Sec);
473     }
474
475     void finalizeDwarfSections(MCStreamer &MCOS);
476     const std::vector<MCGenDwarfLabelEntry> &getMCGenDwarfLabelEntries() const {
477       return MCGenDwarfLabelEntries;
478     }
479     void addMCGenDwarfLabelEntry(const MCGenDwarfLabelEntry &E) {
480       MCGenDwarfLabelEntries.push_back(E);
481     }
482
483     void setDwarfDebugFlags(StringRef S) { DwarfDebugFlags = S; }
484     StringRef getDwarfDebugFlags() { return DwarfDebugFlags; }
485
486     void setDwarfDebugProducer(StringRef S) { DwarfDebugProducer = S; }
487     StringRef getDwarfDebugProducer() { return DwarfDebugProducer; }
488
489     void setDwarfVersion(uint16_t v) { DwarfVersion = v; }
490     uint16_t getDwarfVersion() const { return DwarfVersion; }
491
492     /// @}
493
494     char *getSecureLogFile() { return SecureLogFile; }
495     raw_ostream *getSecureLog() { return SecureLog; }
496     bool getSecureLogUsed() { return SecureLogUsed; }
497     void setSecureLog(raw_ostream *Value) { SecureLog = Value; }
498     void setSecureLogUsed(bool Value) { SecureLogUsed = Value; }
499
500     void *allocate(unsigned Size, unsigned Align = 8) {
501       return Allocator.Allocate(Size, Align);
502     }
503     void deallocate(void *Ptr) {}
504
505     // Unrecoverable error has occurred. Display the best diagnostic we can
506     // and bail via exit(1). For now, most MC backend errors are unrecoverable.
507     // FIXME: We should really do something about that.
508     LLVM_ATTRIBUTE_NORETURN void reportFatalError(SMLoc L,
509                                                   const Twine &Msg) const;
510   };
511
512 } // end namespace llvm
513
514 // operator new and delete aren't allowed inside namespaces.
515 // The throw specifications are mandated by the standard.
516 /// \brief Placement new for using the MCContext's allocator.
517 ///
518 /// This placement form of operator new uses the MCContext's allocator for
519 /// obtaining memory. It is a non-throwing new, which means that it returns
520 /// null on error. (If that is what the allocator does. The current does, so if
521 /// this ever changes, this operator will have to be changed, too.)
522 /// Usage looks like this (assuming there's an MCContext 'Context' in scope):
523 /// \code
524 /// // Default alignment (8)
525 /// IntegerLiteral *Ex = new (Context) IntegerLiteral(arguments);
526 /// // Specific alignment
527 /// IntegerLiteral *Ex2 = new (Context, 4) IntegerLiteral(arguments);
528 /// \endcode
529 /// Please note that you cannot use delete on the pointer; it must be
530 /// deallocated using an explicit destructor call followed by
531 /// \c Context.Deallocate(Ptr).
532 ///
533 /// \param Bytes The number of bytes to allocate. Calculated by the compiler.
534 /// \param C The MCContext that provides the allocator.
535 /// \param Alignment The alignment of the allocated memory (if the underlying
536 ///                  allocator supports it).
537 /// \return The allocated memory. Could be NULL.
538 inline void *operator new(size_t Bytes, llvm::MCContext &C,
539                           size_t Alignment = 8) throw() {
540   return C.allocate(Bytes, Alignment);
541 }
542 /// \brief Placement delete companion to the new above.
543 ///
544 /// This operator is just a companion to the new above. There is no way of
545 /// invoking it directly; see the new operator for more details. This operator
546 /// is called implicitly by the compiler if a placement new expression using
547 /// the MCContext throws in the object constructor.
548 inline void operator delete(void *Ptr, llvm::MCContext &C, size_t)
549               throw () {
550   C.deallocate(Ptr);
551 }
552
553 /// This placement form of operator new[] uses the MCContext's allocator for
554 /// obtaining memory. It is a non-throwing new[], which means that it returns
555 /// null on error.
556 /// Usage looks like this (assuming there's an MCContext 'Context' in scope):
557 /// \code
558 /// // Default alignment (8)
559 /// char *data = new (Context) char[10];
560 /// // Specific alignment
561 /// char *data = new (Context, 4) char[10];
562 /// \endcode
563 /// Please note that you cannot use delete on the pointer; it must be
564 /// deallocated using an explicit destructor call followed by
565 /// \c Context.Deallocate(Ptr).
566 ///
567 /// \param Bytes The number of bytes to allocate. Calculated by the compiler.
568 /// \param C The MCContext that provides the allocator.
569 /// \param Alignment The alignment of the allocated memory (if the underlying
570 ///                  allocator supports it).
571 /// \return The allocated memory. Could be NULL.
572 inline void *operator new[](size_t Bytes, llvm::MCContext& C,
573                             size_t Alignment = 8) throw() {
574   return C.allocate(Bytes, Alignment);
575 }
576
577 /// \brief Placement delete[] companion to the new[] above.
578 ///
579 /// This operator is just a companion to the new[] above. There is no way of
580 /// invoking it directly; see the new[] operator for more details. This operator
581 /// is called implicitly by the compiler if a placement new[] expression using
582 /// the MCContext throws in the object constructor.
583 inline void operator delete[](void *Ptr, llvm::MCContext &C) throw () {
584   C.deallocate(Ptr);
585 }
586
587 #endif