Skip to content

Remove includes to llvm's CallSite.h #31361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/IRGen/CallEmission.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class CallEmission {
void emitToUnmappedMemory(Address addr);
void emitToUnmappedExplosion(Explosion &out);
void emitYieldsToExplosion(Explosion &out);
llvm::CallSite emitCallSite();
llvm::CallInst *emitCallSite();

public:
CallEmission(IRGenFunction &IGF, Callee &&callee)
Expand Down
8 changes: 3 additions & 5 deletions lib/IRGen/GenCall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "swift/SIL/SILType.h"
#include "swift/ABI/MetadataValues.h"
#include "swift/Runtime/Config.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/GlobalPtrAuthInfo.h"
#include "llvm/Support/Compiler.h"

Expand Down Expand Up @@ -1517,7 +1516,7 @@ void CallEmission::emitToUnmappedExplosion(Explosion &out) {
auto call = emitCallSite();

// Bail out immediately on a void result.
llvm::Value *result = call.getInstruction();
llvm::Value *result = call;
if (result->getType()->isVoidTy())
return;

Expand Down Expand Up @@ -1585,7 +1584,7 @@ void CallEmission::emitToUnmappedMemory(Address result) {
}

/// The private routine to ultimately emit a call or invoke instruction.
llvm::CallSite CallEmission::emitCallSite() {
llvm::CallInst *CallEmission::emitCallSite() {
assert(LastArgWritten == 0);
assert(!EmittedCall);
EmittedCall = true;
Expand Down Expand Up @@ -1733,8 +1732,7 @@ void CallEmission::emitYieldsToExplosion(Explosion &out) {

// Pull the raw return values out.
Explosion rawReturnValues;
extractScalarResults(IGF, call->getType(), call.getInstruction(),
rawReturnValues);
extractScalarResults(IGF, call->getType(), call, rawReturnValues);

auto coroInfo = getCallee().getSignature().getCoroutineInfo();

Expand Down
1 change: 0 additions & 1 deletion lib/IRGen/GenClass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "swift/SIL/SILType.h"
#include "swift/SIL/SILVTableVisitor.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalVariable.h"
Expand Down
1 change: 0 additions & 1 deletion lib/IRGen/GenControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
//===----------------------------------------------------------------------===//

#include "llvm/ADT/STLExtras.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/Function.h"
#include "IRGenFunction.h"
#include "IRGenModule.h"
Expand Down
5 changes: 2 additions & 3 deletions lib/LLVMPasses/LLVMMergeFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/IRBuilder.h"
Expand Down Expand Up @@ -543,8 +542,8 @@ static bool isEligibleFunction(Function *F) {
// outweighs the benefit.
for (BasicBlock &BB : *F) {
for (Instruction &I : BB) {
if (CallSite CS = CallSite(&I)) {
Function *Callee = CS.getCalledFunction();
if (CallBase *CB = dyn_cast<CallBase>(&I)) {
Function *Callee = CB->getCalledFunction();
if (Callee && !mayMergeCallsToFunction(*Callee))
return false;
if (!Callee || !Callee->isIntrinsic()) {
Expand Down