Driver: Handle "linker input" arguments.
- Make InputInfo a variant of filename, pipe, input argument,
nothing.
- Leave a FIXME in InputInfo that this should be revisited.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67292 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index b147bb3..c330707 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -697,12 +697,15 @@
UsePipes = false;
if (const InputAction *IA = dyn_cast<InputAction>(A)) {
- // FIXME: This is broken, linker inputs won't work here.
- assert(isa<PositionalArg>(IA->getInputArg()) && "FIXME: Linker inputs");
-
- IA->getInputArg().claim();
- const char *Name = IA->getInputArg().getValue(C.getArgs());
- Result = InputInfo(Name, A->getType(), Name);
+ // FIXME: It would be nice to not claim this here; maybe the old
+ // scheme of just using Args was better?
+ const Arg &Input = IA->getInputArg();
+ Input.claim();
+ if (isa<PositionalArg>(Input)) {
+ const char *Name = Input.getValue(C.getArgs());
+ Result = InputInfo(Name, A->getType(), Name);
+ } else
+ Result = InputInfo(&Input, A->getType(), "");
return;
}