[PATCH] D48798: llvm-nm: Observe -no-llvm-bc for archive members
Dave Lee via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 30 15:55:41 PDT 2018
kastiglione updated this revision to Diff 153640.
kastiglione added a comment.
Fixup test
Repository:
rL LLVM
https://reviews.llvm.org/D48798
Files:
test/tools/llvm-nm/X86/archive-no-llvm-bc.test
tools/llvm-nm/llvm-nm.cpp
Index: tools/llvm-nm/llvm-nm.cpp
===================================================================
--- tools/llvm-nm/llvm-nm.cpp
+++ tools/llvm-nm/llvm-nm.cpp
@@ -1721,8 +1721,9 @@
return;
LLVMContext Context;
- Expected<std::unique_ptr<Binary>> BinaryOrErr = createBinary(
- BufferOrErr.get()->getMemBufferRef(), NoLLVMBitcode ? nullptr : &Context);
+ LLVMContext *ContextPtr = NoLLVMBitcode ? nullptr : &Context;
+ Expected<std::unique_ptr<Binary>> BinaryOrErr =
+ createBinary(BufferOrErr.get()->getMemBufferRef(), ContextPtr);
if (!BinaryOrErr) {
error(BinaryOrErr.takeError(), Filename);
return;
@@ -1754,7 +1755,8 @@
{
Error Err = Error::success();
for (auto &C : A->children(Err)) {
- Expected<std::unique_ptr<Binary>> ChildOrErr = C.getAsBinary(&Context);
+ Expected<std::unique_ptr<Binary>> ChildOrErr =
+ C.getAsBinary(ContextPtr);
if (!ChildOrErr) {
if (auto E = isNotObjectErrorInvalidFileType(ChildOrErr.takeError()))
error(std::move(E), Filename, C);
@@ -1825,7 +1827,7 @@
Error Err = Error::success();
for (auto &C : A->children(Err)) {
Expected<std::unique_ptr<Binary>> ChildOrErr =
- C.getAsBinary(&Context);
+ C.getAsBinary(ContextPtr);
if (!ChildOrErr) {
if (auto E = isNotObjectErrorInvalidFileType(
ChildOrErr.takeError())) {
@@ -1896,7 +1898,7 @@
Error Err = Error::success();
for (auto &C : A->children(Err)) {
Expected<std::unique_ptr<Binary>> ChildOrErr =
- C.getAsBinary(&Context);
+ C.getAsBinary(ContextPtr);
if (!ChildOrErr) {
if (auto E = isNotObjectErrorInvalidFileType(
ChildOrErr.takeError()))
@@ -1963,7 +1965,7 @@
Error Err = Error::success();
for (auto &C : A->children(Err)) {
Expected<std::unique_ptr<Binary>> ChildOrErr =
- C.getAsBinary(&Context);
+ C.getAsBinary(ContextPtr);
if (!ChildOrErr) {
if (auto E = isNotObjectErrorInvalidFileType(
ChildOrErr.takeError()))
Index: test/tools/llvm-nm/X86/archive-no-llvm-bc.test
===================================================================
--- /dev/null
+++ test/tools/llvm-nm/X86/archive-no-llvm-bc.test
@@ -0,0 +1,14 @@
+; RUN: grep -v "module asm" %s | llvm-as -o %T/embedded.bc
+; RUN: llc -I=%T -filetype=obj -o %t.o %s
+; RUN: llvm-ar crs %t.a %t.o
+; RUN: llvm-nm -m -no-llvm-bc %t.a | FileCheck -match-full-lines %s
+
+target triple = "x86_64-apple-macosx10.11"
+
+ at q = global i32 1, align 4
+; CHECK-NOT: {{-+}} (LTO,DATA) external _q
+; CHECK: {{[[:xdigit:]]+}} (__DATA,__data) external _q
+
+module asm ".section __LLVM,__bitcode"
+module asm ".incbin \22embedded.bc\22"
+
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48798.153640.patch
Type: text/x-patch
Size: 3003 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180630/80d7c49d/attachment.bin>
More information about the llvm-commits
mailing list