]> granicus.if.org Git - clang/commitdiff
Rename namespace clang::printf to clang::analyze_printf to avoid problems where the...
authorTed Kremenek <kremenek@apple.com>
Thu, 28 Jan 2010 02:02:59 +0000 (02:02 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 28 Jan 2010 02:02:59 +0000 (02:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94733 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/Analyses/PrintfFormatString.h
lib/Analysis/PrintfFormatString.cpp

index 6ae7e0c6e924a13a807ee58648412aa7cf477a15..d8630e8edb52f5566ac69ed6212d229c3bb62296 100644 (file)
@@ -18,7 +18,7 @@
 #include <cassert>
 
 namespace clang {
-namespace printf {
+namespace analyze_printf {
 
 class ConversionSpecifier {
 public:
@@ -61,6 +61,7 @@ public:
 
   ConversionSpecifier(Kind k) : kind(k) {}
   
+  bool isObjCArg() const { return kind >= ObjCBeg && kind <= ObjCEnd; }
   bool isIntArg() const { return kind >= dArg && kind <= iArg; }
   bool isUIntArg() const { return kind >= oArg && kind <= XArg; }
   bool isDoubleArg() const { return kind >= fArg && kind <= AArg; }
@@ -147,6 +148,10 @@ public:
     return (LengthModifier) lengthModifier;
   }
   
+  const OptionalAmount &getFieldWidth() const {
+    return FieldWidth;
+  }
+  
   void setFieldWidth(const OptionalAmount &Amt) {
     FieldWidth = Amt;
   }
@@ -154,6 +159,10 @@ public:
   void setPrecision(const OptionalAmount &Amt) {
     Precision = Amt;
   }
+  
+  const OptionalAmount &getPrecision() const {
+    return Precision;
+  }
 
   bool isLeftJustified() const { return flags & LeftJustified; }
   bool hasPlusPrefix() const { return flags & PlusPrefix; }
index 1afa9ad2b717c69dbf72790143f804bf7e3de577..81752e9c4c349db8af478d1112fa5e78600f2dad 100644 (file)
@@ -15,7 +15,7 @@
 #include "clang/Analysis/Analyses/PrintfFormatString.h"
 
 using namespace clang;
-using namespace printf;
+using namespace analyze_printf;
 
 namespace {
 class FormatSpecifierResult {
@@ -26,7 +26,7 @@ public:
   FormatSpecifierResult(bool err = false)
     : Start(0), HasError(err) {}
   FormatSpecifierResult(const char *start,
-                        const printf::FormatSpecifier &fs)
+                        const FormatSpecifier &fs)
     : FS(fs), Start(start), HasError(false) {}
 
   
@@ -37,7 +37,7 @@ public:
     assert(hasValue());
     return FS;
   }
-  const printf::FormatSpecifier &getValue() { return FS; }
+  const FormatSpecifier &getValue() { return FS; }
 };
 } // end anonymous namespace
 
@@ -81,7 +81,7 @@ static OptionalAmount ParseAmount(const char *&Beg, const char *E) {
   return OptionalAmount();  
 }
 
-static FormatSpecifierResult ParseFormatSpecifier(printf::FormatStringHandler &H,
+static FormatSpecifierResult ParseFormatSpecifier(FormatStringHandler &H,
                                                   const char *&Beg, const char *E) {
   
   const char *I = Beg;