Skip to content

Commit

Permalink
Fix -Wunused-function warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
akyrtzi committed Nov 6, 2015
1 parent 156607c commit f0f83d3
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 62 deletions.
15 changes: 0 additions & 15 deletions lib/IRGen/IRGenSIL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3713,21 +3713,6 @@ static void emitUncheckedValueBitCast(IRGenSILFunction &IGF,
return;
}

static void emitValueBitCast(IRGenSILFunction &IGF,
SourceLoc loc,
Explosion &in,
const LoadableTypeInfo &inTI,
Explosion &out,
const LoadableTypeInfo &outTI) {
// Unfortunately, we can't check this invariant until we get to IRGen, since
// the AST and SIL don't know anything about type layout.
if (inTI.getFixedSize() != outTI.getFixedSize()) {
emitTrapAndUndefValue(IGF, in, out, outTI);
return;
}
emitUncheckedValueBitCast(IGF, loc, in, inTI, out, outTI);
}

static void emitValueBitwiseCast(IRGenSILFunction &IGF,
SourceLoc loc,
Explosion &in,
Expand Down
10 changes: 0 additions & 10 deletions lib/SILPasses/SpeculativeDevirtualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,6 @@ static FullApplySite CloneApply(FullApplySite AI, SILBuilder &Builder) {
return NAI;
}

/// Check if a given value is used as an operand of a given instruction.
static bool isOperandOf(SILValue V, SILInstruction *I) {
for (auto &Op : I->getAllOperands()) {
if (Op.get() == V) {
return true;
}
}
return false;
}

/// Insert monomorphic inline caches for a specific class or metatype
/// type \p SubClassTy.
static FullApplySite speculateMonomorphicTarget(FullApplySite AI,
Expand Down
18 changes: 0 additions & 18 deletions lib/SILPasses/Utils/Devirtualize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,24 +340,6 @@ bool swift::canDevirtualizeClassMethod(FullApplySite AI,
return true;
}

/// Insert a cast for an address argument if its type is not the same
/// as the expected parameter type, which can happen with covariant
/// indirect return types and contravariant argument types.
static SILValue conditionallyCastAddr(SILBuilderWithScope<16> &B,
SILLocation Loc, SILValue Arg,
SILType ParamTy) {
if (Arg.getType() == ParamTy)
return Arg;

if (Arg.getType().isAddress())
return B.createUncheckedAddrCast(Loc, Arg, ParamTy);

assert(Arg.getType().isHeapObjectReferenceType() &&
"Expected address type or heap object reference for argument!");

return B.createUncheckedRefCast(Loc, Arg, ParamTy);
}

/// \brief Devirtualize an apply of a class method.
///
/// \p AI is the apply to devirtualize.
Expand Down
19 changes: 0 additions & 19 deletions tools/SourceKit/lib/SwiftLang/SwiftCompletion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,25 +403,6 @@ static UIdent KeywordForUID("source.lang.swift.keyword.for");
static UIdent KeywordWhileUID("source.lang.swift.keyword.while");
static UIdent KeywordFuncUID("source.lang.swift.keyword.func");

static UIdent getUIDForKeywordKind(CodeCompletionKeywordKind kind) {
switch (kind) {
case CodeCompletionKeywordKind::kw_let:
return KeywordLetUID;
case CodeCompletionKeywordKind::kw_var:
return KeywordVarUID;
case CodeCompletionKeywordKind::kw_if:
return KeywordIfUID;
case CodeCompletionKeywordKind::kw_for:
return KeywordForUID;
case CodeCompletionKeywordKind::kw_while:
return KeywordWhileUID;
case CodeCompletionKeywordKind::kw_func:
return KeywordFuncUID;
default:
return KeywordUID;
}
}

bool SwiftToSourceKitCompletionAdapter::handleResult(
SourceKit::CodeCompletionConsumer &Consumer, Completion *Result,
bool leadingPunctuation, bool includeLiterals) {
Expand Down

0 comments on commit f0f83d3

Please sign in to comment.