Cleanup of the [SU]ADDO type legalization code. Patch by Duncan!
[oota-llvm.git] / lib / AsmParser / llvmAsmParser.y
index f2e6404d307cc6d0633e55137e7565ad60a330cb..af8e3afee3f6213abce006c314634c24dbac03af 100644 (file)
@@ -418,6 +418,7 @@ static Value *getExistingVal(const Type *Ty, const ValID &D) {
 
     {
       APSInt Tmp = *D.ConstPoolInt;
+      D.destroy();
       Tmp.extOrTrunc(Ty->getPrimitiveSizeInBits());
       return ConstantInt::get(Tmp);
     }
@@ -436,7 +437,11 @@ static Value *getExistingVal(const Type *Ty, const ValID &D) {
       D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven,
                              &ignored);
     }
-    return ConstantFP::get(*D.ConstPoolFP);
+    {
+      ConstantFP *tmp = ConstantFP::get(*D.ConstPoolFP);
+      D.destroy();
+      return tmp;
+    }
 
   case ValID::ConstNullVal:      // Is it a null value?
     if (!isa<PointerType>(Ty)) {
@@ -1132,7 +1137,7 @@ Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) {
 
 // Function Attributes
 %token SIGNEXT ZEROEXT NORETURN INREG SRET NOUNWIND NOALIAS BYVAL NEST
-%token READNONE READONLY GC OPTSIZE NOINLINE ALWAYSINLINE
+%token READNONE READONLY GC OPTSIZE NOINLINE ALWAYSINLINE SSP SSPREQ
 
 // Visibility Styles
 %token DEFAULT HIDDEN PROTECTED
@@ -1300,7 +1305,9 @@ FuncAttr      : NORETURN { $$ = Attribute::NoReturn; }
               | READONLY { $$ = Attribute::ReadOnly; }
               | NOINLINE { $$ = Attribute::NoInline; }
               | ALWAYSINLINE { $$ = Attribute::AlwaysInline; }
-              | OPTSIZE { $$ = Attribute::OptimizeForSize; }
+              | OPTSIZE  { $$ = Attribute::OptimizeForSize; }
+              | SSP      { $$ = Attribute::StackProtect; }
+              | SSPREQ   { $$ = Attribute::StackProtectReq; }
               ;
 
 OptFuncAttrs  : /* empty */ { $$ = Attribute::None; }