summaryrefslogtreecommitdiffstats
path: root/lib/Driver/InputInfo.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-03-17 22:47:06 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-03-17 22:47:06 +0000
commit5c3c1d7b494660ba5e8983ee4584622750725ac2 (patch)
treeb3f3af845bebdcb1149b787ba4fd8ff98f0b5ffe /lib/Driver/InputInfo.h
parent31b1e5437e7435879fc044afb77ff27096008e72 (diff)
Driver: Add -ccc-print-bindings option (for testing); the Python
driver has no corresponding option. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67125 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/InputInfo.h')
-rw-r--r--lib/Driver/InputInfo.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Driver/InputInfo.h b/lib/Driver/InputInfo.h
index 6fedf82a99..6cef821e39 100644
--- a/lib/Driver/InputInfo.h
+++ b/lib/Driver/InputInfo.h
@@ -11,6 +11,7 @@
#define CLANG_LIB_DRIVER_INPUTINFO_H_
#include <cassert>
+#include <string>
namespace clang {
namespace driver {
@@ -28,6 +29,10 @@ class InputInfo {
public:
InputInfo() {}
+ InputInfo(types::ID _Type, const char *_BaseInput)
+ : IsPipe(false), Type(_Type), BaseInput(_BaseInput) {
+ Data.Filename = 0;
+ }
InputInfo(const char *Filename, types::ID _Type, const char *_BaseInput)
: IsPipe(false), Type(_Type), BaseInput(_BaseInput) {
Data.Filename = Filename;
@@ -49,6 +54,17 @@ public:
assert(isPipe() && "Invalid accessor.");
return *Data.Pipe;
}
+
+ /// getAsString - Return a string name for this input, for
+ /// debugging.
+ std::string getAsString() const {
+ if (isPipe())
+ return "(pipe)";
+ else if (const char *N = getInputFilename())
+ return std::string("\"") + N + '"';
+ else
+ return "(nothing)";
+ }
};
} // end namespace driver