llvm.org GIT mirror llvm / 2d24e2a
Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146960 91177308-0d34-0410-b5e6-96231b3b80d8 David Blaikie 7 years ago
151 changed file(s) with 744 addition(s) and 123 deletion(s). Raw diff Collapse all Expand all
6464 //===----------------------------------------------------------------------===//
6565 class RefCountedBaseVPTR {
6666 mutable unsigned ref_cnt;
67 virtual void anchor();
6768
6869 protected:
6970 RefCountedBaseVPTR() : ref_cnt(0) {}
152152
153153 /// DIScope - A base class for various scopes.
154154 class DIScope : public DIDescriptor {
155 virtual void anchor();
155156 public:
156157 explicit DIScope(const MDNode *N = 0) : DIDescriptor (N) {}
157158 virtual ~DIScope() {}
162163
163164 /// DICompileUnit - A wrapper for a compile unit.
164165 class DICompileUnit : public DIScope {
166 virtual void anchor();
165167 public:
166168 explicit DICompileUnit(const MDNode *N = 0) : DIScope(N) {}
167169
201203
202204 /// DIFile - This is a wrapper for a file.
203205 class DIFile : public DIScope {
206 virtual void anchor();
204207 public:
205208 explicit DIFile(const MDNode *N = 0) : DIScope(N) {
206209 if (DbgNode && !isFile())
229232 /// FIXME: Types should be factored much better so that CV qualifiers and
230233 /// others do not require a huge and empty descriptor full of zeros.
231234 class DIType : public DIScope {
232 public:
235 virtual void anchor();
233236 protected:
234237 // This ctor is used when the Tag has already been validated by a derived
235238 // ctor.
239242
240243 /// Verify - Verify that a type descriptor is well formed.
241244 bool Verify() const;
242 public:
243245 explicit DIType(const MDNode *N);
244246 explicit DIType() {}
245247 virtual ~DIType() {}
319321
320322 /// DIBasicType - A basic type, like 'int' or 'float'.
321323 class DIBasicType : public DIType {
324 virtual void anchor();
322325 public:
323326 explicit DIBasicType(const MDNode *N = 0) : DIType(N) {}
324327
337340 /// DIDerivedType - A simple derived type, like a const qualified type,
338341 /// a typedef, a pointer or reference, etc.
339342 class DIDerivedType : public DIType {
343 virtual void anchor();
340344 protected:
341345 explicit DIDerivedType(const MDNode *N, bool, bool)
342346 : DIType(N, true, true) {}
390394 /// other types, like a function or struct.
391395 /// FIXME: Why is this a DIDerivedType??
392396 class DICompositeType : public DIDerivedType {
397 virtual void anchor();
393398 public:
394399 explicit DICompositeType(const MDNode *N = 0)
395400 : DIDerivedType(N, true, true) {
453458
454459 /// DISubprogram - This is a wrapper for a subprogram (e.g. a function).
455460 class DISubprogram : public DIScope {
461 virtual void anchor();
456462 public:
457463 explicit DISubprogram(const MDNode *N = 0) : DIScope(N) {}
458464
686692
687693 /// DILexicalBlock - This is a wrapper for a lexical block.
688694 class DILexicalBlock : public DIScope {
695 virtual void anchor();
689696 public:
690697 explicit DILexicalBlock(const MDNode *N = 0) : DIScope(N) {}
691698 DIScope getContext() const { return getFieldAs(1); }
704711 /// DILexicalBlockFile - This is a wrapper for a lexical block with
705712 /// a filename change.
706713 class DILexicalBlockFile : public DIScope {
714 virtual void anchor();
707715 public:
708716 explicit DILexicalBlockFile(const MDNode *N = 0) : DIScope(N) {}
709717 DIScope getContext() const { return getScope().getContext(); }
723731
724732 /// DINameSpace - A wrapper for a C++ style name space.
725733 class DINameSpace : public DIScope {
734 virtual void anchor();
726735 public:
727736 explicit DINameSpace(const MDNode *N = 0) : DIScope(N) {}
728737 DIScope getContext() const { return getFieldAs(1); }
153153 /// used to compute a forward dominator frontiers.
154154 ///
155155 class DominanceFrontier : public DominanceFrontierBase {
156 virtual void anchor();
156157 public:
157158 static char ID; // Pass ID, replacement for typeid
158159 DominanceFrontier() :
2929 /// the function was called with.
3030 /// @brief LLVM Argument representation
3131 class Argument : public Value, public ilist_node {
32 virtual void anchor();
3233 Function *Parent;
3334
3435 friend class SymbolTableListTraits;
5050 /// occurred, more memory is allocated, and we reemit the code into it.
5151 ///
5252 class JITCodeEmitter : public MachineCodeEmitter {
53 virtual void anchor();
5354 public:
5455 virtual ~JITCodeEmitter() {}
5556
152152 /// LexicalScope - This class is used to track scope information.
153153 ///
154154 class LexicalScope {
155 virtual void anchor();
155156
156157 public:
157158 LexicalScope(LexicalScope *P, const MDNode *D, const MDNode *I, bool A)
2424 class MachineBasicBlock;
2525
2626 class MachineBranchProbabilityInfo : public ImmutablePass {
27 virtual void anchor();
2728
2829 // Default weight value. Used when we don't have information about the edge.
2930 // TODO: DEFAULT_WEIGHT makes sense during static predication, when none of
1818
1919 #include "llvm/Support/DataTypes.h"
2020 #include "llvm/Support/DebugLoc.h"
21
22 #include
2123
2224 namespace llvm {
2325
4850 /// occurred, more memory is allocated, and we reemit the code into it.
4951 ///
5052 class MachineCodeEmitter {
53 virtual void anchor();
5154 protected:
5255 /// BufferBegin/BufferEnd - Pointers to the start and end of the memory
5356 /// allocated for this code buffer.
3333 /// Abstract base class for all machine specific constantpool value subclasses.
3434 ///
3535 class MachineConstantPoolValue {
36 virtual void anchor();
3637 Type *Ty;
3738
3839 public:
3232 ///
3333 //===----------------------------------------------------------------------===//
3434 class MachinePassRegistryListener {
35 virtual void anchor();
3536 public:
3637 MachinePassRegistryListener() {}
3738 virtual ~MachinePassRegistryListener() {}
426426 /// implementation to decide.
427427 ///
428428 class SchedulingPriorityQueue {
429 virtual void anchor();
429430 unsigned CurCycle;
430431 bool HasReadyFilter;
431432 public:
180180 /// ISelUpdater - helper class to handle updates of the
181181 /// instruction selection graph.
182182 class ISelUpdater : public SelectionDAG::DAGUpdateListener {
183 virtual void anchor();
183184 SelectionDAG::allnodes_iterator &ISelPosition;
184185 public:
185186 explicit ISelUpdater(SelectionDAG::allnodes_iterator &isp)
4040 class Constant : public User {
4141 void operator=(const Constant &); // Do not implement
4242 Constant(const Constant &); // Do not implement
43 virtual void anchor();
4344
4445 protected:
4546 Constant(Type *ty, ValueTy vty, Use *Ops, unsigned NumOps)
4444 /// represents both boolean and integral constants.
4545 /// @brief Class for constant integers.
4646 class ConstantInt : public Constant {
47 virtual void anchor();
4748 void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
4849 ConstantInt(const ConstantInt &); // DO NOT IMPLEMENT
4950 ConstantInt(IntegerType *Ty, const APInt& V);
228229 ///
229230 class ConstantFP : public Constant {
230231 APFloat Val;
232 virtual void anchor();
231233 void *operator new(size_t, unsigned);// DO NOT IMPLEMENT
232234 ConstantFP(const ConstantFP &); // DO NOT IMPLEMENT
233235 friend class LLVMContextImpl;
1313
1414 namespace llvm {
1515 class MCAsmInfoCOFF : public MCAsmInfo {
16 virtual void anchor();
1617 protected:
1718 explicit MCAsmInfoCOFF();
18
1919 };
2020
2121 class MCAsmInfoMicrosoft : public MCAsmInfoCOFF {
22 virtual void anchor();
2223 protected:
2324 explicit MCAsmInfoMicrosoft();
2425 };
2526
2627 class MCAsmInfoGNUCOFF : public MCAsmInfoCOFF {
28 virtual void anchor();
2729 protected:
2830 explicit MCAsmInfoGNUCOFF();
2931 };
1717 #include "llvm/MC/MCAsmInfo.h"
1818
1919 namespace llvm {
20 struct MCAsmInfoDarwin : public MCAsmInfo {
20 class MCAsmInfoDarwin : public MCAsmInfo {
21 virtual void anchor();
22 public:
2123 explicit MCAsmInfoDarwin();
2224 };
2325 }
105105 };
106106
107107 class MCDataFragment : public MCFragment {
108 virtual void anchor();
108109 SmallString<32> Contents;
109110
110111 /// Fixups - The list of fixups in this fragment.
159160 // object with just the MCInst and a code size, then we should just change
160161 // MCDataFragment to have an optional MCInst at its end.
161162 class MCInstFragment : public MCFragment {
163 virtual void anchor();
164
162165 /// Inst - The instruction this is a fragment for.
163166 MCInst Inst;
164167
214217 };
215218
216219 class MCAlignFragment : public MCFragment {
220 virtual void anchor();
221
217222 /// Alignment - The alignment to ensure, in bytes.
218223 unsigned Alignment;
219224
262267 };
263268
264269 class MCFillFragment : public MCFragment {
270 virtual void anchor();
271
265272 /// Value - Value to use for filling bytes.
266273 int64_t Value;
267274
299306 };
300307
301308 class MCOrgFragment : public MCFragment {
309 virtual void anchor();
310
302311 /// Offset - The offset this fragment should start at.
303312 const MCExpr *Offset;
304313
326335 };
327336
328337 class MCLEBFragment : public MCFragment {
338 virtual void anchor();
339
329340 /// Value - The value this fragment should contain.
330341 const MCExpr *Value;
331342
357368 };
358369
359370 class MCDwarfLineAddrFragment : public MCFragment {
371 virtual void anchor();
372
360373 /// LineDelta - the value of the difference between the two line numbers
361374 /// between two .loc dwarf directives.
362375 int64_t LineDelta;
392405 };
393406
394407 class MCDwarfCallFrameFragment : public MCFragment {
408 virtual void anchor();
409
395410 /// AddrDelta - The expression for the difference of the two symbols that
396411 /// make up the address delta between two .cfi_* dwarf directives.
397412 const MCExpr *AddrDelta;
3535 /// These are used to efficiently contain a byte sequence for metadata.
3636 /// MDString is always unnamed.
3737 class MDString : public Value {
38 virtual void anchor();
3839 MDString(const MDString &); // DO NOT IMPLEMENT
3940
4041 StringRef Str;
2121 namespace object {
2222
2323 class Archive : public Binary {
24 virtual void anchor();
2425 public:
2526 class Child {
2627 const Archive *Parent;
231231 /// Concrete instances of this object are created by createObjectFile, which
232232 /// figure out which type to create.
233233 class ObjectFile : public Binary {
234 private:
234 virtual void anchor();
235235 ObjectFile(); // = delete
236236 ObjectFile(const ObjectFile &other); // = delete
237237
6767
6868 class RecTy {
6969 ListRecTy *ListTy;
70 virtual void anchor();
7071 public:
7172 RecTy() : ListTy(0) {}
7273 virtual ~RecTy() {}
488489 class Init {
489490 Init(const Init &); // Do not define.
490491 Init &operator=(const Init &); // Do not define.
492 virtual void anchor();
491493
492494 protected:
493495 Init(void) {}
616618 UnsetInit() : Init() {}
617619 UnsetInit(const UnsetInit &); // Do not define.
618620 UnsetInit &operator=(const UnsetInit &Other); // Do not define.
621 virtual void anchor();
619622
620623 public:
621624 static UnsetInit *get();
637640 explicit BitInit(bool V) : Value(V) {}
638641 BitInit(const BitInit &Other); // Do not define.
639642 BitInit &operator=(BitInit &Other); // Do not define.
643 virtual void anchor();
640644
641645 public:
642646 static BitInit *get(bool V);
749753
750754 StringInit(const StringInit &Other); // Do not define.
751755 StringInit &operator=(const StringInit &Other); // Do not define.
756 virtual void anchor();
752757
753758 public:
754759 static StringInit *get(const std::string &V);
791796
792797 CodeInit(const CodeInit &Other); // Do not define.
793798 CodeInit &operator=(const CodeInit &Other); // Do not define.
799 virtual void anchor();
794800
795801 public:
796802 static CodeInit *get(const std::string &V);
2020 class RecordKeeper;
2121
2222 class TableGenAction {
23 virtual void anchor();
2324 public:
2425 virtual ~TableGenAction() {}
2526
2323 class RecordKeeper;
2424
2525 struct TableGenBackend {
26 virtual void anchor();
2627 virtual ~TableGenBackend() {}
2728
2829 // run - All TableGen backends should implement the run method, which should
2929 /// TargetJITInfo - Target specific information required by the Just-In-Time
3030 /// code generator.
3131 class TargetJITInfo {
32 virtual void anchor();
3233 public:
3334 virtual ~TargetJITInfo() {}
3435
207207 /// library functions are available for the current target, and allows a
208208 /// frontend to disable optimizations through -fno-builtin etc.
209209 class TargetLibraryInfo : public ImmutablePass {
210 virtual void anchor();
210211 unsigned char AvailableArray[(LibFunc::NumLibFuncs+3)/4];
211212 llvm::DenseMap CustomNames;
212213 static const char* StandardNames[LibFunc::NumLibFuncs];
3737 typedef const EVT* vt_iterator;
3838 typedef const TargetRegisterClass* const * sc_iterator;
3939 private:
40 virtual void anchor();
4041 const MCRegisterClass *MC;
4142 const vt_iterator VTs;
4243 const unsigned *SubClassMask;
3232 /// Interface for visiting interesting IV users that are recognized but not
3333 /// simplified by this utility.
3434 class IVVisitor {
35 virtual void anchor();
3536 public:
3637 virtual ~IVVisitor() {}
3738 virtual void visitCast(CastInst *Cast) = 0;
635635 return DIArray(A);
636636 return DIArray();
637637 }
638
639 //===----------------------------------------------------------------------===//
640 // DIDescriptor: vtable anchors for all descriptors.
641 //===----------------------------------------------------------------------===//
642
643 void DIScope::anchor() { }
644
645 void DICompileUnit::anchor() { }
646
647 void DIFile::anchor() { }
648
649 void DIType::anchor() { }
650
651 void DIBasicType::anchor() { }
652
653 void DIDerivedType::anchor() { }
654
655 void DICompositeType::anchor() { }
656
657 void DISubprogram::anchor() { }
658
659 void DILexicalBlock::anchor() { }
660
661 void DINameSpace::anchor() { }
662
663 void DILexicalBlockFile::anchor() { }
638664
639665 //===----------------------------------------------------------------------===//
640666 // DIDescriptor: dump routines for all descriptors.
3333 const DomTreeNode *parentNode;
3434 };
3535 }
36
37 void DominanceFrontier::anchor() { }
3638
3739 const DominanceFrontier::DomSetType &
3840 DominanceFrontier::calculate(const DominatorTree &DT,
173173 }
174174 #endif
175175
176 void DIEValue::anchor() { }
176177
177178 #ifndef NDEBUG
178179 void DIEValue::dump() {
194194 /// DIEValue - A debug information entry value.
195195 ///
196196 class DIEValue {
197 virtual void anchor();
197198 public:
198199 enum {
199200 isInteger,
0 //===-- llvm/CodeGen/JITCodeEmitter.cpp - Code emission --------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "llvm/CodeGen/JITCodeEmitter.h"
10
11 using namespace llvm;
12
13 void JITCodeEmitter::anchor() { }
310310 return Result;
311311 }
312312
313 void LexicalScope::anchor() { }
314
313315 /// dump - Print data structures.
314316 void LexicalScope::dump() const {
315317 #ifndef NDEBUG
2727 STATISTIC(NumDCEDeleted, "Number of instructions deleted by DCE");
2828 STATISTIC(NumDCEFoldedLoads, "Number of single use loads folded after DCE");
2929 STATISTIC(NumFracRanges, "Number of live ranges fractured by DCE");
30
31 void LiveRangeEdit::Delegate::anchor() { }
3032
3133 LiveInterval &LiveRangeEdit::createFrom(unsigned OldReg,
3234 LiveIntervals &LIS,
3232 class LiveRangeEdit {
3333 public:
3434 /// Callback methods for LiveRangeEdit owners.
35 struct Delegate {
35 class Delegate {
36 virtual void anchor();
37 public:
3638 /// Called immediately before erasing a dead machine instruction.
3739 virtual void LRE_WillEraseInstruction(MachineInstr *MI) {}
3840
2424 "Machine Branch Probability Analysis", false, true)
2525
2626 char MachineBranchProbabilityInfo::ID = 0;
27
28 void MachineBranchProbabilityInfo::anchor() { }
2729
2830 uint32_t MachineBranchProbabilityInfo::
2931 getSumForBlock(MachineBasicBlock *MBB, uint32_t &Scale) const {
0 //===-- llvm/CodeGen/MachineCodeEmitter.cpp - Code emission -----*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "llvm/CodeGen/MachineCodeEmitter.h"
10
11 using namespace llvm;
12
13 void MachineCodeEmitter::anchor() { }
618618 // MachineConstantPool implementation
619619 //===----------------------------------------------------------------------===//
620620
621 void MachineConstantPoolValue::anchor() { }
622
621623 Type *MachineConstantPoolEntry::getType() const {
622624 if (isMachineConstantPoolEntry())
623625 return Val.MachineCPVal->getType();
1515
1616 using namespace llvm;
1717
18 void MachinePassRegistryListener::anchor() { }
1819
1920 /// Add - Adds a function pass to the registration list.
2021 ///
2929 "stress-sched", cl::Hidden, cl::init(false),
3030 cl::desc("Stress test instruction scheduling"));
3131 #endif
32
33 void SchedulingPriorityQueue::anchor() { }
3234
3335 ScheduleDAG::ScheduleDAG(MachineFunction &mf)
3436 : TM(mf.getTarget()),
260260 //===----------------------------------------------------------------------===//
261261 // SelectionDAGISel code
262262 //===----------------------------------------------------------------------===//
263
264 void SelectionDAGISel::ISelUpdater::anchor() { }
263265
264266 SelectionDAGISel::SelectionDAGISel(const TargetMachine &tm,
265267 CodeGenOpt::Level OL) :
184184
185185 } // end anonymous namespace
186186
187 void Spiller::anchor() { }
188
187189 llvm::Spiller* llvm::createSpiller(MachineFunctionPass &pass,
188190 MachineFunction &mf,
189191 VirtRegMap &vrm) {
2121 /// Implementations are utility classes which insert spill or remat code on
2222 /// demand.
2323 class Spiller {
24 virtual void anchor();
2425 public:
2526 virtual ~Spiller() = 0;
2627
164164
165165 return DILineInfo(fileName.c_str(), row.Line, row.Column);
166166 }
167
168 void DWARFContextInMemory::anchor() { }
8585 /// DWARFContext. It assumes all content is available in memory and stores
8686 /// pointers to it.
8787 class DWARFContextInMemory : public DWARFContext {
88 virtual void anchor();
8889 StringRef InfoSection;
8990 StringRef AbbrevSection;
9091 StringRef ARangeSection;
0 //==-- MCJITMemoryManager.cpp - Definition for the Memory Manager -*-C++ -*-==//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "MCJITMemoryManager.h"
10
11 using namespace llvm;
12
13 void MCJITMemoryManager::anchor() { }
2020 // and the RuntimeDyld interface that maps objects, by name, onto their
2121 // matching LLVM IR counterparts in the module(s) being compiled.
2222 class MCJITMemoryManager : public RTDyldMemoryManager {
23 virtual void anchor();
2324 JITMemoryManager *JMM;
2425
2526 // FIXME: Multiple modules.
1414 #include "llvm/MC/MCAsmInfoCOFF.h"
1515 #include "llvm/ADT/SmallVector.h"
1616 using namespace llvm;
17
18 void MCAsmInfoCOFF::anchor() { }
1719
1820 MCAsmInfoCOFF::MCAsmInfoCOFF() {
1921 GlobalPrefix = "_";
3840 SupportsDataRegions = false;
3941 }
4042
43 void MCAsmInfoMicrosoft::anchor() { }
44
4145 MCAsmInfoMicrosoft::MCAsmInfoMicrosoft() {
4246 AllowQuotesInName = true;
4347 }
4448
49 void MCAsmInfoGNUCOFF::anchor() { }
50
4551 MCAsmInfoGNUCOFF::MCAsmInfoGNUCOFF() {
4652
4753 }
1616 #include "llvm/MC/MCExpr.h"
1717 #include "llvm/MC/MCStreamer.h"
1818 using namespace llvm;
19
20 void MCAsmInfoDarwin::anchor() { }
1921
2022 MCAsmInfoDarwin::MCAsmInfoDarwin() {
2123 // Common settings for all Darwin targets.
971971 }
972972 OS << "]>\n";
973973 }
974
975 // anchors for MC*Fragment vtables
976 void MCDataFragment::anchor() { }
977 void MCInstFragment::anchor() { }
978 void MCAlignFragment::anchor() { }
979 void MCFillFragment::anchor() { }
980 void MCOrgFragment::anchor() { }
981 void MCLEBFragment::anchor() { }
982 void MCDwarfLineAddrFragment::anchor() { }
983 void MCDwarfCallFrameFragment::anchor() { }
7272 }
7373 return false;
7474 }
75
76 void Archive::anchor() { }
7577
7678 Archive::Child Archive::Child::getNext() const {
7779 size_t SpaceToSkip = sizeof(ArchiveMemberHeader) +
1919
2020 using namespace llvm;
2121 using namespace object;
22
23 void ObjectFile::anchor() { }
2224
2325 ObjectFile::ObjectFile(unsigned int Type, MemoryBuffer *source, error_code &ec)
2426 : Binary(Type, source) {
0 //== IntrusiveRefCntPtr.cpp - Smart Refcounting Pointer ----------*- C++ -*-==//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "llvm/ADT/IntrusiveRefCntPtr.h"
10
11 using namespace llvm;
12
13 void RefCountedBaseVPTR::anchor() { }
8080 CodeRecTy CodeRecTy::Shared;
8181 DagRecTy DagRecTy::Shared;
8282
83 void RecTy::anchor() { }
8384 void RecTy::dump() const { print(errs()); }
8485
8586 ListRecTy *RecTy::getListTy() {
443444 // Initializer implementations
444445 //===----------------------------------------------------------------------===//
445446
447 void Init::anchor() { }
446448 void Init::dump() const { return print(errs()); }
449
450 void UnsetInit::anchor() { }
447451
448452 UnsetInit *UnsetInit::get() {
449453 static UnsetInit TheInit;
450454 return &TheInit;
451455 }
456
457 void BitInit::anchor() { }
452458
453459 BitInit *BitInit::get(bool V) {
454460 static BitInit True(true);
564570 return BitsInit::get(NewBits);
565571 }
566572
573 void StringInit::anchor() { }
574
567575 StringInit *StringInit::get(const std::string &V) {
568576 typedef StringMap Pool;
569577 static Pool ThePool;
572580 if (!I) I = new StringInit(V);
573581 return I;
574582 }
583
584 void CodeInit::anchor() { }
575585
576586 CodeInit *CodeInit::get(const std::string &V) {
577587 typedef StringMap Pool;
0 //===- TableGenAction.cpp - defines TableGenAction --------------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "llvm/TableGen/TableGenAction.h"
10
11 using namespace llvm;
12
13 void TableGenAction::anchor() { }
14
1414 #include "llvm/TableGen/Record.h"
1515 using namespace llvm;
1616
17 void TableGenBackend::anchor() { }
18
1719 void TableGenBackend::EmitSourceFileHeader(const std::string &Desc,
1820 raw_ostream &OS) const {
1921 OS << "//===- TableGen'erated file -------------------------------------*-"
0 //====- ARMMachineFuctionInfo.cpp - ARM machine function info ---*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "ARMMachineFunctionInfo.h"
10
11 using namespace llvm;
12
13 void ARMFunctionInfo::anchor() { }
2424 /// ARMFunctionInfo - This class is derived from MachineFunctionInfo and
2525 /// contains private ARM-specific information for each MachineFunction.
2626 class ARMFunctionInfo : public MachineFunctionInfo {
27 virtual void anchor();
2728
2829 /// isThumb - True if this function is compiled under Thumb mode.
2930 /// Used to initialized Align, so must precede it.
1515 #include "ARMRegisterInfo.h"
1616 using namespace llvm;
1717
18 void ARMRegisterInfo::anchor() { }
19
1820 ARMRegisterInfo::ARMRegisterInfo(const ARMBaseInstrInfo &tii,
1921 const ARMSubtarget &sti)
2022 : ARMBaseRegisterInfo(tii, sti) {
2323 class Type;
2424
2525 struct ARMRegisterInfo : public ARMBaseRegisterInfo {
26 virtual void anchor();
2627 public:
2728 ARMRegisterInfo(const ARMBaseInstrInfo &tii, const ARMSubtarget &STI);
2829 };
3333 RegisterTargetMachine Y(TheThumbTarget);
3434 }
3535
36
3637 /// TargetMachine ctor - Create an ARM architecture model.
3738 ///
3839 ARMBaseTargetMachine::ARMBaseTargetMachine(const Target &T, StringRef TT,
4849 if (Options.FloatABIType == FloatABI::Default)
4950 this->Options.FloatABIType = FloatABI::Soft;
5051 }
52
53 void ARMTargetMachine::anchor() { }
5154
5255 ARMTargetMachine::ARMTargetMachine(const Target &T, StringRef TT,
5356 StringRef CPU, StringRef FS,
7275 report_fatal_error("CPU: '" + Subtarget.getCPUString() + "' does not "
7376 "support ARM mode execution!");
7477 }
78
79 void ThumbTargetMachine::anchor() { }
7580
7681 ThumbTargetMachine::ThumbTargetMachine(const Target &T, StringRef TT,
7782 StringRef CPU, StringRef FS,
6262 /// ARMTargetMachine - ARM target machine.
6363 ///
6464 class ARMTargetMachine : public ARMBaseTargetMachine {
65 virtual void anchor();
6566 ARMInstrInfo InstrInfo;
6667 const TargetData DataLayout; // Calculates type size & alignment
6768 ARMELFWriterInfo ELFWriterInfo;
102103 /// Thumb-1 and Thumb-2.
103104 ///
104105 class ThumbTargetMachine : public ARMBaseTargetMachine {
106 virtual void anchor();
105107 // Either Thumb1InstrInfo or Thumb2InstrInfo.
106108 OwningPtr InstrInfo;
107109 const TargetData DataLayout; // Calculates type size & alignment
4747 0,0
4848 };
4949
50 void ARMMCAsmInfoDarwin::anchor() { }
51
5052 ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin() {
5153 AsmTransCBE = arm_asm_table;
5254 Data64bitsDirective = 0;
5961 // Exceptions handling
6062 ExceptionsType = ExceptionHandling::SjLj;
6163 }
64
65 void ARMELFMCAsmInfo::anchor() { }
6266
6367 ARMELFMCAsmInfo::ARMELFMCAsmInfo() {
6468 // ".comm align is in bytes but .align is pow-2."
1717
1818 namespace llvm {
1919
20 struct ARMMCAsmInfoDarwin : public MCAsmInfoDarwin {
20 class ARMMCAsmInfoDarwin : public MCAsmInfoDarwin {
21 virtual void anchor();
22 public:
2123 explicit ARMMCAsmInfoDarwin();
2224 };
2325
24 struct ARMELFMCAsmInfo : public MCAsmInfo {
26 class ARMELFMCAsmInfo : public MCAsmInfo {
27 virtual void anchor();
28 public:
2529 explicit ARMELFMCAsmInfo();
2630 };
2731
1212
1313 #include "SPUMCAsmInfo.h"
1414 using namespace llvm;
15
16 void SPULinuxMCAsmInfo::anchor() { }
1517
1618 SPULinuxMCAsmInfo::SPULinuxMCAsmInfo(const Target &T, StringRef TT) {
1719 IsLittleEndian = false;
1919 namespace llvm {
2020 class Target;
2121
22 struct SPULinuxMCAsmInfo : public MCAsmInfo {
22 class SPULinuxMCAsmInfo : public MCAsmInfo {
23 virtual void anchor();
24 public:
2325 explicit SPULinuxMCAsmInfo(const Target &T, StringRef TT);
2426 };
2527 } // namespace llvm
0 //==-- SPUMachineFunctionInfo.cpp - Private data used for CellSPU -*- C++ -*-=//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "SPUMachineFunction.h"
10
11 using namespace llvm;
12
13 void SPUFunctionInfo::anchor() { }
2020 /// SPUFunctionInfo - Cell SPU target-specific information for each
2121 /// MachineFunction
2222 class SPUFunctionInfo : public MachineFunctionInfo {
23 private:
23 virtual void anchor();
24
2425 /// UsesLR - Indicates whether LR is used in the current function.
2526 ///
2627 bool UsesLR;
0 //===-- MBlazeMachineFunctionInfo.cpp - Private data --------------*- C++ -*-=//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "MBlazeMachineFunction.h"
10
11 using namespace llvm;
12
13 void MBlazeFunctionInfo::anchor() { }
2424 /// MBlazeFunctionInfo - This class is derived from MachineFunction private
2525 /// MBlaze target-specific information for each MachineFunction.
2626 class MBlazeFunctionInfo : public MachineFunctionInfo {
27 virtual void anchor();
2728
28 private:
2929 /// Holds for each function where on the stack the Frame Pointer must be
3030 /// saved. This is used on Prologue and Epilogue to emit FP save/restore
3131 int FPStackOffset;
1313 #include "MBlazeMCAsmInfo.h"
1414 using namespace llvm;
1515
16 void MBlazeMCAsmInfo::anchor() { }
17
1618 MBlazeMCAsmInfo::MBlazeMCAsmInfo() {
1719 IsLittleEndian = false;
1820 StackGrowsUp = false;
2020 class Target;
2121
2222 class MBlazeMCAsmInfo : public MCAsmInfo {
23 virtual void anchor();
2324 public:
2425 explicit MBlazeMCAsmInfo();
2526 };
1313 #include "MSP430MCAsmInfo.h"
1414 using namespace llvm;
1515
16 void MSP430MCAsmInfo::anchor() { }
17
1618 MSP430MCAsmInfo::MSP430MCAsmInfo(const Target &T, StringRef TT) {
1719 PointerSize = 2;
1820
1919 namespace llvm {
2020 class Target;
2121
22 struct MSP430MCAsmInfo : public MCAsmInfo {
22 class MSP430MCAsmInfo : public MCAsmInfo {
23 virtual void anchor();
24 public:
2325 explicit MSP430MCAsmInfo(const Target &T, StringRef TT);
2426 };
2527
0 //==- MSP430MachineFuctionInfo.cpp - MSP430 machine function info -*- C++ -*-=//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "MSP430MachineFunctionInfo.h"
10
11 using namespace llvm;
12
13 void MSP430MachineFunctionInfo::anchor() { }
2020 /// MSP430MachineFunctionInfo - This class is derived from MachineFunction and
2121 /// contains private MSP430 target-specific information for each MachineFunction.
2222 class MSP430MachineFunctionInfo : public MachineFunctionInfo {
23 virtual void anchor();
24
2325 /// CalleeSavedFrameSize - Size of the callee-saved register portion of the
2426 /// stack frame in bytes.
2527 unsigned CalleeSavedFrameSize;
2020
2121 using namespace llvm;
2222
23 void MSP430Subtarget::anchor() { }
24
2325 MSP430Subtarget::MSP430Subtarget(const std::string &TT,
2426 const std::string &CPU,
2527 const std::string &FS) :
2424 class StringRef;
2525
2626 class MSP430Subtarget : public MSP430GenSubtargetInfo {
27 virtual void anchor();
2728 bool ExtendedInsts;
2829 public:
2930 /// This constructor initializes the data members to match that
1414 #include "llvm/ADT/Triple.h"
1515
1616 using namespace llvm;
17
18 void MipsMCAsmInfo::anchor() { }
1719
1820 MipsMCAsmInfo::MipsMCAsmInfo(const Target &T, StringRef TT) {
1921 Triple TheTriple(TT);
2020 class Target;
2121
2222 class MipsMCAsmInfo : public MCAsmInfo {
23 virtual void anchor();
2324 public:
2425 explicit MipsMCAsmInfo(const Target &T, StringRef TT);
2526 };
0 //===-- MipsMachineFunctionInfo.cpp - Private data used for Mips --*- C++ -*-=//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "MipsMachineFunction.h"
10
11 using namespace llvm;
12
13 void MipsFunctionInfo::anchor() { }
2424 /// MipsFunctionInfo - This class is derived from MachineFunction private
2525 /// Mips target-specific information for each MachineFunction.
2626 class MipsFunctionInfo : public MachineFunctionInfo {
27 virtual void anchor();
2728
28 private:
2929 MachineFunction& MF;
3030 /// SRetReturnReg - Some subtargets require that sret lowering includes
3131 /// returning the value of the returned struct in a register. This field
1919 #include "MipsGenSubtargetInfo.inc"
2020
2121 using namespace llvm;
22
23 void MipsSubtarget::anchor() { }
2224
2325 MipsSubtarget::MipsSubtarget(const std::string &TT, const std::string &CPU,
2426 const std::string &FS, bool little) :
2424 class StringRef;
2525
2626 class MipsSubtarget : public MipsGenSubtargetInfo {
27 virtual void anchor();
2728
2829 public:
2930 // NOTE: O64 will not be supported.
5151 TLInfo(*this), TSInfo(*this), JITInfo() {
5252 }
5353
54 void MipsebTargetMachine::anchor() { }
55
5456 MipsebTargetMachine::
5557 MipsebTargetMachine(const Target &T, StringRef TT,
5658 StringRef CPU, StringRef FS, const TargetOptions &Options,
5759 Reloc::Model RM, CodeModel::Model CM,
5860 CodeGenOpt::Level OL)
5961 : MipsTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, false) {}
62
63 void MipselTargetMachine::anchor() { }
6064
6165 MipselTargetMachine::
6266 MipselTargetMachine(const Target &T, StringRef TT,
6569 CodeGenOpt::Level OL)
6670 : MipsTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, true) {}
6771
72 void Mips64ebTargetMachine::anchor() { }
73
6874 Mips64ebTargetMachine::
6975 Mips64ebTargetMachine(const Target &T, StringRef TT,
7076 StringRef CPU, StringRef FS, const TargetOptions &Options,
7177 Reloc::Model RM, CodeModel::Model CM,
7278 CodeGenOpt::Level OL)
7379 : MipsTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, false) {}
80
81 void Mips64elTargetMachine::anchor() { }
7482
7583 Mips64elTargetMachine::
7684 Mips64elTargetMachine(const Target &T, StringRef TT,
7979 /// MipsebTargetMachine - Mips32 big endian target machine.
8080 ///
8181 class MipsebTargetMachine : public MipsTargetMachine {
82 virtual void anchor();
8283 public:
8384 MipsebTargetMachine(const Target &T, StringRef TT,
8485 StringRef CPU, StringRef FS, const TargetOptions &Options,
8990 /// MipselTargetMachine - Mips32 little endian target machine.
9091 ///
9192 class MipselTargetMachine : public MipsTargetMachine {
93 virtual void anchor();
9294 public:
9395 MipselTargetMachine(const Target &T, StringRef TT,
9496 StringRef CPU, StringRef FS, const TargetOptions &Options,
99101 /// Mips64ebTargetMachine - Mips64 big endian target machine.
100102 ///
101103 class Mips64ebTargetMachine : public MipsTargetMachine {
104 virtual void anchor();
102105 public:
103106 Mips64ebTargetMachine(const Target &T, StringRef TT,
104107 StringRef CPU, StringRef FS,
110113 /// Mips64elTargetMachine - Mips64 little endian target machine.
111114 ///
112115 class Mips64elTargetMachine : public MipsTargetMachine {
116 virtual void anchor();
113117 public:
114118 Mips64elTargetMachine(const Target &T, StringRef TT,
115119 StringRef CPU, StringRef FS,
1515
1616 using namespace llvm;
1717
18 void PTXMCAsmInfo::anchor() { }
19
1820 PTXMCAsmInfo::PTXMCAsmInfo(const Target &T, const StringRef &TT) {
1921 Triple TheTriple(TT);
2022 if (TheTriple.getArch() == Triple::ptx64)
1919 class Target;
2020 class StringRef;
2121
22 struct PTXMCAsmInfo : public MCAsmInfo {
22 class PTXMCAsmInfo : public MCAsmInfo {
23 virtual void anchor();
24 public:
2325 explicit PTXMCAsmInfo(const Target &T, const StringRef &TT);
2426 };
2527 } // namespace llvm
0 //===- PTXMachineFuctionInfo.cpp - PTX machine function info -----*- C++ -*-==//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "PTXMachineFunctionInfo.h"
10
11 using namespace llvm;
12
13 void PTXMachineFunctionInfo::anchor() { }
2929 /// contains private PTX target-specific information for each MachineFunction.
3030 ///
3131 class PTXMachineFunctionInfo : public MachineFunctionInfo {
32 private:
32 virtual void anchor();
3333 bool IsKernel;
3434 DenseSet RegArgs;
3535 DenseSet RegRets;
2020 #include "PTXGenSubtargetInfo.inc"
2121
2222 using namespace llvm;
23
24 void PTXSubtarget::anchor() { }
2325
2426 PTXSubtarget::PTXSubtarget(const std::string &TT, const std::string &CPU,
2527 const std::string &FS, bool is64Bit)
2222 class StringRef;
2323
2424 class PTXSubtarget : public PTXGenSubtargetInfo {
25 virtual void anchor();
2526 public:
2627
2728 /**
8484 TLInfo(*this) {
8585 }
8686
87 void PTX32TargetMachine::anchor() { }
88
8789 PTX32TargetMachine::PTX32TargetMachine(const Target &T, StringRef TT,
8890 StringRef CPU, StringRef FS,
8991 const TargetOptions &Options,
9193 CodeGenOpt::Level OL)
9294 : PTXTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, false) {
9395 }
96
97 void PTX64TargetMachine::anchor() { }
9498
9599 PTX64TargetMachine::PTX64TargetMachine(const Target &T, StringRef TT,
96100 StringRef CPU, StringRef FS,
9090
9191
9292 class PTX32TargetMachine : public PTXTargetMachine {
93 virtual void anchor();
9394 public:
9495
9596 PTX32TargetMachine(const Target &T, StringRef TT,
99100 }; // class PTX32TargetMachine
100101
101102 class PTX64TargetMachine : public PTXTargetMachine {
103 virtual void anchor();
102104 public:
103105
104106 PTX64TargetMachine(const Target &T, StringRef TT,
1313 #include "PPCMCAsmInfo.h"
1414 using namespace llvm;
1515
16 void PPCMCAsmInfoDarwin::anchor() { }
17
1618 PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit) {
1719 if (is64Bit)
1820 PointerSize = 8;
2830 AssemblerDialect = 1; // New-Style mnemonics.
2931 SupportsDebugInformation= true; // Debug information.
3032 }
33
34 void PPCLinuxMCAsmInfo::anchor() { }
3135
3236 PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) {
3337 if (is64Bit)
1717
1818 namespace llvm {
1919
20 struct PPCMCAsmInfoDarwin : public MCAsmInfoDarwin {
20 class PPCMCAsmInfoDarwin : public MCAsmInfoDarwin {
21 virtual void anchor();
22 public:
2123 explicit PPCMCAsmInfoDarwin(bool is64Bit);
2224 };
2325
24 struct PPCLinuxMCAsmInfo : public MCAsmInfo {
26 class PPCLinuxMCAsmInfo : public MCAsmInfo {
27 virtual void anchor();
28 public:
2529 explicit PPCLinuxMCAsmInfo(bool is64Bit);
2630 };
2731
0 //=-- PPCMachineFunctionInfo.cpp - Private data used for PowerPC --*- C++ -*-=//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "PPCMachineFunctionInfo.h"
10
11 using namespace llvm;
12
13 void PPCFunctionInfo::anchor() { }
14
2020 /// PPCFunctionInfo - This class is derived from MachineFunction private
2121 /// PowerPC target-specific information for each MachineFunction.
2222 class PPCFunctionInfo : public MachineFunctionInfo {
23 private:
23 virtual void anchor();
24
2425 /// FramePointerSaveIndex - Frame index of where the old frame pointer is
2526 /// stored. Also used as an anchor for instructions that need to be altered
2627 /// when using frame pointers (dyna_add, dyna_sub.)
4343 /// groups, which typically degrades performance.
4444 bool PPCTargetMachine::getEnableTailMergeDefault() const { return false; }
4545
46 void PPC32TargetMachine::anchor() { }
47
4648 PPC32TargetMachine::PPC32TargetMachine(const Target &T, StringRef TT,
4749 StringRef CPU, StringRef FS,
4850 const TargetOptions &Options,
5153 : PPCTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, false) {
5254 }
5355
56 void PPC64TargetMachine::anchor() { }
5457
5558 PPC64TargetMachine::PPC64TargetMachine(const Target &T, StringRef TT,
5659 StringRef CPU, StringRef FS,
7676 /// PPC32TargetMachine - PowerPC 32-bit target machine.
7777 ///
7878 class PPC32TargetMachine : public PPCTargetMachine {
79 virtual void anchor();
7980 public:
8081 PPC32TargetMachine(const Target &T, StringRef TT,
8182 StringRef CPU, StringRef FS, const TargetOptions &Options,
8687 /// PPC64TargetMachine - PowerPC 64-bit target machine.
8788 ///
8889 class PPC64TargetMachine : public PPCTargetMachine {
90 virtual void anchor();
8991 public:
9092 PPC64TargetMachine(const Target &T, StringRef TT,
9193 StringRef CPU, StringRef FS, const TargetOptions &Options,
1414 #include "llvm/ADT/Triple.h"
1515
1616 using namespace llvm;
17
18 void SparcELFMCAsmInfo::anchor() { }
1719
1820 SparcELFMCAsmInfo::SparcELFMCAsmInfo(const Target &T, StringRef TT) {
1921 IsLittleEndian = false;
1919 namespace llvm {
2020 class Target;
2121
22 struct SparcELFMCAsmInfo : public MCAsmInfo {
22 class SparcELFMCAsmInfo : public MCAsmInfo {
23 virtual void anchor();
24 public:
2325 explicit SparcELFMCAsmInfo(const Target &T, StringRef TT);
2426 };
2527
0 //==- SparcMachineFunctionInfo.cpp - Sparc Machine Function Info -*- C++ -*-==//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "SparcMachineFunctionInfo.h"
10
11 using namespace llvm;
12
13 void SparcMachineFunctionInfo::anchor() { }
1717 namespace llvm {
1818
1919 class SparcMachineFunctionInfo : public MachineFunctionInfo {
20 virtual void anchor();
2021 private:
2122 unsigned GlobalBaseReg;
2223
2020
2121 using namespace llvm;
2222
23 void SparcSubtarget::anchor() { }
24
2325 SparcSubtarget::SparcSubtarget(const std::string &TT, const std::string &CPU,
2426 const std::string &FS, bool is64Bit) :
2527 SparcGenSubtargetInfo(TT, CPU, FS),
2323 class StringRef;
2424
2525 class SparcSubtarget : public SparcGenSubtargetInfo {
26 virtual void anchor();
2627 bool IsV9;
2728 bool V8DeprecatedInsts;
2829 bool IsVIS;
5050 return true;
5151 }
5252
53 void SparcV8TargetMachine::anchor() { }
54
5355 SparcV8TargetMachine::SparcV8TargetMachine(const Target &T,
5456 StringRef TT, StringRef CPU,
5557 StringRef FS,
6062 : SparcTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, false) {
6163 }
6264
65 void SparcV9TargetMachine::anchor() { }
66
6367 SparcV9TargetMachine::SparcV9TargetMachine(const Target &T,
6468 StringRef TT, StringRef CPU,
6569 StringRef FS,
6161 /// SparcV8TargetMachine - Sparc 32-bit target machine
6262 ///
6363 class SparcV8TargetMachine : public SparcTargetMachine {
64 virtual void anchor();
6465 public:
6566 SparcV8TargetMachine(const Target &T, StringRef TT,
6667 StringRef CPU, StringRef FS,
7273 /// SparcV9TargetMachine - Sparc 64-bit target machine
7374 ///
7475 class SparcV9TargetMachine : public SparcTargetMachine {
76 virtual void anchor();
7577 public:
7678 SparcV9TargetMachine(const Target &T, StringRef TT,
7779 StringRef CPU, StringRef FS,
0 //===- Target/TargetJITInfo.h - Target Information for JIT ------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "llvm/Target/TargetJITInfo.h"
10
11 using namespace llvm;
12
13 void TargetJITInfo::anchor() { }
1818 INITIALIZE_PASS(TargetLibraryInfo, "targetlibinfo",
1919 "Target Library Information", false, true)
2020 char TargetLibraryInfo::ID = 0;
21
22 void TargetLibraryInfo::anchor() { }
2123
2224 const char* TargetLibraryInfo::StandardNames[LibFunc::NumLibFuncs] =
2325 {
1616 #include "llvm/Support/raw_ostream.h"
1717
1818 using namespace llvm;
19
20 void TargetRegisterClass::anchor() { }
1921
2022 TargetRegisterInfo::TargetRegisterInfo(const TargetRegisterInfoDesc *ID,
2123 regclass_iterator RCB, regclass_iterator RCE,
7777 EDInstInfo *X86GenericDisassembler::getEDInfo() const {
7878 return instInfoX86;
7979 }
80
81 void X86_16Disassembler::anchor() { }
82
83 void X86_32Disassembler::anchor() { }
84
85 void X86_64Disassembler::anchor() { }
8086
8187 /// regionReader - a callback function that wraps the readByte method from
8288 /// MemoryObject.
127127
128128 /// X86_16Disassembler - 16-bit X86 disassembler.
129129 class X86_16Disassembler : public X86GenericDisassembler {
130 virtual void anchor();
130131 public:
131132 X86_16Disassembler(const MCSubtargetInfo &STI) :
132133 X86GenericDisassembler(STI, MODE_16BIT) {
135136
136137 /// X86_16Disassembler - 32-bit X86 disassembler.
137138 class X86_32Disassembler : public X86GenericDisassembler {
139 virtual void anchor();
138140 public:
139141 X86_32Disassembler(const MCSubtargetInfo &STI) :
140142 X86GenericDisassembler(STI, MODE_32BIT) {
143145
144146 /// X86_16Disassembler - 64-bit X86 disassembler.
145147 class X86_64Disassembler : public X86GenericDisassembler {
148 virtual void anchor();
146149 public:
147150 X86_64Disassembler(const MCSubtargetInfo &STI) :
148151 X86GenericDisassembler(STI, MODE_64BIT) {
4747 "{cc}", "cc",
4848 0,0};
4949
50 void X86MCAsmInfoDarwin::anchor() { }
51
5052 X86MCAsmInfoDarwin::X86MCAsmInfoDarwin(const Triple &T) {
5153 bool is64Bit = T.getArch() == Triple::x86_64;
5254 if (is64Bit)
7880 X86_64MCAsmInfoDarwin::X86_64MCAsmInfoDarwin(const Triple &Triple)
7981 : X86MCAsmInfoDarwin(Triple) {
8082 }
83
84 void X86ELFMCAsmInfo::anchor() { }
8185
8286 X86ELFMCAsmInfo::X86ELFMCAsmInfo(const Triple &T) {
8387 if (T.getArch() == Triple::x86_64)
124128 0, SectionKind::getMetadata());
125129 }
126130
131 void X86MCAsmInfoMicrosoft::anchor() { }
132
127133 X86MCAsmInfoMicrosoft::X86MCAsmInfoMicrosoft(const Triple &Triple) {
128134 if (Triple.getArch() == Triple::x86_64) {
129135 GlobalPrefix = "";
136142 TextAlignFillValue = 0x90;
137143 }
138144
145 void X86MCAsmInfoGNUCOFF::anchor() { }
146
139147 X86MCAsmInfoGNUCOFF::X86MCAsmInfoGNUCOFF(const Triple &Triple) {
140148 if (Triple.getArch() == Triple::x86_64) {
141149 GlobalPrefix = "";
2020 namespace llvm {
2121 class Triple;
2222
23 struct X86MCAsmInfoDarwin : public MCAsmInfoDarwin {
23 class X86MCAsmInfoDarwin : public MCAsmInfoDarwin {
24 virtual void anchor();
25 public:
2426 explicit X86MCAsmInfoDarwin(const Triple &Triple);
2527 };
2628
3234 MCStreamer &Streamer) const;
3335 };
3436
35 struct X86ELFMCAsmInfo : public MCAsmInfo {
37 class X86ELFMCAsmInfo : public MCAsmInfo {
38 virtual void anchor();
39 public:
3640 explicit X86ELFMCAsmInfo(const Triple &Triple);
3741 virtual const MCSection *getNonexecutableStackSection(MCContext &Ctx) const;
3842 };
3943
40 struct X86MCAsmInfoMicrosoft : public MCAsmInfoMicrosoft {
44 class X86MCAsmInfoMicrosoft : public MCAsmInfoMicrosoft {
45 virtual void anchor();
46 public:
4147 explicit X86MCAsmInfoMicrosoft(const Triple &Triple);
4248 };
4349
44 struct X86MCAsmInfoGNUCOFF : public MCAsmInfoGNUCOFF {
50 class X86MCAsmInfoGNUCOFF : public MCAsmInfoGNUCOFF {
51 virtual void anchor();
52 public:
4553 explicit X86MCAsmInfoGNUCOFF(const Triple &Triple);
4654 };
4755 } // namespace llvm
0 //====- X86MachineFuctionInfo.cpp - X86 machine function info ---*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "X86MachineFunctionInfo.h"
10
11 using namespace llvm;
12
13 void X86MachineFunctionInfo::anchor() { }
2020 /// X86MachineFunctionInfo - This class is derived from MachineFunction and
2121 /// contains private X86 target-specific information for each MachineFunction.
2222 class X86MachineFunctionInfo : public MachineFunctionInfo {
23 virtual void anchor();
24
2325 /// ForceFramePointer - True if the function is required to use of frame
2426 /// pointer for reasons other than it containing dynamic allocation or
2527 /// that FP eliminatation is turned off. For example, Cygwin main function
2727 RegisterTargetMachine Y(TheX86_64Target);
2828 }
2929
30 void X86_32TargetMachine::anchor() { }
3031
3132 X86_32TargetMachine::X86_32TargetMachine(const Target &T, StringRef TT,
3233 StringRef CPU, StringRef FS,
4950 JITInfo(*this) {
5051 }
5152
53 void X86_64TargetMachine::anchor() { }
5254
5355 X86_64TargetMachine::X86_64TargetMachine(const Target &T, StringRef TT,
5456 StringRef CPU, StringRef FS,
7777 /// X86_32TargetMachine - X86 32-bit target machine.
7878 ///
7979 class X86_32TargetMachine : public X86TargetMachine {
80 virtual void anchor();
8081 const TargetData DataLayout; // Calculates type size & alignment
8182 X86InstrInfo InstrInfo;
8283 X86SelectionDAGInfo TSInfo;
105106 /// X86_64TargetMachine - X86 64-bit target machine.
106107 ///
107108 class X86_64TargetMachine : public X86TargetMachine {
109 virtual void anchor();
108110 const TargetData DataLayout; // Calculates type size & alignment
109111 X86InstrInfo InstrInfo;
110112 X86SelectionDAGInfo TSInfo;
88
99 #include "XCoreMCAsmInfo.h"
1010 using namespace llvm;
11
12 void XCoreMCAsmInfo::anchor() { }
1113
1214 XCoreMCAsmInfo::XCoreMCAsmInfo(const Target &T, StringRef TT) {
1315 SupportsDebugInformation = true;
2020 class Target;
2121
2222 class XCoreMCAsmInfo : public MCAsmInfo {
23 virtual void anchor();
2324 public:
2425 explicit XCoreMCAsmInfo(const Target &T, StringRef TT);
2526 };
0 //===- XCoreMachineFuctionInfo.cpp - XCore machine function info -*- C++ -*-==//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "XCoreMachineFunctionInfo.h"
10
11 using namespace llvm;
12
13 void XCoreFunctionInfo::anchor() { }
2525 /// XCoreFunctionInfo - This class is derived from MachineFunction private
2626 /// XCore target-specific information for each MachineFunction.
2727 class XCoreFunctionInfo : public MachineFunctionInfo {
28 private:
28 virtual void anchor();
2929 bool UsesLR;
3030 int LRSpillSlot;
3131 int FPSpillSlot;
2020
2121 using namespace llvm;
2222
23 void XCoreSubtarget::anchor() { }
24
2325 XCoreSubtarget::XCoreSubtarget(const std::string &TT,
2426 const std::string &CPU, const std::string &FS)
2527 : XCoreGenSubtargetInfo(TT, CPU, FS)
2424 class StringRef;
2525
2626 class XCoreSubtarget : public XCoreGenSubtargetInfo {
27 virtual void anchor();
2728
2829 public:
2930 /// This constructor initializes the data members to match that
374374
375375 namespace llvm {
376376
377 void IVVisitor::anchor() { }
378
377379 /// simplifyUsersOfIV - Simplify instructions that use this induction variable
378380 /// by using ScalarEvolution to analyze the IV's recurrence.
379381 bool simplifyUsersOfIV(PHINode *CurrIV, ScalarEvolution *SE, LPPassManager *LPM,
3838 //===----------------------------------------------------------------------===//
3939 // Constant Class
4040 //===----------------------------------------------------------------------===//
41
42 void Constant::anchor() { }
4143
4244 bool Constant::isNegativeZeroValue() const {
4345 // Floating point values have an explicit -0.0 value.
362364 // ConstantInt
363365 //===----------------------------------------------------------------------===//
364366
367 void ConstantInt::anchor() { }
368
365369 ConstantInt::ConstantInt(IntegerType *Ty, const APInt& V)
366370 : Constant(Ty, ConstantIntVal, 0, 0), Val(V) {
367371 assert(V.getBitWidth() == Ty->getBitWidth() && "Invalid constant for type");
484488 assert(Ty->isPPC_FP128Ty() && "Unknown FP format");
485489 return &APFloat::PPCDoubleDouble;
486490 }
491
492 void ConstantFP::anchor() { }
487493
488494 /// get() - This returns a constant fp for the specified value in the
489495 /// specified type. This should only be used for simple constant values like
2929 /// UnaryConstantExpr - This class is private to Constants.cpp, and is used
3030 /// behind the scenes to implement unary constant exprs.
3131 class UnaryConstantExpr : public ConstantExpr {
32 virtual void anchor();
3233 void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
3334 public:
3435 // allocate space for exactly one operand
4546 /// BinaryConstantExpr - This class is private to Constants.cpp, and is used
4647 /// behind the scenes to implement binary constant exprs.
4748 class BinaryConstantExpr : public ConstantExpr {
49 virtual void anchor();
4850 void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
4951 public:
5052 // allocate space for exactly two operands
6567 /// SelectConstantExpr - This class is private to Constants.cpp, and is used
6668 /// behind the scenes to implement select constant exprs.
6769 class SelectConstantExpr : public ConstantExpr {
70 virtual void anchor();
6871 void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
6972 public:
7073 // allocate space for exactly three operands
8588 /// Constants.cpp, and is used behind the scenes to implement
8689 /// extractelement constant exprs.
8790 class ExtractElementConstantExpr : public ConstantExpr {
91 virtual void anchor();
8892 void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
8993 public:
9094 // allocate space for exactly two operands
105109 /// Constants.cpp, and is used behind the scenes to implement
106110 /// insertelement constant exprs.
107111 class InsertElementConstantExpr : public ConstantExpr {
112 virtual void anchor();
108113 void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
109114 public:
110115 // allocate space for exactly three operands
126131 /// Constants.cpp, and is used behind the scenes to implement
127132 /// shufflevector constant exprs.
128133 class ShuffleVectorConstantExpr : public ConstantExpr {
134 virtual void anchor();
129135 void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
130136 public:
131137 // allocate space for exactly three operands
150156 /// Constants.cpp, and is used behind the scenes to implement
151157 /// extractvalue constant exprs.
152158 class ExtractValueConstantExpr : public ConstantExpr {
159 virtual void anchor();
153160 void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
154161 public:
155162 // allocate space for exactly one operand
175182 /// Constants.cpp, and is used behind the scenes to implement
176183 /// insertvalue constant exprs.
177184 class InsertValueConstantExpr : public ConstantExpr {
185 virtual void anchor();
178186 void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
179187 public:
180188 // allocate space for exactly one operand
201209 /// GetElementPtrConstantExpr - This class is private to Constants.cpp, and is
202210 /// used behind the scenes to implement getelementpr constant exprs.
203211 class GetElementPtrConstantExpr : public ConstantExpr {
212 virtual void anchor();
204213 GetElementPtrConstantExpr(Constant *C, const std::vector &IdxList,
205214 Type *DestTy);
206215 public:
220229 // CompareConstantExpr - This class is private to Constants.cpp, and is used
221230 // behind the scenes to implement ICmp and FCmp constant expressions. This is
222231 // needed in order to store the predicate value for these instructions.
223 struct CompareConstantExpr : public ConstantExpr {
224 void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
232 class CompareConstantExpr : public ConstantExpr {
233 virtual void anchor();
234 void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
235 public:
225236 // allocate space for exactly two operands
226237 void *operator new(size_t s) {
227238 return User::operator new(s, 2);
3838 // Argument Implementation
3939 //===----------------------------------------------------------------------===//
4040
41 void Argument::anchor() { }
42
4143 Argument::Argument(Type *Ty, const Twine &Name, Function *Par)
4244 : Value(Ty, Value::ArgumentVal) {
4345 Parent = 0;
9292 // Destroy MDStrings.
9393 DeleteContainerSeconds(MDStringCache);
9494 }
95
96 // ConstantsContext anchors
97 void UnaryConstantExpr::anchor() { }
98
99 void BinaryConstantExpr::anchor() { }
100
101 void SelectConstantExpr::anchor() { }
102
103 void ExtractElementConstantExpr::anchor() { }
104
105 void InsertElementConstantExpr::anchor() { }
106
107 void ShuffleVectorConstantExpr::anchor() { }
108
109 void ExtractValueConstantExpr::anchor() { }
110
111 void InsertValueConstantExpr::anchor() { }
112
113 void GetElementPtrConstantExpr::anchor() { }
114
115 void CompareConstantExpr::anchor() { }
2727 //===----------------------------------------------------------------------===//
2828 // MDString implementation.
2929 //
30
31 void MDString::anchor() { }
3032
3133 MDString::MDString(LLVMContext &C, StringRef S)
3234 : Value(Type::getMetadataTy(C), Value::MDStringVal), Str(S) {}
222222 class FunctionPassManagerImpl : public Pass,
223223 public PMDataManager,
224224 public PMTopLevelManager {
225 virtual void anchor();
225226 private:
226227 bool wasRun;
227228 public:
290291 }
291292 };
292293
294 void FunctionPassManagerImpl::anchor() {}
295
293296 char FunctionPassManagerImpl::ID = 0;
294297
295298 //===----------------------------------------------------------------------===//
383386 class PassManagerImpl : public Pass,
384387 public PMDataManager,
385388 public PMTopLevelManager {
389 virtual void anchor();
386390
387391 public:
388392 static char ID;
435439 return MP;
436440 }
437441 };
442
443 void PassManagerImpl::anchor() {}
438444
439445 char PassManagerImpl::ID = 0;
440446 } // End of llvm namespace
168168 return false;
169169 }
170170
171 namespace llvm {
171 namespace {
172172 /// ReduceCrashingFunctions reducer - This works by removing functions and
173173 /// seeing if the program still crashes. If it does, then keep the newer,
174174 /// smaller program.
232232 sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile),
233233 Timeout, MemoryLimit, Error);
234234 }
235
236 void AbstractInterpreter::anchor() { }
235237
236238 // LLI create method - Try to find the LLI executable
237239 AbstractInterpreter *AbstractInterpreter::createLLI(const char *Argv0,
8585 /// complexity behind a simple interface.
8686 ///
8787 class AbstractInterpreter {
88 virtual void anchor();
8889 public:
8990 static CBE *createCBE(const char *Argv0, std::string &Message,
9091 const std::string &GCCBinary,
4242 assert(!Numbering.empty() && "asked for numbering but numbering was no-op");
4343 }
4444
45
46 void Consumer::anchor() { }
4547
4648 void DiffConsumer::printValue(Value *V, bool isL) {
4749 if (V->hasName()) {
2828
2929 /// The interface for consumers of difference data.
3030 class Consumer {
31 virtual void anchor();
3132 public:
3233 /// Record that a local context has been entered. Left and
3334 /// Right are IR "containers" of some sort which are being
627627
628628 }
629629
630 void DifferenceEngine::Oracle::anchor() { }
631
630632 void DifferenceEngine::diff(Function *L, Function *R) {
631633 Context C(*this, L, R);
632634
4949
5050 /// An oracle for answering whether two values are equivalent as
5151 /// operands.
52 struct Oracle {
52 class Oracle {
53 virtual void anchor();
54 public:
5355 virtual bool operator()(Value *L, Value *R) = 0;
5456
5557 protected:
124124 << "', see --version and --triple.\n";
125125 return 0;
126126 }
127
128 void llvm::StringRefMemoryObject::anchor() { }
127129
128130 void llvm::DumpBytes(StringRef bytes) {
129131 static const char hex_rep[] = "0123456789abcdef";
2424 void DisassembleInputMachO(StringRef Filename);
2525
2626 class StringRefMemoryObject : public MemoryObject {
27 private:
27 virtual void anchor();
2828 StringRef Bytes;
2929 public:
3030 StringRefMemoryObject(StringRef bytes) : Bytes(bytes) {}
1818
1919 using namespace llvm;
2020
21 namespace {
2122 class IRBuilderTest : public testing::Test {
2223 protected:
2324 virtual void SetUp() {
3637 OwningPtr M;
3738 BasicBlock *BB;
3839 };
40 }
3941
4042 TEST_F(IRBuilderTest, Lifetime) {
4143 IRBuilder<> Builder(BB);
1616
1717 using namespace llvm;
1818
19 namespace {
1920 class CloneInstruction : public ::testing::Test {
2021 protected:
2122 virtual void SetUp() {
4647 LLVMContext context;
4748 Value *V;
4849 };
50 }
4951
5052 TEST_F(CloneInstruction, OverflowBits) {
5153 V = new Argument(Type::getInt32Ty(context));
1414 #include "llvm/ADT/StringExtras.h"
1515 using namespace llvm;
1616
17 void Matcher::anchor() { }
18
1719 void Matcher::dump() const {
1820 print(errs(), 0);
1921 }
323325 }
324326
325327
328 void EmitNodeMatcher::anchor() { }
329
330 void MorphNodeToMatcher::anchor() { }
331
326332 unsigned MarkGlueResultsMatcher::getHashImpl() const {
327333 return HashUnsigneds(GlueResultNodes.begin(), GlueResultNodes.end());
328334 }
4040 // The next matcher node that is executed after this one. Null if this is the
4141 // last stage of a match.
4242 OwningPtr Next;
43 virtual void anchor();
4344 public:
4445 enum KindTy {
4546 // Matcher state manipulation.
10101011
10111012 /// EmitNodeMatcher - This signals a successful match and generates a node.
10121013 class EmitNodeMatcher : public EmitNodeMatcherCommon {
1014 virtual void anchor();
10131015 unsigned FirstResultSlot;
10141016 public:
10151017 EmitNodeMatcher(const std::string &opcodeName,
10321034 };
10331035
10341036 class MorphNodeToMatcher : public EmitNodeMatcherCommon {
1037 virtual void anchor();
10351038 const PatternToMatch &Pattern;
10361039 public:
10371040 MorphNodeToMatcher(const std::string &opcodeName,
197197 };
198198 } // end anonymous namespace
199199
200 void SetTheory::Operator::anchor() { }
201
202 void SetTheory::Expander::anchor() { }
203
200204 SetTheory::SetTheory() {
201205 addOperator("add", new AddOp);
202206 addOperator("sub", new SubOp);
6464 typedef SmallSetVector RecSet;
6565
6666 /// Operator - A callback representing a DAG operator.
67 struct Operator {
67 class Operator {
68 virtual void anchor();
69 public:
6870 virtual ~Operator() {}
6971
7072 /// apply - Apply this operator to Expr's arguments and insert the result
7577 /// Expander - A callback function that can transform a Record representing a
7678 /// set into a fully expanded list of elements. Expanders provide a way for
7779 /// users to define named sets that can be used in DAG expressions.
78 struct Expander {
80 class Expander {
81 virtual void anchor();
82 public:
7983 virtual ~Expander() {}
8084
8185 virtual void expand(SetTheory&, Record*, RecSet &Elts) =0;
1616 #include "llvm/CodeGen/ValueTypes.h"
1717 #include
1818 using namespace llvm;
19
20 #pragma clang diagnostic push
21 #pragma clang diagnostic ignored "-Wweak-vtables"
1922
2023 namespace llvm {
2124
5659 return NumElements;
5760 }
5861 };
62
63 #pragma clang diagnostic pop
5964
6065 static std::map
6166 ExtendedIntegerTypeMap;
100100
101101 cl::opt
102102 Class("class", cl::desc("Print Enum list for this class"),
103 cl::value_desc("class name"));
103 cl::value_desc("class name"));
104
105 class LLVMTableGenAction : public TableGenAction {
106 public:
107 bool operator()(raw_ostream &OS, RecordKeeper &Records) {
108 switch (Action) {
109 case PrintRecords:
110 OS << Records; // No argument, dump all contents
111 break;
112 case GenEmitter:
113 CodeEmitterGen(Records).run(OS);
114 break;
115 case GenRegisterInfo:
116 RegisterInfoEmitter(Records).run(OS);
117 break;
118 case GenInstrInfo:
119 InstrInfoEmitter(Records).run(OS);
120 break;
121 case GenCallingConv:
122 CallingConvEmitter(Records).run(OS);
123 break;
124 case GenAsmWriter:
125 AsmWriterEmitter(Records).run(OS);
126 break;
127 case GenAsmMatcher:
128 AsmMatcherEmitter(Records).run(OS);
129 break;
130 case GenDisassembler:
131 DisassemblerEmitter(Records).run(OS);
132 break;
133 case GenPseudoLowering:
134 PseudoLoweringEmitter(Records).run(OS);
135 break;
136 case GenDAGISel:
137 DAGISelEmitter(Records).run(OS);
138 break;
139 case GenDFAPacketizer:
140 DFAGen(Records).run(OS);
141 break;
142 case GenFastISel:
143 FastISelEmitter(Records).run(OS);
144 break;
145 case GenSubtarget:
146 SubtargetEmitter(Records).run(OS);
147 break;
148 case GenIntrinsic:
149 IntrinsicEmitter(Records).run(OS);
150 break;
151 case GenTgtIntrinsic:
152 IntrinsicEmitter(Records, true).run(OS);
153 break;
154 case GenEDInfo:
155 EDEmitter(Records).run(OS);
156 break;
157 case PrintEnums:
158 {
159 std::vector Recs = Records.getAllDerivedDefinitions(Class);
160 for (unsigned i = 0, e = Recs.size(); i != e; ++i)
161 OS << Recs[i]->getName() << ", ";
162 OS << "\n";
163 break;
164 }
165 case PrintSets:
166 {
167 SetTheory Sets;
168 Sets.addFieldExpander("Set", "Elements");
169 std::vector Recs = Records.getAllDerivedDefinitions("Set");
170 for (unsigned i = 0, e = Recs.size(); i != e; ++i) {
171 OS << Recs[i]->getName() << " = [";
172 const std::vector *Elts = Sets.expand(Recs[i]);
173 assert(Elts && "Couldn't expand Set instance");
174 for (unsigned ei = 0, ee = Elts->size(); ei != ee; ++ei)
175 OS << ' ' << (*Elts)[ei]->getName();
176 OS << " ]\n";
177 }
178 break;
179 }
180 default:
181 assert(1 && "Invalid Action");
182 return true;
183 }
184
185 return false;
186 }
187 };
104188 }
105
106 class LLVMTableGenAction : public TableGenAction {
107 public:
108 bool operator()(raw_ostream &OS, RecordKeeper &Records) {
109 switch (Action) {
110 case PrintRecords:
111 OS << Records; // No argument, dump all contents
112 break;
113 case GenEmitter:
114 CodeEmitterGen(Records).run(OS);
115 break;
116 case GenRegisterInfo:
117 RegisterInfoEmitter(Records).run(OS);
118 break;
119 case GenInstrInfo:
120 InstrInfoEmitter(Records).run(OS);
121 break;
122 case GenCallingConv:
123 CallingConvEmitter(Records).run(OS);
124 break;
125 case GenAsmWriter:
126 AsmWriterEmitter(Records).run(OS);
127 break;
128 case GenAsmMatcher:
129 AsmMatcherEmitter(Records).run(OS);
130 break;
131 case GenDisassembler:
132 DisassemblerEmitter(Records).run(OS);
133 break;
134 case GenPseudoLowering:
135 PseudoLoweringEmitter(Records).run(OS);
136 break;
137 case GenDAGISel:
138 DAGISelEmitter(Records).run(OS);
139 break;
140 case GenDFAPacketizer:
141 DFAGen(Records).run(OS);
142 break;
143 case GenFastISel:
144 FastISelEmitter(Records).run(OS);
145 break;
146 case GenSubtarget:
147 SubtargetEmitter(Records).run(OS);
148 break;
149 case GenIntrinsic:
150 IntrinsicEmitter(Records).run(OS);
151 break;
152 case GenTgtIntrinsic:
153 IntrinsicEmitter(Records, true).run(OS);
154 break;
155 case GenEDInfo:
156 EDEmitter(Records).run(OS);
157 break;
158 case PrintEnums:
159 {
160 std::vector Recs = Records.getAllDerivedDefinitions(Class);
161 for (unsigned i = 0, e = Recs.size(); i != e; ++i)
162 OS << Recs[i]->getName() << ", ";
163 OS << "\n";
164 break;
165 }
166 case PrintSets:
167 {
168 SetTheory Sets;
169 Sets.addFieldExpander("Set", "Elements");
170 std::vector Recs = Records.getAllDerivedDefinitions("Set");
171 for (unsigned i = 0, e = Recs.size(); i != e; ++i) {
172 OS << Recs[i]->getName() << " = [";
173 const std::vector *Elts = Sets.expand(Recs[i]);
174 assert(Elts && "Couldn't expand Set instance");
175 for (unsigned ei = 0, ee = Elts->size(); ei != ee; ++ei)
176 OS << ' ' << (*Elts)[ei]->getName();
177 OS << " ]\n";
178 }
179 break;
180 }
181 default:
182 assert(1 && "Invalid Action");
183 return true;
184 }
185
186 return false;
187 }
188 };
189189
190190 int main(int argc, char **argv) {
191191 sys::PrintStackTraceOnErrorSignal();
0 //===- X86ModRMFilters.cpp - Disassembler ModR/M filterss -------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "X86ModRMFilters.h"
10
11 using namespace llvm::X86Disassembler;
12
13 void ModRMFilter::anchor() { }
14
15 void DumbFilter::anchor() { }
16
17 void ModFilter::anchor() { }
18
19 void EscapeFilter::anchor() { }
20
21 void AddRegEscapeFilter::anchor() { }
22
23 void ExtendedFilter::anchor() { }
24
25 void ExactFilter::anchor() { }
2626 /// ModRMFilter - Abstract base class for clases that recognize patterns in
2727 /// ModR/M bytes.
2828 class ModRMFilter {
29 virtual void anchor();
2930 public:
3031 /// Destructor - Override as necessary.
3132 virtual ~ModRMFilter() { }
4849 /// require a ModR/M byte or instructions where the entire ModR/M byte is used
4950 /// for operands.
5051 class DumbFilter : public ModRMFilter {
52 virtual void anchor();
5153 public:
5254 bool isDumb() const {
5355 return true;
6264 /// Some instructions are classified based on whether they are 11 or anything
6365 /// else. This filter performs that classification.
6466 class ModFilter : public ModRMFilter {
65 private:
67 virtual void anchor();
6668 bool R;
6769 public:
6870 /// Constructor
8991 /// possible value. Otherwise, there is one instruction for each value of the
9092 /// nnn field [bits 5-3], known elsewhere as the reg field.
9193 class EscapeFilter : public ModRMFilter {
92 private:
94 virtual void anchor();
9395 bool C0_FF;
9496 uint8_t NNN_or_ModRM;
9597 public:
120122 /// maps to a single instruction. Such instructions require the ModR/M byte
121123 /// to fall between 0xc0 and 0xff.
122124 class AddRegEscapeFilter : public ModRMFilter {
123 private:
125 virtual void anchor();
124126 uint8_t ModRM;
125127 public:
126128 /// Constructor
141143 /// ExtendedFilter - Extended opcodes are classified based on the value of the
142144 /// mod field [bits 7-6] and the value of the nnn field [bits 5-3].
143145 class ExtendedFilter : public ModRMFilter {
144 private:
146 virtual void anchor();
145147 bool R;
146148 uint8_t NNN;
147149 public:
168170
169171 /// ExactFilter - The occasional extended opcode (such as VMCALL or MONITOR)
170172 /// requires the ModR/M byte to have a specific value.
171 class ExactFilter : public ModRMFilter
172 {
173 private:
173 class ExactFilter : public ModRMFilter {
174 virtual void anchor();
174175 uint8_t ModRM;
175176 public:
176177 /// Constructor