summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/AsmParser/AsmParserTest.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-04-14 21:59:01 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-04-14 21:59:01 +0000
commit03b42e41bf4bdd9ab05ea4c6905bae5d19971960 (patch)
treed4249845a564b11af673299653e7c4e876d8c4f2 /llvm/unittests/AsmParser/AsmParserTest.cpp
parent3d1c1deb04efe0022f11ebc18bb43d7341ba0c75 (diff)
downloadbcm5719-llvm-03b42e41bf4bdd9ab05ea4c6905bae5d19971960.tar.gz
bcm5719-llvm-03b42e41bf4bdd9ab05ea4c6905bae5d19971960.zip
Remove every uses of getGlobalContext() in LLVM (but the C API)
At the same time, fixes InstructionsTest::CastInst unittest: yes you can leave the IR in an invalid state and exit when you don't destroy the context (like the global one), no longer now. This is the first part of http://reviews.llvm.org/D19094 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266379
Diffstat (limited to 'llvm/unittests/AsmParser/AsmParserTest.cpp')
-rw-r--r--llvm/unittests/AsmParser/AsmParserTest.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/unittests/AsmParser/AsmParserTest.cpp b/llvm/unittests/AsmParser/AsmParserTest.cpp
index 38810cd7c7a..ddbedd05c7b 100644
--- a/llvm/unittests/AsmParser/AsmParserTest.cpp
+++ b/llvm/unittests/AsmParser/AsmParserTest.cpp
@@ -21,7 +21,7 @@ using namespace llvm;
namespace {
TEST(AsmParserTest, NullTerminatedInput) {
- LLVMContext &Ctx = getGlobalContext();
+ LLVMContext Ctx;
StringRef Source = "; Empty module \n";
SMDiagnostic Error;
auto Mod = parseAssemblyString(Source, Error, Ctx);
@@ -34,7 +34,7 @@ TEST(AsmParserTest, NullTerminatedInput) {
#ifndef NDEBUG
TEST(AsmParserTest, NonNullTerminatedInput) {
- LLVMContext &Ctx = getGlobalContext();
+ LLVMContext Ctx;
StringRef Source = "; Empty module \n\1\2";
SMDiagnostic Error;
std::unique_ptr<Module> Mod;
@@ -47,7 +47,7 @@ TEST(AsmParserTest, NonNullTerminatedInput) {
#endif
TEST(AsmParserTest, SlotMappingTest) {
- LLVMContext &Ctx = getGlobalContext();
+ LLVMContext Ctx;
StringRef Source = "@0 = global i32 0\n !0 = !{}\n !42 = !{i32 42}";
SMDiagnostic Error;
SlotMapping Mapping;
@@ -66,7 +66,7 @@ TEST(AsmParserTest, SlotMappingTest) {
}
TEST(AsmParserTest, TypeAndConstantValueParsing) {
- LLVMContext &Ctx = getGlobalContext();
+ LLVMContext Ctx;
SMDiagnostic Error;
StringRef Source = "define void @test() {\n entry:\n ret void\n}";
auto Mod = parseAssemblyString(Source, Error, Ctx);
@@ -117,7 +117,7 @@ TEST(AsmParserTest, TypeAndConstantValueParsing) {
}
TEST(AsmParserTest, TypeAndConstantValueWithSlotMappingParsing) {
- LLVMContext &Ctx = getGlobalContext();
+ LLVMContext Ctx;
SMDiagnostic Error;
StringRef Source =
"%st = type { i32, i32 }\n"
@@ -153,7 +153,7 @@ TEST(AsmParserTest, TypeAndConstantValueWithSlotMappingParsing) {
}
TEST(AsmParserTest, TypeWithSlotMappingParsing) {
- LLVMContext &Ctx = getGlobalContext();
+ LLVMContext Ctx;
SMDiagnostic Error;
StringRef Source =
"%st = type { i32, i32 }\n"
@@ -277,7 +277,7 @@ TEST(AsmParserTest, TypeWithSlotMappingParsing) {
}
TEST(AsmParserTest, TypeAtBeginningWithSlotMappingParsing) {
- LLVMContext &Ctx = getGlobalContext();
+ LLVMContext Ctx;
SMDiagnostic Error;
StringRef Source =
"%st = type { i32, i32 }\n"
OpenPOWER on IntegriCloud