[llvm] r249482 - Fix Clang-tidy modernize-use-nullptr warnings in source directories and generated files; other minor cleanups.
Hans Wennborg via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 6 16:24:36 PDT 2015
Author: hans
Date: Tue Oct 6 18:24:35 2015
New Revision: 249482
URL: http://llvm.org/viewvc/llvm-project?rev=249482&view=rev
Log:
Fix Clang-tidy modernize-use-nullptr warnings in source directories and generated files; other minor cleanups.
Patch by Eugene Zelenko!
Differential Revision: http://reviews.llvm.org/D13321
Modified:
llvm/trunk/lib/Analysis/ScopedNoAliasAA.cpp
llvm/trunk/lib/CodeGen/MachineCombiner.cpp
llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
llvm/trunk/lib/IR/BasicBlock.cpp
llvm/trunk/lib/IR/Module.cpp
llvm/trunk/lib/MC/MCDwarf.cpp
llvm/trunk/lib/MC/MCObjectFileInfo.cpp
llvm/trunk/lib/Support/Unix/Path.inc
llvm/trunk/lib/Target/X86/X86TargetTransformInfo.cpp
llvm/trunk/lib/Transforms/IPO/LowerBitSets.cpp
llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp
llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp
llvm/trunk/lib/Transforms/Instrumentation/SafeStack.cpp
llvm/trunk/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
llvm/trunk/lib/Transforms/Utils/LoopUnrollRuntime.cpp
llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp
llvm/trunk/tools/llvm-nm/llvm-nm.cpp
llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp
llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp
llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp
llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h
llvm/trunk/utils/TableGen/SubtargetEmitter.cpp
llvm/trunk/utils/llvm-build/llvmbuild/main.py
Modified: llvm/trunk/lib/Analysis/ScopedNoAliasAA.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScopedNoAliasAA.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScopedNoAliasAA.cpp (original)
+++ llvm/trunk/lib/Analysis/ScopedNoAliasAA.cpp Tue Oct 6 18:24:35 2015
@@ -41,6 +41,7 @@
#include "llvm/IR/Module.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
+
using namespace llvm;
// A handy option for disabling scoped no-alias functionality. The same effect
@@ -57,7 +58,7 @@ class AliasScopeNode {
const MDNode *Node;
public:
- AliasScopeNode() : Node(0) {}
+ AliasScopeNode() : Node(nullptr) {}
explicit AliasScopeNode(const MDNode *N) : Node(N) {}
/// getNode - Get the MDNode for this AliasScopeNode.
@@ -70,7 +71,7 @@ public:
return dyn_cast_or_null<MDNode>(Node->getOperand(1));
}
};
-} // End of anonymous namespace
+} // end of anonymous namespace
AliasResult ScopedNoAliasAAResult::alias(const MemoryLocation &LocA,
const MemoryLocation &LocB) {
Modified: llvm/trunk/lib/CodeGen/MachineCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCombiner.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineCombiner.cpp Tue Oct 6 18:24:35 2015
@@ -10,6 +10,7 @@
// The machine combiner pass uses machine trace metrics to ensure the combined
// instructions does not lengthen the critical path or the resource depth.
//===----------------------------------------------------------------------===//
+
#define DEBUG_TYPE "machine-combiner"
#include "llvm/ADT/Statistic.h"
@@ -122,7 +123,6 @@ unsigned
MachineCombiner::getDepth(SmallVectorImpl<MachineInstr *> &InsInstrs,
DenseMap<unsigned, unsigned> &InstrIdxForVirtReg,
MachineTraceMetrics::Trace BlockTrace) {
-
SmallVector<unsigned, 16> InstrDepth;
assert(TSchedModel.hasInstrSchedModelOrItineraries() &&
"Missing machine model\n");
@@ -181,7 +181,6 @@ MachineCombiner::getDepth(SmallVectorImp
/// \returns Latency of \p NewRoot
unsigned MachineCombiner::getLatency(MachineInstr *Root, MachineInstr *NewRoot,
MachineTraceMetrics::Trace BlockTrace) {
-
assert(TSchedModel.hasInstrSchedModelOrItineraries() &&
"Missing machine model\n");
@@ -229,7 +228,6 @@ bool MachineCombiner::improvesCriticalPa
SmallVectorImpl<MachineInstr *> &InsInstrs,
DenseMap<unsigned, unsigned> &InstrIdxForVirtReg,
bool NewCodeHasLessInsts) {
-
assert(TSchedModel.hasInstrSchedModelOrItineraries() &&
"Missing machine model\n");
// NewRoot is the last instruction in the \p InsInstrs vector.
@@ -274,6 +272,7 @@ void MachineCombiner::instr2instrSC(
InstrsSC.push_back(SC);
}
}
+
/// True when the new instructions do not increase resource length
bool MachineCombiner::preservesResourceLen(
MachineBasicBlock *MBB, MachineTraceMetrics::Trace BlockTrace,
@@ -425,7 +424,7 @@ bool MachineCombiner::runOnMachineFuncti
TSchedModel.init(SchedModel, &STI, TII);
MRI = &MF.getRegInfo();
Traces = &getAnalysis<MachineTraceMetrics>();
- MinInstr = 0;
+ MinInstr = nullptr;
OptSize = MF.getFunction()->optForSize();
DEBUG(dbgs() << getPassName() << ": " << MF.getName() << '\n');
Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp Tue Oct 6 18:24:35 2015
@@ -66,7 +66,6 @@ public:
static inline bool classof(const ELFObjectFile<ELFT> *v) {
return v->isDyldType();
}
-
};
@@ -187,7 +186,7 @@ LoadedELFObjectInfo::getObjectForDebug(c
return createELFDebugObject(Obj, *this);
}
-} // namespace
+} // anonymous namespace
namespace llvm {
@@ -772,7 +771,7 @@ void RuntimeDyldELF::findPPC64TOCSection
// relocation) without a .toc directive. In this case just use the
// first section (which is usually the .odp) since the code won't
// reference the .toc base directly.
- Rel.SymbolName = NULL;
+ Rel.SymbolName = nullptr;
Rel.SectionID = 0;
// The TOC consists of sections .got, .toc, .tocbss, .plt in that
@@ -1737,7 +1736,7 @@ uint64_t RuntimeDyldELF::allocateGOTEntr
GOTSectionID = Sections.size();
// Reserve a section id. We'll allocate the section later
// once we know the total size
- Sections.push_back(SectionEntry(".got", 0, 0, 0));
+ Sections.push_back(SectionEntry(".got", nullptr, 0, 0));
}
uint64_t StartOffset = CurrentGOTIndex * getGOTEntrySize();
CurrentGOTIndex += no;
Modified: llvm/trunk/lib/IR/BasicBlock.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/BasicBlock.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/lib/IR/BasicBlock.cpp (original)
+++ llvm/trunk/lib/IR/BasicBlock.cpp Tue Oct 6 18:24:35 2015
@@ -21,6 +21,7 @@
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Type.h"
#include <algorithm>
+
using namespace llvm;
ValueSymbolTable *BasicBlock::getValueSymbolTable() {
@@ -37,7 +38,6 @@ LLVMContext &BasicBlock::getContext() co
// are not in the public header file...
template class llvm::SymbolTableListTraits<Instruction, BasicBlock>;
-
BasicBlock::BasicBlock(LLVMContext &C, const Twine &Name, Function *NewParent,
BasicBlock *InsertBefore)
: Value(Type::getLabelTy(C), Value::BasicBlockVal), Parent(nullptr) {
@@ -245,12 +245,12 @@ BasicBlock *BasicBlock::getSingleSuccess
BasicBlock *BasicBlock::getUniqueSuccessor() {
succ_iterator SI = succ_begin(this), E = succ_end(this);
- if (SI == E) return NULL; // No successors
+ if (SI == E) return nullptr; // No successors
BasicBlock *SuccBB = *SI;
++SI;
for (;SI != E; ++SI) {
if (*SI != SuccBB)
- return NULL;
+ return nullptr;
// The same successor appears multiple times in the successor list.
// This is OK.
}
Modified: llvm/trunk/lib/IR/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Module.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Module.cpp (original)
+++ llvm/trunk/lib/IR/Module.cpp Tue Oct 6 18:24:35 2015
@@ -29,6 +29,7 @@
#include <algorithm>
#include <cstdarg>
#include <cstdlib>
+
using namespace llvm;
//===----------------------------------------------------------------------===//
@@ -81,7 +82,6 @@ RandomNumberGenerator *Module::createRNG
return new RandomNumberGenerator(Salt);
}
-
/// getNamedValue - Return the first global value in the module with
/// the specified name, of arbitrary type. This method returns null
/// if a global with the specified name is not found.
@@ -481,7 +481,7 @@ Comdat *Module::getOrInsertComdat(String
PICLevel::Level Module::getPICLevel() const {
auto *Val = cast_or_null<ConstantAsMetadata>(getModuleFlag("PIC Level"));
- if (Val == NULL)
+ if (!Val)
return PICLevel::Default;
return static_cast<PICLevel::Level>(
Modified: llvm/trunk/lib/MC/MCDwarf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDwarf.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCDwarf.cpp (original)
+++ llvm/trunk/lib/MC/MCDwarf.cpp Tue Oct 6 18:24:35 2015
@@ -27,6 +27,7 @@
#include "llvm/Support/Path.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/raw_ostream.h"
+
using namespace llvm;
static inline uint64_t ScaleAddrDelta(MCContext &Context, uint64_t AddrDelta) {
@@ -244,7 +245,6 @@ static void emitAbsValue(MCStreamer &OS,
std::pair<MCSymbol *, MCSymbol *>
MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params,
ArrayRef<char> StandardOpcodeLengths) const {
-
MCContext &context = MCOS->getContext();
// Create a symbol at the beginning of the line table.
@@ -842,7 +842,7 @@ void MCGenDwarfInfo::Emit(MCStreamer *MC
LineSectionSymbol = MCOS->getDwarfLineTableSymbol(0);
MCSymbol *AbbrevSectionSymbol = nullptr;
MCSymbol *InfoSectionSymbol = nullptr;
- MCSymbol *RangesSectionSymbol = NULL;
+ MCSymbol *RangesSectionSymbol = nullptr;
// Create end symbols for each section, and remove empty sections
MCOS->getContext().finalizeDwarfSections(*MCOS);
@@ -1458,7 +1458,7 @@ namespace {
bool IsSignalFrame;
bool IsSimple;
};
-}
+} // anonymous namespace
namespace llvm {
template <>
@@ -1485,7 +1485,7 @@ namespace llvm {
LHS.IsSimple == RHS.IsSimple;
}
};
-}
+} // namespace llvm
void MCDwarfFrameEmitter::Emit(MCObjectStreamer &Streamer, MCAsmBackend *MAB,
bool IsEH) {
Modified: llvm/trunk/lib/MC/MCObjectFileInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectFileInfo.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCObjectFileInfo.cpp (original)
+++ llvm/trunk/lib/MC/MCObjectFileInfo.cpp Tue Oct 6 18:24:35 2015
@@ -17,6 +17,7 @@
#include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCSectionMachO.h"
#include "llvm/Support/COFF.h"
+
using namespace llvm;
static bool useCompactUnwind(const Triple &T) {
@@ -259,7 +260,6 @@ void MCObjectFileInfo::initELFMCObjectFi
FDECFIEncoding = dwarf::DW_EH_PE_pcrel |
((CMModel == CodeModel::Large) ? dwarf::DW_EH_PE_sdata8
: dwarf::DW_EH_PE_sdata4);
-
break;
default:
FDECFIEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
@@ -577,7 +577,7 @@ void MCObjectFileInfo::initCOFFMCObjectF
assert(T.isOSWindows() && "Windows is the only supported COFF target");
if (T.getArch() == Triple::x86_64) {
// On Windows 64 with SEH, the LSDA is emitted into the .xdata section
- LSDASection = 0;
+ LSDASection = nullptr;
} else {
LSDASection = Ctx->getCOFFSection(".gcc_except_table",
COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
Modified: llvm/trunk/lib/Support/Unix/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Path.inc?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Path.inc (original)
+++ llvm/trunk/lib/Support/Unix/Path.inc Tue Oct 6 18:24:35 2015
@@ -75,12 +75,12 @@ test_dir(char ret[PATH_MAX], const char
char fullpath[PATH_MAX];
snprintf(fullpath, PATH_MAX, "%s/%s", dir, bin);
- if (realpath(fullpath, ret) == NULL)
- return (1);
+ if (!realpath(fullpath, ret))
+ return 1;
if (stat(fullpath, &sb) != 0)
- return (1);
+ return 1;
- return (0);
+ return 0;
}
static char *
@@ -91,34 +91,34 @@ getprogpath(char ret[PATH_MAX], const ch
/* First approach: absolute path. */
if (bin[0] == '/') {
if (test_dir(ret, "/", bin) == 0)
- return (ret);
- return (NULL);
+ return ret;
+ return nullptr;
}
/* Second approach: relative path. */
- if (strchr(bin, '/') != NULL) {
+ if (strchr(bin, '/')) {
char cwd[PATH_MAX];
- if (getcwd(cwd, PATH_MAX) == NULL)
- return (NULL);
+ if (!getcwd(cwd, PATH_MAX))
+ return nullptr;
if (test_dir(ret, cwd, bin) == 0)
- return (ret);
- return (NULL);
+ return ret;
+ return nullptr;
}
/* Third approach: $PATH */
- if ((pv = getenv("PATH")) == NULL)
- return (NULL);
+ if ((pv = getenv("PATH")) == nullptr)
+ return nullptr;
s = pv = strdup(pv);
- if (pv == NULL)
- return (NULL);
- while ((t = strsep(&s, ":")) != NULL) {
+ if (!pv)
+ return nullptr;
+ while ((t = strsep(&s, ":")) != nullptr) {
if (test_dir(ret, t, bin) == 0) {
free(pv);
- return (ret);
+ return ret;
}
}
free(pv);
- return (NULL);
+ return nullptr;
}
#endif // __FreeBSD__ || __NetBSD__ || __FreeBSD_kernel__
@@ -153,8 +153,8 @@ std::string getMainExecutable(const char
return std::string(exe_path, len);
} else {
// Fall back to the classical detection.
- if (getprogpath(exe_path, argv0) != NULL)
- return exe_path;
+ if (getprogpath(exe_path, argv0))
+ return exe_path;
}
#elif defined(HAVE_DLFCN_H)
// Use dladdr to get executable path if available.
Modified: llvm/trunk/lib/Target/X86/X86TargetTransformInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetTransformInfo.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetTransformInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetTransformInfo.cpp Tue Oct 6 18:24:35 2015
@@ -21,6 +21,7 @@
#include "llvm/Support/Debug.h"
#include "llvm/Target/CostTable.h"
#include "llvm/Target/TargetLowering.h"
+
using namespace llvm;
#define DEBUG_TYPE "x86tti"
@@ -62,8 +63,8 @@ unsigned X86TTIImpl::getRegisterBitWidth
if (ST->is64Bit())
return 64;
- return 32;
+ return 32;
}
unsigned X86TTIImpl::getMaxInterleaveFactor(unsigned VF) {
@@ -880,7 +881,7 @@ int X86TTIImpl::getMaskedMemoryOpCost(un
// Scalarization
int MaskSplitCost = getScalarizationOverhead(MaskTy, false, true);
int ScalarCompareCost = getCmpSelInstrCost(
- Instruction::ICmp, Type::getInt8Ty(getGlobalContext()), NULL);
+ Instruction::ICmp, Type::getInt8Ty(getGlobalContext()), nullptr);
int BranchCost = getCFInstrCost(Instruction::Br);
int MaskCmpCost = NumElem * (BranchCost + ScalarCompareCost);
@@ -898,8 +899,8 @@ int X86TTIImpl::getMaskedMemoryOpCost(un
if (LT.second != TLI->getValueType(DL, SrcVTy).getSimpleVT() &&
LT.second.getVectorNumElements() == NumElem)
// Promotion requires expand/truncate for data and a shuffle for mask.
- Cost += getShuffleCost(TTI::SK_Alternate, SrcVTy, 0, 0) +
- getShuffleCost(TTI::SK_Alternate, MaskTy, 0, 0);
+ Cost += getShuffleCost(TTI::SK_Alternate, SrcVTy, 0, nullptr) +
+ getShuffleCost(TTI::SK_Alternate, MaskTy, 0, nullptr);
else if (LT.second.getVectorNumElements() > NumElem) {
VectorType *NewMaskTy = VectorType::get(MaskTy->getVectorElementType(),
Modified: llvm/trunk/lib/Transforms/IPO/LowerBitSets.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/LowerBitSets.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/LowerBitSets.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/LowerBitSets.cpp Tue Oct 6 18:24:35 2015
@@ -107,7 +107,6 @@ void BitSetInfo::print(raw_ostream &OS)
for (uint64_t B : Bits)
OS << B << ' ';
OS << "}\n";
- return;
}
BitSetInfo BitSetBuilder::build() {
@@ -262,7 +261,7 @@ struct LowerBitSets : public ModulePass
bool runOnModule(Module &M) override;
};
-} // namespace
+} // anonymous namespace
INITIALIZE_PASS_BEGIN(LowerBitSets, "lowerbitsets",
"Lower bitset metadata", false, false)
@@ -610,7 +609,7 @@ void LowerBitSets::lowerBitSetCalls(
BSI.print(dbgs());
});
- ByteArrayInfo *BAI = 0;
+ ByteArrayInfo *BAI = nullptr;
// Lower each call to llvm.bitset.test for this bitset.
for (CallInst *CI : BitSetTestCallSites[BS]) {
Modified: llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Tue Oct 6 18:24:35 2015
@@ -113,6 +113,7 @@
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include <vector>
+
using namespace llvm;
#define DEBUG_TYPE "mergefunc"
@@ -465,9 +466,9 @@ public:
F = G;
}
- void release() { F = 0; }
+ void release() { F = nullptr; }
};
-}
+} // end anonymous namespace
int FunctionComparator::cmpNumbers(uint64_t L, uint64_t R) const {
if (L < R) return -1;
@@ -535,6 +536,7 @@ int FunctionComparator::cmpAttrs(const A
}
return 0;
}
+
int FunctionComparator::cmpRangeMetadata(const MDNode* L,
const MDNode* R) const {
if (L == R)
@@ -770,7 +772,6 @@ int FunctionComparator::cmpGlobalValues(
/// defines total ordering among the types set.
/// See method declaration comments for more details.
int FunctionComparator::cmpTypes(Type *TyL, Type *TyR) const {
-
PointerType *PTyL = dyn_cast<PointerType>(TyL);
PointerType *PTyR = dyn_cast<PointerType>(TyR);
@@ -1164,7 +1165,6 @@ int FunctionComparator::cmpBasicBlocks(c
// Test whether the two functions have equivalent behaviour.
int FunctionComparator::compare() {
-
sn_mapL.clear();
sn_mapR.clear();
@@ -1400,7 +1400,7 @@ private:
bool HasGlobalAliases;
};
-} // end anonymous namespace
+} // end anonymous namespace
char MergeFunctions::ID = 0;
INITIALIZE_PASS(MergeFunctions, "mergefunc", "Merge Functions", false, false)
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp Tue Oct 6 18:24:35 2015
@@ -216,8 +216,6 @@ static void ComputeUnsignedMinMaxValuesF
Max = KnownOne|UnknownBits;
}
-
-
/// FoldCmpLoadFromIndexedGlobal - Called we see this pattern:
/// cmp pred (load (gep GV, ...)), cmpcst
/// where GV is a global variable with a constant initializer. Try to simplify
@@ -371,7 +369,6 @@ FoldCmpLoadFromIndexedGlobal(GetElementP
}
}
-
// If this element is in range, update our magic bitvector.
if (i < 64 && IsTrueForElt)
MagicBitvector |= 1ULL << i;
@@ -469,7 +466,6 @@ FoldCmpLoadFromIndexedGlobal(GetElementP
return new ICmpInst(ICmpInst::ICMP_UGT, Idx, End);
}
-
// If a magic bitvector captures the entire comparison state
// of this load, replace it with computation that does:
// ((magic_cst >> i) & 1) != 0
@@ -496,7 +492,6 @@ FoldCmpLoadFromIndexedGlobal(GetElementP
return nullptr;
}
-
/// EvaluateGEPOffsetExpression - Return a value that can be used to compare
/// the *offset* implied by a GEP to zero. For example, if we have &A[i], we
/// want to return 'i' for "icmp ne i, 0". Note that, in general, indices can
@@ -562,8 +557,6 @@ static Value *EvaluateGEPOffsetExpressio
}
}
-
-
// Okay, we know we have a single variable index, which must be a
// pointer/array/vector index. If there is no offset, life is simple, return
// the index.
@@ -851,7 +844,6 @@ Instruction *InstCombiner::FoldICmpDivCs
// to the same result value.
HiOverflow = AddWithOverflow(HiBound, LoBound, RangeSize, false);
}
-
} else if (DivRHS->getValue().isStrictlyPositive()) { // Divisor is > 0.
if (CmpRHSV == 0) { // (X / pos) op 0
// Can't overflow. e.g. X/2 op 0 --> [-1, 2)
@@ -996,7 +988,6 @@ Instruction *InstCombiner::FoldICmpShrCs
return Res;
}
-
// If we are comparing against bits always shifted out, the
// comparison cannot succeed.
APInt Comp = CmpRHSV << ShAmtVal;
@@ -2514,7 +2505,6 @@ static APInt DemandedBitsLHSMask(ICmpIns
default:
return APInt::getAllOnesValue(BitWidth);
}
-
}
/// \brief Check if the order of \p Op0 and \p Op1 as operand in an ICmpInst
@@ -2951,7 +2941,6 @@ Instruction *InstCombiner::visitICmpInst
ConstantInt::get(X->getType(),
CI->countTrailingZeros()));
}
-
break;
}
case ICmpInst::ICMP_NE: {
@@ -2996,7 +2985,6 @@ Instruction *InstCombiner::visitICmpInst
ConstantInt::get(X->getType(),
CI->countTrailingZeros()));
}
-
break;
}
case ICmpInst::ICMP_ULT:
@@ -3149,7 +3137,7 @@ Instruction *InstCombiner::visitICmpInst
// comparison into the select arms, which will cause one to be
// constant folded and the select turned into a bitwise or.
Value *Op1 = nullptr, *Op2 = nullptr;
- ConstantInt *CI = 0;
+ ConstantInt *CI = nullptr;
if (Constant *C = dyn_cast<Constant>(LHSI->getOperand(1))) {
Op1 = ConstantExpr::getICmp(I.getPredicate(), C, RHSC);
CI = dyn_cast<ConstantInt>(Op1);
Modified: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp Tue Oct 6 18:24:35 2015
@@ -729,7 +729,7 @@ struct FunctionStackPoisoner : public In
Instruction *ThenTerm, Value *ValueIfFalse);
};
-} // namespace
+} // anonymous namespace
char AddressSanitizer::ID = 0;
INITIALIZE_PASS_BEGIN(
@@ -959,7 +959,7 @@ void AddressSanitizer::instrumentMop(Obj
// If initialization order checking is disabled, a simple access to a
// dynamically initialized global is always valid.
GlobalVariable *G = dyn_cast<GlobalVariable>(GetUnderlyingObject(Addr, DL));
- if (G != NULL && (!ClInitializers || GlobalIsLinkerInitialized(G)) &&
+ if (G && (!ClInitializers || GlobalIsLinkerInitialized(G)) &&
isSafeAccess(ObjSizeVis, Addr, TypeSize)) {
NumOptimizedAccessesToGlobalVar++;
return;
@@ -1805,7 +1805,7 @@ void FunctionStackPoisoner::poisonStack(
unpoisonDynamicAllocas();
}
- if (AllocaVec.size() == 0) return;
+ if (AllocaVec.empty()) return;
int StackMallocIdx = -1;
DebugLoc EntryDebugLocation;
Modified: llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp Tue Oct 6 18:24:35 2015
@@ -291,17 +291,17 @@ static const PlatformMemoryMapParams Lin
};
static const PlatformMemoryMapParams Linux_MIPS_MemoryMapParams = {
- NULL,
+ nullptr,
&Linux_MIPS64_MemoryMapParams,
};
static const PlatformMemoryMapParams Linux_PowerPC_MemoryMapParams = {
- NULL,
+ nullptr,
&Linux_PowerPC64_MemoryMapParams,
};
static const PlatformMemoryMapParams Linux_ARM_MemoryMapParams = {
- NULL,
+ nullptr,
&Linux_AArch64_MemoryMapParams,
};
@@ -384,7 +384,7 @@ class MemorySanitizer : public FunctionP
friend struct VarArgAMD64Helper;
friend struct VarArgMIPS64Helper;
};
-} // namespace
+} // anonymous namespace
char MemorySanitizer::ID = 0;
INITIALIZE_PASS(MemorySanitizer, "msan",
@@ -407,7 +407,6 @@ static GlobalVariable *createPrivateNonC
GlobalValue::PrivateLinkage, StrConst, "");
}
-
/// \brief Insert extern declaration of runtime-provided functions and globals.
void MemorySanitizer::initializeCallbacks(Module &M) {
// Only do this once.
@@ -3105,7 +3104,7 @@ VarArgHelper *CreateVarArgHelper(Functio
return new VarArgNoOpHelper(Func, Msan, Visitor);
}
-} // namespace
+} // anonymous namespace
bool MemorySanitizer::runOnFunction(Function &F) {
if (&F == MsanCtorFunction)
Modified: llvm/trunk/lib/Transforms/Instrumentation/SafeStack.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/SafeStack.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/SafeStack.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/SafeStack.cpp Tue Oct 6 18:24:35 2015
@@ -278,7 +278,7 @@ Value *SafeStack::getOrCreateUnsafeStack
UnsafeStackPtr = new GlobalVariable(
/*Module=*/M, /*Type=*/StackPtrTy,
/*isConstant=*/false, /*Linkage=*/GlobalValue::ExternalLinkage,
- /*Initializer=*/0, /*Name=*/kUnsafeStackPtrVar,
+ /*Initializer=*/nullptr, /*Name=*/kUnsafeStackPtrVar,
/*InsertBefore=*/nullptr,
/*ThreadLocalMode=*/GlobalValue::InitialExecTLSModel);
} else {
@@ -619,7 +619,7 @@ bool SafeStack::runOnFunction(Function &
return true;
}
-} // end anonymous namespace
+} // anonymous namespace
char SafeStack::ID = 0;
INITIALIZE_TM_PASS_BEGIN(SafeStack, "safe-stack",
Modified: llvm/trunk/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp Tue Oct 6 18:24:35 2015
@@ -92,6 +92,7 @@
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/SSAUpdater.h"
#include <vector>
+
using namespace llvm;
#define DEBUG_TYPE "mldst-motion"
@@ -238,7 +239,6 @@ bool MergedLoadStoreMotion::isDiamondHea
/// being loaded or protect against the load from happening
/// it is considered a hoist barrier.
///
-
bool MergedLoadStoreMotion::isLoadHoistBarrierInRange(const Instruction& Start,
const Instruction& End,
LoadInst* LI) {
@@ -396,7 +396,6 @@ bool MergedLoadStoreMotion::mergeLoads(B
/// value being stored or protect against the store from
/// happening it is considered a sink barrier.
///
-
bool MergedLoadStoreMotion::isStoreSinkBarrierInRange(const Instruction &Start,
const Instruction &End,
MemoryLocation Loc) {
@@ -440,7 +439,7 @@ StoreInst *MergedLoadStoreMotion::canSin
PHINode *MergedLoadStoreMotion::getPHIOperand(BasicBlock *BB, StoreInst *S0,
StoreInst *S1) {
// Create a phi if the values mismatch.
- PHINode *NewPN = 0;
+ PHINode *NewPN = nullptr;
Value *Opd1 = S0->getValueOperand();
Value *Opd2 = S1->getValueOperand();
if (Opd1 != Opd2) {
@@ -561,6 +560,7 @@ bool MergedLoadStoreMotion::mergeStores(
}
return MergedStores;
}
+
///
/// \brief Run the transformation for each function
///
Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Tue Oct 6 18:24:35 2015
@@ -41,6 +41,7 @@
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Support/CommandLine.h"
#include <algorithm>
+
using namespace llvm;
static cl::opt<bool>
@@ -121,7 +122,7 @@ namespace {
}
}
};
-}
+} // anonymous namespace
/// Get or create a target for the branch from ResumeInsts.
BasicBlock *LandingPadInliningInfo::getInnerResumeDest() {
@@ -613,7 +614,7 @@ static void AddAliasScopeMetadata(CallSi
for (unsigned i = 0, ie = PtrArgs.size(); i != ie; ++i) {
SmallVector<Value *, 4> Objects;
GetUnderlyingObjects(const_cast<Value*>(PtrArgs[i]),
- Objects, DL, /* MaxLookup = */ 0);
+ Objects, DL, /* LI = */ nullptr);
for (Value *O : Objects)
ObjSet.insert(O);
@@ -1451,7 +1452,6 @@ bool llvm::InlineFunction(CallSite CS, I
}
}
-
// Add a branch to the merge points and remove return instructions.
DebugLoc Loc;
for (unsigned i = 0, e = Returns.size(); i != e; ++i) {
Modified: llvm/trunk/lib/Transforms/Utils/LoopUnrollRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopUnrollRuntime.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LoopUnrollRuntime.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LoopUnrollRuntime.cpp Tue Oct 6 18:24:35 2015
@@ -150,7 +150,7 @@ static void CloneLoopBlocks(Loop *L, Val
Function *F = Header->getParent();
LoopBlocksDFS::RPOIterator BlockBegin = LoopBlocks.beginRPO();
LoopBlocksDFS::RPOIterator BlockEnd = LoopBlocks.endRPO();
- Loop *NewLoop = 0;
+ Loop *NewLoop = nullptr;
Loop *ParentLoop = L->getParentLoop();
if (!UnrollProlog) {
NewLoop = new Loop();
Modified: llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp (original)
+++ llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp Tue Oct 6 18:24:35 2015
@@ -96,7 +96,7 @@ private:
};
static void Warning(const Twine &Msg) { errs() << "warning: " + Msg + "\n"; }
-}
+} // anonymous namespace
/// Reset the parser state coresponding to the current object
/// file. This is to be called after an object file is finished
@@ -185,14 +185,14 @@ static const struct DarwinStabName Darwi
{MachO::N_LBRAC, "N_LBRAC"}, {MachO::N_EXCL, "N_EXCL"},
{MachO::N_RBRAC, "N_RBRAC"}, {MachO::N_BCOMM, "N_BCOMM"},
{MachO::N_ECOMM, "N_ECOMM"}, {MachO::N_ECOML, "N_ECOML"},
- {MachO::N_LENG, "N_LENG"}, {0, 0}};
+ {MachO::N_LENG, "N_LENG"}, {0, nullptr}};
static const char *getDarwinStabString(uint8_t NType) {
for (unsigned i = 0; DarwinStabNames[i].Name; i++) {
if (DarwinStabNames[i].NType == NType)
return DarwinStabNames[i].Name;
}
- return 0;
+ return nullptr;
}
void MachODebugMapParser::dumpSymTabHeader(raw_ostream &OS, StringRef Arch) {
@@ -209,7 +209,6 @@ void MachODebugMapParser::dumpSymTabEntr
uint32_t StringIndex, uint8_t Type,
uint8_t SectionIndex, uint16_t Flags,
uint64_t Value) {
-
// Index
OS << '[' << format_decimal(Index, 6) << "] "
// n_strx
@@ -471,5 +470,5 @@ bool dumpStab(StringRef InputFile, Array
MachODebugMapParser Parser(InputFile, Archs, PrependPath, false);
return Parser.dumpStab();
}
-}
-}
+} // namespace dsymutil
+} // namespace llvm
Modified: llvm/trunk/tools/llvm-nm/llvm-nm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-nm/llvm-nm.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-nm/llvm-nm.cpp (original)
+++ llvm/trunk/tools/llvm-nm/llvm-nm.cpp Tue Oct 6 18:24:35 2015
@@ -44,6 +44,7 @@
#include <cstring>
#include <system_error>
#include <vector>
+
using namespace llvm;
using namespace object;
@@ -159,7 +160,7 @@ bool MultipleFiles = false;
bool HadError = false;
std::string ToolName;
-}
+} // anonymous namespace
static void error(Twine Message, Twine Path = Twine()) {
HadError = true;
@@ -182,7 +183,7 @@ struct NMSymbol {
StringRef Name;
BasicSymbolRef Sym;
};
-}
+} // anonymous namespace
static bool compareSymbolAddress(const NMSymbol &A, const NMSymbol &B) {
bool ADefined = !(A.Sym.getFlags() & SymbolRef::SF_Undefined);
@@ -439,13 +440,14 @@ static const struct DarwinStabName Darwi
{MachO::N_ECOMM, "ECOMM"},
{MachO::N_ECOML, "ECOML"},
{MachO::N_LENG, "LENG"},
- {0, 0}};
+ {0, nullptr}};
+
static const char *getDarwinStabString(uint8_t NType) {
for (unsigned i = 0; DarwinStabNames[i].Name; i++) {
if (DarwinStabNames[i].NType == NType)
return DarwinStabNames[i].Name;
}
- return 0;
+ return nullptr;
}
// darwinPrintStab() prints the n_sect, n_desc along with a symbolic name of
@@ -1150,7 +1152,6 @@ static void dumpSymbolNamesFromFile(std:
return;
}
error("unrecognizable file type", Filename);
- return;
}
int main(int argc, char **argv) {
Modified: llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp (original)
+++ llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp Tue Oct 6 18:24:35 2015
@@ -1,4 +1,4 @@
-//===- MCJITTest.cpp - Unit tests for the MCJIT ---------------------------===//
+//===- MCJITTest.cpp - Unit tests for the MCJIT -----------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -479,14 +479,14 @@ TEST_F(MCJITCAPITest, addGlobalMapping)
Module = LLVMModuleCreateWithName("testModule");
LLVMSetTarget(Module, HostTriple.c_str());
- LLVMTypeRef FunctionType = LLVMFunctionType(LLVMInt32Type(), NULL, 0, 0);
+ LLVMTypeRef FunctionType = LLVMFunctionType(LLVMInt32Type(), nullptr, 0, 0);
LLVMValueRef MappedFn = LLVMAddFunction(Module, "mapped_fn", FunctionType);
Function = LLVMAddFunction(Module, "test_fn", FunctionType);
LLVMBasicBlockRef Entry = LLVMAppendBasicBlock(Function, "");
LLVMBuilderRef Builder = LLVMCreateBuilder();
LLVMPositionBuilderAtEnd(Builder, Entry);
- LLVMValueRef RetVal = LLVMBuildCall(Builder, MappedFn, NULL, 0, "");
+ LLVMValueRef RetVal = LLVMBuildCall(Builder, MappedFn, nullptr, 0, "");
LLVMBuildRet(Builder, RetVal);
LLVMDisposeBuilder(Builder);
Modified: llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp (original)
+++ llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp Tue Oct 6 18:24:35 2015
@@ -1,4 +1,4 @@
-//===- MCJITMultipeModuleTest.cpp - Unit tests for the MCJIT---------------===//
+//===- MCJITMultipeModuleTest.cpp - Unit tests for the MCJIT-----*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -223,7 +223,7 @@ TEST_F(MCJITMultipleModuleTest, two_modu
EXPECT_EQ(GVA, TheJIT->FindGlobalVariableNamed("GVA"));
EXPECT_EQ(GVB, TheJIT->FindGlobalVariableNamed("GVB"));
EXPECT_EQ(GVC, TheJIT->FindGlobalVariableNamed("GVC",true));
- EXPECT_EQ(NULL, TheJIT->FindGlobalVariableNamed("GVC"));
+ EXPECT_EQ(nullptr, TheJIT->FindGlobalVariableNamed("GVC"));
uint64_t FBPtr = TheJIT->getFunctionAddress(FB->getName().str());
TheJIT->finalizeObject();
@@ -420,4 +420,4 @@ TEST_F(MCJITMultipleModuleTest, FindFunc
EXPECT_EQ(FB1, TheJIT->FindFunctionNamed(FB1->getName().data()));
}
-}
+} // end anonymous namespace
Modified: llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp (original)
+++ llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp Tue Oct 6 18:24:35 2015
@@ -1,4 +1,4 @@
-//===- MCJITTest.cpp - Unit tests for the MCJIT ---------------------------===//
+//===- MCJITTest.cpp - Unit tests for the MCJIT -----------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -196,7 +196,7 @@ TEST_F(MCJITTest, multiple_decl_lookups)
void *A = TheJIT->getPointerToFunction(Foo);
void *B = TheJIT->getPointerToFunction(Foo);
- EXPECT_TRUE(A != 0) << "Failed lookup - test not correctly configured.";
+ EXPECT_TRUE(A != nullptr) << "Failed lookup - test not correctly configured.";
EXPECT_EQ(A, B) << "Repeat calls to getPointerToFunction fail.";
}
@@ -281,4 +281,4 @@ TEST_F(MCJITTest, lazy_function_creator_
EXPECT_FALSE(std::find(I, E, "Foo2") == E);
}
-}
+} // end anonymous namespace
Modified: llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h (original)
+++ llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h Tue Oct 6 18:24:35 2015
@@ -1,4 +1,4 @@
-//===- MCJITTestBase.h - Common base class for MCJIT Unit tests ----------===//
+//===- MCJITTestBase.h - Common base class for MCJIT Unit tests -*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -13,7 +13,6 @@
//
//===----------------------------------------------------------------------===//
-
#ifndef LLVM_UNITTESTS_EXECUTIONENGINE_MCJIT_MCJITTESTBASE_H
#define LLVM_UNITTESTS_EXECUTIONENGINE_MCJIT_MCJITTESTBASE_H
@@ -160,10 +159,10 @@ protected:
// }
// NOTE: if Helper is left as the default parameter, Helper == recursive_add.
Function *insertAccumulateFunction(Module *M,
- Function *Helper = 0,
- StringRef Name = "accumulate") {
+ Function *Helper = nullptr,
+ StringRef Name = "accumulate") {
Function *Result = startFunction<int32_t(int32_t)>(M, Name);
- if (Helper == 0)
+ if (!Helper)
Helper = Result;
BasicBlock *BaseCase = BasicBlock::Create(Context, "", Result);
@@ -199,7 +198,7 @@ protected:
Function *&FB1, Function *&FB2) {
// Define FB1 in B.
B.reset(createEmptyModule("B"));
- FB1 = insertAccumulateFunction(B.get(), 0, "FB1");
+ FB1 = insertAccumulateFunction(B.get(), nullptr, "FB1");
// Declare FB1 in A (as an external).
A.reset(createEmptyModule("A"));
@@ -234,7 +233,6 @@ protected:
FC = insertSimpleCallFunction<int32_t(int32_t, int32_t)>(C.get(), FBExtern_in_C);
}
-
// Module A { Function FA },
// Populates Modules A and B:
// Module B { Function FB }
@@ -279,7 +277,6 @@ protected:
}
};
-
class MCJITTestBase : public MCJITTestAPICommon, public TrivialModuleBuilder {
protected:
@@ -348,4 +345,4 @@ protected:
} // namespace llvm
-#endif
+#endif // LLVM_UNITTESTS_EXECUTIONENGINE_MCJIT_MCJITTESTBASE_H
Modified: llvm/trunk/utils/TableGen/SubtargetEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/SubtargetEmitter.cpp?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/SubtargetEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/SubtargetEmitter.cpp Tue Oct 6 18:24:35 2015
@@ -26,6 +26,7 @@
#include <map>
#include <string>
#include <vector>
+
using namespace llvm;
#define DEBUG_TYPE "subtarget-emitter"
@@ -105,9 +106,8 @@ public:
Records(R), SchedModels(TGT.getSchedModels()), Target(TGT.getName()) {}
void run(raw_ostream &o);
-
};
-} // End anonymous namespace
+} // end anonymous namespace
//
// Enumeration - Emit the specified class as an enumeration.
@@ -1199,7 +1199,8 @@ void SubtargetEmitter::EmitProcessorMode
<< " " << (SchedModels.schedClassEnd()
- SchedModels.schedClassBegin()) << ",\n";
else
- OS << " 0, 0, 0, 0, // No instruction-level machine model.\n";
+ OS << " nullptr, nullptr, 0, 0,"
+ << " // No instruction-level machine model.\n";
if (PI->hasItineraries())
OS << " " << PI->ItinsDef->getName() << "};\n";
else
@@ -1414,7 +1415,7 @@ void SubtargetEmitter::run(raw_ostream &
OS << "namespace llvm {\n";
Enumeration(OS, "SubtargetFeature");
- OS << "} // End llvm namespace \n";
+ OS << "} // end llvm namespace\n";
OS << "#endif // GET_SUBTARGETINFO_ENUM\n\n";
OS << "\n#ifdef GET_SUBTARGETINFO_MC_DESC\n";
@@ -1461,7 +1462,7 @@ void SubtargetEmitter::run(raw_ostream &
OS << "0, 0, 0";
OS << ");\n}\n\n";
- OS << "} // End llvm namespace \n";
+ OS << "} // end llvm namespace\n";
OS << "#endif // GET_SUBTARGETINFO_MC_DESC\n\n";
@@ -1491,7 +1492,7 @@ void SubtargetEmitter::run(raw_ostream &
<< " DFAPacketizer *createDFAPacketizer(const InstrItineraryData *IID)"
<< " const;\n"
<< "};\n";
- OS << "} // End llvm namespace \n";
+ OS << "} // end llvm namespace\n";
OS << "#endif // GET_SUBTARGETINFO_HEADER\n\n";
@@ -1543,7 +1544,7 @@ void SubtargetEmitter::run(raw_ostream &
EmitSchedModelHelpers(ClassName, OS);
- OS << "} // End llvm namespace \n";
+ OS << "} // end llvm namespace\n";
OS << "#endif // GET_SUBTARGETINFO_CTOR\n\n";
}
@@ -1555,4 +1556,4 @@ void EmitSubtarget(RecordKeeper &RK, raw
SubtargetEmitter(RK, CGTarget).run(OS);
}
-} // End llvm namespace
+} // end llvm namespace
Modified: llvm/trunk/utils/llvm-build/llvmbuild/main.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvm-build/llvmbuild/main.py?rev=249482&r1=249481&r2=249482&view=diff
==============================================================================
--- llvm/trunk/utils/llvm-build/llvmbuild/main.py (original)
+++ llvm/trunk/utils/llvm-build/llvmbuild/main.py Tue Oct 6 18:24:35 2015
@@ -411,11 +411,15 @@ subdirectories = %s
f.write('} AvailableComponents[%d] = {\n' % len(entries))
for name,library_name,required_names,is_installed in entries:
if library_name is None:
- library_name_as_cstr = '0'
+ library_name_as_cstr = 'nullptr'
else:
library_name_as_cstr = '"lib%s.a"' % library_name
- f.write(' { "%s", %s, %d, { %s } },\n' % (
- name, library_name_as_cstr, is_installed,
+ if is_installed:
+ is_installed_as_cstr = 'true'
+ else:
+ is_installed_as_cstr = 'false'
+ f.write(' { "%s", %s, %s, { %s } },\n' % (
+ name, library_name_as_cstr, is_installed_as_cstr,
', '.join('"%s"' % dep
for dep in required_names)))
f.write('};\n')
More information about the llvm-commits
mailing list