summaryrefslogtreecommitdiffstats
path: root/llvm/lib/AsmParser
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2005-05-02 19:07:27 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2005-05-02 19:07:27 +0000
commitf5d58d1bc375c2b6bd8971b2ee58d8fc77d66a11 (patch)
treee6146bdf4e409b9ee2cd3924cf084c2ef4461566 /llvm/lib/AsmParser
parentf42ed7bdafaa82590264286c28f4d8085ba6fce0 (diff)
downloadbcm5719-llvm-f5d58d1bc375c2b6bd8971b2ee58d8fc77d66a11.tar.gz
bcm5719-llvm-f5d58d1bc375c2b6bd8971b2ee58d8fc77d66a11.zip
Remove support for 1.0 style varargs
amusing of course, because we will have to go back to those semantics soon llvm-svn: 21654
Diffstat (limited to 'llvm/lib/AsmParser')
-rw-r--r--llvm/lib/AsmParser/Lexer.l1
-rw-r--r--llvm/lib/AsmParser/llvmAsmParser.y86
2 files changed, 0 insertions, 87 deletions
diff --git a/llvm/lib/AsmParser/Lexer.l b/llvm/lib/AsmParser/Lexer.l
index 2edc50fa101..93e309260b6 100644
--- a/llvm/lib/AsmParser/Lexer.l
+++ b/llvm/lib/AsmParser/Lexer.l
@@ -240,7 +240,6 @@ cast { RET_TOK(OtherOpVal, Cast, CAST); }
select { RET_TOK(OtherOpVal, Select, SELECT); }
shl { RET_TOK(OtherOpVal, Shl, SHL); }
shr { RET_TOK(OtherOpVal, Shr, SHR); }
-va_arg { return VA_ARG; /* FIXME: OBSOLETE */}
vanext { RET_TOK(OtherOpVal, VANext, VANEXT); }
vaarg { RET_TOK(OtherOpVal, VAArg , VAARG); }
diff --git a/llvm/lib/AsmParser/llvmAsmParser.y b/llvm/lib/AsmParser/llvmAsmParser.y
index 0e61b2beab6..c6251cc983f 100644
--- a/llvm/lib/AsmParser/llvmAsmParser.y
+++ b/llvm/lib/AsmParser/llvmAsmParser.y
@@ -732,7 +732,6 @@ Module *llvm::RunVMAsmParser(const std::string &Filename, FILE *F) {
llvmAsmin = F;
CurFilename = Filename;
llvmAsmlineno = 1; // Reset the current line number...
- ObsoleteVarArgs = false;
// Allocate a new module to read
CurModule.CurrentModule = new Module(Filename);
@@ -741,67 +740,6 @@ Module *llvm::RunVMAsmParser(const std::string &Filename, FILE *F) {
Module *Result = ParserResult;
- // Check to see if they called va_start but not va_arg..
- if (!ObsoleteVarArgs)
- if (Function *F = Result->getNamedFunction("llvm.va_start"))
- if (F->arg_size() == 1) {
- std::cerr << "WARNING: this file uses obsolete features. "
- << "Assemble and disassemble to update it.\n";
- ObsoleteVarArgs = true;
- }
-
- if (ObsoleteVarArgs) {
- // If the user is making use of obsolete varargs intrinsics, adjust them for
- // the user.
- if (Function *F = Result->getNamedFunction("llvm.va_start")) {
- assert(F->arg_size() == 1 && "Obsolete va_start takes 1 argument!");
-
- const Type *RetTy = F->getFunctionType()->getParamType(0);
- RetTy = cast<PointerType>(RetTy)->getElementType();
- Function *NF = Result->getOrInsertFunction("llvm.va_start", RetTy, 0);
-
- while (!F->use_empty()) {
- CallInst *CI = cast<CallInst>(F->use_back());
- Value *V = new CallInst(NF, "", CI);
- new StoreInst(V, CI->getOperand(1), CI);
- CI->getParent()->getInstList().erase(CI);
- }
- Result->getFunctionList().erase(F);
- }
-
- if (Function *F = Result->getNamedFunction("llvm.va_end")) {
- assert(F->arg_size() == 1 && "Obsolete va_end takes 1 argument!");
- const Type *ArgTy = F->getFunctionType()->getParamType(0);
- ArgTy = cast<PointerType>(ArgTy)->getElementType();
- Function *NF = Result->getOrInsertFunction("llvm.va_end", Type::VoidTy,
- ArgTy, 0);
-
- while (!F->use_empty()) {
- CallInst *CI = cast<CallInst>(F->use_back());
- Value *V = new LoadInst(CI->getOperand(1), "", CI);
- new CallInst(NF, V, "", CI);
- CI->getParent()->getInstList().erase(CI);
- }
- Result->getFunctionList().erase(F);
- }
-
- if (Function *F = Result->getNamedFunction("llvm.va_copy")) {
- assert(F->arg_size() == 2 && "Obsolete va_copy takes 2 argument!");
- const Type *ArgTy = F->getFunctionType()->getParamType(0);
- ArgTy = cast<PointerType>(ArgTy)->getElementType();
- Function *NF = Result->getOrInsertFunction("llvm.va_copy", ArgTy,
- ArgTy, 0);
-
- while (!F->use_empty()) {
- CallInst *CI = cast<CallInst>(F->use_back());
- Value *V = new CallInst(NF, CI->getOperand(2), "", CI);
- new StoreInst(V, CI->getOperand(1), CI);
- CI->getParent()->getInstList().erase(CI);
- }
- Result->getFunctionList().erase(F);
- }
- }
-
llvmAsmin = stdin; // F is about to go away, don't use it anymore...
ParserResult = 0;
@@ -915,7 +853,6 @@ Module *llvm::RunVMAsmParser(const std::string &Filename, FILE *F) {
// Other Operators
%type <OtherOpVal> ShiftOps
%token <OtherOpVal> PHI_TOK CALL CAST SELECT SHL SHR VAARG VANEXT
-%token VA_ARG // FIXME: OBSOLETE
%start Module
%%
@@ -1986,29 +1923,6 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef {
ThrowException("select value types should match!");
$$ = new SelectInst($2, $4, $6);
}
- | VA_ARG ResolvedVal ',' Types {
- // FIXME: This is emulation code for an obsolete syntax. This should be
- // removed at some point.
- if (!ObsoleteVarArgs) {
- std::cerr << "WARNING: this file uses obsolete features. "
- << "Assemble and disassemble to update it.\n";
- ObsoleteVarArgs = true;
- }
-
- // First, load the valist...
- Instruction *CurVAList = new LoadInst($2, "");
- CurBB->getInstList().push_back(CurVAList);
-
- // Emit the vaarg instruction.
- $$ = new VAArgInst(CurVAList, *$4);
-
- // Now we must advance the pointer and update it in memory.
- Instruction *TheVANext = new VANextInst(CurVAList, *$4);
- CurBB->getInstList().push_back(TheVANext);
-
- CurBB->getInstList().push_back(new StoreInst(TheVANext, $2));
- delete $4;
- }
| VAARG ResolvedVal ',' Types {
$$ = new VAArgInst($2, *$4);
delete $4;
OpenPOWER on IntegriCloud