summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-10-28 01:21:55 +0000
committerChris Lattner <sabre@nondot.org>2002-10-28 01:21:55 +0000
commit51a8d8528135ba4e3e4cf7cd711a9e47b19078a3 (patch)
tree1d8da498a45a40f2bea7c0812dc7ad7cf4d387d3 /include
parent6b9445389a226b4ac97ceb89a34ee1a5bf921714 (diff)
downloadllvm-51a8d8528135ba4e3e4cf7cd711a9e47b19078a3.tar.gz
llvm-51a8d8528135ba4e3e4cf7cd711a9e47b19078a3.tar.bz2
llvm-51a8d8528135ba4e3e4cf7cd711a9e47b19078a3.tar.xz
Inline some methods from .cpp files into .h files, minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4313 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/MachineBasicBlock.h6
-rw-r--r--include/llvm/CodeGen/MachineCodeForBasicBlock.h6
-rw-r--r--include/llvm/CodeGen/MachineCodeForInstruction.h13
3 files changed, 16 insertions, 9 deletions
diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h
index 1a3c7a00f6..62454de3fd 100644
--- a/include/llvm/CodeGen/MachineBasicBlock.h
+++ b/include/llvm/CodeGen/MachineBasicBlock.h
@@ -1,8 +1,8 @@
-//===-- llvm/CodeGen/MachineBasicBlock.h ------------------------*- C++ -*--=//
+//===-- llvm/CodeGen/MachineBasicBlock.h ------------------------*- C++ -*-===//
//
// Collect the sequence of machine instructions for a basic block.
//
-//===---------------------------------------------------------------------===//
+//===----------------------------------------------------------------------===//
#ifndef LLVM_CODEGEN_MACHINEBASICBLOCK_H
#define LLVM_CODEGEN_MACHINEBASICBLOCK_H
@@ -19,7 +19,7 @@ typedef MachineBasicBlock MachineCodeForBasicBlock;
class MachineBasicBlock: public Annotation {
std::vector<MachineInstr*> Insts;
public:
- MachineBasicBlock();
+ MachineBasicBlock() : Annotation(MCFBB_AID) {}
~MachineBasicBlock() {}
// Static methods to retrieve or destroy the MachineBasicBlock
diff --git a/include/llvm/CodeGen/MachineCodeForBasicBlock.h b/include/llvm/CodeGen/MachineCodeForBasicBlock.h
index 1a3c7a00f6..62454de3fd 100644
--- a/include/llvm/CodeGen/MachineCodeForBasicBlock.h
+++ b/include/llvm/CodeGen/MachineCodeForBasicBlock.h
@@ -1,8 +1,8 @@
-//===-- llvm/CodeGen/MachineBasicBlock.h ------------------------*- C++ -*--=//
+//===-- llvm/CodeGen/MachineBasicBlock.h ------------------------*- C++ -*-===//
//
// Collect the sequence of machine instructions for a basic block.
//
-//===---------------------------------------------------------------------===//
+//===----------------------------------------------------------------------===//
#ifndef LLVM_CODEGEN_MACHINEBASICBLOCK_H
#define LLVM_CODEGEN_MACHINEBASICBLOCK_H
@@ -19,7 +19,7 @@ typedef MachineBasicBlock MachineCodeForBasicBlock;
class MachineBasicBlock: public Annotation {
std::vector<MachineInstr*> Insts;
public:
- MachineBasicBlock();
+ MachineBasicBlock() : Annotation(MCFBB_AID) {}
~MachineBasicBlock() {}
// Static methods to retrieve or destroy the MachineBasicBlock
diff --git a/include/llvm/CodeGen/MachineCodeForInstruction.h b/include/llvm/CodeGen/MachineCodeForInstruction.h
index 050a626c2b..aa6ddd55ca 100644
--- a/include/llvm/CodeGen/MachineCodeForInstruction.h
+++ b/include/llvm/CodeGen/MachineCodeForInstruction.h
@@ -24,15 +24,22 @@ class MachineInstr;
class Instruction;
class Value;
+extern AnnotationID MCFI_AID;
+
class MachineCodeForInstruction : public Annotation {
std::vector<Value*> tempVec; // used by m/c instr but not VM instr
std::vector<MachineInstr*> Contents;
public:
- MachineCodeForInstruction();
+ MachineCodeForInstruction() : Annotation(MCFI_AID) {}
~MachineCodeForInstruction();
- static MachineCodeForInstruction &get(const Instruction *I);
- static void destroy(const Instruction *I);
+ static MachineCodeForInstruction &get(const Instruction *I) {
+ assert(I != NULL);
+ return *(MachineCodeForInstruction*)I->getOrCreateAnnotation(MCFI_AID);
+ }
+ static void destroy(const Instruction *I) {
+ I->deleteAnnotation(MCFI_AID);
+ }
// Access to underlying machine instructions...
typedef std::vector<MachineInstr*>::iterator iterator;