1 //===--- InputInfo.h - Input Source & Type Information ----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef CLANG_LIB_DRIVER_INPUTINFO_H_
11 #define CLANG_LIB_DRIVER_INPUTINFO_H_
19 /// InputInfo - Wrapper for information about an input source.
27 const char *BaseInput;
31 InputInfo(const char *Filename, types::ID _Type, const char *_BaseInput)
32 : IsPipe(false), Type(_Type), BaseInput(_BaseInput) {
33 Data.Filename = Filename;
35 InputInfo(PipedJob *Pipe, types::ID _Type, const char *_BaseInput)
36 : IsPipe(true), Type(_Type), BaseInput(_BaseInput) {
40 bool isPipe() const { return IsPipe; }
41 types::ID getType() const { return Type; }
42 const char *getBaseInput() const { return BaseInput; }
44 const char *getInputFilename() const {
45 assert(!isPipe() && "Invalid accessor.");
48 PipedJob &getPipe() const {
49 assert(isPipe() && "Invalid accessor.");
54 } // end namespace driver
55 } // end namespace clang