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