Put all LLVM code into the llvm namespace, as per bug 109.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Brian Gaeke
2003-11-11 22:41:34 +00:00
parent 0d723acf15
commit d0fde30ce8
558 changed files with 2494 additions and 264 deletions

View File

@@ -35,6 +35,7 @@
#define RET_TOK(type, Enum, sym) \
llvmAsmlval.type = Instruction::Enum; return sym
namespace llvm {
// TODO: All of the static identifiers are figured out by the lexer,
// these should be hashed to reduce the lexer size
@@ -121,6 +122,10 @@ char *UnEscapeLexed(char *Buffer, bool AllowNull) {
return BOut;
}
} // End llvm namespace
using namespace llvm;
#define YY_NEVER_INTERACTIVE 1
%}

View File

@@ -15,6 +15,8 @@
#include "llvm/Module.h"
#include "llvm/Analysis/Verifier.h"
namespace llvm {
// The useful interface defined by this file... Parse an ASCII file, and return
// the internal representation in a nice slice'n'dice'able representation.
//
@@ -82,3 +84,5 @@ const std::string ParseException::getMessage() const {
return Result + ": " + Message;
}
} // End llvm namespace

View File

@@ -22,19 +22,23 @@
#include "llvm/Assembly/Parser.h"
#include "Support/StringExtras.h"
class Module;
// Global variables exported from the lexer...
extern std::FILE *llvmAsmin;
extern int llvmAsmlineno;
// Globals exported by the parser...
extern std::string CurFilename;
Module *RunVMAsmParser(const std::string &Filename, FILE *F);
extern char* llvmAsmtext;
extern int llvmAsmleng;
namespace llvm {
// Globals exported by the parser...
extern std::string CurFilename;
class Module;
Module *RunVMAsmParser(const std::string &Filename, FILE *F);
// UnEscapeLexed - Run through the specified buffer and change \xx codes to the
// appropriate character. If AllowNull is set to false, a \00 value will cause
// an exception to be thrown.
@@ -209,4 +213,6 @@ static inline int getLineNumFromPlaceHolder(const Value *Val) {
}
}
} // End llvm namespace
#endif

View File

@@ -29,6 +29,8 @@ int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit
int yylex(); // declaration" of xxx warnings.
int yyparse();
namespace llvm {
static Module *ParserResult;
std::string CurFilename;
@@ -686,30 +688,34 @@ Module *RunVMAsmParser(const std::string &Filename, FILE *F) {
return Result;
}
} // End llvm namespace
using namespace llvm;
%}
%union {
Module *ModuleVal;
Function *FunctionVal;
std::pair<PATypeHolder*, char*> *ArgVal;
BasicBlock *BasicBlockVal;
TerminatorInst *TermInstVal;
Instruction *InstVal;
Constant *ConstVal;
llvm::Module *ModuleVal;
llvm::Function *FunctionVal;
std::pair<llvm::PATypeHolder*, char*> *ArgVal;
llvm::BasicBlock *BasicBlockVal;
llvm::TerminatorInst *TermInstVal;
llvm::Instruction *InstVal;
llvm::Constant *ConstVal;
const Type *PrimType;
PATypeHolder *TypeVal;
Value *ValueVal;
const llvm::Type *PrimType;
llvm::PATypeHolder *TypeVal;
llvm::Value *ValueVal;
std::vector<std::pair<PATypeHolder*,char*> > *ArgList;
std::vector<Value*> *ValueList;
std::list<PATypeHolder> *TypeList;
std::list<std::pair<Value*,
BasicBlock*> > *PHIList; // Represent the RHS of PHI node
std::vector<std::pair<Constant*, BasicBlock*> > *JumpTable;
std::vector<Constant*> *ConstVector;
std::vector<std::pair<llvm::PATypeHolder*,char*> > *ArgList;
std::vector<llvm::Value*> *ValueList;
std::list<llvm::PATypeHolder> *TypeList;
std::list<std::pair<llvm::Value*,
llvm::BasicBlock*> > *PHIList; // Represent the RHS of PHI node
std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
std::vector<llvm::Constant*> *ConstVector;
GlobalValue::LinkageTypes Linkage;
llvm::GlobalValue::LinkageTypes Linkage;
int64_t SInt64Val;
uint64_t UInt64Val;
int SIntVal;
@@ -718,13 +724,13 @@ Module *RunVMAsmParser(const std::string &Filename, FILE *F) {
bool BoolVal;
char *StrVal; // This memory is strdup'd!
ValID ValIDVal; // strdup'd memory maybe!
llvm::ValID ValIDVal; // strdup'd memory maybe!
Instruction::BinaryOps BinaryOpVal;
Instruction::TermOps TermOpVal;
Instruction::MemoryOps MemOpVal;
Instruction::OtherOps OtherOpVal;
Module::Endianness Endianness;
llvm::Instruction::BinaryOps BinaryOpVal;
llvm::Instruction::TermOps TermOpVal;
llvm::Instruction::MemoryOps MemOpVal;
llvm::Instruction::OtherOps OtherOpVal;
llvm::Module::Endianness Endianness;
}
%type <ModuleVal> Module FunctionList
@@ -1892,6 +1898,7 @@ MemoryInst : MALLOC Types {
delete $2; delete $4;
};
%%
int yyerror(const char *ErrorMsg) {
std::string where