|
@@ -20,6 +20,7 @@
|
|
#include "llvm/ADT/SmallVector.h"
|
|
#include "llvm/ADT/SmallVector.h"
|
|
#include "llvm/IR/Constants.h"
|
|
#include "llvm/IR/Constants.h"
|
|
#include "llvm/IR/DerivedTypes.h"
|
|
#include "llvm/IR/DerivedTypes.h"
|
|
|
|
+#include "llvm/IR/Instructions.h"
|
|
#include "llvm/IR/Type.h"
|
|
#include "llvm/IR/Type.h"
|
|
#include "llvm/IR/Value.h"
|
|
#include "llvm/IR/Value.h"
|
|
#include <functional>
|
|
#include <functional>
|
|
@@ -128,7 +129,7 @@ static inline SourcePred anyFloatType() {
|
|
|
|
|
|
static inline SourcePred anyPtrType() {
|
|
static inline SourcePred anyPtrType() {
|
|
auto Pred = [](ArrayRef<Value *>, const Value *V) {
|
|
auto Pred = [](ArrayRef<Value *>, const Value *V) {
|
|
- return V->getType()->isPointerTy();
|
|
|
|
|
|
+ return V->getType()->isPointerTy() && !V->isSwiftError();
|
|
};
|
|
};
|
|
auto Make = [](ArrayRef<Value *>, ArrayRef<Type *> Ts) {
|
|
auto Make = [](ArrayRef<Value *>, ArrayRef<Type *> Ts) {
|
|
std::vector<Constant *> Result;
|
|
std::vector<Constant *> Result;
|
|
@@ -142,6 +143,9 @@ static inline SourcePred anyPtrType() {
|
|
|
|
|
|
static inline SourcePred sizedPtrType() {
|
|
static inline SourcePred sizedPtrType() {
|
|
auto Pred = [](ArrayRef<Value *>, const Value *V) {
|
|
auto Pred = [](ArrayRef<Value *>, const Value *V) {
|
|
|
|
+ if (V->isSwiftError())
|
|
|
|
+ return false;
|
|
|
|
+
|
|
if (const auto *PtrT = dyn_cast<PointerType>(V->getType()))
|
|
if (const auto *PtrT = dyn_cast<PointerType>(V->getType()))
|
|
return PtrT->getElementType()->isSized();
|
|
return PtrT->getElementType()->isSized();
|
|
return false;
|
|
return false;
|