diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2003-11-11 22:41:34 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2003-11-11 22:41:34 +0000 |
commit | d0fde30ce850b78371fd1386338350591f9ff494 (patch) | |
tree | 83bb73e83f54fc8e1e474d116250ae2779562f7e /lib/AsmParser/llvmAsmParser.y | |
parent | 0d723acf15b0326e2df09ecb614b02a617f536e4 (diff) | |
download | external_llvm-d0fde30ce850b78371fd1386338350591f9ff494.zip external_llvm-d0fde30ce850b78371fd1386338350591f9ff494.tar.gz external_llvm-d0fde30ce850b78371fd1386338350591f9ff494.tar.bz2 |
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
Diffstat (limited to 'lib/AsmParser/llvmAsmParser.y')
-rw-r--r-- | lib/AsmParser/llvmAsmParser.y | 61 |
1 files changed, 34 insertions, 27 deletions
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index 96d2dae..a55e735 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/lib/AsmParser/llvmAsmParser.y @@ -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; - - const Type *PrimType; - PATypeHolder *TypeVal; - 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; - - GlobalValue::LinkageTypes Linkage; + 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 llvm::Type *PrimType; + llvm::PATypeHolder *TypeVal; + llvm::Value *ValueVal; + + 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; + + 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 |