aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/NaCl/PromoteIntegers.cpp
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2013-05-29 10:27:19 -0700
committerDerek Schuff <dschuff@chromium.org>2013-05-29 10:27:19 -0700
commitdc58e24a36836fc19c534bdcbef5152717a3c3fc (patch)
tree343a9c7047b58bcffb5466acb7dc3f52a481f547 /lib/Transforms/NaCl/PromoteIntegers.cpp
parent8d01804c97533ed9006a65c11cade3c6b23d1c75 (diff)
Enable integer promotion pass and enable ABI check for integer types.
R=mseaborn@chromium.org BUG= https://code.google.com/p/nativeclient/issues/detail?id=3360 Review URL: https://codereview.chromium.org/15950006
Diffstat (limited to 'lib/Transforms/NaCl/PromoteIntegers.cpp')
-rw-r--r--lib/Transforms/NaCl/PromoteIntegers.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Transforms/NaCl/PromoteIntegers.cpp b/lib/Transforms/NaCl/PromoteIntegers.cpp
index fcb9b2e607..37805f8d30 100644
--- a/lib/Transforms/NaCl/PromoteIntegers.cpp
+++ b/lib/Transforms/NaCl/PromoteIntegers.cpp
@@ -34,6 +34,7 @@
#include "llvm/IR/IRBuilder.h"
#include "llvm/Pass.h"
#include "llvm/Support/raw_ostream.h"
+#include "llvm/Transforms/NaCl.h"
using namespace llvm;
@@ -53,11 +54,12 @@ INITIALIZE_PASS(PromoteIntegers, "nacl-promote-ints",
"Promote integer types which are illegal in PNaCl",
false, false)
-
// Legal sizes are currently 1, 8, 16, 32, and 64.
// We can't yet expand types above 64 bit, so don't try to touch them for now.
+// TODO(dschuff): expand >64bit types or disallow >64bit packed bitfields.
+// There are currently none in our tests that use the ABI checker.
+// See https://code.google.com/p/nativeclient/issues/detail?id=3360
static bool isLegalSize(unsigned Size) {
- // TODO(dschuff): expand >64bit types or disallow >64bit packed bitfields
if (Size > 64) return true;
return Size == 1 || Size == 8 || Size == 16 || Size == 32 || Size == 64;
}
@@ -612,3 +614,7 @@ bool PromoteIntegers::runOnFunction(Function &F) {
State.eraseReplacedInstructions();
return Modified;
}
+
+FunctionPass* llvm::createPromoteIntegersPass() {
+ return new PromoteIntegers();
+}