#include "CodeEmitterGen.h"
#include "Record.h"
#include "Support/Debug.h"
-
-namespace llvm {
+using namespace llvm;
void CodeEmitterGen::run(std::ostream &o) {
std::vector<Record*> Insts = Records.getAllDerivedDefinitions("Instruction");
EmitSourceFileTail(o);
}
-
-} // End llvm namespace
#include "CodeGenWrappers.h"
#include "Record.h"
-
-namespace llvm {
+using namespace llvm;
/// getValueType - Return the MCV::ValueType that the specified TableGen record
/// corresponds to.
-MVT::ValueType getValueType(Record *Rec) {
+MVT::ValueType llvm::getValueType(Record *Rec) {
return (MVT::ValueType)Rec->getValueAsInt("Value");
}
-std::string getName(MVT::ValueType T) {
+std::string llvm::getName(MVT::ValueType T) {
switch (T) {
case MVT::Other: return "UNKNOWN";
case MVT::i1: return "i1";
}
}
-std::string getEnumName(MVT::ValueType T) {
+std::string llvm::getEnumName(MVT::ValueType T) {
switch (T) {
case MVT::Other: return "Other";
case MVT::i1: return "i1";
}
-std::ostream &operator<<(std::ostream &OS, MVT::ValueType T) {
+std::ostream &llvm::operator<<(std::ostream &OS, MVT::ValueType T) {
return OS << getName(T);
}
-
/// getTarget - Return the current instance of the Target class.
///
CodeGenTarget::CodeGenTarget() : PointerType(MVT::Other) {
return TargetRec->getValueAsDef("InstructionSet");
}
-} // End llvm namespace
#include "CodeGenWrappers.h"
#include "Record.h"
-
-namespace llvm {
+using namespace llvm;
/// getValueType - Return the MCV::ValueType that the specified TableGen record
/// corresponds to.
-MVT::ValueType getValueType(Record *Rec) {
+MVT::ValueType llvm::getValueType(Record *Rec) {
return (MVT::ValueType)Rec->getValueAsInt("Value");
}
-std::string getName(MVT::ValueType T) {
+std::string llvm::getName(MVT::ValueType T) {
switch (T) {
case MVT::Other: return "UNKNOWN";
case MVT::i1: return "i1";
}
}
-std::string getEnumName(MVT::ValueType T) {
+std::string llvm::getEnumName(MVT::ValueType T) {
switch (T) {
case MVT::Other: return "Other";
case MVT::i1: return "i1";
}
-std::ostream &operator<<(std::ostream &OS, MVT::ValueType T) {
+std::ostream &llvm::operator<<(std::ostream &OS, MVT::ValueType T) {
return OS << getName(T);
}
-
/// getTarget - Return the current instance of the Target class.
///
CodeGenTarget::CodeGenTarget() : PointerType(MVT::Other) {
return TargetRec->getValueAsDef("InstructionSet");
}
-} // End llvm namespace
#include "InstrInfoEmitter.h"
#include "CodeGenWrappers.h"
#include "Record.h"
-
-namespace llvm {
+using namespace llvm;
// runEnums - Print out enum values for all of the instructions.
void InstrInfoEmitter::runEnums(std::ostream &OS) {
throw "In record '" + R->getName() + "' for TSFlag emission.";
}
-} // End llvm namespace
#include "Support/Debug.h"
#include "Support/StringExtras.h"
#include <set>
-
-namespace llvm {
+using namespace llvm;
NodeType::ArgResultTypes NodeType::Translate(Record *R) {
const std::string &Name = R->getName();
return New;
}
-std::ostream &operator<<(std::ostream &OS, const TreePatternNode &N) {
+std::ostream &llvm::operator<<(std::ostream &OS, const TreePatternNode &N) {
if (N.isLeaf())
return OS << N.getType() << ":" << *N.getValue();
OS << "(" << N.getType() << ":";
-std::ostream &operator<<(std::ostream &OS, const Pattern &P) {
+std::ostream &llvm::operator<<(std::ostream &OS, const Pattern &P) {
switch (P.getPatternType()) {
case Pattern::Nonterminal: OS << "Nonterminal pattern "; break;
case Pattern::Instruction: OS << "Instruction pattern "; break;
EmitSourceFileTail(OS);
}
-} // End llvm namespace
//===----------------------------------------------------------------------===//
#include "Record.h"
+using namespace llvm;
//===----------------------------------------------------------------------===//
// Type implementations
//===----------------------------------------------------------------------===//
-namespace llvm {
-
void RecTy::dump() const { print(std::cerr); }
Init *BitRecTy::convertValue(BitsInit *BI) {
void Record::dump() const { std::cerr << *this; }
-std::ostream &operator<<(std::ostream &OS, const Record &R) {
+std::ostream &llvm::operator<<(std::ostream &OS, const Record &R) {
OS << R.getName();
const std::vector<std::string> &TArgs = R.getTemplateArgs();
void RecordKeeper::dump() const { std::cerr << *this; }
-std::ostream &operator<<(std::ostream &OS, const RecordKeeper &RK) {
+std::ostream &llvm::operator<<(std::ostream &OS, const RecordKeeper &RK) {
OS << "------------- Classes -----------------\n";
const std::map<std::string, Record*> &Classes = RK.getClasses();
for (std::map<std::string, Record*>::const_iterator I = Classes.begin(),
return Defs;
}
-} // End llvm namespace
#include "Record.h"
#include "Support/StringExtras.h"
#include <set>
-
-namespace llvm {
+using namespace llvm;
// runEnums - Print out enum values for all of the registers.
void RegisterInfoEmitter::runEnums(std::ostream &OS) {
OS << " 0\n };\n return CalleeSaveRegs;\n}\n\n";
EmitSourceFileTail(OS);
}
-
-} // End llvm namespace
#include <algorithm>
#include <cstdio>
#include <fstream>
-
-namespace llvm {
+using namespace llvm;
enum ActionType {
PrintRecords,
cl::value_desc("directory"), cl::init(""));
}
+namespace llvm {
+ void ParseFile(const std::string &Filename,
+ const std::string &IncludeDir);
+}
-void ParseFile(const std::string &Filename, const std::string & IncludeDir);
-
-RecordKeeper Records;
+RecordKeeper llvm::Records;
static Init *getBit(Record *R, unsigned BitNo) {
const std::vector<RecordVal> &V = R->getValues();
}
}
-} // End llvm namespace
-
-using namespace llvm;
-
int main(int argc, char **argv) {
cl::ParseCommandLineOptions(argc, argv);
ParseFile(InputFilename, IncludeDir);
#include "TableGenBackend.h"
#include "Record.h"
#include <iostream>
-
-namespace llvm {
+using namespace llvm;
void TableGenBackend::EmitSourceFileHeader(const std::string &Desc,
std::ostream &OS) const {
return Namespace + "::" + R->getName();
}
-} // End llvm namespace