projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't use a potentially expensive shift if all we want is one set bit.
[oota-llvm.git]
/
examples
/
BrainF
/
BrainF.cpp
diff --git
a/examples/BrainF/BrainF.cpp
b/examples/BrainF/BrainF.cpp
index cd9a1408715d707a14b78d6c7a991dfdf5a0a5d5..f8129b819e3a6da2a3081a0a140a44a8232816f6 100644
(file)
--- a/
examples/BrainF/BrainF.cpp
+++ b/
examples/BrainF/BrainF.cpp
@@
-24,10
+24,10
@@
//===--------------------------------------------------------------------===//
#include "BrainF.h"
//===--------------------------------------------------------------------===//
#include "BrainF.h"
-#include "llvm/Constants.h"
-#include "llvm/Instructions.h"
-#include "llvm/Intrinsics.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/STLExtras.h"
+#include "llvm/IR/Constants.h"
+#include "llvm/IR/Instructions.h"
+#include "llvm/IR/Intrinsics.h"
#include <iostream>
using namespace llvm;
#include <iostream>
using namespace llvm;
@@
-134,7
+134,8
@@
void BrainF::header(LLVMContext& C) {
{
//@aberrormsg = internal constant [%d x i8] c"\00"
Constant *msg_0 =
{
//@aberrormsg = internal constant [%d x i8] c"\00"
Constant *msg_0 =
- ConstantArray::get(C, "Error: The head has left the tape.", true);
+ ConstantDataArray::getString(C, "Error: The head has left the tape.",
+ true);
GlobalVariable *aberrormsg = new GlobalVariable(
*module,
GlobalVariable *aberrormsg = new GlobalVariable(
*module,
@@
-162,8
+163,7
@@
void BrainF::header(LLVMContext& C) {
};
Constant *msgptr = ConstantExpr::
};
Constant *msgptr = ConstantExpr::
- getGetElementPtr(aberrormsg, gep_params,
- array_lengthof(gep_params));
+ getGetElementPtr(aberrormsg, gep_params);
Value *puts_params[] = {
msgptr
Value *puts_params[] = {
msgptr