summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ExecutionEngine/MCJIT
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2015-10-06 23:24:35 +0000
committerHans Wennborg <hans@hanshq.net>2015-10-06 23:24:35 +0000
commit083ca9bb3233fb4df575bfb8c4198e3f9d6e3acd (patch)
tree81cfb3fc70e644d0ab252b18b9fabf6b764da86a /llvm/unittests/ExecutionEngine/MCJIT
parent44780acd913643391779768c0b1d9259e294dbe8 (diff)
downloadbcm5719-llvm-083ca9bb3233fb4df575bfb8c4198e3f9d6e3acd.tar.gz
bcm5719-llvm-083ca9bb3233fb4df575bfb8c4198e3f9d6e3acd.zip
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 llvm-svn: 249482
Diffstat (limited to 'llvm/unittests/ExecutionEngine/MCJIT')
-rw-r--r--llvm/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp6
-rw-r--r--llvm/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp6
-rw-r--r--llvm/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp6
-rw-r--r--llvm/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h15
4 files changed, 15 insertions, 18 deletions
diff --git a/llvm/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp b/llvm/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp
index 85cabdbd41a..7704e5a2f79 100644
--- a/llvm/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp
+++ b/llvm/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp
@@ -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);
diff --git a/llvm/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp b/llvm/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp
index 7d52a9acca7..c84a16bf687 100644
--- a/llvm/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp
+++ b/llvm/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp
@@ -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_module_global_variables_case) {
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, FindFunctionNamed_test) {
EXPECT_EQ(FB1, TheJIT->FindFunctionNamed(FB1->getName().data()));
}
-}
+} // end anonymous namespace
diff --git a/llvm/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp b/llvm/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp
index 01e796d9a4e..0f10441006a 100644
--- a/llvm/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp
+++ b/llvm/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp
@@ -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_lambda) {
EXPECT_FALSE(std::find(I, E, "Foo2") == E);
}
-}
+} // end anonymous namespace
diff --git a/llvm/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h b/llvm/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h
index 0749a1dfb9c..d2e62d2cea2 100644
--- a/llvm/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h
+++ b/llvm/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h
@@ -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
OpenPOWER on IntegriCloud