summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp16
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp3
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp20
-rw-r--r--llvm/lib/CodeGen/TargetInstrInfo.cpp5
-rw-r--r--llvm/lib/CodeGen/TwoAddressInstructionPass.cpp3
-rw-r--r--llvm/lib/IR/GCOV.cpp4
-rw-r--r--llvm/lib/IR/Value.cpp8
-rw-r--r--llvm/lib/MC/ELFObjectWriter.cpp5
-rw-r--r--llvm/lib/MC/MCMachOStreamer.cpp1
-rw-r--r--llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp3
-rw-r--r--llvm/lib/Target/X86/X86CallFrameOptimization.cpp3
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp2
-rw-r--r--llvm/lib/Transforms/Utils/BuildLibCalls.cpp1
13 files changed, 30 insertions, 44 deletions
diff --git a/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp b/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp
index fe5e07cc45d..566142ecff7 100644
--- a/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp
+++ b/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp
@@ -35,6 +35,7 @@ static char getHexDigit(int N) {
return '0' + N;
return 'a' + N - 10;
}
+
raw_ostream &BlockMass::print(raw_ostream &OS) const {
for (int Digits = 0; Digits < 16; ++Digits)
OS << getHexDigit(Mass >> (60 - Digits * 4) & 0xf);
@@ -78,7 +79,7 @@ struct DitheringDistributer {
BlockMass takeMass(uint32_t Weight);
};
-} // end namespace
+} // end anonymous namespace
DitheringDistributer::DitheringDistributer(Distribution &Dist,
const BlockMass &Mass) {
@@ -130,6 +131,7 @@ static void combineWeight(Weight &W, const Weight &OtherW) {
else
W.Amount += OtherW.Amount;
}
+
static void combineWeightsBySorting(WeightList &Weights) {
// Sort so edges to the same node are adjacent.
std::sort(Weights.begin(), Weights.end(),
@@ -149,8 +151,8 @@ static void combineWeightsBySorting(WeightList &Weights) {
// Erase extra entries.
Weights.erase(O, Weights.end());
- return;
}
+
static void combineWeightsByHashing(WeightList &Weights) {
// Collect weights into a DenseMap.
typedef DenseMap<BlockNode::IndexType, Weight> HashTable;
@@ -168,6 +170,7 @@ static void combineWeightsByHashing(WeightList &Weights) {
for (const auto &I : Combined)
Weights.push_back(I.second);
}
+
static void combineWeights(WeightList &Weights) {
// Use a hash table for many successors to keep this linear.
if (Weights.size() > 128) {
@@ -177,6 +180,7 @@ static void combineWeights(WeightList &Weights) {
combineWeightsBySorting(Weights);
}
+
static uint64_t shiftRightAndRound(uint64_t N, int Shift) {
assert(Shift >= 0);
assert(Shift < 64);
@@ -184,6 +188,7 @@ static uint64_t shiftRightAndRound(uint64_t N, int Shift) {
return N;
return (N >> Shift) + (UINT64_C(1) & N >> (Shift - 1));
}
+
void Distribution::normalize() {
// Early exit for termination nodes.
if (Weights.empty())
@@ -523,6 +528,7 @@ BlockFrequencyInfoImplBase::getBlockFreq(const BlockNode &Node) const {
return 0;
return Freqs[Node.Index].Integer;
}
+
Scaled64
BlockFrequencyInfoImplBase::getFloatingBlockFreq(const BlockNode &Node) const {
if (!Node.isValid())
@@ -541,6 +547,7 @@ std::string
BlockFrequencyInfoImplBase::getBlockName(const BlockNode &Node) const {
return std::string();
}
+
std::string
BlockFrequencyInfoImplBase::getLoopName(const LoopData &Loop) const {
return getBlockName(Loop.getHeader()) + (Loop.isIrreducible() ? "**" : "*");
@@ -568,6 +575,7 @@ void IrreducibleGraph::addNodesInLoop(const BFIBase::LoopData &OuterLoop) {
addNode(N);
indexNodes();
}
+
void IrreducibleGraph::addNodesInFunction() {
Start = 0;
for (uint32_t Index = 0; Index < BFI.Working.size(); ++Index)
@@ -575,10 +583,12 @@ void IrreducibleGraph::addNodesInFunction() {
addNode(Index);
indexNodes();
}
+
void IrreducibleGraph::indexNodes() {
for (auto &I : Nodes)
Lookup[I.Node.Index] = &I;
}
+
void IrreducibleGraph::addEdge(IrrNode &Irr, const BlockNode &Succ,
const BFIBase::LoopData *OuterLoop) {
if (OuterLoop && OuterLoop->isHeader(Succ))
@@ -605,7 +615,7 @@ template <> struct GraphTraits<IrreducibleGraph> {
static ChildIteratorType child_begin(NodeType *N) { return N->succ_begin(); }
static ChildIteratorType child_end(NodeType *N) { return N->succ_end(); }
};
-}
+} // end namespace llvm
/// \brief Find extra irreducible headers.
///
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index dfd25bd4603..612f6c8a035 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -54,6 +54,7 @@
#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetSubtargetInfo.h"
+
using namespace llvm;
#define DEBUG_TYPE "dwarfdebug"
@@ -297,7 +298,6 @@ static void getObjCClassCategory(StringRef In, StringRef &Class,
Class = In.slice(In.find('[') + 1, In.find('('));
Category = In.slice(In.find('[') + 1, In.find(' '));
- return;
}
static StringRef getObjCMethodName(StringRef In) {
@@ -530,7 +530,6 @@ void DwarfDebug::finishSubprogramDefinitions() {
});
}
-
// Collect info for variables that were optimized out.
void DwarfDebug::collectDeadVariables() {
const Module *M = MMI->getModule();
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 859d45c732b..2666951914a 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -59,6 +59,7 @@
#include "llvm/Target/TargetSubtargetInfo.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include <algorithm>
+
using namespace llvm;
#define DEBUG_TYPE "isel"
@@ -317,7 +318,7 @@ namespace llvm {
"Unknown sched type!");
return createILPListDAGScheduler(IS, OptLevel);
}
-}
+} // end namespace llvm
// EmitInstrWithCustomInserter - This method should be implemented by targets
// that mark instructions with the 'usesCustomInserter' flag. These
@@ -854,7 +855,8 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
Scheduler->Run(CurDAG, FuncInfo->MBB);
}
- if (ViewSUnitDAGs && MatchFilterBB) Scheduler->viewGraph();
+ if (ViewSUnitDAGs && MatchFilterBB)
+ Scheduler->viewGraph();
// Emit machine code to BB. This can change 'BB' to the last block being
// inserted into.
@@ -1147,7 +1149,7 @@ static void collectFailStats(const Instruction *I) {
case Instruction::LandingPad: NumFastIselFailLandingPad++; return;
}
}
-#endif
+#endif // NDEBUG
void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) {
// Initialize the Fast-ISel state, if needed.
@@ -1454,7 +1456,6 @@ FindSplitPointForStackProtector(MachineBasicBlock *BB, DebugLoc DL) {
void
SelectionDAGISel::FinishBasicBlock() {
-
DEBUG(dbgs() << "Total amount of phi nodes to update: "
<< FuncInfo->PHINodesToUpdate.size() << "\n";
for (unsigned i = 0, e = FuncInfo->PHINodesToUpdate.size(); i != e; ++i)
@@ -1685,7 +1686,6 @@ SelectionDAGISel::FinishBasicBlock() {
SDB->SwitchCases.clear();
}
-
/// Create the scheduler. If a specific scheduler was specified
/// via the SchedulerRegistry, use it, otherwise select the
/// one preferred by the target.
@@ -1996,8 +1996,6 @@ SDNode
return New.getNode();
}
-
-
SDNode *SelectionDAGISel::Select_UNDEF(SDNode *N) {
return CurDAG->SelectNodeTo(N, TargetOpcode::IMPLICIT_DEF,N->getValueType(0));
}
@@ -2019,7 +2017,6 @@ GetVBR(uint64_t Val, const unsigned char *MatcherTable, unsigned &Idx) {
return Val;
}
-
/// UpdateChainsAndGlue - When a match is complete, this method updates uses of
/// interior glue and chain results to use the new glue and chain results.
void SelectionDAGISel::
@@ -2223,7 +2220,6 @@ WalkChainUsers(const SDNode *ChainedNode,
ChainedNodesInPattern.push_back(User);
InteriorChainedNodes.push_back(User);
}
- continue;
}
return Result;
@@ -2549,7 +2545,6 @@ static unsigned IsPredicateKnownToFail(const unsigned char *Table,
}
namespace {
-
struct MatchScope {
/// FailIndex - If this match fails, this is the index to continue with.
unsigned FailIndex;
@@ -2606,7 +2601,7 @@ public:
J.setNode(E);
}
};
-}
+} // end anonymous namespace
SDNode *SelectionDAGISel::
SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable,
@@ -3310,7 +3305,6 @@ SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable,
InputGlue, GlueResultNodesMatched, true);
return Res;
}
-
continue;
}
@@ -3426,8 +3420,6 @@ SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable,
}
}
-
-
void SelectionDAGISel::CannotYetSelect(SDNode *N) {
std::string msg;
raw_string_ostream Msg(msg);
diff --git a/llvm/lib/CodeGen/TargetInstrInfo.cpp b/llvm/lib/CodeGen/TargetInstrInfo.cpp
index 6eaf991ac70..74b47040078 100644
--- a/llvm/lib/CodeGen/TargetInstrInfo.cpp
+++ b/llvm/lib/CodeGen/TargetInstrInfo.cpp
@@ -31,6 +31,7 @@
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include <cctype>
+
using namespace llvm;
static cl::opt<bool> DisableHazardRecognizer(
@@ -76,8 +77,6 @@ void TargetInstrInfo::insertNoop(MachineBasicBlock &MBB,
/// may be overloaded in the target code to do that.
unsigned TargetInstrInfo::getInlineAsmLength(const char *Str,
const MCAsmInfo &MAI) const {
-
-
// Count the number of instructions in the asm.
bool atInsnStart = true;
unsigned Length = 0;
@@ -637,7 +636,6 @@ bool TargetInstrInfo::isReassociationCandidate(const MachineInstr &Inst,
bool TargetInstrInfo::getMachineCombinerPatterns(
MachineInstr &Root,
SmallVectorImpl<MachineCombinerPattern> &Patterns) const {
-
bool Commute;
if (isReassociationCandidate(Root, Commute)) {
// We found a sequence of instructions that may be suitable for a
@@ -768,7 +766,6 @@ void TargetInstrInfo::genAlternativeCodeSequence(
assert(Prev && "Unknown pattern for machine combiner");
reassociateOps(Root, *Prev, Pattern, InsInstrs, DelInstrs, InstIdxForVirtReg);
- return;
}
/// foldMemoryOperand - Same as the previous version except it allows folding
diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
index c6bae243458..e8009cc8337 100644
--- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -50,6 +50,7 @@
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetSubtargetInfo.h"
+
using namespace llvm;
#define DEBUG_TYPE "twoaddrinstr"
@@ -539,7 +540,6 @@ regsAreCompatible(unsigned RegA, unsigned RegB, const TargetRegisterInfo *TRI) {
return TRI->regsOverlap(RegA, RegB);
}
-
/// Return true if it's potentially profitable to commute the two-address
/// instruction that's being processed.
bool
@@ -808,7 +808,6 @@ void TwoAddressInstructionPass::processCopy(MachineInstr *MI) {
}
Processed.insert(MI);
- return;
}
/// If there is one more local instruction that reads 'Reg' and it kills 'Reg,
diff --git a/llvm/lib/IR/GCOV.cpp b/llvm/lib/IR/GCOV.cpp
index fd6ebcabc8e..5cce9624009 100644
--- a/llvm/lib/IR/GCOV.cpp
+++ b/llvm/lib/IR/GCOV.cpp
@@ -22,6 +22,7 @@
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <system_error>
+
using namespace llvm;
//===----------------------------------------------------------------------===//
@@ -496,7 +497,7 @@ public:
OS << format("%5u:", LineNum) << Line << "\n";
}
};
-}
+} // end anonymous namespace
/// Convert a path to a gcov filename. If PreservePaths is true, this
/// translates "/" to "#", ".." to "^", and drops ".", to match gcov.
@@ -683,7 +684,6 @@ void FileInfo::print(raw_ostream &InfoOS, StringRef MainFilename,
if (Options.FuncCoverage)
printFuncCoverage(InfoOS);
printFileCoverage(InfoOS);
- return;
}
/// printFunctionSummary - Print function and block summary.
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp
index eb9deb6a07e..250f451b6b4 100644
--- a/llvm/lib/IR/Value.cpp
+++ b/llvm/lib/IR/Value.cpp
@@ -34,6 +34,7 @@
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
+
using namespace llvm;
//===----------------------------------------------------------------------===//
@@ -356,7 +357,7 @@ static bool contains(Value *Expr, Value *V) {
SmallPtrSet<ConstantExpr *, 4> Cache;
return contains(Cache, CE, C);
}
-#endif
+#endif // NDEBUG
void Value::replaceAllUsesWith(Value *New) {
assert(New && "Value::replaceAllUsesWith(<null>) is invalid!");
@@ -408,7 +409,6 @@ void Value::replaceUsesOutsideBlock(Value *New, BasicBlock *BB) {
continue;
U.set(New);
}
- return;
}
namespace {
@@ -463,7 +463,7 @@ static Value *stripPointerCastsAndOffsets(Value *V) {
return V;
}
-} // namespace
+} // end anonymous namespace
Value *Value::stripPointerCasts() {
return stripPointerCastsAndOffsets<PSK_ZeroIndicesAndAliases>(this);
@@ -642,7 +642,6 @@ void ValueHandleBase::RemoveFromUseList() {
}
}
-
void ValueHandleBase::ValueIsDeleted(Value *V) {
assert(V->HasValueHandle && "Should only be called if ValueHandles present");
@@ -699,7 +698,6 @@ void ValueHandleBase::ValueIsDeleted(Value *V) {
}
}
-
void ValueHandleBase::ValueIsRAUWd(Value *Old, Value *New) {
assert(Old->HasValueHandle &&"Should only be called if ValueHandles present");
assert(Old != New && "Changing value into itself!");
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index 20ad41659f4..01b7148cea7 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -35,13 +35,13 @@
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/StringSaver.h"
#include <vector>
+
using namespace llvm;
#undef DEBUG_TYPE
#define DEBUG_TYPE "reloc-info"
namespace {
-
typedef DenseMap<const MCSectionELF *, uint32_t> SectionIndexMapTy;
class ELFObjectWriter;
@@ -232,7 +232,7 @@ class ELFObjectWriter : public MCObjectWriter {
uint32_t GroupSymbolIndex, uint64_t Offset, uint64_t Size,
const MCSectionELF &Section);
};
-}
+} // end anonymous namespace
void ELFObjectWriter::align(unsigned Alignment) {
uint64_t Padding = OffsetToAlignment(getStream().tell(), Alignment);
@@ -713,7 +713,6 @@ void ELFObjectWriter::recordRelocation(MCAssembler &Asm,
}
ELFRelocationEntry Rec(FixupOffset, SymA, Type, Addend);
Relocations[&FixupSection].push_back(Rec);
- return;
}
bool ELFObjectWriter::isInSymtab(const MCAsmLayout &Layout,
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp
index 578ae962007..f59fa1d5169 100644
--- a/llvm/lib/MC/MCMachOStreamer.cpp
+++ b/llvm/lib/MC/MCMachOStreamer.cpp
@@ -427,7 +427,6 @@ void MCMachOStreamer::EmitZerofill(MCSection *Section, MCSymbol *Symbol,
void MCMachOStreamer::EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
uint64_t Size, unsigned ByteAlignment) {
EmitZerofill(Section, Symbol, Size, ByteAlignment);
- return;
}
void MCMachOStreamer::EmitInstToData(const MCInst &Inst,
diff --git a/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp b/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp
index 040143b1558..0d883f313ea 100644
--- a/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp
+++ b/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp
@@ -53,7 +53,6 @@ struct ContextDecision {
#define debug(s) do { } while (0)
#endif
-
/*
* contextForAttrs - Client for the instruction context table. Takes a set of
* attributes and returns the appropriate decode context.
@@ -276,8 +275,6 @@ static void dbgprintf(struct InternalInstruction* insn,
va_end(ap);
insn->dlog(insn->dlogArg, buffer);
-
- return;
}
/*
diff --git a/llvm/lib/Target/X86/X86CallFrameOptimization.cpp b/llvm/lib/Target/X86/X86CallFrameOptimization.cpp
index fc6ee1752f1..c4bf5a410b9 100644
--- a/llvm/lib/Target/X86/X86CallFrameOptimization.cpp
+++ b/llvm/lib/Target/X86/X86CallFrameOptimization.cpp
@@ -110,7 +110,7 @@ private:
};
char X86CallFrameOptimization::ID = 0;
-}
+} // end anonymous namespace
FunctionPass *llvm::createX86CallFrameOptimization() {
return new X86CallFrameOptimization();
@@ -440,7 +440,6 @@ void X86CallFrameOptimization::collectCallInfo(MachineFunction &MF,
return;
Context.UsePush = true;
- return;
}
bool X86CallFrameOptimization::adjustCallSequence(MachineFunction &MF,
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
index be31f984db7..e7e3f821b9a 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
@@ -321,8 +321,6 @@ void FAddendCoef::operator*=(const FAddendCoef &That) {
APFloat::rmNearestTiesToEven);
else
F0.multiply(That.getFpVal(), APFloat::rmNearestTiesToEven);
-
- return;
}
void FAddendCoef::negate() {
diff --git a/llvm/lib/Transforms/Utils/BuildLibCalls.cpp b/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
index adf3b1703ec..40339cc748e 100644
--- a/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
+++ b/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
@@ -226,7 +226,6 @@ static void appendTypeSuffix(Value *Op, StringRef &Name,
Name = NameBuffer;
}
- return;
}
Value *llvm::emitUnaryFloatFnCall(Value *Op, StringRef Name, IRBuilder<> &B,
OpenPOWER on IntegriCloud