Implement -mno-sse: if SSE is disabled on x86-64, don't store XMM on stack for
[oota-llvm.git] / lib / VMCore / Function.cpp
index f83fe435cd0e2243695e97074e6a001d26353f2c..bda2eff4c99c3b48140e1ac7938f8e6fa225f742 100644 (file)
@@ -18,7 +18,6 @@
 #include "llvm/Support/LeakDetector.h"
 #include "llvm/Support/StringPool.h"
 #include "SymbolTableListTraitsImpl.h"
-#include "llvm/ADT/BitVector.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/StringExtras.h"
 using namespace llvm;
@@ -161,12 +160,10 @@ Function::Function(const FunctionType *Ty, LinkageTypes Linkage,
                    const std::string &name, Module *ParentModule)
   : GlobalValue(PointerType::getUnqual(Ty), 
                 Value::FunctionVal, 0, 0, Linkage, name) {
+  assert(FunctionType::isValidReturnType(getReturnType()) &&
+         !isa<OpaqueType>(getReturnType()) && "invalid return type");
   SymTab = new ValueSymbolTable();
 
-  assert((getReturnType()->isFirstClassType() ||getReturnType() == Type::VoidTy
-          || isa<StructType>(getReturnType()))
-         && "LLVM functions cannot return aggregate values!");
-
   // If the function has arguments, mark them as lazily built.
   if (Ty->getNumParams())
     SubclassData = 1;   // Set the "has lazy arguments" bit.
@@ -362,20 +359,11 @@ const FunctionType *Intrinsic::getType(ID id, const Type **Tys,
   return FunctionType::get(ResultTy, ArgTys, IsVarArg); 
 }
 
-AttrListPtr Intrinsic::getAttributes(ID id) {
-  Attributes Attr = Attribute::None;
-
+/// This defines the "Intrinsic::getAttributes(ID id)" method.
 #define GET_INTRINSIC_ATTRIBUTES
 #include "llvm/Intrinsics.gen"
 #undef GET_INTRINSIC_ATTRIBUTES
 
-  // Intrinsics cannot throw exceptions.
-  Attr |= Attribute::NoUnwind;
-
-  AttributeWithIndex PAWI = AttributeWithIndex::get(~0, Attr);
-  return AttrListPtr::get(&PAWI, 1);
-}
-
 Function *Intrinsic::getDeclaration(Module *M, ID id, const Type **Tys, 
                                     unsigned numTys) {
   // There can never be multiple globals with the same name of different types,