Use Intrinsic::getDeclaration in more places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49338 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/examples/BrainF/BrainF.cpp b/examples/BrainF/BrainF.cpp
index b2959f2..3717ee7 100644
--- a/examples/BrainF/BrainF.cpp
+++ b/examples/BrainF/BrainF.cpp
@@ -25,6 +25,7 @@
 
 #include "BrainF.h"
 #include "llvm/Constants.h"
+#include "llvm/Intrinsics.h"
 #include "llvm/ADT/STLExtras.h"
 
 using namespace llvm;
@@ -52,11 +53,7 @@
   //Function prototypes
 
   //declare void @llvm.memset.i32(i8 *, i8, i32, i32)
-  Function *memset_func = cast<Function>(module->
-    getOrInsertFunction("llvm.memset.i32", Type::VoidTy,
-                        PointerType::getUnqual(IntegerType::Int8Ty),
-                        IntegerType::Int8Ty, IntegerType::Int32Ty,
-                        IntegerType::Int32Ty, NULL));
+  Function *memset_func = Intrinsic::getDeclaration(module, Intrinsic::memset_i32);
 
   //declare i32 @getchar()
   getchar_func = cast<Function>(module->