diff options
author | Hans Wennborg <hans@hanshq.net> | 2011-12-09 11:11:07 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2011-12-09 11:11:07 +0000 |
commit | b8ec3e35d2d7a56b21cb449d4a7bde8d9d12c2a5 (patch) | |
tree | 8ba3d301c70350896145f4b889b459892a58c36d | |
parent | 117348caf0a8f91782e9e32e32a8689576f394d7 (diff) |
Move definition of ConversionSpecifier::toString() to FormatString.cpp
It's declared in FormatString.h, so it shouldn't be defined in
PrintfFormatString.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146253 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Analysis/FormatString.cpp | 45 | ||||
-rw-r--r-- | lib/Analysis/PrintfFormatString.cpp | 40 |
2 files changed, 41 insertions, 44 deletions
diff --git a/lib/Analysis/FormatString.cpp b/lib/Analysis/FormatString.cpp index 0853164df7..fe308471bd 100644 --- a/lib/Analysis/FormatString.cpp +++ b/lib/Analysis/FormatString.cpp @@ -399,6 +399,47 @@ analyze_format_string::LengthModifier::toString() const { } //===----------------------------------------------------------------------===// +// Methods on ConversionSpecifier. +//===----------------------------------------------------------------------===// + +const char *ConversionSpecifier::toString() const { + switch (kind) { + case dArg: return "d"; + case iArg: return "i"; + case oArg: return "o"; + case uArg: return "u"; + case xArg: return "x"; + case XArg: return "X"; + case fArg: return "f"; + case FArg: return "F"; + case eArg: return "e"; + case EArg: return "E"; + case gArg: return "g"; + case GArg: return "G"; + case aArg: return "a"; + case AArg: return "A"; + case cArg: return "c"; + case sArg: return "s"; + case pArg: return "p"; + case nArg: return "n"; + case PercentArg: return "%"; + case ScanListArg: return "["; + case InvalidSpecifier: return NULL; + + // MacOS X unicode extensions. + case CArg: return "C"; + case SArg: return "S"; + + // Objective-C specific specifiers. + case ObjCObjArg: return "@"; + + // GlibC specific specifiers. + case PrintErrno: return "m"; + } + return NULL; +} + +//===----------------------------------------------------------------------===// // Methods on OptionalAmount. //===----------------------------------------------------------------------===// @@ -423,10 +464,6 @@ void OptionalAmount::toString(raw_ostream &os) const { } } -//===----------------------------------------------------------------------===// -// Methods on ConversionSpecifier. -//===----------------------------------------------------------------------===// - bool FormatSpecifier::hasValidLengthModifier() const { switch (LM.getKind()) { case LengthModifier::None: diff --git a/lib/Analysis/PrintfFormatString.cpp b/lib/Analysis/PrintfFormatString.cpp index 097cc62a6c..3b8c45b7e2 100644 --- a/lib/Analysis/PrintfFormatString.cpp +++ b/lib/Analysis/PrintfFormatString.cpp @@ -235,46 +235,6 @@ bool clang::analyze_format_string::ParsePrintfString(FormatStringHandler &H, } //===----------------------------------------------------------------------===// -// Methods on ConversionSpecifier. -//===----------------------------------------------------------------------===// -const char *ConversionSpecifier::toString() const { - switch (kind) { - case dArg: return "d"; - case iArg: return "i"; - case oArg: return "o"; - case uArg: return "u"; - case xArg: return "x"; - case XArg: return "X"; - case fArg: return "f"; - case FArg: return "F"; - case eArg: return "e"; - case EArg: return "E"; - case gArg: return "g"; - case GArg: return "G"; - case aArg: return "a"; - case AArg: return "A"; - case cArg: return "c"; - case sArg: return "s"; - case pArg: return "p"; - case nArg: return "n"; - case PercentArg: return "%"; - case ScanListArg: return "["; - case InvalidSpecifier: return NULL; - - // MacOS X unicode extensions. - case CArg: return "C"; - case SArg: return "S"; - - // Objective-C specific specifiers. - case ObjCObjArg: return "@"; - - // GlibC specific specifiers. - case PrintErrno: return "m"; - } - return NULL; -} - -//===----------------------------------------------------------------------===// // Methods on PrintfSpecifier. //===----------------------------------------------------------------------===// |