本文整理汇总了C++中ArchSpec::MergeFrom方法的典型用法代码示例。如果您正苦于以下问题:C++ ArchSpec::MergeFrom方法的具体用法?C++ ArchSpec::MergeFrom怎么用?C++ ArchSpec::MergeFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArchSpec
的用法示例。
在下文中一共展示了ArchSpec::MergeFrom方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
lldb::UnwindAssemblySP
FuncUnwinders::GetUnwindAssemblyProfiler(Target &target) {
UnwindAssemblySP assembly_profiler_sp;
ArchSpec arch;
if (m_unwind_table.GetArchitecture(arch)) {
arch.MergeFrom(target.GetArchitecture());
assembly_profiler_sp = UnwindAssembly::FindPlugin(arch);
}
return assembly_profiler_sp;
}
示例2: B
TEST(ArchSpecTest, MergeFrom) {
{
ArchSpec A;
ArchSpec B("x86_64-pc-linux");
EXPECT_FALSE(A.IsValid());
ASSERT_TRUE(B.IsValid());
EXPECT_EQ(llvm::Triple::ArchType::x86_64, B.GetTriple().getArch());
EXPECT_EQ(llvm::Triple::VendorType::PC, B.GetTriple().getVendor());
EXPECT_EQ(llvm::Triple::OSType::Linux, B.GetTriple().getOS());
EXPECT_EQ(ArchSpec::eCore_x86_64_x86_64, B.GetCore());
A.MergeFrom(B);
ASSERT_TRUE(A.IsValid());
EXPECT_EQ(llvm::Triple::ArchType::x86_64, A.GetTriple().getArch());
EXPECT_EQ(llvm::Triple::VendorType::PC, A.GetTriple().getVendor());
EXPECT_EQ(llvm::Triple::OSType::Linux, A.GetTriple().getOS());
EXPECT_EQ(ArchSpec::eCore_x86_64_x86_64, A.GetCore());
}
{
ArchSpec A("aarch64");
ArchSpec B("aarch64--linux-android");
EXPECT_TRUE(A.IsValid());
EXPECT_TRUE(B.IsValid());
EXPECT_EQ(llvm::Triple::ArchType::aarch64, B.GetTriple().getArch());
EXPECT_EQ(llvm::Triple::VendorType::UnknownVendor,
B.GetTriple().getVendor());
EXPECT_EQ(llvm::Triple::OSType::Linux, B.GetTriple().getOS());
EXPECT_EQ(llvm::Triple::EnvironmentType::Android,
B.GetTriple().getEnvironment());
A.MergeFrom(B);
EXPECT_EQ(llvm::Triple::ArchType::aarch64, A.GetTriple().getArch());
EXPECT_EQ(llvm::Triple::VendorType::UnknownVendor,
A.GetTriple().getVendor());
EXPECT_EQ(llvm::Triple::OSType::Linux, A.GetTriple().getOS());
EXPECT_EQ(llvm::Triple::EnvironmentType::Android,
A.GetTriple().getEnvironment());
}
}