Răsfoiți Sursa

Remove tabs, and whitespace cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
Mike Stump 16 ani în urmă
părinte
comite
1eb4433ac4
100 a modificat fișierele cu 4409 adăugiri și 4429 ștergeri
  1. 20 20
      include/clang/AST/APValue.h
  2. 6 6
      include/clang/AST/ASTConsumer.h
  3. 131 131
      include/clang/AST/ASTContext.h
  4. 1 1
      include/clang/AST/ASTDiagnostic.h
  5. 49 49
      include/clang/AST/Attr.h
  6. 148 163
      include/clang/AST/CanonicalType.h
  7. 146 146
      include/clang/AST/Decl.h
  8. 61 61
      include/clang/AST/DeclBase.h
  9. 189 189
      include/clang/AST/DeclCXX.h
  10. 15 15
      include/clang/AST/DeclContextInternals.h
  11. 19 19
      include/clang/AST/DeclGroup.h
  12. 192 192
      include/clang/AST/DeclObjC.h
  13. 149 153
      include/clang/AST/DeclTemplate.h
  14. 18 18
      include/clang/AST/DeclarationName.h
  15. 200 200
      include/clang/AST/Expr.h
  16. 206 206
      include/clang/AST/ExprCXX.h
  17. 102 102
      include/clang/AST/ExprObjC.h
  18. 4 4
      include/clang/AST/ExternalASTSource.h
  19. 16 16
      include/clang/AST/NestedNameSpecifier.h
  20. 5 5
      include/clang/AST/ParentMap.h
  21. 1 1
      include/clang/AST/PrettyPrinter.h
  22. 33 33
      include/clang/AST/RecordLayout.h
  23. 6 6
      include/clang/AST/Redeclarable.h
  24. 198 198
      include/clang/AST/Stmt.h
  25. 14 14
      include/clang/AST/StmtGraphTraits.h
  26. 31 31
      include/clang/AST/StmtIterator.h
  27. 95 95
      include/clang/AST/StmtObjC.h
  28. 10 10
      include/clang/AST/StmtVisitor.h
  29. 19 19
      include/clang/AST/TemplateName.h
  30. 181 181
      include/clang/AST/Type.h
  31. 5 5
      include/clang/AST/TypeLoc.h
  32. 3 3
      include/clang/AST/TypeOrdering.h
  33. 4 4
      include/clang/AST/TypeVisitor.h
  34. 21 21
      include/clang/Analysis/Analyses/LiveVariables.h
  35. 12 12
      include/clang/Analysis/Analyses/UninitializedValues.h
  36. 1 1
      include/clang/Analysis/AnalysisDiagnostic.h
  37. 66 66
      include/clang/Analysis/CFG.h
  38. 50 50
      include/clang/Analysis/FlowSensitive/DataflowSolver.h
  39. 28 28
      include/clang/Analysis/FlowSensitive/DataflowValues.h
  40. 10 10
      include/clang/Analysis/LocalCheckers.h
  41. 104 104
      include/clang/Analysis/PathDiagnostic.h
  42. 10 10
      include/clang/Analysis/PathSensitive/AnalysisContext.h
  43. 21 21
      include/clang/Analysis/PathSensitive/AnalysisManager.h
  44. 30 30
      include/clang/Analysis/PathSensitive/BasicValueFactory.h
  45. 96 96
      include/clang/Analysis/PathSensitive/BugReporter.h
  46. 16 16
      include/clang/Analysis/PathSensitive/Checker.h
  47. 5 5
      include/clang/Analysis/PathSensitive/CheckerVisitor.h
  48. 7 7
      include/clang/Analysis/PathSensitive/ConstraintManager.h
  49. 16 16
      include/clang/Analysis/PathSensitive/Environment.h
  50. 71 71
      include/clang/Analysis/PathSensitive/ExplodedGraph.h
  51. 4 4
      include/clang/Analysis/PathSensitive/GRAuditor.h
  52. 8 8
      include/clang/Analysis/PathSensitive/GRBlockCounter.h
  53. 95 95
      include/clang/Analysis/PathSensitive/GRCoreEngine.h
  54. 148 148
      include/clang/Analysis/PathSensitive/GRExprEngine.h
  55. 8 8
      include/clang/Analysis/PathSensitive/GRExprEngineBuilders.h
  56. 3 3
      include/clang/Analysis/PathSensitive/GRSimpleAPICheck.h
  57. 122 122
      include/clang/Analysis/PathSensitive/GRState.h
  58. 41 41
      include/clang/Analysis/PathSensitive/GRStateTrait.h
  59. 9 9
      include/clang/Analysis/PathSensitive/GRSubEngine.h
  60. 16 16
      include/clang/Analysis/PathSensitive/GRTransferFuncs.h
  61. 13 13
      include/clang/Analysis/PathSensitive/GRWorkList.h
  62. 141 141
      include/clang/Analysis/PathSensitive/MemRegion.h
  63. 80 80
      include/clang/Analysis/PathSensitive/SVals.h
  64. 11 11
      include/clang/Analysis/PathSensitive/SValuator.h
  65. 26 26
      include/clang/Analysis/PathSensitive/Store.h
  66. 69 69
      include/clang/Analysis/PathSensitive/SymbolManager.h
  67. 29 30
      include/clang/Analysis/PathSensitive/ValueManager.h
  68. 55 55
      include/clang/Analysis/ProgramPoint.h
  69. 63 63
      include/clang/Analysis/Support/BlkExprDeclBitVector.h
  70. 6 6
      include/clang/Analysis/Support/Optional.h
  71. 3 3
      include/clang/Analysis/Support/SaveAndRestore.h
  72. 7 7
      include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h
  73. 2 2
      include/clang/Analysis/Visitors/CFGRecStmtVisitor.h
  74. 30 30
      include/clang/Analysis/Visitors/CFGStmtVisitor.h
  75. 10 10
      include/clang/Analysis/Visitors/CFGVarDeclVisitor.h
  76. 8 8
      include/clang/Basic/Builtins.h
  77. 12 12
      include/clang/Basic/ConvertUTF.h
  78. 67 67
      include/clang/Basic/Diagnostic.h
  79. 17 17
      include/clang/Basic/FileManager.h
  80. 59 59
      include/clang/Basic/IdentifierTable.h
  81. 15 15
      include/clang/Basic/LangOptions.h
  82. 44 44
      include/clang/Basic/OnDiskHashTable.h
  83. 45 45
      include/clang/Basic/SourceLocation.h
  84. 105 105
      include/clang/Basic/SourceManager.h
  85. 12 12
      include/clang/Basic/SourceManagerInternals.h
  86. 40 40
      include/clang/Basic/TargetInfo.h
  87. 1 1
      include/clang/Basic/TokenKinds.h
  88. 3 3
      include/clang/CodeGen/ModuleBuilder.h
  89. 19 19
      include/clang/Driver/Action.h
  90. 23 23
      include/clang/Driver/Arg.h
  91. 13 13
      include/clang/Driver/ArgList.h
  92. 5 5
      include/clang/Driver/Compilation.h
  93. 8 8
      include/clang/Driver/Driver.h
  94. 1 1
      include/clang/Driver/DriverDiagnostic.h
  95. 9 9
      include/clang/Driver/HostInfo.h
  96. 11 11
      include/clang/Driver/Job.h
  97. 44 44
      include/clang/Driver/Option.h
  98. 2 2
      include/clang/Driver/Options.h
  99. 4 4
      include/clang/Driver/Tool.h
  100. 2 2
      include/clang/Frontend/ASTConsumers.h

+ 20 - 20
include/clang/AST/APValue.h

@@ -37,16 +37,16 @@ public:
   };
   };
 private:
 private:
   ValueKind Kind;
   ValueKind Kind;
-  
-  struct ComplexAPSInt { 
-    APSInt Real, Imag; 
+
+  struct ComplexAPSInt {
+    APSInt Real, Imag;
     ComplexAPSInt() : Real(1), Imag(1) {}
     ComplexAPSInt() : Real(1), Imag(1) {}
   };
   };
   struct ComplexAPFloat {
   struct ComplexAPFloat {
     APFloat Real, Imag;
     APFloat Real, Imag;
     ComplexAPFloat() : Real(0.0), Imag(0.0) {}
     ComplexAPFloat() : Real(0.0), Imag(0.0) {}
   };
   };
-  
+
   struct LV {
   struct LV {
     Expr* Base;
     Expr* Base;
     uint64_t Offset;
     uint64_t Offset;
@@ -57,9 +57,9 @@ private:
     Vec() : Elts(0), NumElts(0) {}
     Vec() : Elts(0), NumElts(0) {}
     ~Vec() { delete[] Elts; }
     ~Vec() { delete[] Elts; }
   };
   };
-  
+
   enum {
   enum {
-    MaxSize = (sizeof(ComplexAPSInt) > sizeof(ComplexAPFloat) ? 
+    MaxSize = (sizeof(ComplexAPSInt) > sizeof(ComplexAPFloat) ?
                sizeof(ComplexAPSInt) : sizeof(ComplexAPFloat))
                sizeof(ComplexAPSInt) : sizeof(ComplexAPFloat))
   };
   };
 
 
@@ -94,7 +94,7 @@ public:
   ~APValue() {
   ~APValue() {
     MakeUninit();
     MakeUninit();
   }
   }
-  
+
   ValueKind getKind() const { return Kind; }
   ValueKind getKind() const { return Kind; }
   bool isUninit() const { return Kind == Uninitialized; }
   bool isUninit() const { return Kind == Uninitialized; }
   bool isInt() const { return Kind == Int; }
   bool isInt() const { return Kind == Int; }
@@ -103,10 +103,10 @@ public:
   bool isComplexFloat() const { return Kind == ComplexFloat; }
   bool isComplexFloat() const { return Kind == ComplexFloat; }
   bool isLValue() const { return Kind == LValue; }
   bool isLValue() const { return Kind == LValue; }
   bool isVector() const { return Kind == Vector; }
   bool isVector() const { return Kind == Vector; }
-  
+
   void print(llvm::raw_ostream &OS) const;
   void print(llvm::raw_ostream &OS) const;
   void dump() const;
   void dump() const;
-  
+
   APSInt &getInt() {
   APSInt &getInt() {
     assert(isInt() && "Invalid accessor");
     assert(isInt() && "Invalid accessor");
     return *(APSInt*)(char*)Data;
     return *(APSInt*)(char*)Data;
@@ -114,7 +114,7 @@ public:
   const APSInt &getInt() const {
   const APSInt &getInt() const {
     return const_cast<APValue*>(this)->getInt();
     return const_cast<APValue*>(this)->getInt();
   }
   }
-  
+
   APFloat &getFloat() {
   APFloat &getFloat() {
     assert(isFloat() && "Invalid accessor");
     assert(isFloat() && "Invalid accessor");
     return *(APFloat*)(char*)Data;
     return *(APFloat*)(char*)Data;
@@ -122,7 +122,7 @@ public:
   const APFloat &getFloat() const {
   const APFloat &getFloat() const {
     return const_cast<APValue*>(this)->getFloat();
     return const_cast<APValue*>(this)->getFloat();
   }
   }
-  
+
   APValue &getVectorElt(unsigned i) const {
   APValue &getVectorElt(unsigned i) const {
     assert(isVector() && "Invalid accessor");
     assert(isVector() && "Invalid accessor");
     return ((Vec*)(char*)Data)->Elts[i];
     return ((Vec*)(char*)Data)->Elts[i];
@@ -131,7 +131,7 @@ public:
     assert(isVector() && "Invalid accessor");
     assert(isVector() && "Invalid accessor");
     return ((Vec*)(void *)Data)->NumElts;
     return ((Vec*)(void *)Data)->NumElts;
   }
   }
-  
+
   APSInt &getComplexIntReal() {
   APSInt &getComplexIntReal() {
     assert(isComplexInt() && "Invalid accessor");
     assert(isComplexInt() && "Invalid accessor");
     return ((ComplexAPSInt*)(char*)Data)->Real;
     return ((ComplexAPSInt*)(char*)Data)->Real;
@@ -139,7 +139,7 @@ public:
   const APSInt &getComplexIntReal() const {
   const APSInt &getComplexIntReal() const {
     return const_cast<APValue*>(this)->getComplexIntReal();
     return const_cast<APValue*>(this)->getComplexIntReal();
   }
   }
-  
+
   APSInt &getComplexIntImag() {
   APSInt &getComplexIntImag() {
     assert(isComplexInt() && "Invalid accessor");
     assert(isComplexInt() && "Invalid accessor");
     return ((ComplexAPSInt*)(char*)Data)->Imag;
     return ((ComplexAPSInt*)(char*)Data)->Imag;
@@ -147,7 +147,7 @@ public:
   const APSInt &getComplexIntImag() const {
   const APSInt &getComplexIntImag() const {
     return const_cast<APValue*>(this)->getComplexIntImag();
     return const_cast<APValue*>(this)->getComplexIntImag();
   }
   }
-  
+
   APFloat &getComplexFloatReal() {
   APFloat &getComplexFloatReal() {
     assert(isComplexFloat() && "Invalid accessor");
     assert(isComplexFloat() && "Invalid accessor");
     return ((ComplexAPFloat*)(char*)Data)->Real;
     return ((ComplexAPFloat*)(char*)Data)->Real;
@@ -172,7 +172,7 @@ public:
     assert(isLValue() && "Invalid accessor");
     assert(isLValue() && "Invalid accessor");
     return ((const LV*)(const void*)Data)->Offset;
     return ((const LV*)(const void*)Data)->Offset;
   }
   }
-  
+
   void setInt(const APSInt &I) {
   void setInt(const APSInt &I) {
     assert(isInt() && "Invalid accessor");
     assert(isInt() && "Invalid accessor");
     *(APSInt*)(char*)Data = I;
     *(APSInt*)(char*)Data = I;
@@ -189,14 +189,14 @@ public:
       ((Vec*)(char*)Data)->Elts[i] = E[i];
       ((Vec*)(char*)Data)->Elts[i] = E[i];
   }
   }
   void setComplexInt(const APSInt &R, const APSInt &I) {
   void setComplexInt(const APSInt &R, const APSInt &I) {
-    assert(R.getBitWidth() == I.getBitWidth() && 
+    assert(R.getBitWidth() == I.getBitWidth() &&
            "Invalid complex int (type mismatch).");
            "Invalid complex int (type mismatch).");
     assert(isComplexInt() && "Invalid accessor");
     assert(isComplexInt() && "Invalid accessor");
     ((ComplexAPSInt*)(char*)Data)->Real = R;
     ((ComplexAPSInt*)(char*)Data)->Real = R;
     ((ComplexAPSInt*)(char*)Data)->Imag = I;
     ((ComplexAPSInt*)(char*)Data)->Imag = I;
   }
   }
   void setComplexFloat(const APFloat &R, const APFloat &I) {
   void setComplexFloat(const APFloat &R, const APFloat &I) {
-    assert(&R.getSemantics() == &I.getSemantics() && 
+    assert(&R.getSemantics() == &I.getSemantics() &&
            "Invalid complex float (type mismatch).");
            "Invalid complex float (type mismatch).");
     assert(isComplexFloat() && "Invalid accessor");
     assert(isComplexFloat() && "Invalid accessor");
     ((ComplexAPFloat*)(char*)Data)->Real = R;
     ((ComplexAPFloat*)(char*)Data)->Real = R;
@@ -207,9 +207,9 @@ public:
     ((LV*)(char*)Data)->Base = B;
     ((LV*)(char*)Data)->Base = B;
     ((LV*)(char*)Data)->Offset = O;
     ((LV*)(char*)Data)->Offset = O;
   }
   }
-  
+
   const APValue &operator=(const APValue &RHS);
   const APValue &operator=(const APValue &RHS);
-  
+
 private:
 private:
   void MakeUninit();
   void MakeUninit();
   void MakeInt() {
   void MakeInt() {
@@ -248,7 +248,7 @@ inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const APValue &V) {
   V.print(OS);
   V.print(OS);
   return OS;
   return OS;
 }
 }
-  
+
 } // end namespace clang.
 } // end namespace clang.
 
 
 #endif
 #endif

+ 6 - 6
include/clang/AST/ASTConsumer.h

@@ -36,27 +36,27 @@ public:
   ASTConsumer() : SemaConsumer(false) { }
   ASTConsumer() : SemaConsumer(false) { }
 
 
   virtual ~ASTConsumer() {}
   virtual ~ASTConsumer() {}
-  
+
   /// Initialize - This is called to initialize the consumer, providing the
   /// Initialize - This is called to initialize the consumer, providing the
   /// ASTContext and the Action.
   /// ASTContext and the Action.
   virtual void Initialize(ASTContext &Context) {}
   virtual void Initialize(ASTContext &Context) {}
-  
+
   /// HandleTopLevelDecl - Handle the specified top-level declaration.  This is
   /// HandleTopLevelDecl - Handle the specified top-level declaration.  This is
   ///  called by the parser to process every top-level Decl*. Note that D can
   ///  called by the parser to process every top-level Decl*. Note that D can
   ///  be the head of a chain of Decls (e.g. for `int a, b` the chain will have
   ///  be the head of a chain of Decls (e.g. for `int a, b` the chain will have
   ///  two elements). Use Decl::getNextDeclarator() to walk the chain.
   ///  two elements). Use Decl::getNextDeclarator() to walk the chain.
   virtual void HandleTopLevelDecl(DeclGroupRef D);
   virtual void HandleTopLevelDecl(DeclGroupRef D);
-  
+
   /// HandleTranslationUnit - This method is called when the ASTs for entire
   /// HandleTranslationUnit - This method is called when the ASTs for entire
   ///  translation unit have been parsed.
   ///  translation unit have been parsed.
-  virtual void HandleTranslationUnit(ASTContext &Ctx) {}    
-  
+  virtual void HandleTranslationUnit(ASTContext &Ctx) {}
+
   /// HandleTagDeclDefinition - This callback is invoked each time a TagDecl
   /// HandleTagDeclDefinition - This callback is invoked each time a TagDecl
   /// (e.g. struct, union, enum, class) is completed.  This allows the client to
   /// (e.g. struct, union, enum, class) is completed.  This allows the client to
   /// hack on the type, which can occur at any point in the file (because these
   /// hack on the type, which can occur at any point in the file (because these
   /// can be defined in declspecs).
   /// can be defined in declspecs).
   virtual void HandleTagDeclDefinition(TagDecl *D) {}
   virtual void HandleTagDeclDefinition(TagDecl *D) {}
-  
+
   /// \brief Callback invoked at the end of a translation unit to
   /// \brief Callback invoked at the end of a translation unit to
   /// notify the consumer that the given tentative definition should
   /// notify the consumer that the given tentative definition should
   /// be completed.
   /// be completed.

+ 131 - 131
include/clang/AST/ASTContext.h

@@ -56,12 +56,12 @@ namespace clang {
   class TypedefDecl;
   class TypedefDecl;
   class UnresolvedUsingDecl;
   class UnresolvedUsingDecl;
   class UsingDecl;
   class UsingDecl;
-  
+
   namespace Builtin { class Context; }
   namespace Builtin { class Context; }
-  
+
 /// ASTContext - This class holds long-lived AST nodes (such as types and
 /// ASTContext - This class holds long-lived AST nodes (such as types and
 /// decls) that can be referred to throughout the semantic analysis of a file.
 /// decls) that can be referred to throughout the semantic analysis of a file.
-class ASTContext {  
+class ASTContext {
   std::vector<Type*> Types;
   std::vector<Type*> Types;
   llvm::FoldingSet<ExtQualType> ExtQualTypes;
   llvm::FoldingSet<ExtQualType> ExtQualTypes;
   llvm::FoldingSet<ComplexType> ComplexTypes;
   llvm::FoldingSet<ComplexType> ComplexTypes;
@@ -87,7 +87,7 @@ class ASTContext {
   llvm::FoldingSet<ObjCInterfaceType> ObjCInterfaceTypes;
   llvm::FoldingSet<ObjCInterfaceType> ObjCInterfaceTypes;
   llvm::FoldingSet<ObjCObjectPointerType> ObjCObjectPointerTypes;
   llvm::FoldingSet<ObjCObjectPointerType> ObjCObjectPointerTypes;
   llvm::FoldingSet<ElaboratedType> ElaboratedTypes;
   llvm::FoldingSet<ElaboratedType> ElaboratedTypes;
-  
+
   llvm::FoldingSet<QualifiedTemplateName> QualifiedTemplateNames;
   llvm::FoldingSet<QualifiedTemplateName> QualifiedTemplateNames;
   llvm::FoldingSet<DependentTemplateName> DependentTemplateNames;
   llvm::FoldingSet<DependentTemplateName> DependentTemplateNames;
 
 
@@ -108,7 +108,7 @@ class ASTContext {
 
 
   llvm::DenseMap<unsigned, FixedWidthIntType*> SignedFixedWidthIntTypes;
   llvm::DenseMap<unsigned, FixedWidthIntType*> SignedFixedWidthIntTypes;
   llvm::DenseMap<unsigned, FixedWidthIntType*> UnsignedFixedWidthIntTypes;
   llvm::DenseMap<unsigned, FixedWidthIntType*> UnsignedFixedWidthIntTypes;
-  
+
   /// BuiltinVaListType - built-in va list type.
   /// BuiltinVaListType - built-in va list type.
   /// This is initially null and set by Sema::LazilyCreateBuiltin when
   /// This is initially null and set by Sema::LazilyCreateBuiltin when
   /// a builtin that takes a valist is encountered.
   /// a builtin that takes a valist is encountered.
@@ -116,33 +116,33 @@ class ASTContext {
 
 
   /// ObjCIdType - a pseudo built-in typedef type (set by Sema).
   /// ObjCIdType - a pseudo built-in typedef type (set by Sema).
   QualType ObjCIdTypedefType;
   QualType ObjCIdTypedefType;
-  
+
   /// ObjCSelType - another pseudo built-in typedef type (set by Sema).
   /// ObjCSelType - another pseudo built-in typedef type (set by Sema).
   QualType ObjCSelType;
   QualType ObjCSelType;
   const RecordType *SelStructType;
   const RecordType *SelStructType;
-  
+
   /// ObjCProtoType - another pseudo built-in typedef type (set by Sema).
   /// ObjCProtoType - another pseudo built-in typedef type (set by Sema).
   QualType ObjCProtoType;
   QualType ObjCProtoType;
   const RecordType *ProtoStructType;
   const RecordType *ProtoStructType;
 
 
   /// ObjCClassType - another pseudo built-in typedef type (set by Sema).
   /// ObjCClassType - another pseudo built-in typedef type (set by Sema).
   QualType ObjCClassTypedefType;
   QualType ObjCClassTypedefType;
-  
+
   QualType ObjCConstantStringType;
   QualType ObjCConstantStringType;
   RecordDecl *CFConstantStringTypeDecl;
   RecordDecl *CFConstantStringTypeDecl;
 
 
   RecordDecl *ObjCFastEnumerationStateTypeDecl;
   RecordDecl *ObjCFastEnumerationStateTypeDecl;
-  
+
   /// \brief The type for the C FILE type.
   /// \brief The type for the C FILE type.
   TypeDecl *FILEDecl;
   TypeDecl *FILEDecl;
-  
+
   /// \brief The type for the C jmp_buf type.
   /// \brief The type for the C jmp_buf type.
   TypeDecl *jmp_bufDecl;
   TypeDecl *jmp_bufDecl;
-  
+
   /// \brief The type for the C sigjmp_buf type.
   /// \brief The type for the C sigjmp_buf type.
   TypeDecl *sigjmp_bufDecl;
   TypeDecl *sigjmp_bufDecl;
-  
-  /// \brief Keeps track of all declaration attributes. 
+
+  /// \brief Keeps track of all declaration attributes.
   ///
   ///
   /// Since so few decls have attrs, we keep them in a hash map instead of
   /// Since so few decls have attrs, we keep them in a hash map instead of
   /// wasting space in the Decl class.
   /// wasting space in the Decl class.
@@ -153,7 +153,7 @@ class ASTContext {
   ///
   ///
   /// This data structure stores the mapping from instantiations of static
   /// This data structure stores the mapping from instantiations of static
   /// data members to the static data member representations within the
   /// data members to the static data member representations within the
-  /// class template from which they were instantiated. 
+  /// class template from which they were instantiated.
   ///
   ///
   /// Given the following example:
   /// Given the following example:
   ///
   ///
@@ -169,11 +169,11 @@ class ASTContext {
   /// int *x = &X<int>::value;
   /// int *x = &X<int>::value;
   /// \endcode
   /// \endcode
   ///
   ///
-  /// This mapping will contain an entry that maps from the VarDecl for 
+  /// This mapping will contain an entry that maps from the VarDecl for
   /// X<int>::value to the corresponding VarDecl for X<T>::value (within the
   /// X<int>::value to the corresponding VarDecl for X<T>::value (within the
-  /// class template X). 
+  /// class template X).
   llvm::DenseMap<VarDecl *, VarDecl *> InstantiatedFromStaticDataMember;
   llvm::DenseMap<VarDecl *, VarDecl *> InstantiatedFromStaticDataMember;
-  
+
   /// \brief Keeps track of the UnresolvedUsingDecls from which UsingDecls
   /// \brief Keeps track of the UnresolvedUsingDecls from which UsingDecls
   /// where created during instantiation.
   /// where created during instantiation.
   ///
   ///
@@ -196,14 +196,14 @@ class ASTContext {
   /// B<int> to the UnresolvedUsingDecl in B<T>.
   /// B<int> to the UnresolvedUsingDecl in B<T>.
   llvm::DenseMap<UsingDecl *, UnresolvedUsingDecl *>
   llvm::DenseMap<UsingDecl *, UnresolvedUsingDecl *>
     InstantiatedFromUnresolvedUsingDecl;
     InstantiatedFromUnresolvedUsingDecl;
-  
+
   llvm::DenseMap<FieldDecl *, FieldDecl *> InstantiatedFromUnnamedFieldDecl;
   llvm::DenseMap<FieldDecl *, FieldDecl *> InstantiatedFromUnnamedFieldDecl;
-  
+
   TranslationUnitDecl *TUDecl;
   TranslationUnitDecl *TUDecl;
 
 
   /// SourceMgr - The associated SourceManager object.
   /// SourceMgr - The associated SourceManager object.
   SourceManager &SourceMgr;
   SourceManager &SourceMgr;
-  
+
   /// LangOpts - The language options used to create the AST associated with
   /// LangOpts - The language options used to create the AST associated with
   ///  this ASTContext object.
   ///  this ASTContext object.
   LangOptions LangOpts;
   LangOptions LangOpts;
@@ -211,17 +211,17 @@ class ASTContext {
   /// \brief Whether we have already loaded comment source ranges from an
   /// \brief Whether we have already loaded comment source ranges from an
   /// external source.
   /// external source.
   bool LoadedExternalComments;
   bool LoadedExternalComments;
-  
+
   /// MallocAlloc/BumpAlloc - The allocator objects used to create AST objects.
   /// MallocAlloc/BumpAlloc - The allocator objects used to create AST objects.
   bool FreeMemory;
   bool FreeMemory;
   llvm::MallocAllocator MallocAlloc;
   llvm::MallocAllocator MallocAlloc;
   llvm::BumpPtrAllocator BumpAlloc;
   llvm::BumpPtrAllocator BumpAlloc;
-  
+
   /// \brief Mapping from declarations to their comments, once we have
   /// \brief Mapping from declarations to their comments, once we have
   /// already looked up the comment associated with a given declaration.
   /// already looked up the comment associated with a given declaration.
   llvm::DenseMap<const Decl *, std::string> DeclComments;
   llvm::DenseMap<const Decl *, std::string> DeclComments;
-  
-public:  
+
+public:
   TargetInfo &Target;
   TargetInfo &Target;
   IdentifierTable &Idents;
   IdentifierTable &Idents;
   SelectorTable &Selectors;
   SelectorTable &Selectors;
@@ -238,38 +238,38 @@ public:
   /// \brief Source ranges for all of the comments in the source file,
   /// \brief Source ranges for all of the comments in the source file,
   /// sorted in order of appearance in the translation unit.
   /// sorted in order of appearance in the translation unit.
   std::vector<SourceRange> Comments;
   std::vector<SourceRange> Comments;
-  
+
   SourceManager& getSourceManager() { return SourceMgr; }
   SourceManager& getSourceManager() { return SourceMgr; }
   const SourceManager& getSourceManager() const { return SourceMgr; }
   const SourceManager& getSourceManager() const { return SourceMgr; }
   void *Allocate(unsigned Size, unsigned Align = 8) {
   void *Allocate(unsigned Size, unsigned Align = 8) {
     return FreeMemory ? MallocAlloc.Allocate(Size, Align) :
     return FreeMemory ? MallocAlloc.Allocate(Size, Align) :
                         BumpAlloc.Allocate(Size, Align);
                         BumpAlloc.Allocate(Size, Align);
   }
   }
-  void Deallocate(void *Ptr) { 
+  void Deallocate(void *Ptr) {
     if (FreeMemory)
     if (FreeMemory)
-      MallocAlloc.Deallocate(Ptr); 
+      MallocAlloc.Deallocate(Ptr);
   }
   }
   const LangOptions& getLangOptions() const { return LangOpts; }
   const LangOptions& getLangOptions() const { return LangOpts; }
-  
-  FullSourceLoc getFullLoc(SourceLocation Loc) const { 
+
+  FullSourceLoc getFullLoc(SourceLocation Loc) const {
     return FullSourceLoc(Loc,SourceMgr);
     return FullSourceLoc(Loc,SourceMgr);
   }
   }
 
 
   /// \brief Retrieve the attributes for the given declaration.
   /// \brief Retrieve the attributes for the given declaration.
   Attr*& getDeclAttrs(const Decl *D) { return DeclAttrs[D]; }
   Attr*& getDeclAttrs(const Decl *D) { return DeclAttrs[D]; }
-  
+
   /// \brief Erase the attributes corresponding to the given declaration.
   /// \brief Erase the attributes corresponding to the given declaration.
   void eraseDeclAttrs(const Decl *D) { DeclAttrs.erase(D); }
   void eraseDeclAttrs(const Decl *D) { DeclAttrs.erase(D); }
 
 
   /// \brief If this variable is an instantiated static data member of a
   /// \brief If this variable is an instantiated static data member of a
-  /// class template specialization, returns the templated static data member 
+  /// class template specialization, returns the templated static data member
   /// from which it was instantiated.
   /// from which it was instantiated.
   VarDecl *getInstantiatedFromStaticDataMember(VarDecl *Var);
   VarDecl *getInstantiatedFromStaticDataMember(VarDecl *Var);
-  
+
   /// \brief Note that the static data member \p Inst is an instantiation of
   /// \brief Note that the static data member \p Inst is an instantiation of
   /// the static data member template \p Tmpl of a class template.
   /// the static data member template \p Tmpl of a class template.
-  void setInstantiatedFromStaticDataMember(VarDecl *Inst, VarDecl *Tmpl);  
-  
+  void setInstantiatedFromStaticDataMember(VarDecl *Inst, VarDecl *Tmpl);
+
   /// \brief If this using decl is instantiated from an unresolved using decl,
   /// \brief If this using decl is instantiated from an unresolved using decl,
   /// return it.
   /// return it.
   UnresolvedUsingDecl *getInstantiatedFromUnresolvedUsingDecl(UsingDecl *UUD);
   UnresolvedUsingDecl *getInstantiatedFromUnresolvedUsingDecl(UsingDecl *UUD);
@@ -278,17 +278,17 @@ public:
   /// the unresolved using decl \p Tmpl of a class template.
   /// the unresolved using decl \p Tmpl of a class template.
   void setInstantiatedFromUnresolvedUsingDecl(UsingDecl *Inst,
   void setInstantiatedFromUnresolvedUsingDecl(UsingDecl *Inst,
                                               UnresolvedUsingDecl *Tmpl);
                                               UnresolvedUsingDecl *Tmpl);
-  
-  
+
+
   FieldDecl *getInstantiatedFromUnnamedFieldDecl(FieldDecl *Field);
   FieldDecl *getInstantiatedFromUnnamedFieldDecl(FieldDecl *Field);
-  
+
   void setInstantiatedFromUnnamedFieldDecl(FieldDecl *Inst, FieldDecl *Tmpl);
   void setInstantiatedFromUnnamedFieldDecl(FieldDecl *Inst, FieldDecl *Tmpl);
-  
+
   TranslationUnitDecl *getTranslationUnitDecl() const { return TUDecl; }
   TranslationUnitDecl *getTranslationUnitDecl() const { return TUDecl; }
 
 
-  
+
   const char *getCommentForDecl(const Decl *D);
   const char *getCommentForDecl(const Decl *D);
-  
+
   // Builtin Types.
   // Builtin Types.
   QualType VoidTy;
   QualType VoidTy;
   QualType BoolTy;
   QualType BoolTy;
@@ -331,27 +331,27 @@ public:
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   //                           Type Constructors
   //                           Type Constructors
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
-  
-  /// getAddSpaceQualType - Return the uniqued reference to the type for an 
-  /// address space qualified type with the specified type and address space.  
-  /// The resulting type has a union of the qualifiers from T and the address 
-  /// space. If T already has an address space specifier, it is silently 
+
+  /// getAddSpaceQualType - Return the uniqued reference to the type for an
+  /// address space qualified type with the specified type and address space.
+  /// The resulting type has a union of the qualifiers from T and the address
+  /// space. If T already has an address space specifier, it is silently
   /// replaced.
   /// replaced.
   QualType getAddrSpaceQualType(QualType T, unsigned AddressSpace);
   QualType getAddrSpaceQualType(QualType T, unsigned AddressSpace);
-  
+
   /// getObjCGCQualType - Returns the uniqued reference to the type for an
   /// getObjCGCQualType - Returns the uniqued reference to the type for an
   /// objc gc qualified type. The retulting type has a union of the qualifiers
   /// objc gc qualified type. The retulting type has a union of the qualifiers
   /// from T and the gc attribute.
   /// from T and the gc attribute.
   QualType getObjCGCQualType(QualType T, QualType::GCAttrTypes gcAttr);
   QualType getObjCGCQualType(QualType T, QualType::GCAttrTypes gcAttr);
-  
+
   /// getNoReturnType - Add the noreturn attribute to the given type which must
   /// getNoReturnType - Add the noreturn attribute to the given type which must
   /// be a FunctionType or a pointer to an allowable type or a BlockPointer.
   /// be a FunctionType or a pointer to an allowable type or a BlockPointer.
   QualType getNoReturnType(QualType T);
   QualType getNoReturnType(QualType T);
-  
+
   /// getComplexType - Return the uniqued reference to the type for a complex
   /// getComplexType - Return the uniqued reference to the type for a complex
   /// number with the specified element type.
   /// number with the specified element type.
   QualType getComplexType(QualType T);
   QualType getComplexType(QualType T);
-  
+
   /// getPointerType - Return the uniqued reference to the type for a pointer to
   /// getPointerType - Return the uniqued reference to the type for a pointer to
   /// the specified type.
   /// the specified type.
   QualType getPointerType(QualType T);
   QualType getPointerType(QualType T);
@@ -379,7 +379,7 @@ public:
                                 ArrayType::ArraySizeModifier ASM,
                                 ArrayType::ArraySizeModifier ASM,
                                 unsigned EltTypeQuals,
                                 unsigned EltTypeQuals,
                                 SourceRange Brackets);
                                 SourceRange Brackets);
-  
+
   /// getDependentSizedArrayType - Returns a non-unique reference to
   /// getDependentSizedArrayType - Returns a non-unique reference to
   /// the type for a dependently-sized array of the specified element
   /// the type for a dependently-sized array of the specified element
   /// type. FIXME: We will need these to be uniqued, or at least
   /// type. FIXME: We will need these to be uniqued, or at least
@@ -430,7 +430,7 @@ public:
   /// the type for a dependently-sized vector of the specified element
   /// the type for a dependently-sized vector of the specified element
   /// type. FIXME: We will need these to be uniqued, or at least
   /// type. FIXME: We will need these to be uniqued, or at least
   /// comparable, at some point.
   /// comparable, at some point.
-  QualType getDependentSizedExtVectorType(QualType VectorType, 
+  QualType getDependentSizedExtVectorType(QualType VectorType,
                                           Expr *SizeExpr,
                                           Expr *SizeExpr,
                                           SourceLocation AttrLoc);
                                           SourceLocation AttrLoc);
 
 
@@ -455,7 +455,7 @@ public:
   /// specified typename decl.
   /// specified typename decl.
   QualType getTypedefType(TypedefDecl *Decl);
   QualType getTypedefType(TypedefDecl *Decl);
 
 
-  QualType getTemplateTypeParmType(unsigned Depth, unsigned Index, 
+  QualType getTemplateTypeParmType(unsigned Depth, unsigned Index,
                                    bool ParameterPack,
                                    bool ParameterPack,
                                    IdentifierInfo *Name = 0);
                                    IdentifierInfo *Name = 0);
 
 
@@ -466,17 +466,17 @@ public:
 
 
   QualType getQualifiedNameType(NestedNameSpecifier *NNS,
   QualType getQualifiedNameType(NestedNameSpecifier *NNS,
                                 QualType NamedType);
                                 QualType NamedType);
-  QualType getTypenameType(NestedNameSpecifier *NNS, 
+  QualType getTypenameType(NestedNameSpecifier *NNS,
                            const IdentifierInfo *Name,
                            const IdentifierInfo *Name,
                            QualType Canon = QualType());
                            QualType Canon = QualType());
-  QualType getTypenameType(NestedNameSpecifier *NNS, 
+  QualType getTypenameType(NestedNameSpecifier *NNS,
                            const TemplateSpecializationType *TemplateId,
                            const TemplateSpecializationType *TemplateId,
                            QualType Canon = QualType());
                            QualType Canon = QualType());
   QualType getElaboratedType(QualType UnderlyingType,
   QualType getElaboratedType(QualType UnderlyingType,
                              ElaboratedType::TagKind Tag);
                              ElaboratedType::TagKind Tag);
 
 
   QualType getObjCInterfaceType(const ObjCInterfaceDecl *Decl,
   QualType getObjCInterfaceType(const ObjCInterfaceDecl *Decl,
-                                ObjCProtocolDecl **Protocols = 0, 
+                                ObjCProtocolDecl **Protocols = 0,
                                 unsigned NumProtocols = 0);
                                 unsigned NumProtocols = 0);
 
 
   /// getObjCObjectPointerType - Return a ObjCObjectPointerType type for the
   /// getObjCObjectPointerType - Return a ObjCObjectPointerType type for the
@@ -484,18 +484,18 @@ public:
   QualType getObjCObjectPointerType(QualType OIT,
   QualType getObjCObjectPointerType(QualType OIT,
                                     ObjCProtocolDecl **ProtocolList = 0,
                                     ObjCProtocolDecl **ProtocolList = 0,
                                     unsigned NumProtocols = 0);
                                     unsigned NumProtocols = 0);
-  
+
   /// getTypeOfType - GCC extension.
   /// getTypeOfType - GCC extension.
   QualType getTypeOfExprType(Expr *e);
   QualType getTypeOfExprType(Expr *e);
   QualType getTypeOfType(QualType t);
   QualType getTypeOfType(QualType t);
-  
+
   /// getDecltypeType - C++0x decltype.
   /// getDecltypeType - C++0x decltype.
   QualType getDecltypeType(Expr *e);
   QualType getDecltypeType(Expr *e);
-  
+
   /// getTagDeclType - Return the unique reference to the type for the
   /// getTagDeclType - Return the unique reference to the type for the
   /// specified TagDecl (struct/union/class/enum) decl.
   /// specified TagDecl (struct/union/class/enum) decl.
   QualType getTagDeclType(const TagDecl *Decl);
   QualType getTagDeclType(const TagDecl *Decl);
-  
+
   /// getSizeType - Return the unique type for "size_t" (C99 7.17), defined
   /// getSizeType - Return the unique type for "size_t" (C99 7.17), defined
   /// in <stddef.h>. The sizeof operator requires this (C99 6.5.3.4p4).
   /// in <stddef.h>. The sizeof operator requires this (C99 6.5.3.4p4).
   QualType getSizeType() const;
   QualType getSizeType() const;
@@ -512,15 +512,15 @@ public:
   /// getUnsignedWCharType - Return the type of "unsigned wchar_t".
   /// getUnsignedWCharType - Return the type of "unsigned wchar_t".
   /// Used when in C++, as a GCC extension.
   /// Used when in C++, as a GCC extension.
   QualType getUnsignedWCharType() const;
   QualType getUnsignedWCharType() const;
-  
+
   /// getPointerDiffType - Return the unique type for "ptrdiff_t" (ref?)
   /// getPointerDiffType - Return the unique type for "ptrdiff_t" (ref?)
   /// defined in <stddef.h>. Pointer - pointer requires this (C99 6.5.6p9).
   /// defined in <stddef.h>. Pointer - pointer requires this (C99 6.5.6p9).
   QualType getPointerDiffType() const;
   QualType getPointerDiffType() const;
-  
+
   // getCFConstantStringType - Return the C structure type used to represent
   // getCFConstantStringType - Return the C structure type used to represent
   // constant CFStrings.
   // constant CFStrings.
-  QualType getCFConstantStringType(); 
-  
+  QualType getCFConstantStringType();
+
   /// Get the structure type used to representation CFStrings, or NULL
   /// Get the structure type used to representation CFStrings, or NULL
   /// if it hasn't yet been built.
   /// if it hasn't yet been built.
   QualType getRawCFConstantStringType() {
   QualType getRawCFConstantStringType() {
@@ -532,13 +532,13 @@ public:
 
 
   // This setter/getter represents the ObjC type for an NSConstantString.
   // This setter/getter represents the ObjC type for an NSConstantString.
   void setObjCConstantStringInterface(ObjCInterfaceDecl *Decl);
   void setObjCConstantStringInterface(ObjCInterfaceDecl *Decl);
-  QualType getObjCConstantStringInterface() const { 
-    return ObjCConstantStringType; 
+  QualType getObjCConstantStringInterface() const {
+    return ObjCConstantStringType;
   }
   }
 
 
   //// This gets the struct used to keep track of fast enumerations.
   //// This gets the struct used to keep track of fast enumerations.
   QualType getObjCFastEnumerationStateType();
   QualType getObjCFastEnumerationStateType();
-  
+
   /// Get the ObjCFastEnumerationState type, or NULL if it hasn't yet
   /// Get the ObjCFastEnumerationState type, or NULL if it hasn't yet
   /// been built.
   /// been built.
   QualType getRawObjCFastEnumerationStateType() {
   QualType getRawObjCFastEnumerationStateType() {
@@ -551,10 +551,10 @@ public:
 
 
   /// \brief Set the type for the C FILE type.
   /// \brief Set the type for the C FILE type.
   void setFILEDecl(TypeDecl *FILEDecl) { this->FILEDecl = FILEDecl; }
   void setFILEDecl(TypeDecl *FILEDecl) { this->FILEDecl = FILEDecl; }
-  
+
   /// \brief Retrieve the C FILE type.
   /// \brief Retrieve the C FILE type.
-  QualType getFILEType() { 
-    if (FILEDecl) 
+  QualType getFILEType() {
+    if (FILEDecl)
       return getTypeDeclType(FILEDecl);
       return getTypeDeclType(FILEDecl);
     return QualType();
     return QualType();
   }
   }
@@ -563,10 +563,10 @@ public:
   void setjmp_bufDecl(TypeDecl *jmp_bufDecl) {
   void setjmp_bufDecl(TypeDecl *jmp_bufDecl) {
     this->jmp_bufDecl = jmp_bufDecl;
     this->jmp_bufDecl = jmp_bufDecl;
   }
   }
-  
+
   /// \brief Retrieve the C jmp_buf type.
   /// \brief Retrieve the C jmp_buf type.
-  QualType getjmp_bufType() { 
-    if (jmp_bufDecl) 
+  QualType getjmp_bufType() {
+    if (jmp_bufDecl)
       return getTypeDeclType(jmp_bufDecl);
       return getTypeDeclType(jmp_bufDecl);
     return QualType();
     return QualType();
   }
   }
@@ -575,41 +575,41 @@ public:
   void setsigjmp_bufDecl(TypeDecl *sigjmp_bufDecl) {
   void setsigjmp_bufDecl(TypeDecl *sigjmp_bufDecl) {
     this->sigjmp_bufDecl = sigjmp_bufDecl;
     this->sigjmp_bufDecl = sigjmp_bufDecl;
   }
   }
-  
+
   /// \brief Retrieve the C sigjmp_buf type.
   /// \brief Retrieve the C sigjmp_buf type.
-  QualType getsigjmp_bufType() { 
-    if (sigjmp_bufDecl) 
+  QualType getsigjmp_bufType() {
+    if (sigjmp_bufDecl)
       return getTypeDeclType(sigjmp_bufDecl);
       return getTypeDeclType(sigjmp_bufDecl);
     return QualType();
     return QualType();
   }
   }
-                       
+
   /// getObjCEncodingForType - Emit the ObjC type encoding for the
   /// getObjCEncodingForType - Emit the ObjC type encoding for the
   /// given type into \arg S. If \arg NameFields is specified then
   /// given type into \arg S. If \arg NameFields is specified then
   /// record field names are also encoded.
   /// record field names are also encoded.
-  void getObjCEncodingForType(QualType t, std::string &S, 
+  void getObjCEncodingForType(QualType t, std::string &S,
                               const FieldDecl *Field=0);
                               const FieldDecl *Field=0);
 
 
   void getLegacyIntegralTypeEncoding(QualType &t) const;
   void getLegacyIntegralTypeEncoding(QualType &t) const;
-  
+
   // Put the string version of type qualifiers into S.
   // Put the string version of type qualifiers into S.
-  void getObjCEncodingForTypeQualifier(Decl::ObjCDeclQualifier QT, 
+  void getObjCEncodingForTypeQualifier(Decl::ObjCDeclQualifier QT,
                                        std::string &S) const;
                                        std::string &S) const;
-  
+
   /// getObjCEncodingForMethodDecl - Return the encoded type for this method
   /// getObjCEncodingForMethodDecl - Return the encoded type for this method
   /// declaration.
   /// declaration.
   void getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl, std::string &S);
   void getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl, std::string &S);
-  
+
   /// getObjCEncodingForPropertyDecl - Return the encoded type for
   /// getObjCEncodingForPropertyDecl - Return the encoded type for
   /// this method declaration. If non-NULL, Container must be either
   /// this method declaration. If non-NULL, Container must be either
   /// an ObjCCategoryImplDecl or ObjCImplementationDecl; it should
   /// an ObjCCategoryImplDecl or ObjCImplementationDecl; it should
   /// only be NULL when getting encodings for protocol properties.
   /// only be NULL when getting encodings for protocol properties.
-  void getObjCEncodingForPropertyDecl(const ObjCPropertyDecl *PD, 
+  void getObjCEncodingForPropertyDecl(const ObjCPropertyDecl *PD,
                                       const Decl *Container,
                                       const Decl *Container,
                                       std::string &S);
                                       std::string &S);
-  
+
   bool ProtocolCompatibleWithProtocol(ObjCProtocolDecl *lProto,
   bool ProtocolCompatibleWithProtocol(ObjCProtocolDecl *lProto,
                                       ObjCProtocolDecl *rProto);
                                       ObjCProtocolDecl *rProto);
-  
+
   /// getObjCEncodingTypeSize returns size of type for objective-c encoding
   /// getObjCEncodingTypeSize returns size of type for objective-c encoding
   /// purpose.
   /// purpose.
   int getObjCEncodingTypeSize(QualType t);
   int getObjCEncodingTypeSize(QualType t);
@@ -618,32 +618,32 @@ public:
   /// Sema.  id is always a (typedef for a) pointer type, a pointer to a struct.
   /// Sema.  id is always a (typedef for a) pointer type, a pointer to a struct.
   QualType getObjCIdType() const { return ObjCIdTypedefType; }
   QualType getObjCIdType() const { return ObjCIdTypedefType; }
   void setObjCIdType(QualType T);
   void setObjCIdType(QualType T);
-  
+
   void setObjCSelType(QualType T);
   void setObjCSelType(QualType T);
   QualType getObjCSelType() const { return ObjCSelType; }
   QualType getObjCSelType() const { return ObjCSelType; }
-  
+
   void setObjCProtoType(QualType QT);
   void setObjCProtoType(QualType QT);
   QualType getObjCProtoType() const { return ObjCProtoType; }
   QualType getObjCProtoType() const { return ObjCProtoType; }
-  
+
   /// This setter/getter repreents the ObjC 'Class' type. It is setup lazily, by
   /// This setter/getter repreents the ObjC 'Class' type. It is setup lazily, by
   /// Sema.  'Class' is always a (typedef for a) pointer type, a pointer to a
   /// Sema.  'Class' is always a (typedef for a) pointer type, a pointer to a
   /// struct.
   /// struct.
   QualType getObjCClassType() const { return ObjCClassTypedefType; }
   QualType getObjCClassType() const { return ObjCClassTypedefType; }
   void setObjCClassType(QualType T);
   void setObjCClassType(QualType T);
-  
+
   void setBuiltinVaListType(QualType T);
   void setBuiltinVaListType(QualType T);
   QualType getBuiltinVaListType() const { return BuiltinVaListType; }
   QualType getBuiltinVaListType() const { return BuiltinVaListType; }
 
 
   QualType getFixedWidthIntType(unsigned Width, bool Signed);
   QualType getFixedWidthIntType(unsigned Width, bool Signed);
 
 
-  TemplateName getQualifiedTemplateName(NestedNameSpecifier *NNS, 
+  TemplateName getQualifiedTemplateName(NestedNameSpecifier *NNS,
                                         bool TemplateKeyword,
                                         bool TemplateKeyword,
                                         TemplateDecl *Template);
                                         TemplateDecl *Template);
-  TemplateName getQualifiedTemplateName(NestedNameSpecifier *NNS, 
+  TemplateName getQualifiedTemplateName(NestedNameSpecifier *NNS,
                                         bool TemplateKeyword,
                                         bool TemplateKeyword,
                                         OverloadedFunctionDecl *Template);
                                         OverloadedFunctionDecl *Template);
-  
-  TemplateName getDependentTemplateName(NestedNameSpecifier *NNS, 
+
+  TemplateName getDependentTemplateName(NestedNameSpecifier *NNS,
                                         const IdentifierInfo *Name);
                                         const IdentifierInfo *Name);
 
 
   enum GetBuiltinTypeError {
   enum GetBuiltinTypeError {
@@ -651,42 +651,42 @@ public:
     GE_Missing_stdio,     //< Missing a type from <stdio.h>
     GE_Missing_stdio,     //< Missing a type from <stdio.h>
     GE_Missing_setjmp     //< Missing a type from <setjmp.h>
     GE_Missing_setjmp     //< Missing a type from <setjmp.h>
   };
   };
-  
+
   /// GetBuiltinType - Return the type for the specified builtin.
   /// GetBuiltinType - Return the type for the specified builtin.
   QualType GetBuiltinType(unsigned ID, GetBuiltinTypeError &Error);
   QualType GetBuiltinType(unsigned ID, GetBuiltinTypeError &Error);
-  
+
 private:
 private:
   QualType getFromTargetType(unsigned Type) const;
   QualType getFromTargetType(unsigned Type) const;
 
 
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   //                         Type Predicates.
   //                         Type Predicates.
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
- 
+
 public:
 public:
   /// getObjCGCAttr - Returns one of GCNone, Weak or Strong objc's
   /// getObjCGCAttr - Returns one of GCNone, Weak or Strong objc's
   /// garbage collection attribute.
   /// garbage collection attribute.
   ///
   ///
   QualType::GCAttrTypes getObjCGCAttrKind(const QualType &Ty) const;
   QualType::GCAttrTypes getObjCGCAttrKind(const QualType &Ty) const;
-  
+
   /// isObjCNSObjectType - Return true if this is an NSObject object with
   /// isObjCNSObjectType - Return true if this is an NSObject object with
   /// its NSObject attribute set.
   /// its NSObject attribute set.
   bool isObjCNSObjectType(QualType Ty) const;
   bool isObjCNSObjectType(QualType Ty) const;
-    
+
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   //                         Type Sizing and Analysis
   //                         Type Sizing and Analysis
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
-  
+
   /// getFloatTypeSemantics - Return the APFloat 'semantics' for the specified
   /// getFloatTypeSemantics - Return the APFloat 'semantics' for the specified
   /// scalar floating point type.
   /// scalar floating point type.
   const llvm::fltSemantics &getFloatTypeSemantics(QualType T) const;
   const llvm::fltSemantics &getFloatTypeSemantics(QualType T) const;
-  
+
   /// getTypeInfo - Get the size and alignment of the specified complete type in
   /// getTypeInfo - Get the size and alignment of the specified complete type in
   /// bits.
   /// bits.
   std::pair<uint64_t, unsigned> getTypeInfo(const Type *T);
   std::pair<uint64_t, unsigned> getTypeInfo(const Type *T);
   std::pair<uint64_t, unsigned> getTypeInfo(QualType T) {
   std::pair<uint64_t, unsigned> getTypeInfo(QualType T) {
     return getTypeInfo(T.getTypePtr());
     return getTypeInfo(T.getTypePtr());
   }
   }
-  
+
   /// getTypeSize - Return the size of the specified type, in bits.  This method
   /// getTypeSize - Return the size of the specified type, in bits.  This method
   /// does not work on incomplete types.
   /// does not work on incomplete types.
   uint64_t getTypeSize(QualType T) {
   uint64_t getTypeSize(QualType T) {
@@ -695,7 +695,7 @@ public:
   uint64_t getTypeSize(const Type *T) {
   uint64_t getTypeSize(const Type *T) {
     return getTypeInfo(T).first;
     return getTypeInfo(T).first;
   }
   }
-  
+
   /// getTypeAlign - Return the ABI-specified alignment of a type, in bits.
   /// getTypeAlign - Return the ABI-specified alignment of a type, in bits.
   /// This method does not work on incomplete types.
   /// This method does not work on incomplete types.
   unsigned getTypeAlign(QualType T) {
   unsigned getTypeAlign(QualType T) {
@@ -704,23 +704,23 @@ public:
   unsigned getTypeAlign(const Type *T) {
   unsigned getTypeAlign(const Type *T) {
     return getTypeInfo(T).second;
     return getTypeInfo(T).second;
   }
   }
-  
+
   /// getPreferredTypeAlign - Return the "preferred" alignment of the specified
   /// getPreferredTypeAlign - Return the "preferred" alignment of the specified
   /// type for the current target in bits.  This can be different than the ABI
   /// type for the current target in bits.  This can be different than the ABI
   /// alignment in cases where it is beneficial for performance to overalign
   /// alignment in cases where it is beneficial for performance to overalign
   /// a data type.
   /// a data type.
   unsigned getPreferredTypeAlign(const Type *T);
   unsigned getPreferredTypeAlign(const Type *T);
-  
+
   /// getDeclAlignInBytes - Return the alignment of the specified decl
   /// getDeclAlignInBytes - Return the alignment of the specified decl
   /// that should be returned by __alignof().  Note that bitfields do
   /// that should be returned by __alignof().  Note that bitfields do
   /// not have a valid alignment, so this method will assert on them.
   /// not have a valid alignment, so this method will assert on them.
   unsigned getDeclAlignInBytes(const Decl *D);
   unsigned getDeclAlignInBytes(const Decl *D);
-  
+
   /// getASTRecordLayout - Get or compute information about the layout of the
   /// getASTRecordLayout - Get or compute information about the layout of the
   /// specified record (struct/union/class), which indicates its size and field
   /// specified record (struct/union/class), which indicates its size and field
   /// position information.
   /// position information.
   const ASTRecordLayout &getASTRecordLayout(const RecordDecl *D);
   const ASTRecordLayout &getASTRecordLayout(const RecordDecl *D);
-  
+
   /// getASTObjCInterfaceLayout - Get or compute information about the
   /// getASTObjCInterfaceLayout - Get or compute information about the
   /// layout of the specified Objective-C interface.
   /// layout of the specified Objective-C interface.
   const ASTRecordLayout &getASTObjCInterfaceLayout(const ObjCInterfaceDecl *D);
   const ASTRecordLayout &getASTObjCInterfaceLayout(const ObjCInterfaceDecl *D);
@@ -747,7 +747,7 @@ public:
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   //                            Type Operators
   //                            Type Operators
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
-  
+
   /// getCanonicalType - Return the canonical (structural) type corresponding to
   /// getCanonicalType - Return the canonical (structural) type corresponding to
   /// the specified potentially non-canonical type.  The non-canonical version
   /// the specified potentially non-canonical type.  The non-canonical version
   /// of a type may have many "decorated" versions of types.  Decorators can
   /// of a type may have many "decorated" versions of types.  Decorators can
@@ -763,7 +763,7 @@ public:
   bool hasSameType(QualType T1, QualType T2) {
   bool hasSameType(QualType T1, QualType T2) {
     return getCanonicalType(T1) == getCanonicalType(T2);
     return getCanonicalType(T1) == getCanonicalType(T2);
   }
   }
-  
+
   /// \brief Determine whether the given types are equivalent after
   /// \brief Determine whether the given types are equivalent after
   /// cvr-qualifiers have been removed.
   /// cvr-qualifiers have been removed.
   bool hasSameUnqualifiedType(QualType T1, QualType T2) {
   bool hasSameUnqualifiedType(QualType T1, QualType T2) {
@@ -772,7 +772,7 @@ public:
     return T1.getUnqualifiedType() == T2.getUnqualifiedType();
     return T1.getUnqualifiedType() == T2.getUnqualifiedType();
   }
   }
 
 
-  /// \brief Retrieves the "canonical" declaration of 
+  /// \brief Retrieves the "canonical" declaration of
 
 
   /// \brief Retrieves the "canonical" nested name specifier for a
   /// \brief Retrieves the "canonical" nested name specifier for a
   /// given nested name specifier.
   /// given nested name specifier.
@@ -822,11 +822,11 @@ public:
 
 
   /// \brief Retrieve the "canonical" template argument.
   /// \brief Retrieve the "canonical" template argument.
   ///
   ///
-  /// The canonical template argument is the simplest template argument 
-  /// (which may be a type, value, expression, or declaration) that 
+  /// The canonical template argument is the simplest template argument
+  /// (which may be a type, value, expression, or declaration) that
   /// expresses the value of the argument.
   /// expresses the value of the argument.
   TemplateArgument getCanonicalTemplateArgument(const TemplateArgument &Arg);
   TemplateArgument getCanonicalTemplateArgument(const TemplateArgument &Arg);
-  
+
   /// Type Query functions.  If the type is an instance of the specified class,
   /// Type Query functions.  If the type is an instance of the specified class,
   /// return the Type pointer for the underlying maximally pretty type.  This
   /// return the Type pointer for the underlying maximally pretty type.  This
   /// is a member of ASTContext because this may need to do some amount of
   /// is a member of ASTContext because this may need to do some amount of
@@ -849,10 +849,10 @@ public:
   /// getBaseElementType - Returns the innermost element type of a type
   /// getBaseElementType - Returns the innermost element type of a type
   /// (which needn't actually be an array type).
   /// (which needn't actually be an array type).
   QualType getBaseElementType(QualType QT);
   QualType getBaseElementType(QualType QT);
-  
+
   /// getConstantArrayElementCount - Returns number of constant array elements.
   /// getConstantArrayElementCount - Returns number of constant array elements.
   uint64_t getConstantArrayElementCount(const ConstantArrayType *CA) const;
   uint64_t getConstantArrayElementCount(const ConstantArrayType *CA) const;
-  
+
   /// getArrayDecayedType - Return the properly qualified result of decaying the
   /// getArrayDecayedType - Return the properly qualified result of decaying the
   /// specified array type to a pointer.  This operation is non-trivial when
   /// specified array type to a pointer.  This operation is non-trivial when
   /// handling typedefs etc.  The canonical type of "T" must be an array type,
   /// handling typedefs etc.  The canonical type of "T" must be an array type,
@@ -860,7 +860,7 @@ public:
   ///
   ///
   /// See C99 6.7.5.3p7 and C99 6.3.2.1p3.
   /// See C99 6.7.5.3p7 and C99 6.3.2.1p3.
   QualType getArrayDecayedType(QualType T);
   QualType getArrayDecayedType(QualType T);
-  
+
   /// getPromotedIntegerType - Returns the type that Promotable will
   /// getPromotedIntegerType - Returns the type that Promotable will
   /// promote to: C99 6.3.1.1p2, assuming that Promotable is a promotable
   /// promote to: C99 6.3.1.1p2, assuming that Promotable is a promotable
   /// integer type.
   /// integer type.
@@ -873,22 +873,22 @@ public:
   /// promotion occurs.
   /// promotion occurs.
   QualType isPromotableBitField(Expr *E);
   QualType isPromotableBitField(Expr *E);
 
 
-  /// getIntegerTypeOrder - Returns the highest ranked integer type: 
+  /// getIntegerTypeOrder - Returns the highest ranked integer type:
   /// C99 6.3.1.8p1.  If LHS > RHS, return 1.  If LHS == RHS, return 0. If
   /// C99 6.3.1.8p1.  If LHS > RHS, return 1.  If LHS == RHS, return 0. If
-  /// LHS < RHS, return -1. 
+  /// LHS < RHS, return -1.
   int getIntegerTypeOrder(QualType LHS, QualType RHS);
   int getIntegerTypeOrder(QualType LHS, QualType RHS);
-  
+
   /// getFloatingTypeOrder - Compare the rank of the two specified floating
   /// getFloatingTypeOrder - Compare the rank of the two specified floating
   /// point types, ignoring the domain of the type (i.e. 'double' ==
   /// point types, ignoring the domain of the type (i.e. 'double' ==
   /// '_Complex double').  If LHS > RHS, return 1.  If LHS == RHS, return 0. If
   /// '_Complex double').  If LHS > RHS, return 1.  If LHS == RHS, return 0. If
-  /// LHS < RHS, return -1. 
+  /// LHS < RHS, return -1.
   int getFloatingTypeOrder(QualType LHS, QualType RHS);
   int getFloatingTypeOrder(QualType LHS, QualType RHS);
 
 
-  /// getFloatingTypeOfSizeWithinDomain - Returns a real floating 
-  /// point or a complex type (based on typeDomain/typeSize). 
+  /// getFloatingTypeOfSizeWithinDomain - Returns a real floating
+  /// point or a complex type (based on typeDomain/typeSize).
   /// 'typeDomain' is a real floating point or complex type.
   /// 'typeDomain' is a real floating point or complex type.
   /// 'typeSize' is a real floating point or complex type.
   /// 'typeSize' is a real floating point or complex type.
-  QualType getFloatingTypeOfSizeWithinDomain(QualType typeSize, 
+  QualType getFloatingTypeOfSizeWithinDomain(QualType typeSize,
                                              QualType typeDomain) const;
                                              QualType typeDomain) const;
 
 
 private:
 private:
@@ -900,10 +900,10 @@ public:
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   //                    Type Compatibility Predicates
   //                    Type Compatibility Predicates
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
-                                             
+
   /// Compatibility predicates used to check assignment expressions.
   /// Compatibility predicates used to check assignment expressions.
   bool typesAreCompatible(QualType, QualType); // C99 6.2.7p1
   bool typesAreCompatible(QualType, QualType); // C99 6.2.7p1
-  
+
   bool isObjCIdType(QualType T) const {
   bool isObjCIdType(QualType T) const {
     return T == ObjCIdTypedefType;
     return T == ObjCIdTypedefType;
   }
   }
@@ -950,15 +950,15 @@ public:
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   //                    Type Iterators.
   //                    Type Iterators.
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
-  
+
   typedef std::vector<Type*>::iterator       type_iterator;
   typedef std::vector<Type*>::iterator       type_iterator;
   typedef std::vector<Type*>::const_iterator const_type_iterator;
   typedef std::vector<Type*>::const_iterator const_type_iterator;
-  
+
   type_iterator types_begin() { return Types.begin(); }
   type_iterator types_begin() { return Types.begin(); }
   type_iterator types_end() { return Types.end(); }
   type_iterator types_end() { return Types.end(); }
   const_type_iterator types_begin() const { return Types.begin(); }
   const_type_iterator types_begin() const { return Types.begin(); }
-  const_type_iterator types_end() const { return Types.end(); }  
-  
+  const_type_iterator types_end() const { return Types.end(); }
+
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   //                    Integer Values
   //                    Integer Values
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
@@ -996,12 +996,12 @@ public:
 private:
 private:
   ASTContext(const ASTContext&); // DO NOT IMPLEMENT
   ASTContext(const ASTContext&); // DO NOT IMPLEMENT
   void operator=(const ASTContext&); // DO NOT IMPLEMENT
   void operator=(const ASTContext&); // DO NOT IMPLEMENT
-  
+
   void InitBuiltinTypes();
   void InitBuiltinTypes();
   void InitBuiltinType(QualType &R, BuiltinType::Kind K);
   void InitBuiltinType(QualType &R, BuiltinType::Kind K);
-  
+
   // Return the ObjC type encoding for a given type.
   // Return the ObjC type encoding for a given type.
-  void getObjCEncodingForTypeImpl(QualType t, std::string &S, 
+  void getObjCEncodingForTypeImpl(QualType t, std::string &S,
                                   bool ExpandPointedToStructures,
                                   bool ExpandPointedToStructures,
                                   bool ExpandStructures,
                                   bool ExpandStructures,
                                   const FieldDecl *Field,
                                   const FieldDecl *Field,
@@ -1009,7 +1009,7 @@ private:
                                   bool EncodingProperty = false);
                                   bool EncodingProperty = false);
 
 
   const ASTRecordLayout &getObjCLayout(const ObjCInterfaceDecl *D,
   const ASTRecordLayout &getObjCLayout(const ObjCInterfaceDecl *D,
-                                       const ObjCImplementationDecl *Impl);    
+                                       const ObjCImplementationDecl *Impl);
 };
 };
 
 
 }  // end namespace clang
 }  // end namespace clang

+ 1 - 1
include/clang/AST/ASTDiagnostic.h

@@ -13,7 +13,7 @@
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/Diagnostic.h"
 
 
 namespace clang {
 namespace clang {
-  namespace diag { 
+  namespace diag {
     enum {
     enum {
 #define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,SFINAE) ENUM,
 #define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,SFINAE) ENUM,
 #define ASTSTART
 #define ASTSTART

+ 49 - 49
include/clang/AST/Attr.h

@@ -57,7 +57,7 @@ public:
     DLLImport,
     DLLImport,
     Deprecated,
     Deprecated,
     Destructor,
     Destructor,
-    FastCall,    
+    FastCall,
     Format,
     Format,
     FormatArg,
     FormatArg,
     GNUInline,
     GNUInline,
@@ -83,14 +83,14 @@ public:
     StdCall,
     StdCall,
     TransparentUnion,
     TransparentUnion,
     Unavailable,
     Unavailable,
-    Unused,    
+    Unused,
     Used,
     Used,
     Visibility,
     Visibility,
     WarnUnusedResult,
     WarnUnusedResult,
     Weak,
     Weak,
     WeakImport
     WeakImport
   };
   };
-    
+
 private:
 private:
   Attr *Next;
   Attr *Next;
   Kind AttrKind;
   Kind AttrKind;
@@ -104,16 +104,16 @@ protected:
   void operator delete(void* data) throw() {
   void operator delete(void* data) throw() {
     assert(0 && "Attrs cannot be released with regular 'delete'.");
     assert(0 && "Attrs cannot be released with regular 'delete'.");
   }
   }
-  
+
 protected:
 protected:
   Attr(Kind AK) : Next(0), AttrKind(AK), Inherited(false) {}
   Attr(Kind AK) : Next(0), AttrKind(AK), Inherited(false) {}
   virtual ~Attr() {
   virtual ~Attr() {
     assert(Next == 0 && "Destroy didn't work");
     assert(Next == 0 && "Destroy didn't work");
   }
   }
 public:
 public:
-  
+
   void Destroy(ASTContext &C);
   void Destroy(ASTContext &C);
-  
+
   /// \brief Whether this attribute should be merged to new
   /// \brief Whether this attribute should be merged to new
   /// declarations.
   /// declarations.
   virtual bool isMerged() const { return true; }
   virtual bool isMerged() const { return true; }
@@ -130,18 +130,18 @@ public:
         return V;
         return V;
     return 0;
     return 0;
   }
   }
-  
+
   bool isInherited() const { return Inherited; }
   bool isInherited() const { return Inherited; }
   void setInherited(bool value) { Inherited = value; }
   void setInherited(bool value) { Inherited = value; }
 
 
   void addAttr(Attr *attr) {
   void addAttr(Attr *attr) {
     assert((attr != 0) && "addAttr(): attr is null");
     assert((attr != 0) && "addAttr(): attr is null");
-    
+
     // FIXME: This doesn't preserve the order in any way.
     // FIXME: This doesn't preserve the order in any way.
     attr->Next = Next;
     attr->Next = Next;
     Next = attr;
     Next = attr;
   }
   }
-  
+
   // Clone this attribute.
   // Clone this attribute.
   virtual Attr* clone(ASTContext &C) const = 0;
   virtual Attr* clone(ASTContext &C) const = 0;
 
 
@@ -169,8 +169,8 @@ public:
   /// getAlignment - The specified alignment in bits.
   /// getAlignment - The specified alignment in bits.
   unsigned getAlignment() const { return Alignment; }
   unsigned getAlignment() const { return Alignment; }
 
 
-  virtual Attr* clone(ASTContext &C) const { 
-    return ::new (C) PragmaPackAttr(Alignment); 
+  virtual Attr* clone(ASTContext &C) const {
+    return ::new (C) PragmaPackAttr(Alignment);
   }
   }
 
 
   // Implement isa/cast/dyncast/etc.
   // Implement isa/cast/dyncast/etc.
@@ -179,7 +179,7 @@ public:
   }
   }
   static bool classof(const PragmaPackAttr *A) { return true; }
   static bool classof(const PragmaPackAttr *A) { return true; }
 };
 };
-  
+
 class AlignedAttr : public Attr {
 class AlignedAttr : public Attr {
   unsigned Alignment;
   unsigned Alignment;
 public:
 public:
@@ -189,7 +189,7 @@ public:
   unsigned getAlignment() const { return Alignment; }
   unsigned getAlignment() const { return Alignment; }
 
 
   virtual Attr* clone(ASTContext &C) const { return ::new (C) AlignedAttr(Alignment); }
   virtual Attr* clone(ASTContext &C) const { return ::new (C) AlignedAttr(Alignment); }
-  
+
   // Implement isa/cast/dyncast/etc.
   // Implement isa/cast/dyncast/etc.
   static bool classof(const Attr *A) {
   static bool classof(const Attr *A) {
     return A->getKind() == Aligned;
     return A->getKind() == Aligned;
@@ -201,11 +201,11 @@ class AnnotateAttr : public Attr {
   std::string Annotation;
   std::string Annotation;
 public:
 public:
   AnnotateAttr(const std::string &ann) : Attr(Annotate), Annotation(ann) {}
   AnnotateAttr(const std::string &ann) : Attr(Annotate), Annotation(ann) {}
-  
+
   const std::string& getAnnotation() const { return Annotation; }
   const std::string& getAnnotation() const { return Annotation; }
 
 
   virtual Attr* clone(ASTContext &C) const { return ::new (C) AnnotateAttr(Annotation); }
   virtual Attr* clone(ASTContext &C) const { return ::new (C) AnnotateAttr(Annotation); }
-  
+
   // Implement isa/cast/dyncast/etc.
   // Implement isa/cast/dyncast/etc.
   static bool classof(const Attr *A) {
   static bool classof(const Attr *A) {
     return A->getKind() == Annotate;
     return A->getKind() == Annotate;
@@ -217,11 +217,11 @@ class AsmLabelAttr : public Attr {
   std::string Label;
   std::string Label;
 public:
 public:
   AsmLabelAttr(const std::string &L) : Attr(AsmLabel), Label(L) {}
   AsmLabelAttr(const std::string &L) : Attr(AsmLabel), Label(L) {}
-  
+
   const std::string& getLabel() const { return Label; }
   const std::string& getLabel() const { return Label; }
-  
+
   virtual Attr* clone(ASTContext &C) const { return ::new (C) AsmLabelAttr(Label); }
   virtual Attr* clone(ASTContext &C) const { return ::new (C) AsmLabelAttr(Label); }
-  
+
   // Implement isa/cast/dyncast/etc.
   // Implement isa/cast/dyncast/etc.
   static bool classof(const Attr *A) {
   static bool classof(const Attr *A) {
     return A->getKind() == AsmLabel;
     return A->getKind() == AsmLabel;
@@ -251,28 +251,28 @@ public:
   ConstructorAttr(int p) : Attr(Constructor), priority(p) {}
   ConstructorAttr(int p) : Attr(Constructor), priority(p) {}
 
 
   int getPriority() const { return priority; }
   int getPriority() const { return priority; }
-  
+
   virtual Attr *clone(ASTContext &C) const { return ::new (C) ConstructorAttr(priority); }
   virtual Attr *clone(ASTContext &C) const { return ::new (C) ConstructorAttr(priority); }
 
 
   // Implement isa/cast/dyncast/etc.
   // Implement isa/cast/dyncast/etc.
-  static bool classof(const Attr *A) { return A->getKind() == Constructor; }  
+  static bool classof(const Attr *A) { return A->getKind() == Constructor; }
   static bool classof(const ConstructorAttr *A) { return true; }
   static bool classof(const ConstructorAttr *A) { return true; }
-};  
-  
+};
+
 class DestructorAttr : public Attr {
 class DestructorAttr : public Attr {
   int priority;
   int priority;
 public:
 public:
   DestructorAttr(int p) : Attr(Destructor), priority(p) {}
   DestructorAttr(int p) : Attr(Destructor), priority(p) {}
 
 
   int getPriority() const { return priority; }
   int getPriority() const { return priority; }
-  
+
   virtual Attr *clone(ASTContext &C) const { return ::new (C) DestructorAttr(priority); }
   virtual Attr *clone(ASTContext &C) const { return ::new (C) DestructorAttr(priority); }
 
 
   // Implement isa/cast/dyncast/etc.
   // Implement isa/cast/dyncast/etc.
-  static bool classof(const Attr *A) { return A->getKind() == Destructor; }  
+  static bool classof(const Attr *A) { return A->getKind() == Destructor; }
   static bool classof(const DestructorAttr *A) { return true; }
   static bool classof(const DestructorAttr *A) { return true; }
-};  
-    
+};
+
 class GNUInlineAttr : public Attr {
 class GNUInlineAttr : public Attr {
 public:
 public:
   GNUInlineAttr() : Attr(GNUInline) {}
   GNUInlineAttr() : Attr(GNUInline) {}
@@ -301,14 +301,14 @@ public:
 
 
 DEF_SIMPLE_ATTR(Malloc);
 DEF_SIMPLE_ATTR(Malloc);
 DEF_SIMPLE_ATTR(NoReturn);
 DEF_SIMPLE_ATTR(NoReturn);
-DEF_SIMPLE_ATTR(AnalyzerNoReturn);  
+DEF_SIMPLE_ATTR(AnalyzerNoReturn);
 DEF_SIMPLE_ATTR(Deprecated);
 DEF_SIMPLE_ATTR(Deprecated);
 
 
 class SectionAttr : public Attr {
 class SectionAttr : public Attr {
   std::string Name;
   std::string Name;
 public:
 public:
   SectionAttr(const std::string &N) : Attr(Section), Name(N) {}
   SectionAttr(const std::string &N) : Attr(Section), Name(N) {}
-  
+
   const std::string& getName() const { return Name; }
   const std::string& getName() const { return Name; }
 
 
   virtual Attr *clone(ASTContext &C) const { return ::new (C) SectionAttr(Name); }
   virtual Attr *clone(ASTContext &C) const { return ::new (C) SectionAttr(Name); }
@@ -322,8 +322,8 @@ public:
 
 
 DEF_SIMPLE_ATTR(Unavailable);
 DEF_SIMPLE_ATTR(Unavailable);
 DEF_SIMPLE_ATTR(Unused);
 DEF_SIMPLE_ATTR(Unused);
-DEF_SIMPLE_ATTR(Used);  
-DEF_SIMPLE_ATTR(Weak);  
+DEF_SIMPLE_ATTR(Used);
+DEF_SIMPLE_ATTR(Weak);
 DEF_SIMPLE_ATTR(WeakImport);
 DEF_SIMPLE_ATTR(WeakImport);
 DEF_SIMPLE_ATTR(NoThrow);
 DEF_SIMPLE_ATTR(NoThrow);
 DEF_SIMPLE_ATTR(Const);
 DEF_SIMPLE_ATTR(Const);
@@ -335,14 +335,14 @@ class NonNullAttr : public Attr {
 public:
 public:
   NonNullAttr(unsigned* arg_nums = 0, unsigned size = 0) : Attr(NonNull),
   NonNullAttr(unsigned* arg_nums = 0, unsigned size = 0) : Attr(NonNull),
     ArgNums(0), Size(0) {
     ArgNums(0), Size(0) {
-  
+
     if (size == 0) return;
     if (size == 0) return;
     assert(arg_nums);
     assert(arg_nums);
     ArgNums = new unsigned[size];
     ArgNums = new unsigned[size];
     Size = size;
     Size = size;
     memcpy(ArgNums, arg_nums, sizeof(*ArgNums)*size);
     memcpy(ArgNums, arg_nums, sizeof(*ArgNums)*size);
   }
   }
-  
+
   virtual ~NonNullAttr() {
   virtual ~NonNullAttr() {
     delete [] ArgNums;
     delete [] ArgNums;
   }
   }
@@ -354,7 +354,7 @@ public:
 
 
   bool isNonNull(unsigned arg) const {
   bool isNonNull(unsigned arg) const {
     return ArgNums ? std::binary_search(ArgNums, ArgNums+Size, arg) : true;
     return ArgNums ? std::binary_search(ArgNums, ArgNums+Size, arg) : true;
-  }  
+  }
 
 
   virtual Attr *clone(ASTContext &C) const { return ::new (C) NonNullAttr(ArgNums, Size); }
   virtual Attr *clone(ASTContext &C) const { return ::new (C) NonNullAttr(ArgNums, Size); }
 
 
@@ -374,8 +374,8 @@ public:
   int getFormatIdx() const { return formatIdx; }
   int getFormatIdx() const { return formatIdx; }
   int getFirstArg() const { return firstArg; }
   int getFirstArg() const { return firstArg; }
 
 
-  virtual Attr *clone(ASTContext &C) const { 
-    return ::new (C) FormatAttr(Type, formatIdx, firstArg); 
+  virtual Attr *clone(ASTContext &C) const {
+    return ::new (C) FormatAttr(Type, formatIdx, firstArg);
   }
   }
 
 
   // Implement isa/cast/dyncast/etc.
   // Implement isa/cast/dyncast/etc.
@@ -452,8 +452,8 @@ public:
 
 
   virtual bool isMerged() const { return false; }
   virtual bool isMerged() const { return false; }
 
 
-  virtual Attr *clone(ASTContext &C) const { 
-    return ::new (C) OverloadableAttr; 
+  virtual Attr *clone(ASTContext &C) const {
+    return ::new (C) OverloadableAttr;
   }
   }
 
 
   static bool classof(const Attr *A) { return A->getKind() == Overloadable; }
   static bool classof(const Attr *A) { return A->getKind() == Overloadable; }
@@ -480,15 +480,15 @@ public:
 };
 };
 
 
 class FunctionDecl;
 class FunctionDecl;
-  
+
 class CleanupAttr : public Attr {
 class CleanupAttr : public Attr {
   FunctionDecl *FD;
   FunctionDecl *FD;
-  
+
 public:
 public:
   CleanupAttr(FunctionDecl *fd) : Attr(Cleanup), FD(fd) {}
   CleanupAttr(FunctionDecl *fd) : Attr(Cleanup), FD(fd) {}
 
 
   const FunctionDecl *getFunctionDecl() const { return FD; }
   const FunctionDecl *getFunctionDecl() const { return FD; }
-  
+
   virtual Attr *clone(ASTContext &C) const { return ::new (C) CleanupAttr(FD); }
   virtual Attr *clone(ASTContext &C) const { return ::new (C) CleanupAttr(FD); }
 
 
   // Implement isa/cast/dyncast/etc.
   // Implement isa/cast/dyncast/etc.
@@ -497,7 +497,7 @@ public:
 };
 };
 
 
 DEF_SIMPLE_ATTR(NoDebug);
 DEF_SIMPLE_ATTR(NoDebug);
-DEF_SIMPLE_ATTR(WarnUnusedResult);  
+DEF_SIMPLE_ATTR(WarnUnusedResult);
 DEF_SIMPLE_ATTR(NoInline);
 DEF_SIMPLE_ATTR(NoInline);
 
 
 class RegparmAttr : public Attr {
 class RegparmAttr : public Attr {
@@ -508,11 +508,11 @@ public:
 
 
   unsigned getNumParams() const { return NumParams; }
   unsigned getNumParams() const { return NumParams; }
 
 
-  virtual Attr *clone(ASTContext &C) const { 
-    return ::new (C) RegparmAttr(NumParams); 
+  virtual Attr *clone(ASTContext &C) const {
+    return ::new (C) RegparmAttr(NumParams);
   }
   }
 
 
-  // Implement isa/cast/dyncast/etc.    
+  // Implement isa/cast/dyncast/etc.
   static bool classof(const Attr *A) { return A->getKind() == Regparm; }
   static bool classof(const Attr *A) { return A->getKind() == Regparm; }
   static bool classof(const RegparmAttr *A) { return true; }
   static bool classof(const RegparmAttr *A) { return true; }
 };
 };
@@ -527,23 +527,23 @@ public:
   unsigned getYDim() const { return Y; }
   unsigned getYDim() const { return Y; }
   unsigned getZDim() const { return Z; }
   unsigned getZDim() const { return Z; }
 
 
-  virtual Attr *clone(ASTContext &C) const { 
-    return ::new (C) ReqdWorkGroupSizeAttr(X, Y, Z); 
+  virtual Attr *clone(ASTContext &C) const {
+    return ::new (C) ReqdWorkGroupSizeAttr(X, Y, Z);
   }
   }
-  
+
   // Implement isa/cast/dyncast/etc.
   // Implement isa/cast/dyncast/etc.
   static bool classof(const Attr *A) {
   static bool classof(const Attr *A) {
     return A->getKind() == ReqdWorkGroupSize;
     return A->getKind() == ReqdWorkGroupSize;
   }
   }
   static bool classof(const ReqdWorkGroupSizeAttr *A) { return true; }
   static bool classof(const ReqdWorkGroupSizeAttr *A) { return true; }
 };
 };
-  
+
 // Checker-specific attributes.
 // Checker-specific attributes.
 DEF_SIMPLE_ATTR(CFReturnsRetained);
 DEF_SIMPLE_ATTR(CFReturnsRetained);
 DEF_SIMPLE_ATTR(NSReturnsRetained);
 DEF_SIMPLE_ATTR(NSReturnsRetained);
 
 
 #undef DEF_SIMPLE_ATTR
 #undef DEF_SIMPLE_ATTR
-  
+
 }  // end namespace clang
 }  // end namespace clang
 
 
 #endif
 #endif

+ 148 - 163
include/clang/AST/CanonicalType.h

@@ -21,69 +21,69 @@
 #include <iterator>
 #include <iterator>
 
 
 namespace clang {
 namespace clang {
-  
+
 template<typename T> class CanProxy;
 template<typename T> class CanProxy;
 template<typename T> struct CanProxyAdaptor;
 template<typename T> struct CanProxyAdaptor;
 
 
 //----------------------------------------------------------------------------//
 //----------------------------------------------------------------------------//
 // Canonical, qualified type template
 // Canonical, qualified type template
 //----------------------------------------------------------------------------//
 //----------------------------------------------------------------------------//
-  
+
 /// \brief Represents a canonical, potentially-qualified type.
 /// \brief Represents a canonical, potentially-qualified type.
 ///
 ///
 /// The CanQual template is a lightweight smart pointer that provides access
 /// The CanQual template is a lightweight smart pointer that provides access
 /// to the canonical representation of a type, where all typedefs and other
 /// to the canonical representation of a type, where all typedefs and other
-/// syntactic sugar has been eliminated. A CanQualType may also have various 
+/// syntactic sugar has been eliminated. A CanQualType may also have various
 /// qualifiers (const, volatile, restrict) attached to it.
 /// qualifiers (const, volatile, restrict) attached to it.
 ///
 ///
-/// The template type parameter @p T is one of the Type classes (PointerType, 
+/// The template type parameter @p T is one of the Type classes (PointerType,
 /// BuiltinType, etc.). The type stored within @c CanQual<T> will be of that
 /// BuiltinType, etc.). The type stored within @c CanQual<T> will be of that
 /// type (or some subclass of that type). The typedef @c CanQualType is just
 /// type (or some subclass of that type). The typedef @c CanQualType is just
 /// a shorthand for @c CanQual<Type>.
 /// a shorthand for @c CanQual<Type>.
 ///
 ///
-/// An instance of @c CanQual<T> can be implicitly converted to a 
+/// An instance of @c CanQual<T> can be implicitly converted to a
 /// @c CanQual<U> when T is derived from U, which essentially provides an
 /// @c CanQual<U> when T is derived from U, which essentially provides an
-/// implicit upcast. For example, @c CanQual<LValueReferenceType> can be 
-/// converted to @c CanQual<ReferenceType>. Note that any @c CanQual type can 
+/// implicit upcast. For example, @c CanQual<LValueReferenceType> can be
+/// converted to @c CanQual<ReferenceType>. Note that any @c CanQual type can
 /// be implicitly converted to a QualType, but the reverse operation requires
 /// be implicitly converted to a QualType, but the reverse operation requires
 /// a call to ASTContext::getCanonicalType().
 /// a call to ASTContext::getCanonicalType().
-/// 
-/// 
+///
+///
 template<typename T = Type>
 template<typename T = Type>
 class CanQual {
 class CanQual {
-  /// \brief The actual, canonical type. 
+  /// \brief The actual, canonical type.
   QualType Stored;
   QualType Stored;
-  
+
 public:
 public:
   /// \brief Constructs a NULL canonical type.
   /// \brief Constructs a NULL canonical type.
   CanQual() : Stored() { }
   CanQual() : Stored() { }
-  
+
   /// \brief Converting constructor that permits implicit upcasting of
   /// \brief Converting constructor that permits implicit upcasting of
   /// canonical type pointers.
   /// canonical type pointers.
   template<typename U>
   template<typename U>
-  CanQual(const CanQual<U>& Other, 
+  CanQual(const CanQual<U>& Other,
           typename llvm::enable_if<llvm::is_base_of<T, U>, int>::type = 0);
           typename llvm::enable_if<llvm::is_base_of<T, U>, int>::type = 0);
-  
+
   /// \brief Implicit conversion to the underlying pointer.
   /// \brief Implicit conversion to the underlying pointer.
   ///
   ///
   /// Also provides the ability to use canonical types in a boolean context,
   /// Also provides the ability to use canonical types in a boolean context,
-  /// e.g., 
+  /// e.g.,
   /// @code
   /// @code
   ///   if (CanQual<PointerType> Ptr = T->getAs<PointerType>()) { ... }
   ///   if (CanQual<PointerType> Ptr = T->getAs<PointerType>()) { ... }
   /// @endcode
   /// @endcode
   operator const T*() const { return getTypePtr(); }
   operator const T*() const { return getTypePtr(); }
-  
-  /// \brief Retrieve the underlying type pointer, which refers to a 
+
+  /// \brief Retrieve the underlying type pointer, which refers to a
   /// canonical type.
   /// canonical type.
   T *getTypePtr() const { return cast_or_null<T>(Stored.getTypePtr()); }
   T *getTypePtr() const { return cast_or_null<T>(Stored.getTypePtr()); }
-  
+
   /// \brief Implicit conversion to a qualified type.
   /// \brief Implicit conversion to a qualified type.
   operator QualType() const { return Stored; }
   operator QualType() const { return Stored; }
-  
+
   /// \brief Retrieve a canonical type pointer with a different static type,
   /// \brief Retrieve a canonical type pointer with a different static type,
   /// upcasting or downcasting as needed.
   /// upcasting or downcasting as needed.
   ///
   ///
-  /// The getAs() function is typically used to try to downcast to a 
+  /// The getAs() function is typically used to try to downcast to a
   /// more specific (canonical) type in the type system. For example:
   /// more specific (canonical) type in the type system. For example:
   ///
   ///
   /// @code
   /// @code
@@ -98,17 +98,17 @@ public:
   /// static type (@p U). If the dynamic type is not the specified static type
   /// static type (@p U). If the dynamic type is not the specified static type
   /// or a derived class thereof, a NULL canonical type.
   /// or a derived class thereof, a NULL canonical type.
   template<typename U> CanProxy<U> getAs() const;
   template<typename U> CanProxy<U> getAs() const;
-  
+
   /// \brief Overloaded arrow operator that produces a canonical type
   /// \brief Overloaded arrow operator that produces a canonical type
   /// proxy.
   /// proxy.
   CanProxy<T> operator->() const;
   CanProxy<T> operator->() const;
-  
+
   /// \brief Retrieve the const/volatile/restrict qualifiers.
   /// \brief Retrieve the const/volatile/restrict qualifiers.
   unsigned getCVRQualifiers() const { return Stored.getCVRQualifiers(); }
   unsigned getCVRQualifiers() const { return Stored.getCVRQualifiers(); }
-  
+
   /// \brief Set the const/volatile/restrict qualifiers
   /// \brief Set the const/volatile/restrict qualifiers
   void setCVRQualifiers(unsigned Quals) { Stored.setCVRQualifiers(Quals); }
   void setCVRQualifiers(unsigned Quals) { Stored.setCVRQualifiers(Quals); }
-  
+
   bool isConstQualified() const {
   bool isConstQualified() const {
     return (getCVRQualifiers() & QualType::Const) ? true : false;
     return (getCVRQualifiers() & QualType::Const) ? true : false;
   }
   }
@@ -117,42 +117,42 @@ public:
   }
   }
   bool isRestrictQualified() const {
   bool isRestrictQualified() const {
     return (getCVRQualifiers() & QualType::Restrict) ? true : false;
     return (getCVRQualifiers() & QualType::Restrict) ? true : false;
-  }  
-  
+  }
+
   /// \brief Retrieve the unqualified form of this type.
   /// \brief Retrieve the unqualified form of this type.
   CanQual<T> getUnqualifiedType() const;
   CanQual<T> getUnqualifiedType() const;
-  
+
   CanQual<T> getQualifiedType(unsigned TQs) const {
   CanQual<T> getQualifiedType(unsigned TQs) const {
     return CanQual<T>::CreateUnsafe(QualType(getTypePtr(), TQs));
     return CanQual<T>::CreateUnsafe(QualType(getTypePtr(), TQs));
   }
   }
-  
-  /// \brief Determines whether this canonical type is more qualified than 
+
+  /// \brief Determines whether this canonical type is more qualified than
   /// the @p Other canonical type.
   /// the @p Other canonical type.
   bool isMoreQualifiedThan(CanQual<T> Other) const {
   bool isMoreQualifiedThan(CanQual<T> Other) const {
     return Stored.isMoreQualifiedThan(Other.Stored);
     return Stored.isMoreQualifiedThan(Other.Stored);
   }
   }
-  
+
   /// \brief Determines whether this canonical type is at least as qualified as
   /// \brief Determines whether this canonical type is at least as qualified as
   /// the @p Other canonical type.
   /// the @p Other canonical type.
   bool isAtLeastAsQualifiedAs(CanQual<T> Other) const {
   bool isAtLeastAsQualifiedAs(CanQual<T> Other) const {
     return Stored.isAtLeastAsQualifiedAs(Other.Stored);
     return Stored.isAtLeastAsQualifiedAs(Other.Stored);
   }
   }
-  
+
   /// \brief If the canonical type is a reference type, returns the type that
   /// \brief If the canonical type is a reference type, returns the type that
   /// it refers to; otherwise, returns the type itself.
   /// it refers to; otherwise, returns the type itself.
   CanQual<Type> getNonReferenceType() const;
   CanQual<Type> getNonReferenceType() const;
-  
+
   /// \brief Retrieve the internal representation of this canonical type.
   /// \brief Retrieve the internal representation of this canonical type.
   void *getAsOpaquePtr() const { return Stored.getAsOpaquePtr(); }
   void *getAsOpaquePtr() const { return Stored.getAsOpaquePtr(); }
-  
+
   /// \brief Construct a canonical type from its internal representation.
   /// \brief Construct a canonical type from its internal representation.
   static CanQual<T> getFromOpaquePtr(void *Ptr);
   static CanQual<T> getFromOpaquePtr(void *Ptr);
-  
+
   /// \brief Builds a canonical type from a QualType.
   /// \brief Builds a canonical type from a QualType.
   ///
   ///
-  /// This routine is inherently unsafe, because it requires the user to 
-  /// ensure that the given type is a canonical type with the correct 
-  // (dynamic) type. 
+  /// This routine is inherently unsafe, because it requires the user to
+  /// ensure that the given type is a canonical type with the correct
+  // (dynamic) type.
   static CanQual<T> CreateUnsafe(QualType Other);
   static CanQual<T> CreateUnsafe(QualType Other);
 };
 };
 
 
@@ -172,7 +172,7 @@ typedef CanQual<Type> CanQualType;
 //----------------------------------------------------------------------------//
 //----------------------------------------------------------------------------//
 // Internal proxy classes used by canonical types
 // Internal proxy classes used by canonical types
 //----------------------------------------------------------------------------//
 //----------------------------------------------------------------------------//
-  
+
 #define LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(Accessor)                    \
 #define LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(Accessor)                    \
 CanQualType Accessor() const {                                           \
 CanQualType Accessor() const {                                           \
 return CanQualType::CreateUnsafe(this->getTypePtr()->Accessor());      \
 return CanQualType::CreateUnsafe(this->getTypePtr()->Accessor());      \
@@ -183,32 +183,32 @@ Type Accessor() const { return this->getTypePtr()->Accessor(); }
 
 
 /// \brief Base class of all canonical proxy types, which is responsible for
 /// \brief Base class of all canonical proxy types, which is responsible for
 /// storing the underlying canonical type and providing basic conversions.
 /// storing the underlying canonical type and providing basic conversions.
-template<typename T> 
+template<typename T>
 class CanProxyBase {
 class CanProxyBase {
 protected:
 protected:
   CanQual<T> Stored;
   CanQual<T> Stored;
-  
+
 public:
 public:
   /// \brief Retrieve the pointer to the underlying Type
   /// \brief Retrieve the pointer to the underlying Type
   T* getTypePtr() const { return Stored.getTypePtr(); }
   T* getTypePtr() const { return Stored.getTypePtr(); }
-  
+
   /// \brief Implicit conversion to the underlying pointer.
   /// \brief Implicit conversion to the underlying pointer.
   ///
   ///
   /// Also provides the ability to use canonical type proxies in a Boolean
   /// Also provides the ability to use canonical type proxies in a Boolean
-  // context,e.g., 
+  // context,e.g.,
   /// @code
   /// @code
   ///   if (CanQual<PointerType> Ptr = T->getAs<PointerType>()) { ... }
   ///   if (CanQual<PointerType> Ptr = T->getAs<PointerType>()) { ... }
   /// @endcode
   /// @endcode
   operator const T*() const { return this->Stored.getTypePtr(); }
   operator const T*() const { return this->Stored.getTypePtr(); }
-  
+
   /// \brief Try to convert the given canonical type to a specific structural
   /// \brief Try to convert the given canonical type to a specific structural
   /// type.
   /// type.
-  template<typename U> CanProxy<U> getAs() const { 
-    return this->Stored.template getAs<U>(); 
+  template<typename U> CanProxy<U> getAs() const {
+    return this->Stored.template getAs<U>();
   }
   }
-  
+
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(Type::TypeClass, getTypeClass)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(Type::TypeClass, getTypeClass)
-  
+
   // Type predicates
   // Type predicates
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isObjectType)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isObjectType)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isIncompleteType)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isIncompleteType)
@@ -271,44 +271,44 @@ public:
 /// that provide accessors returning canonical types (@c CanQualType) rather
 /// that provide accessors returning canonical types (@c CanQualType) rather
 /// than the more typical @c QualType, to propagate the notion of "canonical"
 /// than the more typical @c QualType, to propagate the notion of "canonical"
 /// through the system.
 /// through the system.
-template<typename T> 
+template<typename T>
 struct CanProxyAdaptor : CanProxyBase<T> { };
 struct CanProxyAdaptor : CanProxyBase<T> { };
 
 
 /// \brief Canonical proxy type returned when retrieving the members of a
 /// \brief Canonical proxy type returned when retrieving the members of a
-/// canonical type or as the result of the @c CanQual<T>::getAs member 
+/// canonical type or as the result of the @c CanQual<T>::getAs member
 /// function.
 /// function.
 ///
 ///
 /// The CanProxy type mainly exists as a proxy through which operator-> will
 /// The CanProxy type mainly exists as a proxy through which operator-> will
-/// look to either map down to a raw T* (e.g., PointerType*) or to a proxy 
+/// look to either map down to a raw T* (e.g., PointerType*) or to a proxy
 /// type that provides canonical-type access to the fields of the type.
 /// type that provides canonical-type access to the fields of the type.
 template<typename T>
 template<typename T>
 class CanProxy : public CanProxyAdaptor<T> {
 class CanProxy : public CanProxyAdaptor<T> {
 public:
 public:
   /// \brief Build a NULL proxy.
   /// \brief Build a NULL proxy.
   CanProxy() { }
   CanProxy() { }
-  
+
   /// \brief Build a proxy to the given canonical type.
   /// \brief Build a proxy to the given canonical type.
   CanProxy(CanQual<T> Stored) { this->Stored = Stored; }
   CanProxy(CanQual<T> Stored) { this->Stored = Stored; }
-  
+
   /// \brief Implicit conversion to the stored canonical type.
   /// \brief Implicit conversion to the stored canonical type.
   operator CanQual<T>() const { return this->Stored; }
   operator CanQual<T>() const { return this->Stored; }
 };
 };
-  
+
 } // end namespace clang
 } // end namespace clang
 
 
 namespace llvm {
 namespace llvm {
-  
-/// Implement simplify_type for CanQual<T>, so that we can dyn_cast from 
+
+/// Implement simplify_type for CanQual<T>, so that we can dyn_cast from
 /// CanQual<T> to a specific Type class. We're prefer isa/dyn_cast/cast/etc.
 /// CanQual<T> to a specific Type class. We're prefer isa/dyn_cast/cast/etc.
 /// to return smart pointer (proxies?).
 /// to return smart pointer (proxies?).
-template<typename T> 
+template<typename T>
 struct simplify_type<const ::clang::CanQual<T> > {
 struct simplify_type<const ::clang::CanQual<T> > {
   typedef T* SimpleType;
   typedef T* SimpleType;
   static SimpleType getSimplifiedValue(const ::clang::CanQual<T> &Val) {
   static SimpleType getSimplifiedValue(const ::clang::CanQual<T> &Val) {
     return Val.getTypePtr();
     return Val.getTypePtr();
   }
   }
 };
 };
-template<typename T> 
+template<typename T>
 struct simplify_type< ::clang::CanQual<T> >
 struct simplify_type< ::clang::CanQual<T> >
 : public simplify_type<const ::clang::CanQual<T> > {};
 : public simplify_type<const ::clang::CanQual<T> > {};
 
 
@@ -325,21 +325,21 @@ public:
   // CVR qualifiers go in low bits.
   // CVR qualifiers go in low bits.
   enum { NumLowBitsAvailable = 0 };
   enum { NumLowBitsAvailable = 0 };
 };
 };
-  
+
 } // end namespace llvm
 } // end namespace llvm
 
 
 namespace clang {
 namespace clang {
-  
+
 //----------------------------------------------------------------------------//
 //----------------------------------------------------------------------------//
 // Canonical proxy adaptors for canonical type nodes.
 // Canonical proxy adaptors for canonical type nodes.
 //----------------------------------------------------------------------------//
 //----------------------------------------------------------------------------//
-  
-/// \brief Iterator adaptor that turns an iterator over canonical QualTypes 
+
+/// \brief Iterator adaptor that turns an iterator over canonical QualTypes
 /// into an iterator over CanQualTypes.
 /// into an iterator over CanQualTypes.
 template<typename InputIterator>
 template<typename InputIterator>
 class CanTypeIterator {
 class CanTypeIterator {
   InputIterator Iter;
   InputIterator Iter;
-  
+
 public:
 public:
   typedef CanQualType    value_type;
   typedef CanQualType    value_type;
   typedef value_type     reference;
   typedef value_type     reference;
@@ -348,62 +348,62 @@ public:
     difference_type;
     difference_type;
   typedef typename std::iterator_traits<InputIterator>::iterator_category
   typedef typename std::iterator_traits<InputIterator>::iterator_category
     iterator_category;
     iterator_category;
-  
+
   CanTypeIterator() : Iter() { }
   CanTypeIterator() : Iter() { }
   explicit CanTypeIterator(InputIterator Iter) : Iter(Iter) { }
   explicit CanTypeIterator(InputIterator Iter) : Iter(Iter) { }
-  
+
   // Input iterator
   // Input iterator
   reference operator*() const {
   reference operator*() const {
     return CanQualType::CreateUnsafe(*Iter);
     return CanQualType::CreateUnsafe(*Iter);
   }
   }
-  
+
   pointer operator->() const;
   pointer operator->() const;
-  
+
   CanTypeIterator &operator++() {
   CanTypeIterator &operator++() {
     ++Iter;
     ++Iter;
     return *this;
     return *this;
   }
   }
-  
+
   CanTypeIterator operator++(int) {
   CanTypeIterator operator++(int) {
     CanTypeIterator Tmp(*this);
     CanTypeIterator Tmp(*this);
     ++Iter;
     ++Iter;
     return Tmp;
     return Tmp;
   }
   }
- 
+
   friend bool operator==(const CanTypeIterator& X, const CanTypeIterator &Y) {
   friend bool operator==(const CanTypeIterator& X, const CanTypeIterator &Y) {
     return X.Iter == Y.Iter;
     return X.Iter == Y.Iter;
   }
   }
   friend bool operator!=(const CanTypeIterator& X, const CanTypeIterator &Y) {
   friend bool operator!=(const CanTypeIterator& X, const CanTypeIterator &Y) {
     return X.Iter != Y.Iter;
     return X.Iter != Y.Iter;
   }
   }
-  
+
   // Bidirectional iterator
   // Bidirectional iterator
   CanTypeIterator &operator--() {
   CanTypeIterator &operator--() {
     --Iter;
     --Iter;
     return *this;
     return *this;
   }
   }
-  
+
   CanTypeIterator operator--(int) {
   CanTypeIterator operator--(int) {
     CanTypeIterator Tmp(*this);
     CanTypeIterator Tmp(*this);
     --Iter;
     --Iter;
     return Tmp;
     return Tmp;
   }
   }
-  
+
   // Random access iterator
   // Random access iterator
   reference operator[](difference_type n) const {
   reference operator[](difference_type n) const {
     return CanQualType::CreateUnsafe(Iter[n]);
     return CanQualType::CreateUnsafe(Iter[n]);
   }
   }
-  
+
   CanTypeIterator &operator+=(difference_type n) {
   CanTypeIterator &operator+=(difference_type n) {
     Iter += n;
     Iter += n;
     return *this;
     return *this;
   }
   }
-  
+
   CanTypeIterator &operator-=(difference_type n) {
   CanTypeIterator &operator-=(difference_type n) {
     Iter -= n;
     Iter -= n;
     return *this;
     return *this;
   }
   }
-  
+
   friend CanTypeIterator operator+(CanTypeIterator X, difference_type n) {
   friend CanTypeIterator operator+(CanTypeIterator X, difference_type n) {
     X += n;
     X += n;
     return X;
     return X;
@@ -413,15 +413,15 @@ public:
     X += n;
     X += n;
     return X;
     return X;
   }
   }
-  
+
   friend CanTypeIterator operator-(CanTypeIterator X, difference_type n) {
   friend CanTypeIterator operator-(CanTypeIterator X, difference_type n) {
     X -= n;
     X -= n;
     return X;
     return X;
   }
   }
-  
-  friend difference_type operator-(const CanTypeIterator &X, 
+
+  friend difference_type operator-(const CanTypeIterator &X,
                                    const CanTypeIterator &Y) {
                                    const CanTypeIterator &Y) {
-    return X - Y; 
+    return X - Y;
   }
   }
 };
 };
 
 
@@ -431,7 +431,7 @@ struct CanProxyAdaptor<ExtQualType> : public CanProxyBase<ExtQualType> {
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(QualType::GCAttrTypes, getObjCGCAttr)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(QualType::GCAttrTypes, getObjCGCAttr)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getAddressSpace)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getAddressSpace)
 };
 };
-  
+
 template<>
 template<>
 struct CanProxyAdaptor<ComplexType> : public CanProxyBase<ComplexType> {
 struct CanProxyAdaptor<ComplexType> : public CanProxyBase<ComplexType> {
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
@@ -441,66 +441,60 @@ template<>
 struct CanProxyAdaptor<PointerType> : public CanProxyBase<PointerType> {
 struct CanProxyAdaptor<PointerType> : public CanProxyBase<PointerType> {
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
 };
 };
-  
+
 template<>
 template<>
-struct CanProxyAdaptor<BlockPointerType> 
-  : public CanProxyBase<BlockPointerType> 
-{
+struct CanProxyAdaptor<BlockPointerType>
+  : public CanProxyBase<BlockPointerType> {
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
 };
 };
-  
+
 template<>
 template<>
 struct CanProxyAdaptor<ReferenceType> : public CanProxyBase<ReferenceType> {
 struct CanProxyAdaptor<ReferenceType> : public CanProxyBase<ReferenceType> {
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
 };
 };
 
 
 template<>
 template<>
-struct CanProxyAdaptor<LValueReferenceType> 
-  : public CanProxyBase<LValueReferenceType> 
-{
+struct CanProxyAdaptor<LValueReferenceType>
+  : public CanProxyBase<LValueReferenceType> {
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
 };
 };
 
 
 template<>
 template<>
-struct CanProxyAdaptor<RValueReferenceType> 
-  : public CanProxyBase<RValueReferenceType> 
-{
+struct CanProxyAdaptor<RValueReferenceType>
+  : public CanProxyBase<RValueReferenceType> {
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
 };
 };
 
 
 template<>
 template<>
-struct CanProxyAdaptor<MemberPointerType> 
-  : public CanProxyBase<MemberPointerType> 
-{
+struct CanProxyAdaptor<MemberPointerType>
+  : public CanProxyBase<MemberPointerType> {
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(const Type *, getClass)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(const Type *, getClass)
 };
 };
-  
+
 template<>
 template<>
 struct CanProxyAdaptor<ArrayType> : public CanProxyBase<ArrayType> {
 struct CanProxyAdaptor<ArrayType> : public CanProxyBase<ArrayType> {
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
-  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(ArrayType::ArraySizeModifier, 
+  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(ArrayType::ArraySizeModifier,
                                       getSizeModifier)
                                       getSizeModifier)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getIndexTypeQualifier)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getIndexTypeQualifier)
 };
 };
 
 
 template<>
 template<>
-struct CanProxyAdaptor<ConstantArrayType> 
-  : public CanProxyBase<ConstantArrayType> 
-{
+struct CanProxyAdaptor<ConstantArrayType>
+  : public CanProxyBase<ConstantArrayType> {
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
-  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(ArrayType::ArraySizeModifier, 
+  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(ArrayType::ArraySizeModifier,
                                       getSizeModifier)
                                       getSizeModifier)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getIndexTypeQualifier)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getIndexTypeQualifier)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(const llvm::APInt &, getSize)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(const llvm::APInt &, getSize)
 };
 };
 
 
 template<>
 template<>
-struct CanProxyAdaptor<ConstantArrayWithExprType> 
-  : public CanProxyBase<ConstantArrayWithExprType> 
-{
+struct CanProxyAdaptor<ConstantArrayWithExprType>
+  : public CanProxyBase<ConstantArrayWithExprType> {
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
-  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(ArrayType::ArraySizeModifier, 
+  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(ArrayType::ArraySizeModifier,
                                       getSizeModifier)
                                       getSizeModifier)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getIndexTypeQualifier)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getIndexTypeQualifier)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(const llvm::APInt &, getSize)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(const llvm::APInt &, getSize)
@@ -509,34 +503,31 @@ struct CanProxyAdaptor<ConstantArrayWithExprType>
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(SourceLocation, getLBracketLoc)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(SourceLocation, getLBracketLoc)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(SourceLocation, getRBracketLoc)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(SourceLocation, getRBracketLoc)
 };
 };
-  
+
 template<>
 template<>
-struct CanProxyAdaptor<ConstantArrayWithoutExprType> 
-  : public CanProxyBase<ConstantArrayWithoutExprType> 
-{
+struct CanProxyAdaptor<ConstantArrayWithoutExprType>
+  : public CanProxyBase<ConstantArrayWithoutExprType> {
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
-  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(ArrayType::ArraySizeModifier, 
+  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(ArrayType::ArraySizeModifier,
                                       getSizeModifier)
                                       getSizeModifier)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getIndexTypeQualifier)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getIndexTypeQualifier)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(const llvm::APInt &, getSize)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(const llvm::APInt &, getSize)
 };
 };
 
 
 template<>
 template<>
-struct CanProxyAdaptor<IncompleteArrayType> 
-  : public CanProxyBase<IncompleteArrayType> 
-{
+struct CanProxyAdaptor<IncompleteArrayType>
+  : public CanProxyBase<IncompleteArrayType> {
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
-  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(ArrayType::ArraySizeModifier, 
+  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(ArrayType::ArraySizeModifier,
                                       getSizeModifier)
                                       getSizeModifier)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getIndexTypeQualifier)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getIndexTypeQualifier)
 };
 };
-  
+
 template<>
 template<>
-struct CanProxyAdaptor<VariableArrayType> 
-  : public CanProxyBase<VariableArrayType> 
-{
+struct CanProxyAdaptor<VariableArrayType>
+  : public CanProxyBase<VariableArrayType> {
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
-  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(ArrayType::ArraySizeModifier, 
+  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(ArrayType::ArraySizeModifier,
                                       getSizeModifier)
                                       getSizeModifier)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getIndexTypeQualifier)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getIndexTypeQualifier)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(Expr *, getSizeExpr)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(Expr *, getSizeExpr)
@@ -546,9 +537,8 @@ struct CanProxyAdaptor<VariableArrayType>
 };
 };
 
 
 template<>
 template<>
-struct CanProxyAdaptor<DependentSizedArrayType> 
-  : public CanProxyBase<DependentSizedArrayType> 
-{
+struct CanProxyAdaptor<DependentSizedArrayType>
+  : public CanProxyBase<DependentSizedArrayType> {
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(Expr *, getSizeExpr)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(Expr *, getSizeExpr)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(SourceRange, getBracketsRange)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(SourceRange, getBracketsRange)
@@ -557,14 +547,13 @@ struct CanProxyAdaptor<DependentSizedArrayType>
 };
 };
 
 
 template<>
 template<>
-struct CanProxyAdaptor<DependentSizedExtVectorType> 
-  : public CanProxyBase<DependentSizedExtVectorType>
-{
+struct CanProxyAdaptor<DependentSizedExtVectorType>
+  : public CanProxyBase<DependentSizedExtVectorType> {
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(const Expr *, getSizeExpr)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(const Expr *, getSizeExpr)
-  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(SourceLocation, getAttributeLoc)  
+  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(SourceLocation, getAttributeLoc)
 };
 };
-  
+
 template<>
 template<>
 struct CanProxyAdaptor<VectorType> : public CanProxyBase<VectorType> {
 struct CanProxyAdaptor<VectorType> : public CanProxyBase<VectorType> {
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getElementType)
@@ -583,28 +572,26 @@ struct CanProxyAdaptor<FunctionType> : public CanProxyBase<FunctionType> {
 };
 };
 
 
 template<>
 template<>
-struct CanProxyAdaptor<FunctionNoProtoType> 
-  : public CanProxyBase<FunctionNoProtoType> 
-{
+struct CanProxyAdaptor<FunctionNoProtoType>
+  : public CanProxyBase<FunctionNoProtoType> {
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getResultType)
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getResultType)
 };
 };
-  
+
 template<>
 template<>
-struct CanProxyAdaptor<FunctionProtoType> 
-  : public CanProxyBase<FunctionProtoType>
-{
+struct CanProxyAdaptor<FunctionProtoType>
+  : public CanProxyBase<FunctionProtoType> {
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getResultType)
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getResultType)
-  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getNumArgs);  
+  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getNumArgs);
   CanQualType getArgType(unsigned i) const {
   CanQualType getArgType(unsigned i) const {
     return CanQualType::CreateUnsafe(this->getTypePtr()->getArgType(i));
     return CanQualType::CreateUnsafe(this->getTypePtr()->getArgType(i));
   }
   }
-  
+
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isVariadic)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isVariadic)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getTypeQuals)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getTypeQuals)
-  
-  typedef CanTypeIterator<FunctionProtoType::arg_type_iterator> 
+
+  typedef CanTypeIterator<FunctionProtoType::arg_type_iterator>
     arg_type_iterator;
     arg_type_iterator;
-  
+
   arg_type_iterator arg_type_begin() const {
   arg_type_iterator arg_type_begin() const {
     return arg_type_iterator(this->getTypePtr()->arg_type_begin());
     return arg_type_iterator(this->getTypePtr()->arg_type_begin());
   }
   }
@@ -612,10 +599,10 @@ struct CanProxyAdaptor<FunctionProtoType>
   arg_type_iterator arg_type_end() const {
   arg_type_iterator arg_type_end() const {
     return arg_type_iterator(this->getTypePtr()->arg_type_end());
     return arg_type_iterator(this->getTypePtr()->arg_type_end());
   }
   }
-  
+
   // Note: canonical function types never have exception specifications
   // Note: canonical function types never have exception specifications
 };
 };
-  
+
 template<>
 template<>
 struct CanProxyAdaptor<TypeOfType> : public CanProxyBase<TypeOfType> {
 struct CanProxyAdaptor<TypeOfType> : public CanProxyBase<TypeOfType> {
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getUnderlyingType)
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getUnderlyingType)
@@ -638,44 +625,42 @@ struct CanProxyAdaptor<RecordType> : public CanProxyBase<RecordType> {
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(RecordDecl *, getDecl)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(RecordDecl *, getDecl)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isBeingDefined)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isBeingDefined)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, hasConstFields)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, hasConstFields)
-  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getAddressSpace)  
+  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getAddressSpace)
 };
 };
-  
+
 template<>
 template<>
 struct CanProxyAdaptor<EnumType> : public CanProxyBase<EnumType> {
 struct CanProxyAdaptor<EnumType> : public CanProxyBase<EnumType> {
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(EnumDecl *, getDecl)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(EnumDecl *, getDecl)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isBeingDefined)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isBeingDefined)
 };
 };
-  
+
 template<>
 template<>
-struct CanProxyAdaptor<TemplateTypeParmType> 
-  : public CanProxyBase<TemplateTypeParmType>
-{
+struct CanProxyAdaptor<TemplateTypeParmType>
+  : public CanProxyBase<TemplateTypeParmType> {
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getDepth)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getDepth)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getIndex)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getIndex)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isParameterPack)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isParameterPack)
-  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(IdentifierInfo *, getName)    
+  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(IdentifierInfo *, getName)
 };
 };
-  
+
 template<>
 template<>
-struct CanProxyAdaptor<ObjCObjectPointerType> 
-  : public CanProxyBase<ObjCObjectPointerType> 
-{
+struct CanProxyAdaptor<ObjCObjectPointerType>
+  : public CanProxyBase<ObjCObjectPointerType> {
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
-  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(const ObjCInterfaceType *, 
+  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(const ObjCInterfaceType *,
                                       getInterfaceType)
                                       getInterfaceType)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isObjCIdType)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isObjCIdType)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isObjCClassType)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isObjCClassType)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isObjCQualifiedIdType)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isObjCQualifiedIdType)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isObjCQualifiedClassType)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isObjCQualifiedClassType)
-  
+
   typedef ObjCObjectPointerType::qual_iterator qual_iterator;
   typedef ObjCObjectPointerType::qual_iterator qual_iterator;
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(qual_iterator, qual_begin)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(qual_iterator, qual_begin)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(qual_iterator, qual_end)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(qual_iterator, qual_end)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, qual_empty)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, qual_empty)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getNumProtocols)
   LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getNumProtocols)
 };
 };
-  
+
 //----------------------------------------------------------------------------//
 //----------------------------------------------------------------------------//
 // Method and function definitions
 // Method and function definitions
 //----------------------------------------------------------------------------//
 //----------------------------------------------------------------------------//
@@ -698,12 +683,12 @@ template<typename T>
 CanQual<T> CanQual<T>::getFromOpaquePtr(void *Ptr) {
 CanQual<T> CanQual<T>::getFromOpaquePtr(void *Ptr) {
   CanQual<T> Result;
   CanQual<T> Result;
   Result.Stored.setFromOpaqueValue(Ptr);
   Result.Stored.setFromOpaqueValue(Ptr);
-  assert((!Result || Result.Stored.isCanonical()) 
+  assert((!Result || Result.Stored.isCanonical())
          && "Type is not canonical!");
          && "Type is not canonical!");
   return Result;
   return Result;
 }
 }
 
 
-template<typename T> 
+template<typename T>
 CanQual<T> CanQual<T>::CreateUnsafe(QualType Other) {
 CanQual<T> CanQual<T>::CreateUnsafe(QualType Other) {
   assert((Other.isNull() || Other->isCanonical()) && "Type is not canonical!");
   assert((Other.isNull() || Other->isCanonical()) && "Type is not canonical!");
   assert((Other.isNull() || isa<T>(Other.getTypePtr())) &&
   assert((Other.isNull() || isa<T>(Other.getTypePtr())) &&
@@ -713,19 +698,19 @@ CanQual<T> CanQual<T>::CreateUnsafe(QualType Other) {
   return Result;
   return Result;
 }
 }
 
 
-template<typename T> 
-template<typename U> 
+template<typename T>
+template<typename U>
 CanProxy<U> CanQual<T>::getAs() const {
 CanProxy<U> CanQual<T>::getAs() const {
   if (Stored.isNull())
   if (Stored.isNull())
     return CanProxy<U>();
     return CanProxy<U>();
-  
+
   if (isa<U>(Stored.getTypePtr()))
   if (isa<U>(Stored.getTypePtr()))
     return CanQual<U>::CreateUnsafe(Stored);
     return CanQual<U>::CreateUnsafe(Stored);
-    
+
   if (const ExtQualType *EQ = Stored->getAs<ExtQualType>())
   if (const ExtQualType *EQ = Stored->getAs<ExtQualType>())
     return CanQual<T>::CreateUnsafe(QualType(EQ->getBaseType(), 0))
     return CanQual<T>::CreateUnsafe(QualType(EQ->getBaseType(), 0))
              .template getAs<U>();
              .template getAs<U>();
-  
+
   return CanProxy<U>();
   return CanProxy<U>();
 }
 }
 
 
@@ -733,13 +718,13 @@ template<typename T>
 CanProxy<T> CanQual<T>::operator->() const {
 CanProxy<T> CanQual<T>::operator->() const {
   return CanProxy<T>(*this);
   return CanProxy<T>(*this);
 }
 }
-  
+
 template<typename InputIterator>
 template<typename InputIterator>
-typename CanTypeIterator<InputIterator>::pointer 
+typename CanTypeIterator<InputIterator>::pointer
 CanTypeIterator<InputIterator>::operator->() const {
 CanTypeIterator<InputIterator>::operator->() const {
   return CanProxy<Type>(*this);
   return CanProxy<Type>(*this);
 }
 }
-  
+
 }
 }
 
 
 
 

+ 146 - 146
include/clang/AST/Decl.h

@@ -53,18 +53,18 @@ public:
 /// TranslationUnitDecl - The top declaration context.
 /// TranslationUnitDecl - The top declaration context.
 class TranslationUnitDecl : public Decl, public DeclContext {
 class TranslationUnitDecl : public Decl, public DeclContext {
   ASTContext &Ctx;
   ASTContext &Ctx;
-  
+
   explicit TranslationUnitDecl(ASTContext &ctx)
   explicit TranslationUnitDecl(ASTContext &ctx)
     : Decl(TranslationUnit, 0, SourceLocation()),
     : Decl(TranslationUnit, 0, SourceLocation()),
       DeclContext(TranslationUnit),
       DeclContext(TranslationUnit),
       Ctx(ctx) {}
       Ctx(ctx) {}
 public:
 public:
   ASTContext &getASTContext() const { return Ctx; }
   ASTContext &getASTContext() const { return Ctx; }
-  
+
   static TranslationUnitDecl *Create(ASTContext &C);
   static TranslationUnitDecl *Create(ASTContext &C);
   // Implement isa/cast/dyncast/etc.
   // Implement isa/cast/dyncast/etc.
   static bool classof(const Decl *D) { return D->getKind() == TranslationUnit; }
   static bool classof(const Decl *D) { return D->getKind() == TranslationUnit; }
-  static bool classof(const TranslationUnitDecl *D) { return true; }  
+  static bool classof(const TranslationUnitDecl *D) { return true; }
   static DeclContext *castToDeclContext(const TranslationUnitDecl *D) {
   static DeclContext *castToDeclContext(const TranslationUnitDecl *D) {
     return static_cast<DeclContext *>(const_cast<TranslationUnitDecl*>(D));
     return static_cast<DeclContext *>(const_cast<TranslationUnitDecl*>(D));
   }
   }
@@ -113,7 +113,7 @@ public:
   /// manipulation, so it should be called only when performance doesn't matter.
   /// manipulation, so it should be called only when performance doesn't matter.
   /// For simple declarations, getNameAsCString() should suffice.
   /// For simple declarations, getNameAsCString() should suffice.
   std::string getNameAsString() const { return Name.getAsString(); }
   std::string getNameAsString() const { return Name.getAsString(); }
-  
+
   /// getQualifiedNameAsString - Returns human-readable qualified name for
   /// getQualifiedNameAsString - Returns human-readable qualified name for
   /// declaration, like A::B::i, for i being member of namespace A::B.
   /// declaration, like A::B::i, for i being member of namespace A::B.
   /// If declaration is not member of context which can be named (record,
   /// If declaration is not member of context which can be named (record,
@@ -141,7 +141,7 @@ public:
   const NamedDecl *getUnderlyingDecl() const {
   const NamedDecl *getUnderlyingDecl() const {
     return const_cast<NamedDecl*>(this)->getUnderlyingDecl();
     return const_cast<NamedDecl*>(this)->getUnderlyingDecl();
   }
   }
-  
+
   static bool classof(const Decl *D) {
   static bool classof(const Decl *D) {
     return D->getKind() >= NamedFirst && D->getKind() <= NamedLast;
     return D->getKind() >= NamedFirst && D->getKind() <= NamedLast;
   }
   }
@@ -151,7 +151,7 @@ public:
 /// NamespaceDecl - Represent a C++ namespace.
 /// NamespaceDecl - Represent a C++ namespace.
 class NamespaceDecl : public NamedDecl, public DeclContext {
 class NamespaceDecl : public NamedDecl, public DeclContext {
   SourceLocation LBracLoc, RBracLoc;
   SourceLocation LBracLoc, RBracLoc;
-  
+
   // For extended namespace definitions:
   // For extended namespace definitions:
   //
   //
   // namespace A { int x; }
   // namespace A { int x; }
@@ -162,7 +162,7 @@ class NamespaceDecl : public NamedDecl, public DeclContext {
   // OrigNamespace points to the original namespace declaration.
   // OrigNamespace points to the original namespace declaration.
   // OrigNamespace of the first namespace decl points to itself.
   // OrigNamespace of the first namespace decl points to itself.
   NamespaceDecl *OrigNamespace, *NextNamespace;
   NamespaceDecl *OrigNamespace, *NextNamespace;
-  
+
   NamespaceDecl(DeclContext *DC, SourceLocation L, IdentifierInfo *Id)
   NamespaceDecl(DeclContext *DC, SourceLocation L, IdentifierInfo *Id)
     : NamedDecl(Namespace, DC, L, Id), DeclContext(Namespace) {
     : NamedDecl(Namespace, DC, L, Id), DeclContext(Namespace) {
     OrigNamespace = this;
     OrigNamespace = this;
@@ -171,7 +171,7 @@ class NamespaceDecl : public NamedDecl, public DeclContext {
 public:
 public:
   static NamespaceDecl *Create(ASTContext &C, DeclContext *DC,
   static NamespaceDecl *Create(ASTContext &C, DeclContext *DC,
                                SourceLocation L, IdentifierInfo *Id);
                                SourceLocation L, IdentifierInfo *Id);
-  
+
   virtual void Destroy(ASTContext& C);
   virtual void Destroy(ASTContext& C);
 
 
   NamespaceDecl *getNextNamespace() { return NextNamespace; }
   NamespaceDecl *getNextNamespace() { return NextNamespace; }
@@ -182,7 +182,7 @@ public:
     return OrigNamespace;
     return OrigNamespace;
   }
   }
   void setOriginalNamespace(NamespaceDecl *ND) { OrigNamespace = ND; }
   void setOriginalNamespace(NamespaceDecl *ND) { OrigNamespace = ND; }
-  
+
   virtual SourceRange getSourceRange() const {
   virtual SourceRange getSourceRange() const {
     return SourceRange(getLocation(), RBracLoc);
     return SourceRange(getLocation(), RBracLoc);
   }
   }
@@ -191,7 +191,7 @@ public:
   SourceLocation getRBracLoc() const { return RBracLoc; }
   SourceLocation getRBracLoc() const { return RBracLoc; }
   void setLBracLoc(SourceLocation LBrace) { LBracLoc = LBrace; }
   void setLBracLoc(SourceLocation LBrace) { LBracLoc = LBrace; }
   void setRBracLoc(SourceLocation RBrace) { RBracLoc = RBrace; }
   void setRBracLoc(SourceLocation RBrace) { RBracLoc = RBrace; }
-  
+
   // Implement isa/cast/dyncast/etc.
   // Implement isa/cast/dyncast/etc.
   static bool classof(const Decl *D) { return D->getKind() == Namespace; }
   static bool classof(const Decl *D) { return D->getKind() == Namespace; }
   static bool classof(const NamespaceDecl *D) { return true; }
   static bool classof(const NamespaceDecl *D) { return true; }
@@ -203,20 +203,20 @@ public:
   }
   }
 };
 };
 
 
-/// ValueDecl - Represent the declaration of a variable (in which case it is 
+/// ValueDecl - Represent the declaration of a variable (in which case it is
 /// an lvalue) a function (in which case it is a function designator) or
 /// an lvalue) a function (in which case it is a function designator) or
-/// an enum constant. 
+/// an enum constant.
 class ValueDecl : public NamedDecl {
 class ValueDecl : public NamedDecl {
   QualType DeclType;
   QualType DeclType;
 
 
 protected:
 protected:
   ValueDecl(Kind DK, DeclContext *DC, SourceLocation L,
   ValueDecl(Kind DK, DeclContext *DC, SourceLocation L,
-            DeclarationName N, QualType T) 
+            DeclarationName N, QualType T)
     : NamedDecl(DK, DC, L, N), DeclType(T) {}
     : NamedDecl(DK, DC, L, N), DeclType(T) {}
 public:
 public:
   QualType getType() const { return DeclType; }
   QualType getType() const { return DeclType; }
   void setType(QualType newType) { DeclType = newType; }
   void setType(QualType newType) { DeclType = newType; }
-  
+
   // Implement isa/cast/dyncast/etc.
   // Implement isa/cast/dyncast/etc.
   static bool classof(const Decl *D) {
   static bool classof(const Decl *D) {
     return D->getKind() >= ValueFirst && D->getKind() <= ValueLast;
     return D->getKind() >= ValueFirst && D->getKind() <= ValueLast;
@@ -287,23 +287,23 @@ protected:
   /// argument.
   /// argument.
   struct UnparsedDefaultArgument;
   struct UnparsedDefaultArgument;
 
 
-  /// \brief Placeholder type used in Init to denote an uninstantiated C++ 
+  /// \brief Placeholder type used in Init to denote an uninstantiated C++
   /// default argument.
   /// default argument.
   struct UninstantiatedDefaultArgument;
   struct UninstantiatedDefaultArgument;
 
 
-  typedef llvm::PointerUnion4<Stmt *, EvaluatedStmt *, 
-                              UnparsedDefaultArgument *, 
+  typedef llvm::PointerUnion4<Stmt *, EvaluatedStmt *,
+                              UnparsedDefaultArgument *,
                               UninstantiatedDefaultArgument *> InitType;
                               UninstantiatedDefaultArgument *> InitType;
-  
-  /// \brief The initializer for this variable or, for a ParmVarDecl, the 
+
+  /// \brief The initializer for this variable or, for a ParmVarDecl, the
   /// C++ default argument.
   /// C++ default argument.
   mutable InitType Init;
   mutable InitType Init;
-  
+
 private:
 private:
   // FIXME: This can be packed into the bitfields in Decl.
   // FIXME: This can be packed into the bitfields in Decl.
   unsigned SClass : 3;
   unsigned SClass : 3;
   bool ThreadSpecified : 1;
   bool ThreadSpecified : 1;
-  bool HasCXXDirectInit : 1; 
+  bool HasCXXDirectInit : 1;
 
 
   /// DeclaredInCondition - Whether this variable was declared in a
   /// DeclaredInCondition - Whether this variable was declared in a
   /// condition, e.g., if (int x = foo()) { ... }.
   /// condition, e.g., if (int x = foo()) { ... }.
@@ -315,8 +315,8 @@ protected:
           QualType T, DeclaratorInfo *DInfo, StorageClass SC)
           QualType T, DeclaratorInfo *DInfo, StorageClass SC)
     : DeclaratorDecl(DK, DC, L, Id, T, DInfo), Init(),
     : DeclaratorDecl(DK, DC, L, Id, T, DInfo), Init(),
       ThreadSpecified(false), HasCXXDirectInit(false),
       ThreadSpecified(false), HasCXXDirectInit(false),
-      DeclaredInCondition(false) { 
-    SClass = SC; 
+      DeclaredInCondition(false) {
+    SClass = SC;
   }
   }
 
 
   typedef Redeclarable<VarDecl> redeclarable_base;
   typedef Redeclarable<VarDecl> redeclarable_base;
@@ -326,7 +326,7 @@ public:
   typedef redeclarable_base::redecl_iterator redecl_iterator;
   typedef redeclarable_base::redecl_iterator redecl_iterator;
   redecl_iterator redecls_begin() const {
   redecl_iterator redecls_begin() const {
     return redeclarable_base::redecls_begin();
     return redeclarable_base::redecls_begin();
-  } 
+  }
   redecl_iterator redecls_end() const {
   redecl_iterator redecls_end() const {
     return redeclarable_base::redecls_end();
     return redeclarable_base::redecls_end();
   }
   }
@@ -340,10 +340,10 @@ public:
 
 
   StorageClass getStorageClass() const { return (StorageClass)SClass; }
   StorageClass getStorageClass() const { return (StorageClass)SClass; }
   void setStorageClass(StorageClass SC) { SClass = SC; }
   void setStorageClass(StorageClass SC) { SClass = SC; }
-  
+
   virtual SourceRange getSourceRange() const;
   virtual SourceRange getSourceRange() const;
 
 
-  const Expr *getInit() const { 
+  const Expr *getInit() const {
     if (Init.isNull())
     if (Init.isNull())
       return 0;
       return 0;
 
 
@@ -352,9 +352,9 @@ public:
       if (EvaluatedStmt *ES = Init.dyn_cast<EvaluatedStmt*>())
       if (EvaluatedStmt *ES = Init.dyn_cast<EvaluatedStmt*>())
         S = ES->Value;
         S = ES->Value;
     }
     }
-    return (const Expr*) S; 
+    return (const Expr*) S;
   }
   }
-  Expr *getInit() { 
+  Expr *getInit() {
     if (Init.isNull())
     if (Init.isNull())
       return 0;
       return 0;
 
 
@@ -364,26 +364,26 @@ public:
         S = ES->Value;
         S = ES->Value;
     }
     }
 
 
-    return (Expr*) S; 
+    return (Expr*) S;
   }
   }
 
 
   /// \brief Retrieve the address of the initializer expression.
   /// \brief Retrieve the address of the initializer expression.
   Stmt **getInitAddress() {
   Stmt **getInitAddress() {
     if (EvaluatedStmt *ES = Init.dyn_cast<EvaluatedStmt*>())
     if (EvaluatedStmt *ES = Init.dyn_cast<EvaluatedStmt*>())
       return &ES->Value;
       return &ES->Value;
-    
+
     // This union hack tip-toes around strict-aliasing rules.
     // This union hack tip-toes around strict-aliasing rules.
     union {
     union {
       InitType *InitPtr;
       InitType *InitPtr;
       Stmt **StmtPtr;
       Stmt **StmtPtr;
     };
     };
-    
+
     InitPtr = &Init;
     InitPtr = &Init;
     return StmtPtr;
     return StmtPtr;
   }
   }
 
 
   void setInit(ASTContext &C, Expr *I);
   void setInit(ASTContext &C, Expr *I);
-   
+
   /// \brief Note that constant evaluation has computed the given
   /// \brief Note that constant evaluation has computed the given
   /// value for this variable's initializer.
   /// value for this variable's initializer.
   void setEvaluatedValue(ASTContext &C, const APValue &Value) const {
   void setEvaluatedValue(ASTContext &C, const APValue &Value) const {
@@ -398,7 +398,7 @@ public:
     Eval->WasEvaluated = true;
     Eval->WasEvaluated = true;
     Eval->Evaluated = Value;
     Eval->Evaluated = Value;
   }
   }
-   
+
   /// \brief Return the already-evaluated value of this variable's
   /// \brief Return the already-evaluated value of this variable's
   /// initializer, or NULL if the value is not yet known.
   /// initializer, or NULL if the value is not yet known.
   APValue *getEvaluatedValue() const {
   APValue *getEvaluatedValue() const {
@@ -423,7 +423,7 @@ public:
   ///
   ///
   /// \pre isInitKnownICE()
   /// \pre isInitKnownICE()
   bool isInitICE() const {
   bool isInitICE() const {
-    assert(isInitKnownICE() && 
+    assert(isInitKnownICE() &&
            "Check whether we already know that the initializer is an ICE");
            "Check whether we already know that the initializer is an ICE");
     return Init.get<EvaluatedStmt *>()->IsICE;
     return Init.get<EvaluatedStmt *>()->IsICE;
   }
   }
@@ -465,7 +465,7 @@ public:
   bool hasCXXDirectInitializer() const {
   bool hasCXXDirectInitializer() const {
     return HasCXXDirectInit;
     return HasCXXDirectInit;
   }
   }
-  
+
   /// isDeclaredInCondition - Whether this variable was declared as
   /// isDeclaredInCondition - Whether this variable was declared as
   /// part of a condition in an if/switch/while statement, e.g.,
   /// part of a condition in an if/switch/while statement, e.g.,
   /// @code
   /// @code
@@ -474,8 +474,8 @@ public:
   bool isDeclaredInCondition() const {
   bool isDeclaredInCondition() const {
     return DeclaredInCondition;
     return DeclaredInCondition;
   }
   }
-  void setDeclaredInCondition(bool InCondition) { 
-    DeclaredInCondition = InCondition; 
+  void setDeclaredInCondition(bool InCondition) {
+    DeclaredInCondition = InCondition;
   }
   }
 
 
   virtual VarDecl *getCanonicalDecl();
   virtual VarDecl *getCanonicalDecl();
@@ -485,10 +485,10 @@ public:
   bool hasLocalStorage() const {
   bool hasLocalStorage() const {
     if (getStorageClass() == None)
     if (getStorageClass() == None)
       return !isFileVarDecl();
       return !isFileVarDecl();
-    
+
     // Return true for:  Auto, Register.
     // Return true for:  Auto, Register.
     // Return false for: Extern, Static, PrivateExtern.
     // Return false for: Extern, Static, PrivateExtern.
-    
+
     return getStorageClass() <= Register;
     return getStorageClass() <= Register;
   }
   }
 
 
@@ -515,7 +515,7 @@ public:
       return DC->getLookupContext()->isFunctionOrMethod();
       return DC->getLookupContext()->isFunctionOrMethod();
     return false;
     return false;
   }
   }
-  
+
   /// \brief Determines whether this is a static data member.
   /// \brief Determines whether this is a static data member.
   ///
   ///
   /// This will only be true in C++, and applies to, e.g., the
   /// This will only be true in C++, and applies to, e.g., the
@@ -530,10 +530,10 @@ public:
   }
   }
 
 
   /// \brief If this variable is an instantiated static data member of a
   /// \brief If this variable is an instantiated static data member of a
-  /// class template specialization, returns the templated static data member 
+  /// class template specialization, returns the templated static data member
   /// from which it was instantiated.
   /// from which it was instantiated.
-  VarDecl *getInstantiatedFromStaticDataMember(); 
-  
+  VarDecl *getInstantiatedFromStaticDataMember();
+
   /// isFileVarDecl - Returns true for file scoped variable declaration.
   /// isFileVarDecl - Returns true for file scoped variable declaration.
   bool isFileVarDecl() const {
   bool isFileVarDecl() const {
     if (getKind() != Decl::Var)
     if (getKind() != Decl::Var)
@@ -545,14 +545,14 @@ public:
     }
     }
     if (isStaticDataMember())
     if (isStaticDataMember())
       return true;
       return true;
-    
+
     return false;
     return false;
   }
   }
 
 
   /// \brief Determine whether this is a tentative definition of a
   /// \brief Determine whether this is a tentative definition of a
   /// variable in C.
   /// variable in C.
   bool isTentativeDefinition(ASTContext &Context) const;
   bool isTentativeDefinition(ASTContext &Context) const;
-  
+
   /// \brief Determines whether this variable is a variable with
   /// \brief Determines whether this variable is a variable with
   /// external, C linkage.
   /// external, C linkage.
   bool isExternC(ASTContext &Context) const;
   bool isExternC(ASTContext &Context) const;
@@ -567,7 +567,7 @@ public:
 class ImplicitParamDecl : public VarDecl {
 class ImplicitParamDecl : public VarDecl {
 protected:
 protected:
   ImplicitParamDecl(Kind DK, DeclContext *DC, SourceLocation L,
   ImplicitParamDecl(Kind DK, DeclContext *DC, SourceLocation L,
-                    IdentifierInfo *Id, QualType Tw) 
+                    IdentifierInfo *Id, QualType Tw)
     : VarDecl(DK, DC, L, Id, Tw, /*DInfo=*/0, VarDecl::None) {}
     : VarDecl(DK, DC, L, Id, Tw, /*DInfo=*/0, VarDecl::None) {}
 public:
 public:
   static ImplicitParamDecl *Create(ASTContext &C, DeclContext *DC,
   static ImplicitParamDecl *Create(ASTContext &C, DeclContext *DC,
@@ -584,15 +584,15 @@ class ParmVarDecl : public VarDecl {
   /// FIXME: Also can be paced into the bitfields in Decl.
   /// FIXME: Also can be paced into the bitfields in Decl.
   /// in, inout, etc.
   /// in, inout, etc.
   unsigned objcDeclQualifier : 6;
   unsigned objcDeclQualifier : 6;
-  
-  /// \brief Retrieves the fake "value" of an unparsed 
+
+  /// \brief Retrieves the fake "value" of an unparsed
   static Expr *getUnparsedDefaultArgValue() {
   static Expr *getUnparsedDefaultArgValue() {
     uintptr_t Value = (uintptr_t)-1;
     uintptr_t Value = (uintptr_t)-1;
     // Mask off the low bits
     // Mask off the low bits
     Value &= ~(uintptr_t)0x07;
     Value &= ~(uintptr_t)0x07;
     return reinterpret_cast<Expr*> (Value);
     return reinterpret_cast<Expr*> (Value);
   }
   }
-  
+
 protected:
 protected:
   ParmVarDecl(Kind DK, DeclContext *DC, SourceLocation L,
   ParmVarDecl(Kind DK, DeclContext *DC, SourceLocation L,
               IdentifierInfo *Id, QualType T, DeclaratorInfo *DInfo,
               IdentifierInfo *Id, QualType T, DeclaratorInfo *DInfo,
@@ -606,27 +606,27 @@ public:
                              SourceLocation L,IdentifierInfo *Id,
                              SourceLocation L,IdentifierInfo *Id,
                              QualType T, DeclaratorInfo *DInfo,
                              QualType T, DeclaratorInfo *DInfo,
                              StorageClass S, Expr *DefArg);
                              StorageClass S, Expr *DefArg);
-  
+
   ObjCDeclQualifier getObjCDeclQualifier() const {
   ObjCDeclQualifier getObjCDeclQualifier() const {
     return ObjCDeclQualifier(objcDeclQualifier);
     return ObjCDeclQualifier(objcDeclQualifier);
   }
   }
   void setObjCDeclQualifier(ObjCDeclQualifier QTVal) {
   void setObjCDeclQualifier(ObjCDeclQualifier QTVal) {
     objcDeclQualifier = QTVal;
     objcDeclQualifier = QTVal;
   }
   }
-    
-  const Expr *getDefaultArg() const { 
+
+  const Expr *getDefaultArg() const {
     assert(!hasUnparsedDefaultArg() && "Default argument is not yet parsed!");
     assert(!hasUnparsedDefaultArg() && "Default argument is not yet parsed!");
-    assert(!hasUninstantiatedDefaultArg() && 
+    assert(!hasUninstantiatedDefaultArg() &&
            "Default argument is not yet instantiated!");
            "Default argument is not yet instantiated!");
     return getInit();
     return getInit();
   }
   }
-  Expr *getDefaultArg() { 
+  Expr *getDefaultArg() {
     assert(!hasUnparsedDefaultArg() && "Default argument is not yet parsed!");
     assert(!hasUnparsedDefaultArg() && "Default argument is not yet parsed!");
-    assert(!hasUninstantiatedDefaultArg() && 
+    assert(!hasUninstantiatedDefaultArg() &&
            "Default argument is not yet instantiated!");
            "Default argument is not yet instantiated!");
     return getInit();
     return getInit();
   }
   }
-  void setDefaultArg(Expr *defarg) { 
+  void setDefaultArg(Expr *defarg) {
     Init = reinterpret_cast<Stmt *>(defarg);
     Init = reinterpret_cast<Stmt *>(defarg);
   }
   }
 
 
@@ -636,14 +636,14 @@ public:
   Expr *getUninstantiatedDefaultArg() {
   Expr *getUninstantiatedDefaultArg() {
     return (Expr *)Init.get<UninstantiatedDefaultArgument *>();
     return (Expr *)Init.get<UninstantiatedDefaultArgument *>();
   }
   }
-  
+
   /// hasDefaultArg - Determines whether this parameter has a default argument,
   /// hasDefaultArg - Determines whether this parameter has a default argument,
   /// either parsed or not.
   /// either parsed or not.
   bool hasDefaultArg() const {
   bool hasDefaultArg() const {
-    return getInit() || hasUnparsedDefaultArg() || 
+    return getInit() || hasUnparsedDefaultArg() ||
       hasUninstantiatedDefaultArg();
       hasUninstantiatedDefaultArg();
   }
   }
-  
+
   /// hasUnparsedDefaultArg - Determines whether this parameter has a
   /// hasUnparsedDefaultArg - Determines whether this parameter has a
   /// default argument that has not yet been parsed. This will occur
   /// default argument that has not yet been parsed. This will occur
   /// during the processing of a C++ class whose member functions have
   /// during the processing of a C++ class whose member functions have
@@ -661,18 +661,18 @@ public:
   bool hasUninstantiatedDefaultArg() const {
   bool hasUninstantiatedDefaultArg() const {
     return Init.is<UninstantiatedDefaultArgument*>();
     return Init.is<UninstantiatedDefaultArgument*>();
   }
   }
-  
+
   /// setUnparsedDefaultArg - Specify that this parameter has an
   /// setUnparsedDefaultArg - Specify that this parameter has an
   /// unparsed default argument. The argument will be replaced with a
   /// unparsed default argument. The argument will be replaced with a
   /// real default argument via setDefaultArg when the class
   /// real default argument via setDefaultArg when the class
   /// definition enclosing the function declaration that owns this
   /// definition enclosing the function declaration that owns this
   /// default argument is completed.
   /// default argument is completed.
-  void setUnparsedDefaultArg() { 
+  void setUnparsedDefaultArg() {
     Init = (UnparsedDefaultArgument *)0;
     Init = (UnparsedDefaultArgument *)0;
   }
   }
 
 
   QualType getOriginalType() const;
   QualType getOriginalType() const;
-  
+
   /// setOwningFunction - Sets the function declaration that owns this
   /// setOwningFunction - Sets the function declaration that owns this
   /// ParmVarDecl. Since ParmVarDecls are often created before the
   /// ParmVarDecl. Since ParmVarDecls are often created before the
   /// FunctionDecls that own them, this routine is required to update
   /// FunctionDecls that own them, this routine is required to update
@@ -680,9 +680,9 @@ public:
   void setOwningFunction(DeclContext *FD) { setDeclContext(FD); }
   void setOwningFunction(DeclContext *FD) { setDeclContext(FD); }
 
 
   // Implement isa/cast/dyncast/etc.
   // Implement isa/cast/dyncast/etc.
-  static bool classof(const Decl *D) { 
+  static bool classof(const Decl *D) {
     return (D->getKind() == ParmVar ||
     return (D->getKind() == ParmVar ||
-            D->getKind() == OriginalParmVar); 
+            D->getKind() == OriginalParmVar);
   }
   }
   static bool classof(const ParmVarDecl *D) { return true; }
   static bool classof(const ParmVarDecl *D) { return true; }
 };
 };
@@ -698,7 +698,7 @@ protected:
 private:
 private:
   OriginalParmVarDecl(DeclContext *DC, SourceLocation L,
   OriginalParmVarDecl(DeclContext *DC, SourceLocation L,
                               IdentifierInfo *Id, QualType T,
                               IdentifierInfo *Id, QualType T,
-                              DeclaratorInfo *DInfo, 
+                              DeclaratorInfo *DInfo,
                               QualType OT, StorageClass S,
                               QualType OT, StorageClass S,
                               Expr *DefArg)
                               Expr *DefArg)
   : ParmVarDecl(OriginalParmVar, DC, L, Id, T, DInfo, S, DefArg),
   : ParmVarDecl(OriginalParmVar, DC, L, Id, T, DInfo, S, DefArg),
@@ -715,7 +715,7 @@ public:
   static bool classof(const Decl *D) { return D->getKind() == OriginalParmVar; }
   static bool classof(const Decl *D) { return D->getKind() == OriginalParmVar; }
   static bool classof(const OriginalParmVarDecl *D) { return true; }
   static bool classof(const OriginalParmVarDecl *D) { return true; }
 };
 };
-  
+
 // \brief Describes the kind of template specialization that a
 // \brief Describes the kind of template specialization that a
 // particular template specialization declaration represents.
 // particular template specialization declaration represents.
 enum TemplateSpecializationKind {
 enum TemplateSpecializationKind {
@@ -730,17 +730,17 @@ enum TemplateSpecializationKind {
   /// specialization (C++ [temp.class.spec]).
   /// specialization (C++ [temp.class.spec]).
   TSK_ExplicitSpecialization,
   TSK_ExplicitSpecialization,
   /// This template specialization was instantiated from a template
   /// This template specialization was instantiated from a template
-  /// due to an explicit instantiation declaration request 
+  /// due to an explicit instantiation declaration request
   /// (C++0x [temp.explicit]).
   /// (C++0x [temp.explicit]).
   TSK_ExplicitInstantiationDeclaration,
   TSK_ExplicitInstantiationDeclaration,
   /// This template specialization was instantiated from a template
   /// This template specialization was instantiated from a template
-  /// due to an explicit instantiation definition request 
+  /// due to an explicit instantiation definition request
   /// (C++ [temp.explicit]).
   /// (C++ [temp.explicit]).
-  TSK_ExplicitInstantiationDefinition  
+  TSK_ExplicitInstantiationDefinition
 };
 };
-  
+
 /// FunctionDecl - An instance of this class is created to represent a
 /// FunctionDecl - An instance of this class is created to represent a
-/// function declaration or definition. 
+/// function declaration or definition.
 ///
 ///
 /// Since a given function can be declared several times in a program,
 /// Since a given function can be declared several times in a program,
 /// there may be several FunctionDecls that correspond to that
 /// there may be several FunctionDecls that correspond to that
@@ -749,20 +749,20 @@ enum TemplateSpecializationKind {
 /// FunctionDecl (e.g., the translation unit); this FunctionDecl
 /// FunctionDecl (e.g., the translation unit); this FunctionDecl
 /// contains all of the information known about the function. Other,
 /// contains all of the information known about the function. Other,
 /// previous declarations of the function are available via the
 /// previous declarations of the function are available via the
-/// getPreviousDeclaration() chain. 
+/// getPreviousDeclaration() chain.
 class FunctionDecl : public DeclaratorDecl, public DeclContext,
 class FunctionDecl : public DeclaratorDecl, public DeclContext,
                      public Redeclarable<FunctionDecl> {
                      public Redeclarable<FunctionDecl> {
 public:
 public:
   enum StorageClass {
   enum StorageClass {
     None, Extern, Static, PrivateExtern
     None, Extern, Static, PrivateExtern
   };
   };
-  
-private:  
+
+private:
   /// ParamInfo - new[]'d array of pointers to VarDecls for the formal
   /// ParamInfo - new[]'d array of pointers to VarDecls for the formal
   /// parameters of this function.  This is null if a prototype or if there are
   /// parameters of this function.  This is null if a prototype or if there are
   /// no formals.
   /// no formals.
   ParmVarDecl **ParamInfo;
   ParmVarDecl **ParamInfo;
-  
+
   LazyDeclStmtPtr Body;
   LazyDeclStmtPtr Body;
 
 
   // FIXME: This can be packed into the bitfields in Decl.
   // FIXME: This can be packed into the bitfields in Decl.
@@ -778,7 +778,7 @@ private:
   bool IsTrivial : 1; // sunk from CXXMethodDecl
   bool IsTrivial : 1; // sunk from CXXMethodDecl
   bool IsCopyAssignment : 1;  // sunk from CXXMethodDecl
   bool IsCopyAssignment : 1;  // sunk from CXXMethodDecl
   bool HasImplicitReturnZero : 1;
   bool HasImplicitReturnZero : 1;
-  
+
   /// \brief End part of this FunctionDecl's source range.
   /// \brief End part of this FunctionDecl's source range.
   ///
   ///
   /// We could compute the full range in getSourceRange(). However, when we're
   /// We could compute the full range in getSourceRange(). However, when we're
@@ -790,15 +790,15 @@ private:
 
 
   /// \brief The template or declaration that this declaration
   /// \brief The template or declaration that this declaration
   /// describes or was instantiated from, respectively.
   /// describes or was instantiated from, respectively.
-  /// 
+  ///
   /// For non-templates, this value will be NULL. For function
   /// For non-templates, this value will be NULL. For function
   /// declarations that describe a function template, this will be a
   /// declarations that describe a function template, this will be a
   /// pointer to a FunctionTemplateDecl. For member functions
   /// pointer to a FunctionTemplateDecl. For member functions
   /// of class template specializations, this will be the
   /// of class template specializations, this will be the
   /// FunctionDecl from which the member function was instantiated.
   /// FunctionDecl from which the member function was instantiated.
-  /// For function template specializations, this will be a 
+  /// For function template specializations, this will be a
   /// FunctionTemplateSpecializationInfo, which contains information about
   /// FunctionTemplateSpecializationInfo, which contains information about
-  /// the template being specialized and the template arguments involved in 
+  /// the template being specialized and the template arguments involved in
   /// that specialization.
   /// that specialization.
   llvm::PointerUnion3<FunctionTemplateDecl*, FunctionDecl*,
   llvm::PointerUnion3<FunctionTemplateDecl*, FunctionDecl*,
                       FunctionTemplateSpecializationInfo*>
                       FunctionTemplateSpecializationInfo*>
@@ -808,11 +808,11 @@ protected:
   FunctionDecl(Kind DK, DeclContext *DC, SourceLocation L,
   FunctionDecl(Kind DK, DeclContext *DC, SourceLocation L,
                DeclarationName N, QualType T, DeclaratorInfo *DInfo,
                DeclarationName N, QualType T, DeclaratorInfo *DInfo,
                StorageClass S, bool isInline)
                StorageClass S, bool isInline)
-    : DeclaratorDecl(DK, DC, L, N, T, DInfo), 
+    : DeclaratorDecl(DK, DC, L, N, T, DInfo),
       DeclContext(DK),
       DeclContext(DK),
       ParamInfo(0), Body(),
       ParamInfo(0), Body(),
-      SClass(S), IsInline(isInline), C99InlineDefinition(false), 
-      IsVirtualAsWritten(false), IsPure(false), HasInheritedPrototype(false), 
+      SClass(S), IsInline(isInline), C99InlineDefinition(false),
+      IsVirtualAsWritten(false), IsPure(false), HasInheritedPrototype(false),
       HasWrittenPrototype(true), IsDeleted(false), IsTrivial(false),
       HasWrittenPrototype(true), IsDeleted(false), IsTrivial(false),
       IsCopyAssignment(false),
       IsCopyAssignment(false),
       HasImplicitReturnZero(false),
       HasImplicitReturnZero(false),
@@ -828,7 +828,7 @@ public:
   typedef redeclarable_base::redecl_iterator redecl_iterator;
   typedef redeclarable_base::redecl_iterator redecl_iterator;
   redecl_iterator redecls_begin() const {
   redecl_iterator redecls_begin() const {
     return redeclarable_base::redecls_begin();
     return redeclarable_base::redecls_begin();
-  } 
+  }
   redecl_iterator redecls_end() const {
   redecl_iterator redecls_end() const {
     return redeclarable_base::redecls_end();
     return redeclarable_base::redecls_end();
   }
   }
@@ -888,7 +888,7 @@ public:
   /// the class has been fully built by Sema.
   /// the class has been fully built by Sema.
   bool isTrivial() const { return IsTrivial; }
   bool isTrivial() const { return IsTrivial; }
   void setTrivial(bool IT) { IsTrivial = IT; }
   void setTrivial(bool IT) { IsTrivial = IT; }
-                       
+
   bool isCopyAssignment() const { return IsCopyAssignment; }
   bool isCopyAssignment() const { return IsCopyAssignment; }
   void setCopyAssignment(bool CA) { IsCopyAssignment = CA; }
   void setCopyAssignment(bool CA) { IsCopyAssignment = CA; }
 
 
@@ -902,10 +902,10 @@ public:
   /// was explicitly written or because it was "inherited" by merging
   /// was explicitly written or because it was "inherited" by merging
   /// a declaration without a prototype with a declaration that has a
   /// a declaration without a prototype with a declaration that has a
   /// prototype.
   /// prototype.
-  bool hasPrototype() const { 
-    return HasWrittenPrototype || HasInheritedPrototype; 
+  bool hasPrototype() const {
+    return HasWrittenPrototype || HasInheritedPrototype;
   }
   }
-  
+
   bool hasWrittenPrototype() const { return HasWrittenPrototype; }
   bool hasWrittenPrototype() const { return HasWrittenPrototype; }
   void setHasWrittenPrototype(bool P) { HasWrittenPrototype = P; }
   void setHasWrittenPrototype(bool P) { HasWrittenPrototype = P; }
 
 
@@ -953,23 +953,23 @@ public:
   unsigned getBuiltinID(ASTContext &Context) const;
   unsigned getBuiltinID(ASTContext &Context) const;
 
 
   unsigned getNumParmVarDeclsFromType() const;
   unsigned getNumParmVarDeclsFromType() const;
-  
+
   // Iterator access to formal parameters.
   // Iterator access to formal parameters.
   unsigned param_size() const { return getNumParams(); }
   unsigned param_size() const { return getNumParams(); }
   typedef ParmVarDecl **param_iterator;
   typedef ParmVarDecl **param_iterator;
   typedef ParmVarDecl * const *param_const_iterator;
   typedef ParmVarDecl * const *param_const_iterator;
-  
+
   param_iterator param_begin() { return ParamInfo; }
   param_iterator param_begin() { return ParamInfo; }
   param_iterator param_end()   { return ParamInfo+param_size(); }
   param_iterator param_end()   { return ParamInfo+param_size(); }
-  
+
   param_const_iterator param_begin() const { return ParamInfo; }
   param_const_iterator param_begin() const { return ParamInfo; }
   param_const_iterator param_end() const   { return ParamInfo+param_size(); }
   param_const_iterator param_end() const   { return ParamInfo+param_size(); }
-  
+
   /// getNumParams - Return the number of parameters this function must have
   /// getNumParams - Return the number of parameters this function must have
   /// based on its functiontype.  This is the length of the PararmInfo array
   /// based on its functiontype.  This is the length of the PararmInfo array
   /// after it has been created.
   /// after it has been created.
   unsigned getNumParams() const;
   unsigned getNumParams() const;
-  
+
   const ParmVarDecl *getParamDecl(unsigned i) const {
   const ParmVarDecl *getParamDecl(unsigned i) const {
     assert(i < getNumParams() && "Illegal param #");
     assert(i < getNumParams() && "Illegal param #");
     return ParamInfo[i];
     return ParamInfo[i];
@@ -986,7 +986,7 @@ public:
   /// arguments (in C++).
   /// arguments (in C++).
   unsigned getMinRequiredArguments() const;
   unsigned getMinRequiredArguments() const;
 
 
-  QualType getResultType() const { 
+  QualType getResultType() const {
     return getType()->getAsFunctionType()->getResultType();
     return getType()->getAsFunctionType()->getResultType();
   }
   }
   StorageClass getStorageClass() const { return StorageClass(SClass); }
   StorageClass getStorageClass() const { return StorageClass(SClass); }
@@ -1015,7 +1015,7 @@ public:
 
 
   /// isOverloadedOperator - Whether this function declaration
   /// isOverloadedOperator - Whether this function declaration
   /// represents an C++ overloaded operator, e.g., "operator+".
   /// represents an C++ overloaded operator, e.g., "operator+".
-  bool isOverloadedOperator() const { 
+  bool isOverloadedOperator() const {
     return getOverloadedOperator() != OO_None;
     return getOverloadedOperator() != OO_None;
   };
   };
 
 
@@ -1048,7 +1048,7 @@ public:
 
 
   /// \brief Specify that this record is an instantiation of the
   /// \brief Specify that this record is an instantiation of the
   /// member function RD.
   /// member function RD.
-  void setInstantiationOfMemberFunction(FunctionDecl *RD) { 
+  void setInstantiationOfMemberFunction(FunctionDecl *RD) {
     TemplateOrSpecialization = RD;
     TemplateOrSpecialization = RD;
   }
   }
 
 
@@ -1078,14 +1078,14 @@ public:
   /// If this function declaration is not a function template specialization,
   /// If this function declaration is not a function template specialization,
   /// returns NULL.
   /// returns NULL.
   FunctionTemplateDecl *getPrimaryTemplate() const;
   FunctionTemplateDecl *getPrimaryTemplate() const;
-  
+
   /// \brief Retrieve the template arguments used to produce this function
   /// \brief Retrieve the template arguments used to produce this function
   /// template specialization from the primary template.
   /// template specialization from the primary template.
   ///
   ///
   /// If this function declaration is not a function template specialization,
   /// If this function declaration is not a function template specialization,
   /// returns NULL.
   /// returns NULL.
-  const TemplateArgumentList *getTemplateSpecializationArgs() const;  
-  
+  const TemplateArgumentList *getTemplateSpecializationArgs() const;
+
   /// \brief Specify that this function declaration is actually a function
   /// \brief Specify that this function declaration is actually a function
   /// template specialization.
   /// template specialization.
   ///
   ///
@@ -1108,7 +1108,7 @@ public:
   /// \brief Determine what kind of template instantiation this function
   /// \brief Determine what kind of template instantiation this function
   /// represents.
   /// represents.
   void setTemplateSpecializationKind(TemplateSpecializationKind TSK);
   void setTemplateSpecializationKind(TemplateSpecializationKind TSK);
-                       
+
   // Implement isa/cast/dyncast/etc.
   // Implement isa/cast/dyncast/etc.
   static bool classof(const Decl *D) {
   static bool classof(const Decl *D) {
     return D->getKind() >= FunctionFirst && D->getKind() <= FunctionLast;
     return D->getKind() >= FunctionFirst && D->getKind() <= FunctionLast;
@@ -1123,21 +1123,21 @@ public:
 };
 };
 
 
 
 
-/// FieldDecl - An instance of this class is created by Sema::ActOnField to 
+/// FieldDecl - An instance of this class is created by Sema::ActOnField to
 /// represent a member of a struct/union/class.
 /// represent a member of a struct/union/class.
 class FieldDecl : public DeclaratorDecl {
 class FieldDecl : public DeclaratorDecl {
   // FIXME: This can be packed into the bitfields in Decl.
   // FIXME: This can be packed into the bitfields in Decl.
   bool Mutable : 1;
   bool Mutable : 1;
   Expr *BitWidth;
   Expr *BitWidth;
 protected:
 protected:
-  FieldDecl(Kind DK, DeclContext *DC, SourceLocation L, 
+  FieldDecl(Kind DK, DeclContext *DC, SourceLocation L,
             IdentifierInfo *Id, QualType T, DeclaratorInfo *DInfo,
             IdentifierInfo *Id, QualType T, DeclaratorInfo *DInfo,
             Expr *BW, bool Mutable)
             Expr *BW, bool Mutable)
-    : DeclaratorDecl(DK, DC, L, Id, T, DInfo), Mutable(Mutable), BitWidth(BW)
-      { }
+    : DeclaratorDecl(DK, DC, L, Id, T, DInfo), Mutable(Mutable), BitWidth(BW) {
+  }
 
 
 public:
 public:
-  static FieldDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L, 
+  static FieldDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L,
                            IdentifierInfo *Id, QualType T,
                            IdentifierInfo *Id, QualType T,
                            DeclaratorInfo *DInfo, Expr *BW, bool Mutable);
                            DeclaratorInfo *DInfo, Expr *BW, bool Mutable);
 
 
@@ -1189,7 +1189,7 @@ public:
                                   SourceLocation L, IdentifierInfo *Id,
                                   SourceLocation L, IdentifierInfo *Id,
                                   QualType T, Expr *E,
                                   QualType T, Expr *E,
                                   const llvm::APSInt &V);
                                   const llvm::APSInt &V);
-  
+
   virtual void Destroy(ASTContext& C);
   virtual void Destroy(ASTContext& C);
 
 
   const Expr *getInitExpr() const { return (const Expr*) Init; }
   const Expr *getInitExpr() const { return (const Expr*) Init; }
@@ -1198,11 +1198,11 @@ public:
 
 
   void setInitExpr(Expr *E) { Init = (Stmt*) E; }
   void setInitExpr(Expr *E) { Init = (Stmt*) E; }
   void setInitVal(const llvm::APSInt &V) { Val = V; }
   void setInitVal(const llvm::APSInt &V) { Val = V; }
-  
+
   // Implement isa/cast/dyncast/etc.
   // Implement isa/cast/dyncast/etc.
   static bool classof(const Decl *D) { return D->getKind() == EnumConstant; }
   static bool classof(const Decl *D) { return D->getKind() == EnumConstant; }
   static bool classof(const EnumConstantDecl *D) { return true; }
   static bool classof(const EnumConstantDecl *D) { return true; }
-  
+
   friend class StmtIteratorBase;
   friend class StmtIteratorBase;
 };
 };
 
 
@@ -1244,16 +1244,16 @@ class TypedefDecl : public TypeDecl {
   /// UnderlyingType - This is the type the typedef is set to.
   /// UnderlyingType - This is the type the typedef is set to.
   QualType UnderlyingType;
   QualType UnderlyingType;
   TypedefDecl(DeclContext *DC, SourceLocation L,
   TypedefDecl(DeclContext *DC, SourceLocation L,
-              IdentifierInfo *Id, QualType T) 
+              IdentifierInfo *Id, QualType T)
     : TypeDecl(Typedef, DC, L, Id), UnderlyingType(T) {}
     : TypeDecl(Typedef, DC, L, Id), UnderlyingType(T) {}
 
 
   virtual ~TypedefDecl() {}
   virtual ~TypedefDecl() {}
 public:
 public:
-  
+
   static TypedefDecl *Create(ASTContext &C, DeclContext *DC,
   static TypedefDecl *Create(ASTContext &C, DeclContext *DC,
                              SourceLocation L,IdentifierInfo *Id,
                              SourceLocation L,IdentifierInfo *Id,
                              QualType T);
                              QualType T);
-  
+
   QualType getUnderlyingType() const { return UnderlyingType; }
   QualType getUnderlyingType() const { return UnderlyingType; }
   void setUnderlyingType(QualType newType) { UnderlyingType = newType; }
   void setUnderlyingType(QualType newType) { UnderlyingType = newType; }
 
 
@@ -1263,9 +1263,9 @@ public:
 };
 };
 
 
 class TypedefDecl;
 class TypedefDecl;
-  
+
 /// TagDecl - Represents the declaration of a struct/union/class/enum.
 /// TagDecl - Represents the declaration of a struct/union/class/enum.
-class TagDecl 
+class TagDecl
   : public TypeDecl, public DeclContext, public Redeclarable<TagDecl> {
   : public TypeDecl, public DeclContext, public Redeclarable<TagDecl> {
 public:
 public:
   // This is really ugly.
   // This is really ugly.
@@ -1283,7 +1283,7 @@ private:
   /// IsDefinition - True if this is a definition ("struct foo {};"), false if
   /// IsDefinition - True if this is a definition ("struct foo {};"), false if
   /// it is a declaration ("struct foo;").
   /// it is a declaration ("struct foo;").
   bool IsDefinition : 1;
   bool IsDefinition : 1;
-  
+
   /// TypedefForAnonDecl - If a TagDecl is anonymous and part of a typedef,
   /// TypedefForAnonDecl - If a TagDecl is anonymous and part of a typedef,
   /// this points to the TypedefDecl. Used for mangling.
   /// this points to the TypedefDecl. Used for mangling.
   TypedefDecl *TypedefForAnonDecl;
   TypedefDecl *TypedefForAnonDecl;
@@ -1302,19 +1302,19 @@ protected:
     IsDefinition = false;
     IsDefinition = false;
     setPreviousDeclaration(PrevDecl);
     setPreviousDeclaration(PrevDecl);
   }
   }
-    
+
   typedef Redeclarable<TagDecl> redeclarable_base;
   typedef Redeclarable<TagDecl> redeclarable_base;
   virtual TagDecl *getNextRedeclaration() { return RedeclLink.getNext(); }
   virtual TagDecl *getNextRedeclaration() { return RedeclLink.getNext(); }
-    
+
 public:
 public:
   typedef redeclarable_base::redecl_iterator redecl_iterator;
   typedef redeclarable_base::redecl_iterator redecl_iterator;
   redecl_iterator redecls_begin() const {
   redecl_iterator redecls_begin() const {
     return redeclarable_base::redecls_begin();
     return redeclarable_base::redecls_begin();
-  } 
+  }
   redecl_iterator redecls_end() const {
   redecl_iterator redecls_end() const {
     return redeclarable_base::redecls_end();
     return redeclarable_base::redecls_end();
   }
   }
-    
+
   SourceLocation getRBraceLoc() const { return RBraceLoc; }
   SourceLocation getRBraceLoc() const { return RBraceLoc; }
   void setRBraceLoc(SourceLocation L) { RBraceLoc = L; }
   void setRBraceLoc(SourceLocation L) { RBraceLoc = L; }
 
 
@@ -1322,7 +1322,7 @@ public:
   void setTagKeywordLoc(SourceLocation TKL) { TagKeywordLoc = TKL; }
   void setTagKeywordLoc(SourceLocation TKL) { TagKeywordLoc = TKL; }
 
 
   virtual SourceRange getSourceRange() const;
   virtual SourceRange getSourceRange() const;
-  
+
   virtual TagDecl* getCanonicalDecl();
   virtual TagDecl* getCanonicalDecl();
 
 
   /// isDefinition - Return true if this decl has its body specified.
   /// isDefinition - Return true if this decl has its body specified.
@@ -1336,7 +1336,7 @@ public:
   bool isDependentType() const { return isDependentContext(); }
   bool isDependentType() const { return isDependentContext(); }
 
 
   /// @brief Starts the definition of this tag declaration.
   /// @brief Starts the definition of this tag declaration.
-  /// 
+  ///
   /// This method should be invoked at the beginning of the definition
   /// This method should be invoked at the beginning of the definition
   /// of this tag declaration. It will set the tag type into a state
   /// of this tag declaration. It will set the tag type into a state
   /// where it is in the process of being defined.
   /// where it is in the process of being defined.
@@ -1345,7 +1345,7 @@ public:
   /// @brief Completes the definition of this tag declaration.
   /// @brief Completes the definition of this tag declaration.
   void completeDefinition();
   void completeDefinition();
 
 
-  /// getDefinition - Returns the TagDecl that actually defines this 
+  /// getDefinition - Returns the TagDecl that actually defines this
   ///  struct/union/class/enum.  When determining whether or not a
   ///  struct/union/class/enum.  When determining whether or not a
   ///  struct/union/class/enum is completely defined, one should use this method
   ///  struct/union/class/enum is completely defined, one should use this method
   ///  as opposed to 'isDefinition'.  'isDefinition' indicates whether or not a
   ///  as opposed to 'isDefinition'.  'isDefinition' indicates whether or not a
@@ -1353,7 +1353,7 @@ public:
   ///  struct/union/class/enum type is defined.  This method returns NULL if
   ///  struct/union/class/enum type is defined.  This method returns NULL if
   ///  there is no TagDecl that defines the struct/union/class/enum.
   ///  there is no TagDecl that defines the struct/union/class/enum.
   TagDecl* getDefinition(ASTContext& C) const;
   TagDecl* getDefinition(ASTContext& C) const;
-  
+
   const char *getKindName() const {
   const char *getKindName() const {
     return ElaboratedType::getNameForTagKind(getTagKind());
     return ElaboratedType::getNameForTagKind(getTagKind());
   }
   }
@@ -1373,10 +1373,10 @@ public:
   bool isClass()  const { return getTagKind() == TK_class; }
   bool isClass()  const { return getTagKind() == TK_class; }
   bool isUnion()  const { return getTagKind() == TK_union; }
   bool isUnion()  const { return getTagKind() == TK_union; }
   bool isEnum()   const { return getTagKind() == TK_enum; }
   bool isEnum()   const { return getTagKind() == TK_enum; }
-  
+
   TypedefDecl *getTypedefForAnonDecl() const { return TypedefForAnonDecl; }
   TypedefDecl *getTypedefForAnonDecl() const { return TypedefForAnonDecl; }
   void setTypedefForAnonDecl(TypedefDecl *TDD) { TypedefForAnonDecl = TDD; }
   void setTypedefForAnonDecl(TypedefDecl *TDD) { TypedefForAnonDecl = TDD; }
-  
+
   // Implement isa/cast/dyncast/etc.
   // Implement isa/cast/dyncast/etc.
   static bool classof(const Decl *D) {
   static bool classof(const Decl *D) {
     return D->getKind() >= TagFirst && D->getKind() <= TagLast;
     return D->getKind() >= TagFirst && D->getKind() <= TagLast;
@@ -1419,7 +1419,7 @@ public:
   static EnumDecl *Create(ASTContext &C, DeclContext *DC,
   static EnumDecl *Create(ASTContext &C, DeclContext *DC,
                           SourceLocation L, IdentifierInfo *Id,
                           SourceLocation L, IdentifierInfo *Id,
                           SourceLocation TKL, EnumDecl *PrevDecl);
                           SourceLocation TKL, EnumDecl *PrevDecl);
-  
+
   virtual void Destroy(ASTContext& C);
   virtual void Destroy(ASTContext& C);
 
 
   /// completeDefinition - When created, the EnumDecl corresponds to a
   /// completeDefinition - When created, the EnumDecl corresponds to a
@@ -1428,16 +1428,16 @@ public:
   /// added (via DeclContext::addDecl). NewType is the new underlying
   /// added (via DeclContext::addDecl). NewType is the new underlying
   /// type of the enumeration type.
   /// type of the enumeration type.
   void completeDefinition(ASTContext &C, QualType NewType);
   void completeDefinition(ASTContext &C, QualType NewType);
-  
+
   // enumerator_iterator - Iterates through the enumerators of this
   // enumerator_iterator - Iterates through the enumerators of this
   // enumeration.
   // enumeration.
   typedef specific_decl_iterator<EnumConstantDecl> enumerator_iterator;
   typedef specific_decl_iterator<EnumConstantDecl> enumerator_iterator;
 
 
-  enumerator_iterator enumerator_begin() const { 
+  enumerator_iterator enumerator_begin() const {
     return enumerator_iterator(this->decls_begin());
     return enumerator_iterator(this->decls_begin());
   }
   }
 
 
-  enumerator_iterator enumerator_end() const { 
+  enumerator_iterator enumerator_end() const {
     return enumerator_iterator(this->decls_end());
     return enumerator_iterator(this->decls_end());
   }
   }
 
 
@@ -1477,14 +1477,14 @@ class RecordDecl : public TagDecl {
   /// AnonymousStructOrUnion - Whether this is the type of an
   /// AnonymousStructOrUnion - Whether this is the type of an
   /// anonymous struct or union.
   /// anonymous struct or union.
   bool AnonymousStructOrUnion : 1;
   bool AnonymousStructOrUnion : 1;
-  
+
   /// HasObjectMember - This is true if this struct has at least one
   /// HasObjectMember - This is true if this struct has at least one
-  /// member containing an object 
+  /// member containing an object
   bool HasObjectMember : 1;
   bool HasObjectMember : 1;
 
 
 protected:
 protected:
   RecordDecl(Kind DK, TagKind TK, DeclContext *DC,
   RecordDecl(Kind DK, TagKind TK, DeclContext *DC,
-             SourceLocation L, IdentifierInfo *Id, 
+             SourceLocation L, IdentifierInfo *Id,
              RecordDecl *PrevDecl, SourceLocation TKL);
              RecordDecl *PrevDecl, SourceLocation TKL);
   virtual ~RecordDecl();
   virtual ~RecordDecl();
 
 
@@ -1495,7 +1495,7 @@ public:
                             RecordDecl* PrevDecl = 0);
                             RecordDecl* PrevDecl = 0);
 
 
   virtual void Destroy(ASTContext& C);
   virtual void Destroy(ASTContext& C);
-      
+
   bool hasFlexibleArrayMember() const { return HasFlexibleArrayMember; }
   bool hasFlexibleArrayMember() const { return HasFlexibleArrayMember; }
   void setHasFlexibleArrayMember(bool V) { HasFlexibleArrayMember = V; }
   void setHasFlexibleArrayMember(bool V) { HasFlexibleArrayMember = V; }
 
 
@@ -1505,7 +1505,7 @@ public:
   /// type declared, e.g.,
   /// type declared, e.g.,
   /// @code
   /// @code
   ///   union { int i; float f; };
   ///   union { int i; float f; };
-  /// @endcode   
+  /// @endcode
   /// is an anonymous union but neither of the following are:
   /// is an anonymous union but neither of the following are:
   /// @code
   /// @code
   ///  union X { int i; float f; };
   ///  union X { int i; float f; };
@@ -1518,7 +1518,7 @@ public:
 
 
   bool hasObjectMember() const { return HasObjectMember; }
   bool hasObjectMember() const { return HasObjectMember; }
   void setHasObjectMember (bool val) { HasObjectMember = val; }
   void setHasObjectMember (bool val) { HasObjectMember = val; }
-  
+
   /// \brief Determines whether this declaration represents the
   /// \brief Determines whether this declaration represents the
   /// injected class name.
   /// injected class name.
   ///
   ///
@@ -1534,7 +1534,7 @@ public:
   /// \endcode
   /// \endcode
   bool isInjectedClassName() const;
   bool isInjectedClassName() const;
 
 
-  /// getDefinition - Returns the RecordDecl that actually defines this 
+  /// getDefinition - Returns the RecordDecl that actually defines this
   ///  struct/union/class.  When determining whether or not a struct/union/class
   ///  struct/union/class.  When determining whether or not a struct/union/class
   ///  is completely defined, one should use this method as opposed to
   ///  is completely defined, one should use this method as opposed to
   ///  'isDefinition'.  'isDefinition' indicates whether or not a specific
   ///  'isDefinition'.  'isDefinition' indicates whether or not a specific
@@ -1544,7 +1544,7 @@ public:
   RecordDecl* getDefinition(ASTContext& C) const {
   RecordDecl* getDefinition(ASTContext& C) const {
     return cast_or_null<RecordDecl>(TagDecl::getDefinition(C));
     return cast_or_null<RecordDecl>(TagDecl::getDefinition(C));
   }
   }
-  
+
   // Iterator access to field members. The field iterator only visits
   // Iterator access to field members. The field iterator only visits
   // the non-static data members of this class, ignoring any static
   // the non-static data members of this class, ignoring any static
   // data members, functions, constructors, destructors, etc.
   // data members, functions, constructors, destructors, etc.
@@ -1559,7 +1559,7 @@ public:
 
 
   // field_empty - Whether there are any fields (non-static data
   // field_empty - Whether there are any fields (non-static data
   // members) in this record.
   // members) in this record.
-  bool field_empty() const { 
+  bool field_empty() const {
     return field_begin() == field_end();
     return field_begin() == field_end();
   }
   }
 
 
@@ -1588,7 +1588,7 @@ public:
   static bool classof(const Decl *D) {
   static bool classof(const Decl *D) {
     return D->getKind() == FileScopeAsm;
     return D->getKind() == FileScopeAsm;
   }
   }
-  static bool classof(const FileScopeAsmDecl *D) { return true; }  
+  static bool classof(const FileScopeAsmDecl *D) { return true; }
 };
 };
 
 
 /// BlockDecl - This represents a block literal declaration, which is like an
 /// BlockDecl - This represents a block literal declaration, which is like an
@@ -1603,12 +1603,12 @@ class BlockDecl : public Decl, public DeclContext {
   /// no formals.
   /// no formals.
   ParmVarDecl **ParamInfo;
   ParmVarDecl **ParamInfo;
   unsigned NumParams;
   unsigned NumParams;
-  
+
   Stmt *Body;
   Stmt *Body;
-  
+
 protected:
 protected:
   BlockDecl(DeclContext *DC, SourceLocation CaretLoc)
   BlockDecl(DeclContext *DC, SourceLocation CaretLoc)
-    : Decl(Block, DC, CaretLoc), DeclContext(Block), 
+    : Decl(Block, DC, CaretLoc), DeclContext(Block),
       isVariadic(false), ParamInfo(0), NumParams(0), Body(0) {}
       isVariadic(false), ParamInfo(0), NumParams(0), Body(0) {}
 
 
   virtual ~BlockDecl();
   virtual ~BlockDecl();
@@ -1621,7 +1621,7 @@ public:
 
 
   bool IsVariadic() const { return isVariadic; }
   bool IsVariadic() const { return isVariadic; }
   void setIsVariadic(bool value) { isVariadic = value; }
   void setIsVariadic(bool value) { isVariadic = value; }
-  
+
   CompoundStmt *getCompoundBody() const { return (CompoundStmt*) Body; }
   CompoundStmt *getCompoundBody() const { return (CompoundStmt*) Body; }
   Stmt *getBody() const { return (Stmt*) Body; }
   Stmt *getBody() const { return (Stmt*) Body; }
   void setBody(CompoundStmt *B) { Body = (Stmt*) B; }
   void setBody(CompoundStmt *B) { Body = (Stmt*) B; }
@@ -1630,14 +1630,14 @@ public:
   unsigned param_size() const { return getNumParams(); }
   unsigned param_size() const { return getNumParams(); }
   typedef ParmVarDecl **param_iterator;
   typedef ParmVarDecl **param_iterator;
   typedef ParmVarDecl * const *param_const_iterator;
   typedef ParmVarDecl * const *param_const_iterator;
-  
+
   bool param_empty() const { return NumParams == 0; }
   bool param_empty() const { return NumParams == 0; }
   param_iterator param_begin()  { return ParamInfo; }
   param_iterator param_begin()  { return ParamInfo; }
   param_iterator param_end()   { return ParamInfo+param_size(); }
   param_iterator param_end()   { return ParamInfo+param_size(); }
-  
+
   param_const_iterator param_begin() const { return ParamInfo; }
   param_const_iterator param_begin() const { return ParamInfo; }
   param_const_iterator param_end() const   { return ParamInfo+param_size(); }
   param_const_iterator param_end() const   { return ParamInfo+param_size(); }
-  
+
   unsigned getNumParams() const;
   unsigned getNumParams() const;
   const ParmVarDecl *getParamDecl(unsigned i) const {
   const ParmVarDecl *getParamDecl(unsigned i) const {
     assert(i < getNumParams() && "Illegal param #");
     assert(i < getNumParams() && "Illegal param #");
@@ -1648,10 +1648,10 @@ public:
     return ParamInfo[i];
     return ParamInfo[i];
   }
   }
   void setParams(ASTContext& C, ParmVarDecl **NewParamInfo, unsigned NumParams);
   void setParams(ASTContext& C, ParmVarDecl **NewParamInfo, unsigned NumParams);
-    
+
   // Implement isa/cast/dyncast/etc.
   // Implement isa/cast/dyncast/etc.
   static bool classof(const Decl *D) { return D->getKind() == Block; }
   static bool classof(const Decl *D) { return D->getKind() == Block; }
-  static bool classof(const BlockDecl *D) { return true; }  
+  static bool classof(const BlockDecl *D) { return true; }
   static DeclContext *castToDeclContext(const BlockDecl *D) {
   static DeclContext *castToDeclContext(const BlockDecl *D) {
     return static_cast<DeclContext *>(const_cast<BlockDecl*>(D));
     return static_cast<DeclContext *>(const_cast<BlockDecl*>(D));
   }
   }

+ 61 - 61
include/clang/AST/DeclBase.h

@@ -60,8 +60,8 @@ public:
 
 
 namespace clang {
 namespace clang {
 
 
-/// Decl - This represents one declaration (or definition), e.g. a variable, 
-/// typedef, function, struct, etc.  
+/// Decl - This represents one declaration (or definition), e.g. a variable,
+/// typedef, function, struct, etc.
 ///
 ///
 class Decl {
 class Decl {
 public:
 public:
@@ -69,7 +69,7 @@ public:
   enum Kind {
   enum Kind {
 #define DECL(Derived, Base) Derived,
 #define DECL(Derived, Base) Derived,
 #define DECL_RANGE(CommonBase, Start, End) \
 #define DECL_RANGE(CommonBase, Start, End) \
-    CommonBase##First = Start, CommonBase##Last = End, 
+    CommonBase##First = Start, CommonBase##Last = End,
 #define LAST_DECL_RANGE(CommonBase, Start, End) \
 #define LAST_DECL_RANGE(CommonBase, Start, End) \
     CommonBase##First = Start, CommonBase##Last = End
     CommonBase##First = Start, CommonBase##Last = End
 #include "clang/AST/DeclNodes.def"
 #include "clang/AST/DeclNodes.def"
@@ -93,7 +93,7 @@ public:
     IDNS_OrdinaryFriend = 0x80,
     IDNS_OrdinaryFriend = 0x80,
     IDNS_TagFriend = 0x100
     IDNS_TagFriend = 0x100
   };
   };
-  
+
   /// ObjCDeclQualifier - Qualifier used on types in method declarations
   /// ObjCDeclQualifier - Qualifier used on types in method declarations
   /// for remote messaging. They are meant for the arguments though and
   /// for remote messaging. They are meant for the arguments though and
   /// applied to the Decls (ObjCMethodDecl and ParmVarDecl).
   /// applied to the Decls (ObjCMethodDecl and ParmVarDecl).
@@ -106,7 +106,7 @@ public:
     OBJC_TQ_Byref = 0x10,
     OBJC_TQ_Byref = 0x10,
     OBJC_TQ_Oneway = 0x20
     OBJC_TQ_Oneway = 0x20
   };
   };
-    
+
 private:
 private:
   /// NextDeclInContext - The next declaration within the same lexical
   /// NextDeclInContext - The next declaration within the same lexical
   /// DeclContext. These pointers form the linked list that is
   /// DeclContext. These pointers form the linked list that is
@@ -119,8 +119,8 @@ private:
     DeclContext *SemanticDC;
     DeclContext *SemanticDC;
     DeclContext *LexicalDC;
     DeclContext *LexicalDC;
   };
   };
-  
-  
+
+
   /// DeclCtx - Holds either a DeclContext* or a MultipleDC*.
   /// DeclCtx - Holds either a DeclContext* or a MultipleDC*.
   /// For declarations that don't contain C++ scope specifiers, it contains
   /// For declarations that don't contain C++ scope specifiers, it contains
   /// the DeclContext where the Decl was declared.
   /// the DeclContext where the Decl was declared.
@@ -144,16 +144,16 @@ private:
   inline DeclContext *getSemanticDC() const {
   inline DeclContext *getSemanticDC() const {
     return DeclCtx.get<DeclContext*>();
     return DeclCtx.get<DeclContext*>();
   }
   }
-  
+
   /// Loc - The location that this decl.
   /// Loc - The location that this decl.
   SourceLocation Loc;
   SourceLocation Loc;
-  
+
   /// DeclKind - This indicates which class this is.
   /// DeclKind - This indicates which class this is.
   Kind DeclKind   :  8;
   Kind DeclKind   :  8;
-  
+
   /// InvalidDecl - This indicates a semantic error occurred.
   /// InvalidDecl - This indicates a semantic error occurred.
   unsigned int InvalidDecl :  1;
   unsigned int InvalidDecl :  1;
-  
+
   /// HasAttrs - This indicates whether the decl has attributes or not.
   /// HasAttrs - This indicates whether the decl has attributes or not.
   unsigned int HasAttrs : 1;
   unsigned int HasAttrs : 1;
 
 
@@ -168,22 +168,22 @@ private:
 protected:
 protected:
   /// IdentifierNamespace - This specifies what IDNS_* namespace this lives in.
   /// IdentifierNamespace - This specifies what IDNS_* namespace this lives in.
   unsigned IdentifierNamespace : 16;
   unsigned IdentifierNamespace : 16;
-  
+
 private:
 private:
 #ifndef NDEBUG
 #ifndef NDEBUG
   void CheckAccessDeclContext() const;
   void CheckAccessDeclContext() const;
 #else
 #else
   void CheckAccessDeclContext() const { }
   void CheckAccessDeclContext() const { }
 #endif
 #endif
-  
+
 protected:
 protected:
   /// Access - Used by C++ decls for the access specifier.
   /// Access - Used by C++ decls for the access specifier.
   // NOTE: VC++ treats enums as signed, avoid using the AccessSpecifier enum
   // NOTE: VC++ treats enums as signed, avoid using the AccessSpecifier enum
   unsigned Access : 2;
   unsigned Access : 2;
   friend class CXXClassMemberWrapper;
   friend class CXXClassMemberWrapper;
 
 
-  Decl(Kind DK, DeclContext *DC, SourceLocation L) 
-    : NextDeclInContext(0), DeclCtx(DC), 
+  Decl(Kind DK, DeclContext *DC, SourceLocation L)
+    : NextDeclInContext(0), DeclCtx(DC),
       Loc(L), DeclKind(DK), InvalidDecl(0),
       Loc(L), DeclKind(DK), InvalidDecl(0),
       HasAttrs(false), Implicit(false), Used(false),
       HasAttrs(false), Implicit(false), Used(false),
       IdentifierNamespace(getIdentifierNamespaceForKind(DK)), Access(AS_none) {
       IdentifierNamespace(getIdentifierNamespaceForKind(DK)), Access(AS_none) {
@@ -206,7 +206,7 @@ public:
 
 
   Kind getKind() const { return DeclKind; }
   Kind getKind() const { return DeclKind; }
   const char *getDeclKindName() const;
   const char *getDeclKindName() const;
-  
+
   Decl *getNextDeclInContext() { return NextDeclInContext; }
   Decl *getNextDeclInContext() { return NextDeclInContext; }
   const Decl *getNextDeclInContext() const { return NextDeclInContext; }
   const Decl *getNextDeclInContext() const { return NextDeclInContext; }
 
 
@@ -225,15 +225,15 @@ public:
   }
   }
 
 
   ASTContext &getASTContext() const;
   ASTContext &getASTContext() const;
-  
+
   void setAccess(AccessSpecifier AS) {
   void setAccess(AccessSpecifier AS) {
-    Access = AS; 
+    Access = AS;
     CheckAccessDeclContext();
     CheckAccessDeclContext();
   }
   }
-  
-  AccessSpecifier getAccess() const { 
+
+  AccessSpecifier getAccess() const {
     CheckAccessDeclContext();
     CheckAccessDeclContext();
-    return AccessSpecifier(Access); 
+    return AccessSpecifier(Access);
   }
   }
 
 
   bool hasAttrs() const { return HasAttrs; }
   bool hasAttrs() const { return HasAttrs; }
@@ -251,11 +251,11 @@ public:
         return V;
         return V;
     return 0;
     return 0;
   }
   }
-    
+
   template<typename T> bool hasAttr() const {
   template<typename T> bool hasAttr() const {
     return getAttr<T>() != 0;
     return getAttr<T>() != 0;
   }
   }
-  
+
   /// setInvalidDecl - Indicates the Decl had a semantic error. This
   /// setInvalidDecl - Indicates the Decl had a semantic error. This
   /// allows for graceful error recovery.
   /// allows for graceful error recovery.
   void setInvalidDecl(bool Invalid = true) { InvalidDecl = Invalid; }
   void setInvalidDecl(bool Invalid = true) { InvalidDecl = Invalid; }
@@ -266,12 +266,12 @@ public:
   /// was written explicitly in the source code.
   /// was written explicitly in the source code.
   bool isImplicit() const { return Implicit; }
   bool isImplicit() const { return Implicit; }
   void setImplicit(bool I = true) { Implicit = I; }
   void setImplicit(bool I = true) { Implicit = I; }
-  
+
   /// \brief Whether this declaration was used, meaning that a definition
   /// \brief Whether this declaration was used, meaning that a definition
   /// is required.
   /// is required.
   bool isUsed() const { return Used; }
   bool isUsed() const { return Used; }
   void setUsed(bool U = true) { Used = U; }
   void setUsed(bool U = true) { Used = U; }
-  
+
   unsigned getIdentifierNamespace() const {
   unsigned getIdentifierNamespace() const {
     return IdentifierNamespace;
     return IdentifierNamespace;
   }
   }
@@ -280,7 +280,7 @@ public:
   }
   }
   static unsigned getIdentifierNamespaceForKind(Kind DK);
   static unsigned getIdentifierNamespaceForKind(Kind DK);
 
 
-  
+
   /// getLexicalDeclContext - The declaration context where this Decl was
   /// getLexicalDeclContext - The declaration context where this Decl was
   /// lexically declared (LexicalDC). May be different from
   /// lexically declared (LexicalDC). May be different from
   /// getDeclContext() (SemanticDC).
   /// getDeclContext() (SemanticDC).
@@ -303,7 +303,7 @@ public:
   bool isOutOfLine() const {
   bool isOutOfLine() const {
     return getLexicalDeclContext() != getDeclContext();
     return getLexicalDeclContext() != getDeclContext();
   }
   }
-  
+
   /// setDeclContext - Set both the semantic and lexical DeclContext
   /// setDeclContext - Set both the semantic and lexical DeclContext
   /// to DC.
   /// to DC.
   void setDeclContext(DeclContext *DC);
   void setDeclContext(DeclContext *DC);
@@ -324,7 +324,7 @@ public:
 
 
   /// \brief Whether this particular Decl is a canonical one.
   /// \brief Whether this particular Decl is a canonical one.
   bool isCanonicalDecl() const { return getCanonicalDecl() == this; }
   bool isCanonicalDecl() const { return getCanonicalDecl() == this; }
-  
+
 protected:
 protected:
   /// \brief Returns the next redeclaration or itself if this is the only decl.
   /// \brief Returns the next redeclaration or itself if this is the only decl.
   ///
   ///
@@ -367,10 +367,10 @@ public:
       return tmp;
       return tmp;
     }
     }
 
 
-    friend bool operator==(redecl_iterator x, redecl_iterator y) { 
+    friend bool operator==(redecl_iterator x, redecl_iterator y) {
       return x.Current == y.Current;
       return x.Current == y.Current;
     }
     }
-    friend bool operator!=(redecl_iterator x, redecl_iterator y) { 
+    friend bool operator!=(redecl_iterator x, redecl_iterator y) {
       return x.Current != y.Current;
       return x.Current != y.Current;
     }
     }
   };
   };
@@ -398,11 +398,11 @@ public:
   static void addDeclKind(Kind k);
   static void addDeclKind(Kind k);
   static bool CollectingStats(bool Enable = false);
   static bool CollectingStats(bool Enable = false);
   static void PrintStats();
   static void PrintStats();
-    
+
   /// isTemplateParameter - Determines whether this declaration is a
   /// isTemplateParameter - Determines whether this declaration is a
   /// template parameter.
   /// template parameter.
   bool isTemplateParameter() const;
   bool isTemplateParameter() const;
-  
+
   /// isTemplateParameter - Determines whether this declaration is a
   /// isTemplateParameter - Determines whether this declaration is a
   /// template parameter pack.
   /// template parameter pack.
   bool isTemplateParameterPack() const;
   bool isTemplateParameterPack() const;
@@ -445,12 +445,12 @@ public:
     if (!mask) return FOK_None;
     if (!mask) return FOK_None;
     return (mask & (IDNS_Tag | IDNS_Ordinary) ? FOK_Declared : FOK_Undeclared);
     return (mask & (IDNS_Tag | IDNS_Ordinary) ? FOK_Declared : FOK_Undeclared);
   }
   }
-  
+
   // Implement isa/cast/dyncast/etc.
   // Implement isa/cast/dyncast/etc.
   static bool classof(const Decl *) { return true; }
   static bool classof(const Decl *) { return true; }
   static DeclContext *castToDeclContext(const Decl *);
   static DeclContext *castToDeclContext(const Decl *);
   static Decl *castFromDeclContext(const DeclContext *);
   static Decl *castFromDeclContext(const DeclContext *);
-  
+
   /// Destroy - Call destructors and release memory.
   /// Destroy - Call destructors and release memory.
   virtual void Destroy(ASTContext& C);
   virtual void Destroy(ASTContext& C);
 
 
@@ -478,10 +478,10 @@ public:
   PrettyStackTraceDecl(Decl *theDecl, SourceLocation L,
   PrettyStackTraceDecl(Decl *theDecl, SourceLocation L,
                        SourceManager &sm, const char *Msg)
                        SourceManager &sm, const char *Msg)
   : TheDecl(theDecl), Loc(L), SM(sm), Message(Msg) {}
   : TheDecl(theDecl), Loc(L), SM(sm), Message(Msg) {}
-  
+
   virtual void print(llvm::raw_ostream &OS) const;
   virtual void print(llvm::raw_ostream &OS) const;
-};  
-  
+};
+
 
 
 /// DeclContext - This is used only as base class of specific decl types that
 /// DeclContext - This is used only as base class of specific decl types that
 /// can act as declaration contexts. These decls are (only the top classes
 /// can act as declaration contexts. These decls are (only the top classes
@@ -526,9 +526,9 @@ class DeclContext {
   mutable Decl *LastDecl;
   mutable Decl *LastDecl;
 
 
 protected:
 protected:
-   DeclContext(Decl::Kind K) 
+   DeclContext(Decl::Kind K)
      : DeclKind(K), ExternalLexicalStorage(false),
      : DeclKind(K), ExternalLexicalStorage(false),
-       ExternalVisibleStorage(false), LookupPtr(0), FirstDecl(0), 
+       ExternalVisibleStorage(false), LookupPtr(0), FirstDecl(0),
        LastDecl(0) { }
        LastDecl(0) { }
 
 
   void DestroyDecls(ASTContext &C);
   void DestroyDecls(ASTContext &C);
@@ -548,7 +548,7 @@ public:
   const DeclContext *getParent() const {
   const DeclContext *getParent() const {
     return const_cast<DeclContext*>(this)->getParent();
     return const_cast<DeclContext*>(this)->getParent();
   }
   }
-  
+
   /// getLexicalParent - Returns the containing lexical DeclContext. May be
   /// getLexicalParent - Returns the containing lexical DeclContext. May be
   /// different from getParent, e.g.:
   /// different from getParent, e.g.:
   ///
   ///
@@ -563,7 +563,7 @@ public:
   }
   }
   const DeclContext *getLexicalParent() const {
   const DeclContext *getLexicalParent() const {
     return const_cast<DeclContext*>(this)->getLexicalParent();
     return const_cast<DeclContext*>(this)->getLexicalParent();
-  }    
+  }
 
 
   ASTContext &getParentASTContext() const {
   ASTContext &getParentASTContext() const {
     return cast<Decl>(this)->getASTContext();
     return cast<Decl>(this)->getASTContext();
@@ -604,10 +604,10 @@ public:
   /// context are semantically declared in the nearest enclosing
   /// context are semantically declared in the nearest enclosing
   /// non-transparent (opaque) context but are lexically declared in
   /// non-transparent (opaque) context but are lexically declared in
   /// this context. For example, consider the enumerators of an
   /// this context. For example, consider the enumerators of an
-  /// enumeration type: 
+  /// enumeration type:
   /// @code
   /// @code
   /// enum E {
   /// enum E {
-  ///   Val1 
+  ///   Val1
   /// };
   /// };
   /// @endcode
   /// @endcode
   /// Here, E is a transparent context, so its enumerator (Val1) will
   /// Here, E is a transparent context, so its enumerator (Val1) will
@@ -622,7 +622,7 @@ public:
   bool Equals(DeclContext *DC) {
   bool Equals(DeclContext *DC) {
     return this->getPrimaryContext() == DC->getPrimaryContext();
     return this->getPrimaryContext() == DC->getPrimaryContext();
   }
   }
-  
+
   /// \brief Determine whether this declaration context encloses the
   /// \brief Determine whether this declaration context encloses the
   /// declaration context DC.
   /// declaration context DC.
   bool Encloses(DeclContext *DC);
   bool Encloses(DeclContext *DC);
@@ -643,7 +643,7 @@ public:
   const DeclContext *getLookupContext() const {
   const DeclContext *getLookupContext() const {
     return const_cast<DeclContext *>(this)->getLookupContext();
     return const_cast<DeclContext *>(this)->getLookupContext();
   }
   }
-  
+
   /// \brief Retrieve the nearest enclosing namespace context.
   /// \brief Retrieve the nearest enclosing namespace context.
   DeclContext *getEnclosingNamespaceContext();
   DeclContext *getEnclosingNamespaceContext();
   const DeclContext *getEnclosingNamespaceContext() const {
   const DeclContext *getEnclosingNamespaceContext() const {
@@ -699,16 +699,16 @@ public:
       return tmp;
       return tmp;
     }
     }
 
 
-    friend bool operator==(decl_iterator x, decl_iterator y) { 
+    friend bool operator==(decl_iterator x, decl_iterator y) {
       return x.Current == y.Current;
       return x.Current == y.Current;
     }
     }
-    friend bool operator!=(decl_iterator x, decl_iterator y) { 
+    friend bool operator!=(decl_iterator x, decl_iterator y) {
       return x.Current != y.Current;
       return x.Current != y.Current;
     }
     }
   };
   };
 
 
   /// decls_begin/decls_end - Iterate over the declarations stored in
   /// decls_begin/decls_end - Iterate over the declarations stored in
-  /// this context. 
+  /// this context.
   decl_iterator decls_begin() const;
   decl_iterator decls_begin() const;
   decl_iterator decls_end() const;
   decl_iterator decls_end() const;
   bool decls_empty() const;
   bool decls_empty() const;
@@ -724,7 +724,7 @@ public:
     /// will either be NULL or will point to a declaration of
     /// will either be NULL or will point to a declaration of
     /// type SpecificDecl.
     /// type SpecificDecl.
     DeclContext::decl_iterator Current;
     DeclContext::decl_iterator Current;
-    
+
     /// SkipToNextDecl - Advances the current position up to the next
     /// SkipToNextDecl - Advances the current position up to the next
     /// declaration of type SpecificDecl that also meets the criteria
     /// declaration of type SpecificDecl that also meets the criteria
     /// required by Acceptable.
     /// required by Acceptable.
@@ -769,13 +769,13 @@ public:
       ++(*this);
       ++(*this);
       return tmp;
       return tmp;
     }
     }
-  
+
     friend bool
     friend bool
     operator==(const specific_decl_iterator& x, const specific_decl_iterator& y) {
     operator==(const specific_decl_iterator& x, const specific_decl_iterator& y) {
       return x.Current == y.Current;
       return x.Current == y.Current;
     }
     }
-  
-    friend bool 
+
+    friend bool
     operator!=(const specific_decl_iterator& x, const specific_decl_iterator& y) {
     operator!=(const specific_decl_iterator& x, const specific_decl_iterator& y) {
       return x.Current != y.Current;
       return x.Current != y.Current;
     }
     }
@@ -796,7 +796,7 @@ public:
     /// will either be NULL or will point to a declaration of
     /// will either be NULL or will point to a declaration of
     /// type SpecificDecl.
     /// type SpecificDecl.
     DeclContext::decl_iterator Current;
     DeclContext::decl_iterator Current;
-    
+
     /// SkipToNextDecl - Advances the current position up to the next
     /// SkipToNextDecl - Advances the current position up to the next
     /// declaration of type SpecificDecl that also meets the criteria
     /// declaration of type SpecificDecl that also meets the criteria
     /// required by Acceptable.
     /// required by Acceptable.
@@ -843,13 +843,13 @@ public:
       ++(*this);
       ++(*this);
       return tmp;
       return tmp;
     }
     }
-  
+
     friend bool
     friend bool
     operator==(const filtered_decl_iterator& x, const filtered_decl_iterator& y) {
     operator==(const filtered_decl_iterator& x, const filtered_decl_iterator& y) {
       return x.Current == y.Current;
       return x.Current == y.Current;
     }
     }
-  
-    friend bool 
+
+    friend bool
     operator!=(const filtered_decl_iterator& x, const filtered_decl_iterator& y) {
     operator!=(const filtered_decl_iterator& x, const filtered_decl_iterator& y) {
       return x.Current != y.Current;
       return x.Current != y.Current;
     }
     }
@@ -920,7 +920,7 @@ public:
   /// udir_iterator - Iterates through the using-directives stored
   /// udir_iterator - Iterates through the using-directives stored
   /// within this context.
   /// within this context.
   typedef UsingDirectiveDecl * const * udir_iterator;
   typedef UsingDirectiveDecl * const * udir_iterator;
-  
+
   typedef std::pair<udir_iterator, udir_iterator> udir_iterator_range;
   typedef std::pair<udir_iterator, udir_iterator> udir_iterator_range;
 
 
   udir_iterator_range getUsingDirectives() const;
   udir_iterator_range getUsingDirectives() const;
@@ -944,8 +944,8 @@ public:
 
 
   /// \brief State whether this DeclContext has external storage for
   /// \brief State whether this DeclContext has external storage for
   /// declarations lexically in this context.
   /// declarations lexically in this context.
-  void setHasExternalLexicalStorage(bool ES = true) { 
-    ExternalLexicalStorage = ES; 
+  void setHasExternalLexicalStorage(bool ES = true) {
+    ExternalLexicalStorage = ES;
   }
   }
 
 
   /// \brief Whether this DeclContext has external storage containing
   /// \brief Whether this DeclContext has external storage containing
@@ -954,8 +954,8 @@ public:
 
 
   /// \brief State whether this DeclContext has external storage for
   /// \brief State whether this DeclContext has external storage for
   /// declarations visible in this context.
   /// declarations visible in this context.
-  void setHasExternalVisibleStorage(bool ES = true) { 
-    ExternalVisibleStorage = ES; 
+  void setHasExternalVisibleStorage(bool ES = true) {
+    ExternalVisibleStorage = ES;
   }
   }
 
 
   static bool classof(const Decl *D);
   static bool classof(const Decl *D);

Fișier diff suprimat deoarece este prea mare
+ 189 - 189
include/clang/AST/DeclCXX.h


+ 15 - 15
include/clang/AST/DeclContextInternals.h

@@ -57,13 +57,13 @@ public:
       Data = reinterpret_cast<uintptr_t>(New) | (Data & 0x03);
       Data = reinterpret_cast<uintptr_t>(New) | (Data & 0x03);
     }
     }
   }
   }
-  
+
   ~StoredDeclsList() {
   ~StoredDeclsList() {
     // If this is a vector-form, free the vector.
     // If this is a vector-form, free the vector.
     if (VectorTy *Vector = getAsVector())
     if (VectorTy *Vector = getAsVector())
       delete Vector;
       delete Vector;
   }
   }
-  
+
   StoredDeclsList &operator=(const StoredDeclsList &RHS) {
   StoredDeclsList &operator=(const StoredDeclsList &RHS) {
     if (VectorTy *Vector = getAsVector())
     if (VectorTy *Vector = getAsVector())
       delete Vector;
       delete Vector;
@@ -74,9 +74,9 @@ public:
     }
     }
     return *this;
     return *this;
   }
   }
-  
+
   bool isNull() const { return (Data & ~0x03) == 0; }
   bool isNull() const { return (Data & ~0x03) == 0; }
-  
+
   NamedDecl *getAsDecl() const {
   NamedDecl *getAsDecl() const {
     if ((Data & 0x03) != DK_Decl)
     if ((Data & 0x03) != DK_Decl)
       return 0;
       return 0;
@@ -135,27 +135,27 @@ public:
   DeclContext::lookup_result getLookupResult(ASTContext &Context) {
   DeclContext::lookup_result getLookupResult(ASTContext &Context) {
     if (isNull())
     if (isNull())
       return DeclContext::lookup_result(0, 0);
       return DeclContext::lookup_result(0, 0);
-   
+
     if (hasDeclarationIDs())
     if (hasDeclarationIDs())
       materializeDecls(Context);
       materializeDecls(Context);
 
 
     // If we have a single NamedDecl, return it.
     // If we have a single NamedDecl, return it.
     if (getAsDecl()) {
     if (getAsDecl()) {
       assert(!isNull() && "Empty list isn't allowed");
       assert(!isNull() && "Empty list isn't allowed");
-      
+
       // Data is a raw pointer to a NamedDecl*, return it.
       // Data is a raw pointer to a NamedDecl*, return it.
       void *Ptr = &Data;
       void *Ptr = &Data;
       return DeclContext::lookup_result((NamedDecl**)Ptr, (NamedDecl**)Ptr+1);
       return DeclContext::lookup_result((NamedDecl**)Ptr, (NamedDecl**)Ptr+1);
     }
     }
-    
+
     assert(getAsVector() && "Must have a vector at this point");
     assert(getAsVector() && "Must have a vector at this point");
     VectorTy &Vector = *getAsVector();
     VectorTy &Vector = *getAsVector();
-    
+
     // Otherwise, we have a range result.
     // Otherwise, we have a range result.
-    return DeclContext::lookup_result((NamedDecl **)&Vector[0], 
+    return DeclContext::lookup_result((NamedDecl **)&Vector[0],
                                       (NamedDecl **)&Vector[0]+Vector.size());
                                       (NamedDecl **)&Vector[0]+Vector.size());
   }
   }
-  
+
   /// HandleRedeclaration - If this is a redeclaration of an existing decl,
   /// HandleRedeclaration - If this is a redeclaration of an existing decl,
   /// replace the old one with D and return true.  Otherwise return false.
   /// replace the old one with D and return true.  Otherwise return false.
   bool HandleRedeclaration(ASTContext &Context, NamedDecl *D) {
   bool HandleRedeclaration(ASTContext &Context, NamedDecl *D) {
@@ -169,7 +169,7 @@ public:
       setOnlyValue(D);
       setOnlyValue(D);
       return true;
       return true;
     }
     }
-    
+
     // Determine if this declaration is actually a redeclaration.
     // Determine if this declaration is actually a redeclaration.
     VectorTy &Vec = *getAsVector();
     VectorTy &Vec = *getAsVector();
     for (VectorTy::iterator OD = Vec.begin(), ODEnd = Vec.end();
     for (VectorTy::iterator OD = Vec.begin(), ODEnd = Vec.end();
@@ -183,10 +183,10 @@ public:
 
 
     return false;
     return false;
   }
   }
-  
+
   /// AddSubsequentDecl - This is called on the second and later decl when it is
   /// AddSubsequentDecl - This is called on the second and later decl when it is
   /// not a redeclaration to merge it into the appropriate place in our list.
   /// not a redeclaration to merge it into the appropriate place in our list.
-  /// 
+  ///
   void AddSubsequentDecl(NamedDecl *D) {
   void AddSubsequentDecl(NamedDecl *D) {
     assert(!hasDeclarationIDs() && "Must materialize before adding decls");
     assert(!hasDeclarationIDs() && "Must materialize before adding decls");
 
 
@@ -197,7 +197,7 @@ public:
       VT->push_back(reinterpret_cast<uintptr_t>(OldD));
       VT->push_back(reinterpret_cast<uintptr_t>(OldD));
       Data = reinterpret_cast<uintptr_t>(VT) | DK_Decl_Vector;
       Data = reinterpret_cast<uintptr_t>(VT) | DK_Decl_Vector;
     }
     }
-    
+
     VectorTy &Vec = *getAsVector();
     VectorTy &Vec = *getAsVector();
     if (isa<UsingDirectiveDecl>(D) ||
     if (isa<UsingDirectiveDecl>(D) ||
         D->getIdentifierNamespace() == Decl::IDNS_Tag)
         D->getIdentifierNamespace() == Decl::IDNS_Tag)
@@ -217,4 +217,4 @@ typedef llvm::DenseMap<DeclarationName, StoredDeclsList> StoredDeclsMap;
 
 
 } // end namespace clang
 } // end namespace clang
 
 
-#endif 
+#endif

+ 19 - 19
include/clang/AST/DeclGroup.h

@@ -18,7 +18,7 @@
 #include <cassert>
 #include <cassert>
 
 
 namespace clang {
 namespace clang {
-  
+
 class ASTContext;
 class ASTContext;
 class Decl;
 class Decl;
 class DeclGroup;
 class DeclGroup;
@@ -27,7 +27,7 @@ class DeclGroupIterator;
 class DeclGroup {
 class DeclGroup {
   // FIXME: Include a TypeSpecifier object.
   // FIXME: Include a TypeSpecifier object.
   unsigned NumDecls;
   unsigned NumDecls;
-  
+
 private:
 private:
   DeclGroup() : NumDecls(0) {}
   DeclGroup() : NumDecls(0) {}
   DeclGroup(unsigned numdecls, Decl** decls);
   DeclGroup(unsigned numdecls, Decl** decls);
@@ -38,34 +38,34 @@ public:
 
 
   unsigned size() const { return NumDecls; }
   unsigned size() const { return NumDecls; }
 
 
-  Decl*& operator[](unsigned i) { 
+  Decl*& operator[](unsigned i) {
     assert (i < NumDecls && "Out-of-bounds access.");
     assert (i < NumDecls && "Out-of-bounds access.");
     return *((Decl**) (this+1));
     return *((Decl**) (this+1));
   }
   }
-  
-  Decl* const& operator[](unsigned i) const { 
+
+  Decl* const& operator[](unsigned i) const {
     assert (i < NumDecls && "Out-of-bounds access.");
     assert (i < NumDecls && "Out-of-bounds access.");
     return *((Decl* const*) (this+1));
     return *((Decl* const*) (this+1));
   }
   }
 };
 };
-    
+
 class DeclGroupRef {
 class DeclGroupRef {
   // Note this is not a PointerIntPair because we need the address of the
   // Note this is not a PointerIntPair because we need the address of the
   // non-group case to be valid as a Decl** for iteration.
   // non-group case to be valid as a Decl** for iteration.
-  enum Kind { SingleDeclKind=0x0, DeclGroupKind=0x1, Mask=0x1 };  
+  enum Kind { SingleDeclKind=0x0, DeclGroupKind=0x1, Mask=0x1 };
   Decl* D;
   Decl* D;
 
 
   Kind getKind() const {
   Kind getKind() const {
     return (Kind) (reinterpret_cast<uintptr_t>(D) & Mask);
     return (Kind) (reinterpret_cast<uintptr_t>(D) & Mask);
-  }  
-  
-public:    
+  }
+
+public:
   DeclGroupRef() : D(0) {}
   DeclGroupRef() : D(0) {}
-  
+
   explicit DeclGroupRef(Decl* d) : D(d) {}
   explicit DeclGroupRef(Decl* d) : D(d) {}
   explicit DeclGroupRef(DeclGroup* dg)
   explicit DeclGroupRef(DeclGroup* dg)
     : D((Decl*) (reinterpret_cast<uintptr_t>(dg) | DeclGroupKind)) {}
     : D((Decl*) (reinterpret_cast<uintptr_t>(dg) | DeclGroupKind)) {}
-  
+
   static DeclGroupRef Create(ASTContext &C, Decl **Decls, unsigned NumDecls) {
   static DeclGroupRef Create(ASTContext &C, Decl **Decls, unsigned NumDecls) {
     if (NumDecls == 0)
     if (NumDecls == 0)
       return DeclGroupRef();
       return DeclGroupRef();
@@ -73,10 +73,10 @@ public:
       return DeclGroupRef(Decls[0]);
       return DeclGroupRef(Decls[0]);
     return DeclGroupRef(DeclGroup::Create(C, Decls, NumDecls));
     return DeclGroupRef(DeclGroup::Create(C, Decls, NumDecls));
   }
   }
-  
+
   typedef Decl** iterator;
   typedef Decl** iterator;
   typedef Decl* const * const_iterator;
   typedef Decl* const * const_iterator;
-  
+
   bool isNull() const { return D == 0; }
   bool isNull() const { return D == 0; }
   bool isSingleDecl() const { return getKind() == SingleDeclKind; }
   bool isSingleDecl() const { return getKind() == SingleDeclKind; }
   bool isDeclGroup() const { return getKind() == DeclGroupKind; }
   bool isDeclGroup() const { return getKind() == DeclGroupKind; }
@@ -88,7 +88,7 @@ public:
   const Decl *getSingleDecl() const {
   const Decl *getSingleDecl() const {
     return const_cast<DeclGroupRef*>(this)->getSingleDecl();
     return const_cast<DeclGroupRef*>(this)->getSingleDecl();
   }
   }
-  
+
   DeclGroup &getDeclGroup() {
   DeclGroup &getDeclGroup() {
     assert(isDeclGroup() && "Isn't a declgroup");
     assert(isDeclGroup() && "Isn't a declgroup");
     return *((DeclGroup*)(reinterpret_cast<uintptr_t>(D) & ~Mask));
     return *((DeclGroup*)(reinterpret_cast<uintptr_t>(D) & ~Mask));
@@ -96,7 +96,7 @@ public:
   const DeclGroup &getDeclGroup() const {
   const DeclGroup &getDeclGroup() const {
     return const_cast<DeclGroupRef*>(this)->getDeclGroup();
     return const_cast<DeclGroupRef*>(this)->getDeclGroup();
   }
   }
-  
+
   iterator begin() {
   iterator begin() {
     if (isSingleDecl())
     if (isSingleDecl())
       return D ? &D : 0;
       return D ? &D : 0;
@@ -109,13 +109,13 @@ public:
     DeclGroup &G = getDeclGroup();
     DeclGroup &G = getDeclGroup();
     return &G[0] + G.size();
     return &G[0] + G.size();
   }
   }
-  
+
   const_iterator begin() const {
   const_iterator begin() const {
     if (isSingleDecl())
     if (isSingleDecl())
       return D ? &D : 0;
       return D ? &D : 0;
     return &getDeclGroup()[0];
     return &getDeclGroup()[0];
   }
   }
-  
+
   const_iterator end() const {
   const_iterator end() const {
     if (isSingleDecl())
     if (isSingleDecl())
       return D ? &D+1 : 0;
       return D ? &D+1 : 0;
@@ -130,7 +130,7 @@ public:
     return X;
     return X;
   }
   }
 };
 };
-  
+
 } // end clang namespace
 } // end clang namespace
 
 
 namespace llvm {
 namespace llvm {

Fișier diff suprimat deoarece este prea mare
+ 192 - 192
include/clang/AST/DeclObjC.h


+ 149 - 153
include/clang/AST/DeclTemplate.h

@@ -53,7 +53,7 @@ class TemplateParameterList {
                         SourceLocation RAngleLoc);
                         SourceLocation RAngleLoc);
 
 
 public:
 public:
-  static TemplateParameterList *Create(ASTContext &C, 
+  static TemplateParameterList *Create(ASTContext &C,
                                        SourceLocation TemplateLoc,
                                        SourceLocation TemplateLoc,
                                        SourceLocation LAngleLoc,
                                        SourceLocation LAngleLoc,
                                        Decl **Params,
                                        Decl **Params,
@@ -115,10 +115,10 @@ class TemplateArgument {
       bool CopyArgs;
       bool CopyArgs;
     } Args;
     } Args;
   };
   };
-  
+
   /// \brief Location of the beginning of this template argument.
   /// \brief Location of the beginning of this template argument.
   SourceLocation StartLoc;
   SourceLocation StartLoc;
-  
+
 public:
 public:
   /// \brief The type of template argument we're storing.
   /// \brief The type of template argument we're storing.
   enum ArgKind {
   enum ArgKind {
@@ -133,21 +133,21 @@ public:
     /// The template argument is a value- or type-dependent expression
     /// The template argument is a value- or type-dependent expression
     /// stored in an Expr*.
     /// stored in an Expr*.
     Expression = 4,
     Expression = 4,
-    
+
     /// The template argument is actually a parameter pack. Arguments are stored
     /// The template argument is actually a parameter pack. Arguments are stored
     /// in the Args struct.
     /// in the Args struct.
     Pack = 5
     Pack = 5
   } Kind;
   } Kind;
-  
+
   /// \brief Construct an empty, invalid template argument.
   /// \brief Construct an empty, invalid template argument.
   TemplateArgument() : TypeOrValue(0), StartLoc(), Kind(Null) { }
   TemplateArgument() : TypeOrValue(0), StartLoc(), Kind(Null) { }
-  
+
   /// \brief Construct a template type argument.
   /// \brief Construct a template type argument.
   TemplateArgument(SourceLocation Loc, QualType T) : Kind(Type) {
   TemplateArgument(SourceLocation Loc, QualType T) : Kind(Type) {
     TypeOrValue = reinterpret_cast<uintptr_t>(T.getAsOpaquePtr());
     TypeOrValue = reinterpret_cast<uintptr_t>(T.getAsOpaquePtr());
     StartLoc = Loc;
     StartLoc = Loc;
   }
   }
-  
+
   /// \brief Construct a template argument that refers to a
   /// \brief Construct a template argument that refers to a
   /// declaration, which is either an external declaration or a
   /// declaration, which is either an external declaration or a
   /// template declaration.
   /// template declaration.
@@ -156,7 +156,7 @@ public:
     TypeOrValue = reinterpret_cast<uintptr_t>(D);
     TypeOrValue = reinterpret_cast<uintptr_t>(D);
     StartLoc = Loc;
     StartLoc = Loc;
   }
   }
-  
+
   /// \brief Construct an integral constant template argument.
   /// \brief Construct an integral constant template argument.
   TemplateArgument(SourceLocation Loc, const llvm::APSInt &Value,
   TemplateArgument(SourceLocation Loc, const llvm::APSInt &Value,
                    QualType Type)
                    QualType Type)
@@ -165,14 +165,14 @@ public:
     Integer.Type = Type.getAsOpaquePtr();
     Integer.Type = Type.getAsOpaquePtr();
     StartLoc = Loc;
     StartLoc = Loc;
   }
   }
-  
-  /// \brief Construct a template argument that is an expression. 
+
+  /// \brief Construct a template argument that is an expression.
   ///
   ///
   /// This form of template argument only occurs in template argument
   /// This form of template argument only occurs in template argument
   /// lists used for dependent types and for expression; it will not
   /// lists used for dependent types and for expression; it will not
   /// occur in a non-dependent, canonical template argument list.
   /// occur in a non-dependent, canonical template argument list.
   TemplateArgument(Expr *E);
   TemplateArgument(Expr *E);
-  
+
   /// \brief Copy constructor for a template argument.
   /// \brief Copy constructor for a template argument.
   TemplateArgument(const TemplateArgument &Other) : Kind(Other.Kind) {
   TemplateArgument(const TemplateArgument &Other) : Kind(Other.Kind) {
     if (Kind == Integral) {
     if (Kind == Integral) {
@@ -188,27 +188,27 @@ public:
       TypeOrValue = Other.TypeOrValue;
       TypeOrValue = Other.TypeOrValue;
     StartLoc = Other.StartLoc;
     StartLoc = Other.StartLoc;
   }
   }
-  
+
   TemplateArgument& operator=(const TemplateArgument& Other) {
   TemplateArgument& operator=(const TemplateArgument& Other) {
     // FIXME: Does not provide the strong guarantee for exception
     // FIXME: Does not provide the strong guarantee for exception
     // safety.
     // safety.
     using llvm::APSInt;
     using llvm::APSInt;
-    
+
     // FIXME: Handle Packs
     // FIXME: Handle Packs
     assert(Kind != Pack && "FIXME: Handle packs");
     assert(Kind != Pack && "FIXME: Handle packs");
     assert(Other.Kind != Pack && "FIXME: Handle packs");
     assert(Other.Kind != Pack && "FIXME: Handle packs");
-    
+
     if (Kind == Other.Kind && Kind == Integral) {
     if (Kind == Other.Kind && Kind == Integral) {
       // Copy integral values.
       // Copy integral values.
       *this->getAsIntegral() = *Other.getAsIntegral();
       *this->getAsIntegral() = *Other.getAsIntegral();
-      Integer.Type = Other.Integer.Type; 
+      Integer.Type = Other.Integer.Type;
     } else {
     } else {
       // Destroy the current integral value, if that's what we're holding.
       // Destroy the current integral value, if that's what we're holding.
       if (Kind == Integral)
       if (Kind == Integral)
         getAsIntegral()->~APSInt();
         getAsIntegral()->~APSInt();
-      
+
       Kind = Other.Kind;
       Kind = Other.Kind;
-      
+
       if (Other.Kind == Integral) {
       if (Other.Kind == Integral) {
         new (Integer.Value) llvm::APSInt(*Other.getAsIntegral());
         new (Integer.Value) llvm::APSInt(*Other.getAsIntegral());
         Integer.Type = Other.Integer.Type;
         Integer.Type = Other.Integer.Type;
@@ -216,127 +216,127 @@ public:
         TypeOrValue = Other.TypeOrValue;
         TypeOrValue = Other.TypeOrValue;
     }
     }
     StartLoc = Other.StartLoc;
     StartLoc = Other.StartLoc;
-    
+
     return *this;
     return *this;
   }
   }
-  
+
   ~TemplateArgument() {
   ~TemplateArgument() {
     using llvm::APSInt;
     using llvm::APSInt;
-    
+
     if (Kind == Integral)
     if (Kind == Integral)
       getAsIntegral()->~APSInt();
       getAsIntegral()->~APSInt();
     else if (Kind == Pack && Args.CopyArgs)
     else if (Kind == Pack && Args.CopyArgs)
       delete[] Args.Args;
       delete[] Args.Args;
   }
   }
-  
+
   /// \brief Return the kind of stored template argument.
   /// \brief Return the kind of stored template argument.
   ArgKind getKind() const { return Kind; }
   ArgKind getKind() const { return Kind; }
-  
+
   /// \brief Determine whether this template argument has no value.
   /// \brief Determine whether this template argument has no value.
   bool isNull() const { return Kind == Null; }
   bool isNull() const { return Kind == Null; }
-  
+
   /// \brief Retrieve the template argument as a type.
   /// \brief Retrieve the template argument as a type.
   QualType getAsType() const {
   QualType getAsType() const {
     if (Kind != Type)
     if (Kind != Type)
       return QualType();
       return QualType();
-    
+
     return QualType::getFromOpaquePtr(reinterpret_cast<void*>(TypeOrValue));
     return QualType::getFromOpaquePtr(reinterpret_cast<void*>(TypeOrValue));
   }
   }
-  
+
   /// \brief Retrieve the template argument as a declaration.
   /// \brief Retrieve the template argument as a declaration.
   Decl *getAsDecl() const {
   Decl *getAsDecl() const {
     if (Kind != Declaration)
     if (Kind != Declaration)
       return 0;
       return 0;
     return reinterpret_cast<Decl *>(TypeOrValue);
     return reinterpret_cast<Decl *>(TypeOrValue);
   }
   }
-  
+
   /// \brief Retrieve the template argument as an integral value.
   /// \brief Retrieve the template argument as an integral value.
   llvm::APSInt *getAsIntegral() {
   llvm::APSInt *getAsIntegral() {
     if (Kind != Integral)
     if (Kind != Integral)
       return 0;
       return 0;
     return reinterpret_cast<llvm::APSInt*>(&Integer.Value[0]);
     return reinterpret_cast<llvm::APSInt*>(&Integer.Value[0]);
   }
   }
-  
+
   const llvm::APSInt *getAsIntegral() const {
   const llvm::APSInt *getAsIntegral() const {
     return const_cast<TemplateArgument*>(this)->getAsIntegral();
     return const_cast<TemplateArgument*>(this)->getAsIntegral();
   }
   }
-  
+
   /// \brief Retrieve the type of the integral value.
   /// \brief Retrieve the type of the integral value.
   QualType getIntegralType() const {
   QualType getIntegralType() const {
     if (Kind != Integral)
     if (Kind != Integral)
       return QualType();
       return QualType();
-    
+
     return QualType::getFromOpaquePtr(Integer.Type);
     return QualType::getFromOpaquePtr(Integer.Type);
   }
   }
-  
+
   void setIntegralType(QualType T) {
   void setIntegralType(QualType T) {
-    assert(Kind == Integral && 
+    assert(Kind == Integral &&
            "Cannot set the integral type of a non-integral template argument");
            "Cannot set the integral type of a non-integral template argument");
     Integer.Type = T.getAsOpaquePtr();
     Integer.Type = T.getAsOpaquePtr();
   };
   };
-  
+
   /// \brief Retrieve the template argument as an expression.
   /// \brief Retrieve the template argument as an expression.
   Expr *getAsExpr() const {
   Expr *getAsExpr() const {
     if (Kind != Expression)
     if (Kind != Expression)
       return 0;
       return 0;
-    
+
     return reinterpret_cast<Expr *>(TypeOrValue);
     return reinterpret_cast<Expr *>(TypeOrValue);
   }
   }
-  
+
   /// \brief Iterator that traverses the elements of a template argument pack.
   /// \brief Iterator that traverses the elements of a template argument pack.
   typedef const TemplateArgument * pack_iterator;
   typedef const TemplateArgument * pack_iterator;
-  
-  /// \brief Iterator referencing the first argument of a template argument 
+
+  /// \brief Iterator referencing the first argument of a template argument
   /// pack.
   /// pack.
   pack_iterator pack_begin() const {
   pack_iterator pack_begin() const {
     assert(Kind == Pack);
     assert(Kind == Pack);
     return Args.Args;
     return Args.Args;
   }
   }
-  
+
   /// \brief Iterator referencing one past the last argument of a template
   /// \brief Iterator referencing one past the last argument of a template
   /// argument pack.
   /// argument pack.
   pack_iterator pack_end() const {
   pack_iterator pack_end() const {
     assert(Kind == Pack);
     assert(Kind == Pack);
     return Args.Args + Args.NumArgs;
     return Args.Args + Args.NumArgs;
   }
   }
-  
+
   /// \brief The number of template arguments in the given template argument
   /// \brief The number of template arguments in the given template argument
   /// pack.
   /// pack.
   unsigned pack_size() const {
   unsigned pack_size() const {
     assert(Kind == Pack);
     assert(Kind == Pack);
     return Args.NumArgs;
     return Args.NumArgs;
   }
   }
-  
+
   /// \brief Retrieve the location where the template argument starts.
   /// \brief Retrieve the location where the template argument starts.
   SourceLocation getLocation() const { return StartLoc; }
   SourceLocation getLocation() const { return StartLoc; }
-  
+
   /// \brief Construct a template argument pack.
   /// \brief Construct a template argument pack.
   void setArgumentPack(TemplateArgument *Args, unsigned NumArgs, bool CopyArgs);
   void setArgumentPack(TemplateArgument *Args, unsigned NumArgs, bool CopyArgs);
-  
+
   /// \brief Used to insert TemplateArguments into FoldingSets.
   /// \brief Used to insert TemplateArguments into FoldingSets.
   void Profile(llvm::FoldingSetNodeID &ID, ASTContext &Context) const {
   void Profile(llvm::FoldingSetNodeID &ID, ASTContext &Context) const {
     ID.AddInteger(Kind);
     ID.AddInteger(Kind);
     switch (Kind) {
     switch (Kind) {
       case Null:
       case Null:
         break;
         break;
-        
+
       case Type:
       case Type:
         getAsType().Profile(ID);
         getAsType().Profile(ID);
         break;
         break;
-        
+
       case Declaration:
       case Declaration:
         ID.AddPointer(getAsDecl()? getAsDecl()->getCanonicalDecl() : 0);
         ID.AddPointer(getAsDecl()? getAsDecl()->getCanonicalDecl() : 0);
         break;
         break;
-        
+
       case Integral:
       case Integral:
         getAsIntegral()->Profile(ID);
         getAsIntegral()->Profile(ID);
         getIntegralType().Profile(ID);
         getIntegralType().Profile(ID);
         break;
         break;
-        
+
       case Expression:
       case Expression:
         getAsExpr()->Profile(ID, Context, true);
         getAsExpr()->Profile(ID, Context, true);
         break;
         break;
-        
+
       case Pack:
       case Pack:
         ID.AddInteger(Args.NumArgs);
         ID.AddInteger(Args.NumArgs);
         for (unsigned I = 0; I != Args.NumArgs; ++I)
         for (unsigned I = 0; I != Args.NumArgs; ++I)
@@ -350,47 +350,47 @@ class TemplateArgumentListBuilder {
   TemplateArgument *StructuredArgs;
   TemplateArgument *StructuredArgs;
   unsigned MaxStructuredArgs;
   unsigned MaxStructuredArgs;
   unsigned NumStructuredArgs;
   unsigned NumStructuredArgs;
-  
+
   TemplateArgument *FlatArgs;
   TemplateArgument *FlatArgs;
   unsigned MaxFlatArgs;
   unsigned MaxFlatArgs;
   unsigned NumFlatArgs;
   unsigned NumFlatArgs;
-  
+
   bool AddingToPack;
   bool AddingToPack;
   unsigned PackBeginIndex;
   unsigned PackBeginIndex;
-  
+
 public:
 public:
   TemplateArgumentListBuilder(const TemplateParameterList *Parameters,
   TemplateArgumentListBuilder(const TemplateParameterList *Parameters,
                               unsigned NumTemplateArgs)
                               unsigned NumTemplateArgs)
-  : StructuredArgs(0), MaxStructuredArgs(Parameters->size()), 
-  NumStructuredArgs(0), FlatArgs(0), 
+  : StructuredArgs(0), MaxStructuredArgs(Parameters->size()),
+  NumStructuredArgs(0), FlatArgs(0),
   MaxFlatArgs(std::max(MaxStructuredArgs, NumTemplateArgs)), NumFlatArgs(0),
   MaxFlatArgs(std::max(MaxStructuredArgs, NumTemplateArgs)), NumFlatArgs(0),
   AddingToPack(false), PackBeginIndex(0) { }
   AddingToPack(false), PackBeginIndex(0) { }
-  
+
   void Append(const TemplateArgument& Arg);
   void Append(const TemplateArgument& Arg);
   void BeginPack();
   void BeginPack();
   void EndPack();
   void EndPack();
-  
+
   void ReleaseArgs();
   void ReleaseArgs();
-  
-  unsigned flatSize() const { 
+
+  unsigned flatSize() const {
     return NumFlatArgs;
     return NumFlatArgs;
   }
   }
   const TemplateArgument *getFlatArguments() const {
   const TemplateArgument *getFlatArguments() const {
     return FlatArgs;
     return FlatArgs;
   }
   }
-  
+
   unsigned structuredSize() const {
   unsigned structuredSize() const {
     // If we don't have any structured args, just reuse the flat size.
     // If we don't have any structured args, just reuse the flat size.
     if (!StructuredArgs)
     if (!StructuredArgs)
       return flatSize();
       return flatSize();
-    
+
     return NumStructuredArgs;
     return NumStructuredArgs;
   }
   }
   const TemplateArgument *getStructuredArguments() const {
   const TemplateArgument *getStructuredArguments() const {
     // If we don't have any structured args, just reuse the flat args.
     // If we don't have any structured args, just reuse the flat args.
     if (!StructuredArgs)
     if (!StructuredArgs)
       return getFlatArguments();
       return getFlatArguments();
-    
+
     return StructuredArgs;
     return StructuredArgs;
   }
   }
 };
 };
@@ -406,44 +406,44 @@ class TemplateArgumentList {
   /// The integer value will be non-zero to indicate that this
   /// The integer value will be non-zero to indicate that this
   /// template argument list does not own the pointer.
   /// template argument list does not own the pointer.
   llvm::PointerIntPair<const TemplateArgument *, 1> FlatArguments;
   llvm::PointerIntPair<const TemplateArgument *, 1> FlatArguments;
-  
+
   /// \brief The number of template arguments in this template
   /// \brief The number of template arguments in this template
   /// argument list.
   /// argument list.
   unsigned NumFlatArguments;
   unsigned NumFlatArguments;
-  
+
   llvm::PointerIntPair<const TemplateArgument *, 1> StructuredArguments;
   llvm::PointerIntPair<const TemplateArgument *, 1> StructuredArguments;
   unsigned NumStructuredArguments;
   unsigned NumStructuredArguments;
-  
+
 public:
 public:
   TemplateArgumentList(ASTContext &Context,
   TemplateArgumentList(ASTContext &Context,
                        TemplateArgumentListBuilder &Builder,
                        TemplateArgumentListBuilder &Builder,
                        bool TakeArgs);
                        bool TakeArgs);
-  
+
   ~TemplateArgumentList();
   ~TemplateArgumentList();
-  
+
   /// \brief Retrieve the template argument at a given index.
   /// \brief Retrieve the template argument at a given index.
-  const TemplateArgument &get(unsigned Idx) const { 
+  const TemplateArgument &get(unsigned Idx) const {
     assert(Idx < NumFlatArguments && "Invalid template argument index");
     assert(Idx < NumFlatArguments && "Invalid template argument index");
     return getFlatArgumentList()[Idx];
     return getFlatArgumentList()[Idx];
   }
   }
-  
+
   /// \brief Retrieve the template argument at a given index.
   /// \brief Retrieve the template argument at a given index.
   const TemplateArgument &operator[](unsigned Idx) const { return get(Idx); }
   const TemplateArgument &operator[](unsigned Idx) const { return get(Idx); }
-  
+
   /// \brief Retrieve the number of template arguments in this
   /// \brief Retrieve the number of template arguments in this
   /// template argument list.
   /// template argument list.
   unsigned size() const { return NumFlatArguments; }
   unsigned size() const { return NumFlatArguments; }
-  
+
   /// \brief Retrieve the number of template arguments in the
   /// \brief Retrieve the number of template arguments in the
   /// flattened template argument list.
   /// flattened template argument list.
   unsigned flat_size() const { return NumFlatArguments; }
   unsigned flat_size() const { return NumFlatArguments; }
-  
+
   /// \brief Retrieve the flattened template argument list.
   /// \brief Retrieve the flattened template argument list.
-  const TemplateArgument *getFlatArgumentList() const { 
+  const TemplateArgument *getFlatArgumentList() const {
     return FlatArguments.getPointer();
     return FlatArguments.getPointer();
   }
   }
 };
 };
-  
+
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // Kinds of Templates
 // Kinds of Templates
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
@@ -457,15 +457,13 @@ protected:
   // This is probably never used.
   // This is probably never used.
   TemplateDecl(Kind DK, DeclContext *DC, SourceLocation L,
   TemplateDecl(Kind DK, DeclContext *DC, SourceLocation L,
                DeclarationName Name)
                DeclarationName Name)
-    : NamedDecl(DK, DC, L, Name), TemplatedDecl(0), TemplateParams(0)
-  { }
+    : NamedDecl(DK, DC, L, Name), TemplatedDecl(0), TemplateParams(0) { }
 
 
   // Construct a template decl with the given name and parameters.
   // Construct a template decl with the given name and parameters.
   // Used when there is not templated element (tt-params, alias?).
   // Used when there is not templated element (tt-params, alias?).
   TemplateDecl(Kind DK, DeclContext *DC, SourceLocation L,
   TemplateDecl(Kind DK, DeclContext *DC, SourceLocation L,
                DeclarationName Name, TemplateParameterList *Params)
                DeclarationName Name, TemplateParameterList *Params)
-    : NamedDecl(DK, DC, L, Name), TemplatedDecl(0), TemplateParams(Params)
-  { }
+    : NamedDecl(DK, DC, L, Name), TemplatedDecl(0), TemplateParams(Params) { }
 
 
   // Construct a template decl with name, parameters, and templated element.
   // Construct a template decl with name, parameters, and templated element.
   TemplateDecl(Kind DK, DeclContext *DC, SourceLocation L,
   TemplateDecl(Kind DK, DeclContext *DC, SourceLocation L,
@@ -497,26 +495,26 @@ protected:
   NamedDecl *TemplatedDecl;
   NamedDecl *TemplatedDecl;
   TemplateParameterList* TemplateParams;
   TemplateParameterList* TemplateParams;
 };
 };
- 
-/// \brief Provides information about a function template specialization, 
+
+/// \brief Provides information about a function template specialization,
 /// which is a FunctionDecl that has been explicitly specialization or
 /// which is a FunctionDecl that has been explicitly specialization or
 /// instantiated from a function template.
 /// instantiated from a function template.
 class FunctionTemplateSpecializationInfo : public llvm::FoldingSetNode {
 class FunctionTemplateSpecializationInfo : public llvm::FoldingSetNode {
 public:
 public:
-  /// \brief The function template specialization that this structure 
+  /// \brief The function template specialization that this structure
   /// describes.
   /// describes.
   FunctionDecl *Function;
   FunctionDecl *Function;
-  
-  /// \brief The function template from which this function template 
+
+  /// \brief The function template from which this function template
   /// specialization was generated.
   /// specialization was generated.
   ///
   ///
   /// The two bits are contain the top 4 values of TemplateSpecializationKind.
   /// The two bits are contain the top 4 values of TemplateSpecializationKind.
   llvm::PointerIntPair<FunctionTemplateDecl *, 2> Template;
   llvm::PointerIntPair<FunctionTemplateDecl *, 2> Template;
-  
+
   /// \brief The template arguments used to produce the function template
   /// \brief The template arguments used to produce the function template
   /// specialization from the function template.
   /// specialization from the function template.
   const TemplateArgumentList *TemplateArguments;
   const TemplateArgumentList *TemplateArguments;
-  
+
   /// \brief Retrieve the template from which this function was specialized.
   /// \brief Retrieve the template from which this function was specialized.
   FunctionTemplateDecl *getTemplate() const { return Template.getPointer(); }
   FunctionTemplateDecl *getTemplate() const { return Template.getPointer(); }
 
 
@@ -527,61 +525,61 @@ public:
 
 
   /// \brief Set the template specialization kind.
   /// \brief Set the template specialization kind.
   void setTemplateSpecializationKind(TemplateSpecializationKind TSK) {
   void setTemplateSpecializationKind(TemplateSpecializationKind TSK) {
-    assert(TSK != TSK_Undeclared && 
+    assert(TSK != TSK_Undeclared &&
          "Cannot encode TSK_Undeclared for a function template specialization");
          "Cannot encode TSK_Undeclared for a function template specialization");
     Template.setInt(TSK - 1);
     Template.setInt(TSK - 1);
   }
   }
-  
+
   void Profile(llvm::FoldingSetNodeID &ID) {
   void Profile(llvm::FoldingSetNodeID &ID) {
-    Profile(ID, TemplateArguments->getFlatArgumentList(), 
+    Profile(ID, TemplateArguments->getFlatArgumentList(),
             TemplateArguments->flat_size(),
             TemplateArguments->flat_size(),
-            Function->getASTContext());    
+            Function->getASTContext());
   }
   }
-  
-  static void 
-  Profile(llvm::FoldingSetNodeID &ID, const TemplateArgument *TemplateArgs, 
+
+  static void
+  Profile(llvm::FoldingSetNodeID &ID, const TemplateArgument *TemplateArgs,
           unsigned NumTemplateArgs, ASTContext &Context) {
           unsigned NumTemplateArgs, ASTContext &Context) {
     ID.AddInteger(NumTemplateArgs);
     ID.AddInteger(NumTemplateArgs);
     for (unsigned Arg = 0; Arg != NumTemplateArgs; ++Arg)
     for (unsigned Arg = 0; Arg != NumTemplateArgs; ++Arg)
       TemplateArgs[Arg].Profile(ID, Context);
       TemplateArgs[Arg].Profile(ID, Context);
-  }  
+  }
 };
 };
-  
+
 /// Declaration of a template function.
 /// Declaration of a template function.
-class FunctionTemplateDecl : public TemplateDecl {  
+class FunctionTemplateDecl : public TemplateDecl {
 protected:
 protected:
   /// \brief Data that is common to all of the declarations of a given
   /// \brief Data that is common to all of the declarations of a given
   /// function template.
   /// function template.
   struct Common {
   struct Common {
     Common() : InstantiatedFromMember(0) { }
     Common() : InstantiatedFromMember(0) { }
-    
+
     /// \brief The function template specializations for this function
     /// \brief The function template specializations for this function
     /// template, including explicit specializations and instantiations.
     /// template, including explicit specializations and instantiations.
     llvm::FoldingSet<FunctionTemplateSpecializationInfo> Specializations;
     llvm::FoldingSet<FunctionTemplateSpecializationInfo> Specializations;
-    
+
     /// \brief The member function template from which this was most
     /// \brief The member function template from which this was most
     /// directly instantiated (or null).
     /// directly instantiated (or null).
-    FunctionTemplateDecl *InstantiatedFromMember;    
+    FunctionTemplateDecl *InstantiatedFromMember;
   };
   };
-  
+
   /// \brief A pointer to the previous declaration (if this is a redeclaration)
   /// \brief A pointer to the previous declaration (if this is a redeclaration)
   /// or to the data that is common to all declarations of this function
   /// or to the data that is common to all declarations of this function
   /// template.
   /// template.
   llvm::PointerUnion<Common*, FunctionTemplateDecl*> CommonOrPrev;
   llvm::PointerUnion<Common*, FunctionTemplateDecl*> CommonOrPrev;
-  
-  /// \brief Retrieves the "common" pointer shared by all 
+
+  /// \brief Retrieves the "common" pointer shared by all
   /// (re-)declarations of the same function template. Calling this routine
   /// (re-)declarations of the same function template. Calling this routine
   /// may implicitly allocate memory for the common pointer.
   /// may implicitly allocate memory for the common pointer.
   Common *getCommonPtr();
   Common *getCommonPtr();
-  
+
   FunctionTemplateDecl(DeclContext *DC, SourceLocation L, DeclarationName Name,
   FunctionTemplateDecl(DeclContext *DC, SourceLocation L, DeclarationName Name,
                        TemplateParameterList *Params, NamedDecl *Decl)
                        TemplateParameterList *Params, NamedDecl *Decl)
     : TemplateDecl(FunctionTemplate, DC, L, Name, Params, Decl),
     : TemplateDecl(FunctionTemplate, DC, L, Name, Params, Decl),
       CommonOrPrev((Common*)0) { }
       CommonOrPrev((Common*)0) { }
-  
+
 public:
 public:
   void Destroy(ASTContext &C);
   void Destroy(ASTContext &C);
-  
+
   /// Get the underlying function declaration of the template.
   /// Get the underlying function declaration of the template.
   FunctionDecl *getTemplatedDecl() const {
   FunctionDecl *getTemplatedDecl() const {
     return static_cast<FunctionDecl*>(TemplatedDecl);
     return static_cast<FunctionDecl*>(TemplatedDecl);
@@ -592,7 +590,7 @@ public:
   llvm::FoldingSet<FunctionTemplateSpecializationInfo> &getSpecializations() {
   llvm::FoldingSet<FunctionTemplateSpecializationInfo> &getSpecializations() {
     return getCommonPtr()->Specializations;
     return getCommonPtr()->Specializations;
   }
   }
-  
+
   /// \brief Retrieve the previous declaration of this function template, or
   /// \brief Retrieve the previous declaration of this function template, or
   /// NULL if no such declaration exists.
   /// NULL if no such declaration exists.
   const FunctionTemplateDecl *getPreviousDeclaration() const {
   const FunctionTemplateDecl *getPreviousDeclaration() const {
@@ -604,16 +602,16 @@ public:
   FunctionTemplateDecl *getPreviousDeclaration() {
   FunctionTemplateDecl *getPreviousDeclaration() {
     return CommonOrPrev.dyn_cast<FunctionTemplateDecl*>();
     return CommonOrPrev.dyn_cast<FunctionTemplateDecl*>();
   }
   }
-  
+
   /// \brief Set the previous declaration of this function template.
   /// \brief Set the previous declaration of this function template.
   void setPreviousDeclaration(FunctionTemplateDecl *Prev) {
   void setPreviousDeclaration(FunctionTemplateDecl *Prev) {
     if (Prev)
     if (Prev)
       CommonOrPrev = Prev;
       CommonOrPrev = Prev;
   }
   }
-  
+
   virtual FunctionTemplateDecl *getCanonicalDecl();
   virtual FunctionTemplateDecl *getCanonicalDecl();
-  
-  /// \brief Retrieve the member function template that this function template 
+
+  /// \brief Retrieve the member function template that this function template
   /// was instantiated from.
   /// was instantiated from.
   ///
   ///
   /// This routine will return non-NULL for member function templates of
   /// This routine will return non-NULL for member function templates of
@@ -627,23 +625,23 @@ public:
   /// \endcode
   /// \endcode
   ///
   ///
   /// X<int>::A<float> is a CXXMethodDecl (whose parent is X<int>, a
   /// X<int>::A<float> is a CXXMethodDecl (whose parent is X<int>, a
-  /// ClassTemplateSpecializationDecl) for which getPrimaryTemplate() will 
+  /// ClassTemplateSpecializationDecl) for which getPrimaryTemplate() will
   /// return X<int>::f, a FunctionTemplateDecl (whose parent is again
   /// return X<int>::f, a FunctionTemplateDecl (whose parent is again
   /// X<int>) for which getInstantiatedFromMemberTemplate() will return
   /// X<int>) for which getInstantiatedFromMemberTemplate() will return
-  /// X<T>::f, a FunctionTemplateDecl (whose parent is X<T>, a 
+  /// X<T>::f, a FunctionTemplateDecl (whose parent is X<T>, a
   /// ClassTemplateDecl).
   /// ClassTemplateDecl).
   ///
   ///
-  /// \returns NULL if this is not an instantiation of a member function 
+  /// \returns NULL if this is not an instantiation of a member function
   /// template.
   /// template.
   FunctionTemplateDecl *getInstantiatedFromMemberTemplate() {
   FunctionTemplateDecl *getInstantiatedFromMemberTemplate() {
     return getCommonPtr()->InstantiatedFromMember;
     return getCommonPtr()->InstantiatedFromMember;
   }
   }
-  
+
   void setInstantiatedFromMemberTemplate(FunctionTemplateDecl *FTD) {
   void setInstantiatedFromMemberTemplate(FunctionTemplateDecl *FTD) {
     assert(!getCommonPtr()->InstantiatedFromMember);
     assert(!getCommonPtr()->InstantiatedFromMember);
     getCommonPtr()->InstantiatedFromMember = FTD;
     getCommonPtr()->InstantiatedFromMember = FTD;
   }
   }
-  
+
   /// Create a template function node.
   /// Create a template function node.
   static FunctionTemplateDecl *Create(ASTContext &C, DeclContext *DC,
   static FunctionTemplateDecl *Create(ASTContext &C, DeclContext *DC,
                                       SourceLocation L,
                                       SourceLocation L,
@@ -669,8 +667,7 @@ public:
 /// the occurrence within the parameter list.
 /// the occurrence within the parameter list.
 /// This class is inheritedly privately by different kinds of template
 /// This class is inheritedly privately by different kinds of template
 /// parameters and is not part of the Decl hierarchy. Just a facility.
 /// parameters and is not part of the Decl hierarchy. Just a facility.
-class TemplateParmPosition
-{
+class TemplateParmPosition {
 protected:
 protected:
   // FIXME: This should probably never be called, but it's here as
   // FIXME: This should probably never be called, but it's here as
   TemplateParmPosition()
   TemplateParmPosition()
@@ -692,7 +689,7 @@ public:
 
 
   /// Get the position of the template parameter within its parameter list.
   /// Get the position of the template parameter within its parameter list.
   unsigned getPosition() const { return Position; }
   unsigned getPosition() const { return Position; }
-  
+
   /// Get the index of the template parameter within its parameter list.
   /// Get the index of the template parameter within its parameter list.
   unsigned getIndex() const { return Position; }
   unsigned getIndex() const { return Position; }
 };
 };
@@ -721,10 +718,10 @@ class TemplateTypeParmDecl : public TypeDecl {
   /// \brief The default template argument, if any.
   /// \brief The default template argument, if any.
   QualType DefaultArgument;
   QualType DefaultArgument;
 
 
-  TemplateTypeParmDecl(DeclContext *DC, SourceLocation L, IdentifierInfo *Id, 
+  TemplateTypeParmDecl(DeclContext *DC, SourceLocation L, IdentifierInfo *Id,
                        bool Typename, QualType Type, bool ParameterPack)
                        bool Typename, QualType Type, bool ParameterPack)
     : TypeDecl(TemplateTypeParm, DC, L, Id), Typename(Typename),
     : TypeDecl(TemplateTypeParm, DC, L, Id), Typename(Typename),
-      InheritedDefault(false), ParameterPack(ParameterPack), DefaultArgument() { 
+      InheritedDefault(false), ParameterPack(ParameterPack), DefaultArgument() {
     TypeForDecl = Type.getTypePtr();
     TypeForDecl = Type.getTypePtr();
   }
   }
 
 
@@ -787,7 +784,7 @@ class NonTypeTemplateParmDecl
                           unsigned P, IdentifierInfo *Id, QualType T,
                           unsigned P, IdentifierInfo *Id, QualType T,
                           DeclaratorInfo *DInfo)
                           DeclaratorInfo *DInfo)
     : VarDecl(NonTypeTemplateParm, DC, L, Id, T, DInfo, VarDecl::None),
     : VarDecl(NonTypeTemplateParm, DC, L, Id, T, DInfo, VarDecl::None),
-      TemplateParmPosition(D, P), DefaultArgument(0) 
+      TemplateParmPosition(D, P), DefaultArgument(0)
   { }
   { }
 
 
 public:
 public:
@@ -798,7 +795,7 @@ public:
   using TemplateParmPosition::getDepth;
   using TemplateParmPosition::getDepth;
   using TemplateParmPosition::getPosition;
   using TemplateParmPosition::getPosition;
   using TemplateParmPosition::getIndex;
   using TemplateParmPosition::getIndex;
-    
+
   /// \brief Determine whether this template parameter has a default
   /// \brief Determine whether this template parameter has a default
   /// argument.
   /// argument.
   bool hasDefaultArgument() const { return DefaultArgument; }
   bool hasDefaultArgument() const { return DefaultArgument; }
@@ -850,7 +847,7 @@ public:
   using TemplateParmPosition::getDepth;
   using TemplateParmPosition::getDepth;
   using TemplateParmPosition::getPosition;
   using TemplateParmPosition::getPosition;
   using TemplateParmPosition::getIndex;
   using TemplateParmPosition::getIndex;
-    
+
   /// \brief Determine whether this template parameter has a default
   /// \brief Determine whether this template parameter has a default
   /// argument.
   /// argument.
   bool hasDefaultArgument() const { return DefaultArgument; }
   bool hasDefaultArgument() const { return DefaultArgument; }
@@ -882,26 +879,26 @@ public:
 ///
 ///
 /// \code
 /// \code
 /// template<typename T> class array;
 /// template<typename T> class array;
-/// 
-/// template<> 
+///
+/// template<>
 /// class array<bool> { }; // class template specialization array<bool>
 /// class array<bool> { }; // class template specialization array<bool>
 /// \endcode
 /// \endcode
-class ClassTemplateSpecializationDecl 
+class ClassTemplateSpecializationDecl
   : public CXXRecordDecl, public llvm::FoldingSetNode {
   : public CXXRecordDecl, public llvm::FoldingSetNode {
-    
-  /// \brief Structure that stores information about a class template 
+
+  /// \brief Structure that stores information about a class template
   /// specialization that was instantiated from a class template partial
   /// specialization that was instantiated from a class template partial
   /// specialization.
   /// specialization.
   struct SpecializedPartialSpecialization {
   struct SpecializedPartialSpecialization {
     /// \brief The class template partial specialization from which this
     /// \brief The class template partial specialization from which this
     /// class template specialization was instantiated.
     /// class template specialization was instantiated.
     ClassTemplatePartialSpecializationDecl *PartialSpecialization;
     ClassTemplatePartialSpecializationDecl *PartialSpecialization;
-    
+
     /// \brief The template argument list deduced for the class template
     /// \brief The template argument list deduced for the class template
     /// partial specialization itself.
     /// partial specialization itself.
     TemplateArgumentList *TemplateArgs;
     TemplateArgumentList *TemplateArgs;
   };
   };
-    
+
   /// \brief The template that this specialization specializes
   /// \brief The template that this specialization specializes
   llvm::PointerUnion<ClassTemplateDecl *, SpecializedPartialSpecialization *>
   llvm::PointerUnion<ClassTemplateDecl *, SpecializedPartialSpecialization *>
     SpecializedTemplate;
     SpecializedTemplate;
@@ -919,7 +916,7 @@ protected:
                                   ClassTemplateDecl *SpecializedTemplate,
                                   ClassTemplateDecl *SpecializedTemplate,
                                   TemplateArgumentListBuilder &Builder,
                                   TemplateArgumentListBuilder &Builder,
                                   ClassTemplateSpecializationDecl *PrevDecl);
                                   ClassTemplateSpecializationDecl *PrevDecl);
-                                  
+
 public:
 public:
   static ClassTemplateSpecializationDecl *
   static ClassTemplateSpecializationDecl *
   Create(ASTContext &Context, DeclContext *DC, SourceLocation L,
   Create(ASTContext &Context, DeclContext *DC, SourceLocation L,
@@ -932,9 +929,9 @@ public:
   /// \brief Retrieve the template that this specialization specializes.
   /// \brief Retrieve the template that this specialization specializes.
   ClassTemplateDecl *getSpecializedTemplate() const;
   ClassTemplateDecl *getSpecializedTemplate() const;
 
 
-  /// \brief Retrieve the template arguments of the class template 
+  /// \brief Retrieve the template arguments of the class template
   /// specialization.
   /// specialization.
-  const TemplateArgumentList &getTemplateArgs() const { 
+  const TemplateArgumentList &getTemplateArgs() const {
     return TemplateArgs;
     return TemplateArgs;
   }
   }
 
 
@@ -952,22 +949,22 @@ public:
   /// a template (rather than an explicit specialization), return the
   /// a template (rather than an explicit specialization), return the
   /// class template or class template partial specialization from which it
   /// class template or class template partial specialization from which it
   /// was instantiated.
   /// was instantiated.
-  llvm::PointerUnion<ClassTemplateDecl *, 
+  llvm::PointerUnion<ClassTemplateDecl *,
                      ClassTemplatePartialSpecializationDecl *>
                      ClassTemplatePartialSpecializationDecl *>
   getInstantiatedFrom() const {
   getInstantiatedFrom() const {
     if (getSpecializationKind() != TSK_ImplicitInstantiation &&
     if (getSpecializationKind() != TSK_ImplicitInstantiation &&
         getSpecializationKind() != TSK_ExplicitInstantiationDefinition &&
         getSpecializationKind() != TSK_ExplicitInstantiationDefinition &&
         getSpecializationKind() != TSK_ExplicitInstantiationDeclaration)
         getSpecializationKind() != TSK_ExplicitInstantiationDeclaration)
       return (ClassTemplateDecl*)0;
       return (ClassTemplateDecl*)0;
-    
-    if (SpecializedPartialSpecialization *PartialSpec 
+
+    if (SpecializedPartialSpecialization *PartialSpec
           = SpecializedTemplate.dyn_cast<SpecializedPartialSpecialization*>())
           = SpecializedTemplate.dyn_cast<SpecializedPartialSpecialization*>())
       return PartialSpec->PartialSpecialization;
       return PartialSpec->PartialSpecialization;
-    
+
     return const_cast<ClassTemplateDecl*>(
     return const_cast<ClassTemplateDecl*>(
                              SpecializedTemplate.get<ClassTemplateDecl*>());
                              SpecializedTemplate.get<ClassTemplateDecl*>());
   }
   }
-    
+
   /// \brief Retrieve the set of template arguments that should be used
   /// \brief Retrieve the set of template arguments that should be used
   /// to instantiate members of the class template or class template partial
   /// to instantiate members of the class template or class template partial
   /// specialization from which this class template specialization was
   /// specialization from which this class template specialization was
@@ -980,25 +977,25 @@ public:
   /// deduced template arguments for the class template partial specialization
   /// deduced template arguments for the class template partial specialization
   /// itself.
   /// itself.
   const TemplateArgumentList &getTemplateInstantiationArgs() const {
   const TemplateArgumentList &getTemplateInstantiationArgs() const {
-    if (SpecializedPartialSpecialization *PartialSpec 
+    if (SpecializedPartialSpecialization *PartialSpec
         = SpecializedTemplate.dyn_cast<SpecializedPartialSpecialization*>())
         = SpecializedTemplate.dyn_cast<SpecializedPartialSpecialization*>())
       return *PartialSpec->TemplateArgs;
       return *PartialSpec->TemplateArgs;
-    
+
     return getTemplateArgs();
     return getTemplateArgs();
   }
   }
-    
+
   /// \brief Note that this class template specialization is actually an
   /// \brief Note that this class template specialization is actually an
   /// instantiation of the given class template partial specialization whose
   /// instantiation of the given class template partial specialization whose
   /// template arguments have been deduced.
   /// template arguments have been deduced.
   void setInstantiationOf(ClassTemplatePartialSpecializationDecl *PartialSpec,
   void setInstantiationOf(ClassTemplatePartialSpecializationDecl *PartialSpec,
                           TemplateArgumentList *TemplateArgs) {
                           TemplateArgumentList *TemplateArgs) {
-    SpecializedPartialSpecialization *PS 
+    SpecializedPartialSpecialization *PS
       = new (getASTContext()) SpecializedPartialSpecialization();
       = new (getASTContext()) SpecializedPartialSpecialization();
     PS->PartialSpecialization = PartialSpec;
     PS->PartialSpecialization = PartialSpec;
     PS->TemplateArgs = TemplateArgs;
     PS->TemplateArgs = TemplateArgs;
     SpecializedTemplate = PS;
     SpecializedTemplate = PS;
   }
   }
-    
+
   /// \brief Sets the type of this specialization as it was written by
   /// \brief Sets the type of this specialization as it was written by
   /// the user. This will be a class template specialization type.
   /// the user. This will be a class template specialization type.
   void setTypeAsWritten(QualType T) {
   void setTypeAsWritten(QualType T) {
@@ -1010,15 +1007,15 @@ public:
             getASTContext());
             getASTContext());
   }
   }
 
 
-  static void 
-  Profile(llvm::FoldingSetNodeID &ID, const TemplateArgument *TemplateArgs, 
+  static void
+  Profile(llvm::FoldingSetNodeID &ID, const TemplateArgument *TemplateArgs,
           unsigned NumTemplateArgs, ASTContext &Context) {
           unsigned NumTemplateArgs, ASTContext &Context) {
     ID.AddInteger(NumTemplateArgs);
     ID.AddInteger(NumTemplateArgs);
     for (unsigned Arg = 0; Arg != NumTemplateArgs; ++Arg)
     for (unsigned Arg = 0; Arg != NumTemplateArgs; ++Arg)
       TemplateArgs[Arg].Profile(ID, Context);
       TemplateArgs[Arg].Profile(ID, Context);
   }
   }
 
 
-  static bool classof(const Decl *D) { 
+  static bool classof(const Decl *D) {
     return D->getKind() == ClassTemplateSpecialization ||
     return D->getKind() == ClassTemplateSpecialization ||
            D->getKind() == ClassTemplatePartialSpecialization;
            D->getKind() == ClassTemplatePartialSpecialization;
   }
   }
@@ -1032,10 +1029,9 @@ public:
   }
   }
 };
 };
 
 
-class ClassTemplatePartialSpecializationDecl 
-  : public ClassTemplateSpecializationDecl 
-{
-  /// \brief The list of template parameters 
+class ClassTemplatePartialSpecializationDecl
+  : public ClassTemplateSpecializationDecl {
+  /// \brief The list of template parameters
   TemplateParameterList* TemplateParams;
   TemplateParameterList* TemplateParams;
 
 
   ClassTemplatePartialSpecializationDecl(ASTContext &Context,
   ClassTemplatePartialSpecializationDecl(ASTContext &Context,
@@ -1044,7 +1040,7 @@ class ClassTemplatePartialSpecializationDecl
                                          ClassTemplateDecl *SpecializedTemplate,
                                          ClassTemplateDecl *SpecializedTemplate,
                                          TemplateArgumentListBuilder &Builder,
                                          TemplateArgumentListBuilder &Builder,
                                ClassTemplatePartialSpecializationDecl *PrevDecl)
                                ClassTemplatePartialSpecializationDecl *PrevDecl)
-    : ClassTemplateSpecializationDecl(Context, 
+    : ClassTemplateSpecializationDecl(Context,
                                       ClassTemplatePartialSpecialization,
                                       ClassTemplatePartialSpecialization,
                                       DC, L, SpecializedTemplate, Builder,
                                       DC, L, SpecializedTemplate, Builder,
                                       PrevDecl),
                                       PrevDecl),
@@ -1065,7 +1061,7 @@ public:
 
 
   // FIXME: Add Profile support!
   // FIXME: Add Profile support!
 
 
-  static bool classof(const Decl *D) { 
+  static bool classof(const Decl *D) {
     return D->getKind() == ClassTemplatePartialSpecialization;
     return D->getKind() == ClassTemplatePartialSpecialization;
   }
   }
 
 
@@ -1088,7 +1084,7 @@ protected:
 
 
     /// \brief The class template partial specializations for this class
     /// \brief The class template partial specializations for this class
     /// template.
     /// template.
-    llvm::FoldingSet<ClassTemplatePartialSpecializationDecl> 
+    llvm::FoldingSet<ClassTemplatePartialSpecializationDecl>
       PartialSpecializations;
       PartialSpecializations;
 
 
     /// \brief The injected-class-name type for this class template.
     /// \brief The injected-class-name type for this class template.
@@ -1104,11 +1100,11 @@ protected:
 
 
   /// \brief Pointer to the data that is common to all of the
   /// \brief Pointer to the data that is common to all of the
   /// declarations of this class template.
   /// declarations of this class template.
-  /// 
+  ///
   /// The first declaration of a class template (e.g., the declaration
   /// The first declaration of a class template (e.g., the declaration
   /// with no "previous declaration") owns this pointer.
   /// with no "previous declaration") owns this pointer.
   Common *CommonPtr;
   Common *CommonPtr;
-  
+
   ClassTemplateDecl(DeclContext *DC, SourceLocation L, DeclarationName Name,
   ClassTemplateDecl(DeclContext *DC, SourceLocation L, DeclarationName Name,
                     TemplateParameterList *Params, NamedDecl *Decl,
                     TemplateParameterList *Params, NamedDecl *Decl,
                     ClassTemplateDecl *PrevDecl, Common *CommonPtr)
                     ClassTemplateDecl *PrevDecl, Common *CommonPtr)
@@ -1127,7 +1123,7 @@ public:
   ClassTemplateDecl *getPreviousDeclaration() const {
   ClassTemplateDecl *getPreviousDeclaration() const {
     return PreviousDeclaration;
     return PreviousDeclaration;
   }
   }
-  
+
   virtual ClassTemplateDecl *getCanonicalDecl();
   virtual ClassTemplateDecl *getCanonicalDecl();
 
 
   /// Create a class template node.
   /// Create a class template node.
@@ -1159,7 +1155,7 @@ public:
   /// \returns the class template partial specialization that exactly matches
   /// \returns the class template partial specialization that exactly matches
   /// the type \p T, or NULL if no such partial specialization exists.
   /// the type \p T, or NULL if no such partial specialization exists.
   ClassTemplatePartialSpecializationDecl *findPartialSpecialization(QualType T);
   ClassTemplatePartialSpecializationDecl *findPartialSpecialization(QualType T);
-  
+
   /// \brief Retrieve the type of the injected-class-name for this
   /// \brief Retrieve the type of the injected-class-name for this
   /// class template.
   /// class template.
   ///
   ///
@@ -1215,7 +1211,7 @@ public:
 };
 };
 
 
 /// Implementation of inline functions that require the template declarations
 /// Implementation of inline functions that require the template declarations
-inline AnyFunctionDecl::AnyFunctionDecl(FunctionTemplateDecl *FTD) 
+inline AnyFunctionDecl::AnyFunctionDecl(FunctionTemplateDecl *FTD)
   : Function(FTD) { }
   : Function(FTD) { }
 
 
 } /* end of namespace clang */
 } /* end of namespace clang */

+ 18 - 18
include/clang/AST/DeclarationName.h

@@ -101,7 +101,7 @@ private:
   /// CXXSpecialName, returns a pointer to it. Otherwise, returns
   /// CXXSpecialName, returns a pointer to it. Otherwise, returns
   /// a NULL pointer.
   /// a NULL pointer.
   CXXSpecialName *getAsCXXSpecialName() const {
   CXXSpecialName *getAsCXXSpecialName() const {
-    if (getNameKind() >= CXXConstructorName && 
+    if (getNameKind() >= CXXConstructorName &&
         getNameKind() <= CXXConversionFunctionName)
         getNameKind() <= CXXConversionFunctionName)
       return reinterpret_cast<CXXSpecialName *>(Ptr & ~PtrMask);
       return reinterpret_cast<CXXSpecialName *>(Ptr & ~PtrMask);
     return 0;
     return 0;
@@ -116,16 +116,16 @@ private:
 
 
   // Construct a declaration name from the name of a C++ constructor,
   // Construct a declaration name from the name of a C++ constructor,
   // destructor, or conversion function.
   // destructor, or conversion function.
-  DeclarationName(CXXSpecialName *Name) 
-    : Ptr(reinterpret_cast<uintptr_t>(Name)) { 
+  DeclarationName(CXXSpecialName *Name)
+    : Ptr(reinterpret_cast<uintptr_t>(Name)) {
     assert((Ptr & PtrMask) == 0 && "Improperly aligned CXXSpecialName");
     assert((Ptr & PtrMask) == 0 && "Improperly aligned CXXSpecialName");
     Ptr |= StoredDeclarationNameExtra;
     Ptr |= StoredDeclarationNameExtra;
   }
   }
 
 
   // Construct a declaration name from the name of a C++ overloaded
   // Construct a declaration name from the name of a C++ overloaded
   // operator.
   // operator.
-  DeclarationName(CXXOperatorIdName *Name) 
-    : Ptr(reinterpret_cast<uintptr_t>(Name)) { 
+  DeclarationName(CXXOperatorIdName *Name)
+    : Ptr(reinterpret_cast<uintptr_t>(Name)) {
     assert((Ptr & PtrMask) == 0 && "Improperly aligned CXXOperatorId");
     assert((Ptr & PtrMask) == 0 && "Improperly aligned CXXOperatorId");
     Ptr |= StoredDeclarationNameExtra;
     Ptr |= StoredDeclarationNameExtra;
   }
   }
@@ -145,8 +145,8 @@ public:
   DeclarationName() : Ptr(0) { }
   DeclarationName() : Ptr(0) { }
 
 
   // Construct a declaration name from an IdentifierInfo *.
   // Construct a declaration name from an IdentifierInfo *.
-  DeclarationName(const IdentifierInfo *II) 
-    : Ptr(reinterpret_cast<uintptr_t>(II)) { 
+  DeclarationName(const IdentifierInfo *II)
+    : Ptr(reinterpret_cast<uintptr_t>(II)) {
     assert((Ptr & PtrMask) == 0 && "Improperly aligned IdentifierInfo");
     assert((Ptr & PtrMask) == 0 && "Improperly aligned IdentifierInfo");
   }
   }
 
 
@@ -158,8 +158,8 @@ public:
 
 
   // operator bool() - Evaluates true when this declaration name is
   // operator bool() - Evaluates true when this declaration name is
   // non-empty.
   // non-empty.
-  operator bool() const { 
-    return ((Ptr & PtrMask) != 0) || 
+  operator bool() const {
+    return ((Ptr & PtrMask) != 0) ||
            (reinterpret_cast<IdentifierInfo *>(Ptr & ~PtrMask));
            (reinterpret_cast<IdentifierInfo *>(Ptr & ~PtrMask));
   }
   }
 
 
@@ -171,10 +171,10 @@ public:
   bool isObjCOneArgSelector() const {
   bool isObjCOneArgSelector() const {
     return getStoredNameKind() == StoredObjCOneArgSelector;
     return getStoredNameKind() == StoredObjCOneArgSelector;
   }
   }
-  
+
   /// getNameKind - Determine what kind of name this is.
   /// getNameKind - Determine what kind of name this is.
   NameKind getNameKind() const;
   NameKind getNameKind() const;
-  
+
 
 
   /// getName - Retrieve the human-readable string for this name.
   /// getName - Retrieve the human-readable string for this name.
   std::string getAsString() const;
   std::string getAsString() const;
@@ -182,7 +182,7 @@ public:
   /// getAsIdentifierInfo - Retrieve the IdentifierInfo * stored in
   /// getAsIdentifierInfo - Retrieve the IdentifierInfo * stored in
   /// this declaration name, or NULL if this declaration name isn't a
   /// this declaration name, or NULL if this declaration name isn't a
   /// simple identifier.
   /// simple identifier.
-  IdentifierInfo *getAsIdentifierInfo() const { 
+  IdentifierInfo *getAsIdentifierInfo() const {
     if (isIdentifier())
     if (isIdentifier())
       return reinterpret_cast<IdentifierInfo *>(Ptr);
       return reinterpret_cast<IdentifierInfo *>(Ptr);
     return 0;
     return 0;
@@ -201,7 +201,7 @@ public:
     N.Ptr = P;
     N.Ptr = P;
     return N;
     return N;
   }
   }
-  
+
   /// getCXXNameType - If this name is one of the C++ names (of a
   /// getCXXNameType - If this name is one of the C++ names (of a
   /// constructor, destructor, or conversion function), return the
   /// constructor, destructor, or conversion function), return the
   /// type associated with that name.
   /// type associated with that name.
@@ -310,13 +310,13 @@ public:
   /// getCXXSpecialName - Returns a declaration name for special kind
   /// getCXXSpecialName - Returns a declaration name for special kind
   /// of C++ name, e.g., for a constructor, destructor, or conversion
   /// of C++ name, e.g., for a constructor, destructor, or conversion
   /// function.
   /// function.
-  DeclarationName getCXXSpecialName(DeclarationName::NameKind Kind, 
+  DeclarationName getCXXSpecialName(DeclarationName::NameKind Kind,
                                     CanQualType Ty);
                                     CanQualType Ty);
 
 
   /// getCXXOperatorName - Get the name of the overloadable C++
   /// getCXXOperatorName - Get the name of the overloadable C++
   /// operator corresponding to Op.
   /// operator corresponding to Op.
   DeclarationName getCXXOperatorName(OverloadedOperatorKind Op);
   DeclarationName getCXXOperatorName(OverloadedOperatorKind Op);
-};  
+};
 
 
 /// Insertion operator for diagnostics.  This allows sending DeclarationName's
 /// Insertion operator for diagnostics.  This allows sending DeclarationName's
 /// into a diagnostic with <<.
 /// into a diagnostic with <<.
@@ -326,8 +326,8 @@ inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB,
                   Diagnostic::ak_declarationname);
                   Diagnostic::ak_declarationname);
   return DB;
   return DB;
 }
 }
-  
-  
+
+
 }  // end namespace clang
 }  // end namespace clang
 
 
 namespace llvm {
 namespace llvm {
@@ -345,7 +345,7 @@ struct DenseMapInfo<clang::DeclarationName> {
 
 
   static unsigned getHashValue(clang::DeclarationName);
   static unsigned getHashValue(clang::DeclarationName);
 
 
-  static inline bool 
+  static inline bool
   isEqual(clang::DeclarationName LHS, clang::DeclarationName RHS) {
   isEqual(clang::DeclarationName LHS, clang::DeclarationName RHS) {
     return LHS == RHS;
     return LHS == RHS;
   }
   }

Fișier diff suprimat deoarece este prea mare
+ 200 - 200
include/clang/AST/Expr.h


+ 206 - 206
include/clang/AST/ExprCXX.h

@@ -47,14 +47,14 @@ class CXXOperatorCallExpr : public CallExpr {
   OverloadedOperatorKind Operator;
   OverloadedOperatorKind Operator;
 
 
 public:
 public:
-  CXXOperatorCallExpr(ASTContext& C, OverloadedOperatorKind Op, Expr *fn, 
-                      Expr **args, unsigned numargs, QualType t, 
+  CXXOperatorCallExpr(ASTContext& C, OverloadedOperatorKind Op, Expr *fn,
+                      Expr **args, unsigned numargs, QualType t,
                       SourceLocation operatorloc)
                       SourceLocation operatorloc)
     : CallExpr(C, CXXOperatorCallExprClass, fn, args, numargs, t, operatorloc),
     : CallExpr(C, CXXOperatorCallExprClass, fn, args, numargs, t, operatorloc),
       Operator(Op) {}
       Operator(Op) {}
-  explicit CXXOperatorCallExpr(ASTContext& C, EmptyShell Empty) : 
+  explicit CXXOperatorCallExpr(ASTContext& C, EmptyShell Empty) :
     CallExpr(C, CXXOperatorCallExprClass, Empty) { }
     CallExpr(C, CXXOperatorCallExprClass, Empty) { }
-  
+
 
 
   /// getOperator - Returns the kind of overloaded operator that this
   /// getOperator - Returns the kind of overloaded operator that this
   /// expression refers to.
   /// expression refers to.
@@ -69,9 +69,9 @@ public:
   SourceLocation getOperatorLoc() const { return getRParenLoc(); }
   SourceLocation getOperatorLoc() const { return getRParenLoc(); }
 
 
   virtual SourceRange getSourceRange() const;
   virtual SourceRange getSourceRange() const;
-  
-  static bool classof(const Stmt *T) { 
-    return T->getStmtClass() == CXXOperatorCallExprClass; 
+
+  static bool classof(const Stmt *T) {
+    return T->getStmtClass() == CXXOperatorCallExprClass;
   }
   }
   static bool classof(const CXXOperatorCallExpr *) { return true; }
   static bool classof(const CXXOperatorCallExpr *) { return true; }
 };
 };
@@ -95,7 +95,7 @@ public:
   /// operation would return "x".
   /// operation would return "x".
   Expr *getImplicitObjectArgument();
   Expr *getImplicitObjectArgument();
 
 
-  static bool classof(const Stmt *T) { 
+  static bool classof(const Stmt *T) {
     return T->getStmtClass() == CXXMemberCallExprClass;
     return T->getStmtClass() == CXXMemberCallExprClass;
   }
   }
   static bool classof(const CXXMemberCallExpr *) { return true; }
   static bool classof(const CXXMemberCallExpr *) { return true; }
@@ -113,7 +113,7 @@ private:
   SourceLocation Loc; // the location of the casting op
   SourceLocation Loc; // the location of the casting op
 
 
 protected:
 protected:
-  CXXNamedCastExpr(StmtClass SC, QualType ty, const CastInfo &info, Expr *op, 
+  CXXNamedCastExpr(StmtClass SC, QualType ty, const CastInfo &info, Expr *op,
                    QualType writtenTy, SourceLocation l)
                    QualType writtenTy, SourceLocation l)
     : ExplicitCastExpr(SC, ty, info, op, writtenTy), Loc(l) {}
     : ExplicitCastExpr(SC, ty, info, op, writtenTy), Loc(l) {}
 
 
@@ -128,7 +128,7 @@ public:
   virtual SourceRange getSourceRange() const {
   virtual SourceRange getSourceRange() const {
     return SourceRange(Loc, getSubExpr()->getSourceRange().getEnd());
     return SourceRange(Loc, getSubExpr()->getSourceRange().getEnd());
   }
   }
-  static bool classof(const Stmt *T) { 
+  static bool classof(const Stmt *T) {
     switch (T->getStmtClass()) {
     switch (T->getStmtClass()) {
     case CXXNamedCastExprClass:
     case CXXNamedCastExprClass:
     case CXXStaticCastExprClass:
     case CXXStaticCastExprClass:
@@ -144,34 +144,34 @@ public:
 };
 };
 
 
 /// CXXStaticCastExpr - A C++ @c static_cast expression (C++ [expr.static.cast]).
 /// CXXStaticCastExpr - A C++ @c static_cast expression (C++ [expr.static.cast]).
-/// 
+///
 /// This expression node represents a C++ static cast, e.g.,
 /// This expression node represents a C++ static cast, e.g.,
 /// @c static_cast<int>(1.0).
 /// @c static_cast<int>(1.0).
 class CXXStaticCastExpr : public CXXNamedCastExpr {
 class CXXStaticCastExpr : public CXXNamedCastExpr {
 public:
 public:
-  CXXStaticCastExpr(QualType ty, const CastInfo &info, Expr *op, 
+  CXXStaticCastExpr(QualType ty, const CastInfo &info, Expr *op,
                     QualType writtenTy, SourceLocation l)
                     QualType writtenTy, SourceLocation l)
     : CXXNamedCastExpr(CXXStaticCastExprClass, ty, info, op, writtenTy, l) {}
     : CXXNamedCastExpr(CXXStaticCastExprClass, ty, info, op, writtenTy, l) {}
 
 
-  static bool classof(const Stmt *T) { 
+  static bool classof(const Stmt *T) {
     return T->getStmtClass() == CXXStaticCastExprClass;
     return T->getStmtClass() == CXXStaticCastExprClass;
   }
   }
   static bool classof(const CXXStaticCastExpr *) { return true; }
   static bool classof(const CXXStaticCastExpr *) { return true; }
 };
 };
 
 
 /// CXXDynamicCastExpr - A C++ @c dynamic_cast expression
 /// CXXDynamicCastExpr - A C++ @c dynamic_cast expression
-/// (C++ [expr.dynamic.cast]), which may perform a run-time check to 
+/// (C++ [expr.dynamic.cast]), which may perform a run-time check to
 /// determine how to perform the type cast.
 /// determine how to perform the type cast.
-/// 
+///
 /// This expression node represents a dynamic cast, e.g.,
 /// This expression node represents a dynamic cast, e.g.,
 /// @c dynamic_cast<Derived*>(BasePtr).
 /// @c dynamic_cast<Derived*>(BasePtr).
 class CXXDynamicCastExpr : public CXXNamedCastExpr {
 class CXXDynamicCastExpr : public CXXNamedCastExpr {
 public:
 public:
-  CXXDynamicCastExpr(QualType ty, CastKind kind, Expr *op, QualType writtenTy, 
+  CXXDynamicCastExpr(QualType ty, CastKind kind, Expr *op, QualType writtenTy,
                      SourceLocation l)
                      SourceLocation l)
     : CXXNamedCastExpr(CXXDynamicCastExprClass, ty, kind, op, writtenTy, l) {}
     : CXXNamedCastExpr(CXXDynamicCastExprClass, ty, kind, op, writtenTy, l) {}
 
 
-  static bool classof(const Stmt *T) { 
+  static bool classof(const Stmt *T) {
     return T->getStmtClass() == CXXDynamicCastExprClass;
     return T->getStmtClass() == CXXDynamicCastExprClass;
   }
   }
   static bool classof(const CXXDynamicCastExpr *) { return true; }
   static bool classof(const CXXDynamicCastExpr *) { return true; }
@@ -180,17 +180,17 @@ public:
 /// CXXReinterpretCastExpr - A C++ @c reinterpret_cast expression (C++
 /// CXXReinterpretCastExpr - A C++ @c reinterpret_cast expression (C++
 /// [expr.reinterpret.cast]), which provides a differently-typed view
 /// [expr.reinterpret.cast]), which provides a differently-typed view
 /// of a value but performs no actual work at run time.
 /// of a value but performs no actual work at run time.
-/// 
+///
 /// This expression node represents a reinterpret cast, e.g.,
 /// This expression node represents a reinterpret cast, e.g.,
 /// @c reinterpret_cast<int>(VoidPtr).
 /// @c reinterpret_cast<int>(VoidPtr).
 class CXXReinterpretCastExpr : public CXXNamedCastExpr {
 class CXXReinterpretCastExpr : public CXXNamedCastExpr {
 public:
 public:
-  CXXReinterpretCastExpr(QualType ty, Expr *op, QualType writtenTy, 
+  CXXReinterpretCastExpr(QualType ty, Expr *op, QualType writtenTy,
                          SourceLocation l)
                          SourceLocation l)
-    : CXXNamedCastExpr(CXXReinterpretCastExprClass, ty, CK_BitCast, op, 
+    : CXXNamedCastExpr(CXXReinterpretCastExprClass, ty, CK_BitCast, op,
                        writtenTy, l) {}
                        writtenTy, l) {}
 
 
-  static bool classof(const Stmt *T) { 
+  static bool classof(const Stmt *T) {
     return T->getStmtClass() == CXXReinterpretCastExprClass;
     return T->getStmtClass() == CXXReinterpretCastExprClass;
   }
   }
   static bool classof(const CXXReinterpretCastExpr *) { return true; }
   static bool classof(const CXXReinterpretCastExpr *) { return true; }
@@ -198,39 +198,39 @@ public:
 
 
 /// CXXConstCastExpr - A C++ @c const_cast expression (C++ [expr.const.cast]),
 /// CXXConstCastExpr - A C++ @c const_cast expression (C++ [expr.const.cast]),
 /// which can remove type qualifiers but does not change the underlying value.
 /// which can remove type qualifiers but does not change the underlying value.
-/// 
+///
 /// This expression node represents a const cast, e.g.,
 /// This expression node represents a const cast, e.g.,
 /// @c const_cast<char*>(PtrToConstChar).
 /// @c const_cast<char*>(PtrToConstChar).
 class CXXConstCastExpr : public CXXNamedCastExpr {
 class CXXConstCastExpr : public CXXNamedCastExpr {
 public:
 public:
-  CXXConstCastExpr(QualType ty, Expr *op, QualType writtenTy, 
+  CXXConstCastExpr(QualType ty, Expr *op, QualType writtenTy,
                    SourceLocation l)
                    SourceLocation l)
     : CXXNamedCastExpr(CXXConstCastExprClass, ty, CK_NoOp, op, writtenTy, l) {}
     : CXXNamedCastExpr(CXXConstCastExprClass, ty, CK_NoOp, op, writtenTy, l) {}
 
 
-  static bool classof(const Stmt *T) { 
+  static bool classof(const Stmt *T) {
     return T->getStmtClass() == CXXConstCastExprClass;
     return T->getStmtClass() == CXXConstCastExprClass;
   }
   }
   static bool classof(const CXXConstCastExpr *) { return true; }
   static bool classof(const CXXConstCastExpr *) { return true; }
 };
 };
 
 
 /// CXXBoolLiteralExpr - [C++ 2.13.5] C++ Boolean Literal.
 /// CXXBoolLiteralExpr - [C++ 2.13.5] C++ Boolean Literal.
-/// 
+///
 class CXXBoolLiteralExpr : public Expr {
 class CXXBoolLiteralExpr : public Expr {
   bool Value;
   bool Value;
   SourceLocation Loc;
   SourceLocation Loc;
 public:
 public:
-  CXXBoolLiteralExpr(bool val, QualType Ty, SourceLocation l) : 
+  CXXBoolLiteralExpr(bool val, QualType Ty, SourceLocation l) :
     Expr(CXXBoolLiteralExprClass, Ty), Value(val), Loc(l) {}
     Expr(CXXBoolLiteralExprClass, Ty), Value(val), Loc(l) {}
 
 
   bool getValue() const { return Value; }
   bool getValue() const { return Value; }
 
 
   virtual SourceRange getSourceRange() const { return SourceRange(Loc); }
   virtual SourceRange getSourceRange() const { return SourceRange(Loc); }
-    
-  static bool classof(const Stmt *T) { 
+
+  static bool classof(const Stmt *T) {
     return T->getStmtClass() == CXXBoolLiteralExprClass;
     return T->getStmtClass() == CXXBoolLiteralExprClass;
   }
   }
   static bool classof(const CXXBoolLiteralExpr *) { return true; }
   static bool classof(const CXXBoolLiteralExpr *) { return true; }
-      
+
   // Iterators
   // Iterators
   virtual child_iterator child_begin();
   virtual child_iterator child_begin();
   virtual child_iterator child_end();
   virtual child_iterator child_end();
@@ -322,7 +322,7 @@ class CXXThisExpr : public Expr {
   SourceLocation Loc;
   SourceLocation Loc;
 
 
 public:
 public:
-  CXXThisExpr(SourceLocation L, QualType Type) 
+  CXXThisExpr(SourceLocation L, QualType Type)
     : Expr(CXXThisExprClass, Type,
     : Expr(CXXThisExprClass, Type,
            // 'this' is type-dependent if the class type of the enclosing
            // 'this' is type-dependent if the class type of the enclosing
            // member function is dependent (C++ [temp.dep.expr]p2)
            // member function is dependent (C++ [temp.dep.expr]p2)
@@ -331,7 +331,7 @@ public:
 
 
   virtual SourceRange getSourceRange() const { return SourceRange(Loc); }
   virtual SourceRange getSourceRange() const { return SourceRange(Loc); }
 
 
-  static bool classof(const Stmt *T) { 
+  static bool classof(const Stmt *T) {
     return T->getStmtClass() == CXXThisExprClass;
     return T->getStmtClass() == CXXThisExprClass;
   }
   }
   static bool classof(const CXXThisExpr *) { return true; }
   static bool classof(const CXXThisExpr *) { return true; }
@@ -383,14 +383,14 @@ public:
 /// supply arguments for all of the parameters.
 /// supply arguments for all of the parameters.
 class CXXDefaultArgExpr : public Expr {
 class CXXDefaultArgExpr : public Expr {
   ParmVarDecl *Param;
   ParmVarDecl *Param;
-    
+
 protected:
 protected:
-  CXXDefaultArgExpr(StmtClass SC, ParmVarDecl *param) 
-    : Expr(SC, param->hasUnparsedDefaultArg() ? 
+  CXXDefaultArgExpr(StmtClass SC, ParmVarDecl *param)
+    : Expr(SC, param->hasUnparsedDefaultArg() ?
            param->getType().getNonReferenceType()
            param->getType().getNonReferenceType()
            : param->getDefaultArg()->getType()),
            : param->getDefaultArg()->getType()),
     Param(param) { }
     Param(param) { }
-    
+
 public:
 public:
   // Param is the parameter whose default argument is used by this
   // Param is the parameter whose default argument is used by this
   // expression.
   // expression.
@@ -426,39 +426,39 @@ public:
 class CXXTemporary {
 class CXXTemporary {
   /// Destructor - The destructor that needs to be called.
   /// Destructor - The destructor that needs to be called.
   const CXXDestructorDecl *Destructor;
   const CXXDestructorDecl *Destructor;
-  
+
   CXXTemporary(const CXXDestructorDecl *destructor)
   CXXTemporary(const CXXDestructorDecl *destructor)
     : Destructor(destructor) { }
     : Destructor(destructor) { }
   ~CXXTemporary() { }
   ~CXXTemporary() { }
 
 
 public:
 public:
-  static CXXTemporary *Create(ASTContext &C, 
+  static CXXTemporary *Create(ASTContext &C,
                               const CXXDestructorDecl *Destructor);
                               const CXXDestructorDecl *Destructor);
-  
+
   void Destroy(ASTContext &Ctx);
   void Destroy(ASTContext &Ctx);
-  
+
   const CXXDestructorDecl *getDestructor() const { return Destructor; }
   const CXXDestructorDecl *getDestructor() const { return Destructor; }
 };
 };
 
 
-/// CXXBindTemporaryExpr - Represents binding an expression to a temporary, 
+/// CXXBindTemporaryExpr - Represents binding an expression to a temporary,
 /// so its destructor can be called later.
 /// so its destructor can be called later.
 class CXXBindTemporaryExpr : public Expr {
 class CXXBindTemporaryExpr : public Expr {
   CXXTemporary *Temp;
   CXXTemporary *Temp;
-  
+
   Stmt *SubExpr;
   Stmt *SubExpr;
 
 
-  CXXBindTemporaryExpr(CXXTemporary *temp, Expr* subexpr) 
+  CXXBindTemporaryExpr(CXXTemporary *temp, Expr* subexpr)
    : Expr(CXXBindTemporaryExprClass,
    : Expr(CXXBindTemporaryExprClass,
           subexpr->getType()), Temp(temp), SubExpr(subexpr) { }
           subexpr->getType()), Temp(temp), SubExpr(subexpr) { }
-  ~CXXBindTemporaryExpr() { } 
+  ~CXXBindTemporaryExpr() { }
 
 
 protected:
 protected:
   virtual void DoDestroy(ASTContext &C);
   virtual void DoDestroy(ASTContext &C);
 
 
 public:
 public:
-  static CXXBindTemporaryExpr *Create(ASTContext &C, CXXTemporary *Temp, 
+  static CXXBindTemporaryExpr *Create(ASTContext &C, CXXTemporary *Temp,
                                       Expr* SubExpr);
                                       Expr* SubExpr);
-  
+
   CXXTemporary *getTemporary() { return Temp; }
   CXXTemporary *getTemporary() { return Temp; }
   const CXXTemporary *getTemporary() const { return Temp; }
   const CXXTemporary *getTemporary() const { return Temp; }
 
 
@@ -484,24 +484,24 @@ class CXXConstructExpr : public Expr {
   CXXConstructorDecl *Constructor;
   CXXConstructorDecl *Constructor;
 
 
   bool Elidable;
   bool Elidable;
-  
+
   Stmt **Args;
   Stmt **Args;
   unsigned NumArgs;
   unsigned NumArgs;
-  
+
 protected:
 protected:
-  CXXConstructExpr(ASTContext &C, StmtClass SC, QualType T, 
+  CXXConstructExpr(ASTContext &C, StmtClass SC, QualType T,
                    CXXConstructorDecl *d, bool elidable,
                    CXXConstructorDecl *d, bool elidable,
                    Expr **args, unsigned numargs);
                    Expr **args, unsigned numargs);
-  ~CXXConstructExpr() { } 
+  ~CXXConstructExpr() { }
 
 
   virtual void DoDestroy(ASTContext &C);
   virtual void DoDestroy(ASTContext &C);
 
 
 public:
 public:
   static CXXConstructExpr *Create(ASTContext &C, QualType T,
   static CXXConstructExpr *Create(ASTContext &C, QualType T,
-                                  CXXConstructorDecl *D, bool Elidable, 
+                                  CXXConstructorDecl *D, bool Elidable,
                                   Expr **Args, unsigned NumArgs);
                                   Expr **Args, unsigned NumArgs);
-  
-  
+
+
   CXXConstructorDecl* getConstructor() const { return Constructor; }
   CXXConstructorDecl* getConstructor() const { return Constructor; }
 
 
   /// \brief Whether this construction is elidable.
   /// \brief Whether this construction is elidable.
@@ -509,7 +509,7 @@ public:
 
 
   typedef ExprIterator arg_iterator;
   typedef ExprIterator arg_iterator;
   typedef ConstExprIterator const_arg_iterator;
   typedef ConstExprIterator const_arg_iterator;
-  
+
   arg_iterator arg_begin() { return Args; }
   arg_iterator arg_begin() { return Args; }
   arg_iterator arg_end() { return Args + NumArgs; }
   arg_iterator arg_end() { return Args + NumArgs; }
   const_arg_iterator arg_begin() const { return Args; }
   const_arg_iterator arg_begin() const { return Args; }
@@ -526,7 +526,7 @@ public:
     assert(Arg < NumArgs && "Arg access out of range!");
     assert(Arg < NumArgs && "Arg access out of range!");
     return cast<Expr>(Args[Arg]);
     return cast<Expr>(Args[Arg]);
   }
   }
-  
+
   /// setArg - Set the specified argument.
   /// setArg - Set the specified argument.
   void setArg(unsigned Arg, Expr *ArgExpr) {
   void setArg(unsigned Arg, Expr *ArgExpr) {
     assert(Arg < NumArgs && "Arg access out of range!");
     assert(Arg < NumArgs && "Arg access out of range!");
@@ -535,12 +535,12 @@ public:
 
 
   virtual SourceRange getSourceRange() const { return SourceRange(); }
   virtual SourceRange getSourceRange() const { return SourceRange(); }
 
 
-  static bool classof(const Stmt *T) { 
+  static bool classof(const Stmt *T) {
     return T->getStmtClass() == CXXConstructExprClass ||
     return T->getStmtClass() == CXXConstructExprClass ||
       T->getStmtClass() == CXXTemporaryObjectExprClass;
       T->getStmtClass() == CXXTemporaryObjectExprClass;
   }
   }
   static bool classof(const CXXConstructExpr *) { return true; }
   static bool classof(const CXXConstructExpr *) { return true; }
-  
+
   // Iterators
   // Iterators
   virtual child_iterator child_begin();
   virtual child_iterator child_begin();
   virtual child_iterator child_end();
   virtual child_iterator child_end();
@@ -554,24 +554,24 @@ class CXXFunctionalCastExpr : public ExplicitCastExpr {
   SourceLocation TyBeginLoc;
   SourceLocation TyBeginLoc;
   SourceLocation RParenLoc;
   SourceLocation RParenLoc;
 public:
 public:
-  CXXFunctionalCastExpr(QualType ty, QualType writtenTy, 
-                        SourceLocation tyBeginLoc, CastKind kind, 
+  CXXFunctionalCastExpr(QualType ty, QualType writtenTy,
+                        SourceLocation tyBeginLoc, CastKind kind,
                         Expr *castExpr, CXXMethodDecl *typeConversionMethod,
                         Expr *castExpr, CXXMethodDecl *typeConversionMethod,
-                        SourceLocation rParenLoc) : 
+                        SourceLocation rParenLoc) :
     ExplicitCastExpr(CXXFunctionalCastExprClass, ty, kind, castExpr, writtenTy),
     ExplicitCastExpr(CXXFunctionalCastExprClass, ty, kind, castExpr, writtenTy),
     TypeConversionMethod(typeConversionMethod),
     TypeConversionMethod(typeConversionMethod),
     TyBeginLoc(tyBeginLoc), RParenLoc(rParenLoc) {}
     TyBeginLoc(tyBeginLoc), RParenLoc(rParenLoc) {}
 
 
-  CXXMethodDecl *getTypeConversionMethod() const 
+  CXXMethodDecl *getTypeConversionMethod() const
   { return TypeConversionMethod; }
   { return TypeConversionMethod; }
   SourceLocation getTypeBeginLoc() const { return TyBeginLoc; }
   SourceLocation getTypeBeginLoc() const { return TyBeginLoc; }
   SourceLocation getRParenLoc() const { return RParenLoc; }
   SourceLocation getRParenLoc() const { return RParenLoc; }
-  
+
   virtual SourceRange getSourceRange() const {
   virtual SourceRange getSourceRange() const {
     return SourceRange(TyBeginLoc, RParenLoc);
     return SourceRange(TyBeginLoc, RParenLoc);
   }
   }
-  static bool classof(const Stmt *T) { 
-    return T->getStmtClass() == CXXFunctionalCastExprClass; 
+  static bool classof(const Stmt *T) {
+    return T->getStmtClass() == CXXFunctionalCastExprClass;
   }
   }
   static bool classof(const CXXFunctionalCastExpr *) { return true; }
   static bool classof(const CXXFunctionalCastExpr *) { return true; }
 };
 };
@@ -579,7 +579,7 @@ public:
 /// @brief Represents a C++ functional cast expression that builds a
 /// @brief Represents a C++ functional cast expression that builds a
 /// temporary object.
 /// temporary object.
 ///
 ///
-/// This expression type represents a C++ "functional" cast 
+/// This expression type represents a C++ "functional" cast
 /// (C++[expr.type.conv]) with N != 1 arguments that invokes a
 /// (C++[expr.type.conv]) with N != 1 arguments that invokes a
 /// constructor to build a temporary object. If N == 0 but no
 /// constructor to build a temporary object. If N == 0 but no
 /// constructor will be called (because the functional cast is
 /// constructor will be called (because the functional cast is
@@ -600,12 +600,12 @@ class CXXTemporaryObjectExpr : public CXXConstructExpr {
   SourceLocation RParenLoc;
   SourceLocation RParenLoc;
 
 
 public:
 public:
-  CXXTemporaryObjectExpr(ASTContext &C, CXXConstructorDecl *Cons, 
-                         QualType writtenTy, SourceLocation tyBeginLoc, 
-                         Expr **Args,unsigned NumArgs, 
+  CXXTemporaryObjectExpr(ASTContext &C, CXXConstructorDecl *Cons,
+                         QualType writtenTy, SourceLocation tyBeginLoc,
+                         Expr **Args,unsigned NumArgs,
                          SourceLocation rParenLoc);
                          SourceLocation rParenLoc);
 
 
-  ~CXXTemporaryObjectExpr() { } 
+  ~CXXTemporaryObjectExpr() { }
 
 
   SourceLocation getTypeBeginLoc() const { return TyBeginLoc; }
   SourceLocation getTypeBeginLoc() const { return TyBeginLoc; }
   SourceLocation getRParenLoc() const { return RParenLoc; }
   SourceLocation getRParenLoc() const { return RParenLoc; }
@@ -613,7 +613,7 @@ public:
   virtual SourceRange getSourceRange() const {
   virtual SourceRange getSourceRange() const {
     return SourceRange(TyBeginLoc, RParenLoc);
     return SourceRange(TyBeginLoc, RParenLoc);
   }
   }
-  static bool classof(const Stmt *T) { 
+  static bool classof(const Stmt *T) {
     return T->getStmtClass() == CXXTemporaryObjectExprClass;
     return T->getStmtClass() == CXXTemporaryObjectExprClass;
   }
   }
   static bool classof(const CXXTemporaryObjectExpr *) { return true; }
   static bool classof(const CXXTemporaryObjectExpr *) { return true; }
@@ -630,28 +630,28 @@ class CXXZeroInitValueExpr : public Expr {
 
 
 public:
 public:
   CXXZeroInitValueExpr(QualType ty, SourceLocation tyBeginLoc,
   CXXZeroInitValueExpr(QualType ty, SourceLocation tyBeginLoc,
-                       SourceLocation rParenLoc ) : 
+                       SourceLocation rParenLoc ) :
     Expr(CXXZeroInitValueExprClass, ty, false, false),
     Expr(CXXZeroInitValueExprClass, ty, false, false),
     TyBeginLoc(tyBeginLoc), RParenLoc(rParenLoc) {}
     TyBeginLoc(tyBeginLoc), RParenLoc(rParenLoc) {}
-  
+
   SourceLocation getTypeBeginLoc() const { return TyBeginLoc; }
   SourceLocation getTypeBeginLoc() const { return TyBeginLoc; }
   SourceLocation getRParenLoc() const { return RParenLoc; }
   SourceLocation getRParenLoc() const { return RParenLoc; }
 
 
   /// @brief Whether this initialization expression was
   /// @brief Whether this initialization expression was
   /// implicitly-generated.
   /// implicitly-generated.
-  bool isImplicit() const { 
-    return TyBeginLoc.isInvalid() && RParenLoc.isInvalid(); 
+  bool isImplicit() const {
+    return TyBeginLoc.isInvalid() && RParenLoc.isInvalid();
   }
   }
 
 
   virtual SourceRange getSourceRange() const {
   virtual SourceRange getSourceRange() const {
     return SourceRange(TyBeginLoc, RParenLoc);
     return SourceRange(TyBeginLoc, RParenLoc);
   }
   }
-    
-  static bool classof(const Stmt *T) { 
+
+  static bool classof(const Stmt *T) {
     return T->getStmtClass() == CXXZeroInitValueExprClass;
     return T->getStmtClass() == CXXZeroInitValueExprClass;
   }
   }
   static bool classof(const CXXZeroInitValueExpr *) { return true; }
   static bool classof(const CXXZeroInitValueExpr *) { return true; }
-      
+
   // Iterators
   // Iterators
   virtual child_iterator child_begin();
   virtual child_iterator child_begin();
   virtual child_iterator child_end();
   virtual child_iterator child_end();
@@ -666,26 +666,26 @@ class CXXConditionDeclExpr : public DeclRefExpr {
 public:
 public:
   CXXConditionDeclExpr(SourceLocation startLoc,
   CXXConditionDeclExpr(SourceLocation startLoc,
                        SourceLocation eqLoc, VarDecl *var)
                        SourceLocation eqLoc, VarDecl *var)
-    : DeclRefExpr(CXXConditionDeclExprClass, var, 
+    : DeclRefExpr(CXXConditionDeclExprClass, var,
                   var->getType().getNonReferenceType(), startLoc,
                   var->getType().getNonReferenceType(), startLoc,
                   var->getType()->isDependentType(),
                   var->getType()->isDependentType(),
                   /*FIXME:integral constant?*/
                   /*FIXME:integral constant?*/
                     var->getType()->isDependentType()) {}
                     var->getType()->isDependentType()) {}
 
 
   SourceLocation getStartLoc() const { return getLocation(); }
   SourceLocation getStartLoc() const { return getLocation(); }
-  
+
   VarDecl *getVarDecl() { return cast<VarDecl>(getDecl()); }
   VarDecl *getVarDecl() { return cast<VarDecl>(getDecl()); }
   const VarDecl *getVarDecl() const { return cast<VarDecl>(getDecl()); }
   const VarDecl *getVarDecl() const { return cast<VarDecl>(getDecl()); }
 
 
   virtual SourceRange getSourceRange() const {
   virtual SourceRange getSourceRange() const {
     return SourceRange(getStartLoc(), getVarDecl()->getInit()->getLocEnd());
     return SourceRange(getStartLoc(), getVarDecl()->getInit()->getLocEnd());
   }
   }
-    
-  static bool classof(const Stmt *T) { 
+
+  static bool classof(const Stmt *T) {
     return T->getStmtClass() == CXXConditionDeclExprClass;
     return T->getStmtClass() == CXXConditionDeclExprClass;
   }
   }
   static bool classof(const CXXConditionDeclExpr *) { return true; }
   static bool classof(const CXXConditionDeclExpr *) { return true; }
-      
+
   // Iterators
   // Iterators
   virtual child_iterator child_begin();
   virtual child_iterator child_begin();
   virtual child_iterator child_end();
   virtual child_iterator child_end();
@@ -866,7 +866,7 @@ public:
 /// Example:
 /// Example:
 ///
 ///
 /// \code
 /// \code
-/// template<typename T> 
+/// template<typename T>
 /// void destroy(T* ptr) {
 /// void destroy(T* ptr) {
 ///   ptr->~T();
 ///   ptr->~T();
 /// }
 /// }
@@ -874,67 +874,67 @@ public:
 ///
 ///
 /// When the template is parsed, the expression \c ptr->~T will be stored as
 /// When the template is parsed, the expression \c ptr->~T will be stored as
 /// a member reference expression. If it then instantiated with a scalar type
 /// a member reference expression. If it then instantiated with a scalar type
-/// as a template argument for T, the resulting expression will be a 
+/// as a template argument for T, the resulting expression will be a
 /// pseudo-destructor expression.
 /// pseudo-destructor expression.
 class CXXPseudoDestructorExpr : public Expr {
 class CXXPseudoDestructorExpr : public Expr {
   /// \brief The base expression (that is being destroyed).
   /// \brief The base expression (that is being destroyed).
   Stmt *Base;
   Stmt *Base;
-  
+
   /// \brief Whether the operator was an arrow ('->'); otherwise, it was a
   /// \brief Whether the operator was an arrow ('->'); otherwise, it was a
   /// period ('.').
   /// period ('.').
   bool IsArrow : 1;
   bool IsArrow : 1;
-  
+
   /// \brief The location of the '.' or '->' operator.
   /// \brief The location of the '.' or '->' operator.
   SourceLocation OperatorLoc;
   SourceLocation OperatorLoc;
-  
+
   /// \brief The nested-name-specifier that follows the operator, if present.
   /// \brief The nested-name-specifier that follows the operator, if present.
   NestedNameSpecifier *Qualifier;
   NestedNameSpecifier *Qualifier;
-  
-  /// \brief The source range that covers the nested-name-specifier, if 
+
+  /// \brief The source range that covers the nested-name-specifier, if
   /// present.
   /// present.
   SourceRange QualifierRange;
   SourceRange QualifierRange;
-  
+
   /// \brief The type being destroyed.
   /// \brief The type being destroyed.
   QualType DestroyedType;
   QualType DestroyedType;
-  
+
   /// \brief The location of the type after the '~'.
   /// \brief The location of the type after the '~'.
   SourceLocation DestroyedTypeLoc;
   SourceLocation DestroyedTypeLoc;
-    
+
 public:
 public:
   CXXPseudoDestructorExpr(ASTContext &Context,
   CXXPseudoDestructorExpr(ASTContext &Context,
                           Expr *Base, bool isArrow, SourceLocation OperatorLoc,
                           Expr *Base, bool isArrow, SourceLocation OperatorLoc,
                           NestedNameSpecifier *Qualifier,
                           NestedNameSpecifier *Qualifier,
                           SourceRange QualifierRange,
                           SourceRange QualifierRange,
-                          QualType DestroyedType, 
+                          QualType DestroyedType,
                           SourceLocation DestroyedTypeLoc)
                           SourceLocation DestroyedTypeLoc)
-    : Expr(CXXPseudoDestructorExprClass, 
+    : Expr(CXXPseudoDestructorExprClass,
            Context.getPointerType(Context.getFunctionType(Context.VoidTy, 0, 0,
            Context.getPointerType(Context.getFunctionType(Context.VoidTy, 0, 0,
                                                           false, 0)),
                                                           false, 0)),
            /*isTypeDependent=*/false,
            /*isTypeDependent=*/false,
            /*isValueDependent=*/Base->isValueDependent()),
            /*isValueDependent=*/Base->isValueDependent()),
-      Base(static_cast<Stmt *>(Base)), IsArrow(isArrow), 
+      Base(static_cast<Stmt *>(Base)), IsArrow(isArrow),
       OperatorLoc(OperatorLoc), Qualifier(Qualifier),
       OperatorLoc(OperatorLoc), Qualifier(Qualifier),
       QualifierRange(QualifierRange), DestroyedType(DestroyedType),
       QualifierRange(QualifierRange), DestroyedType(DestroyedType),
       DestroyedTypeLoc(DestroyedTypeLoc) { }
       DestroyedTypeLoc(DestroyedTypeLoc) { }
-  
+
   void setBase(Expr *E) { Base = E; }
   void setBase(Expr *E) { Base = E; }
   Expr *getBase() const { return cast<Expr>(Base); }
   Expr *getBase() const { return cast<Expr>(Base); }
-  
-  /// \brief Determines whether this member expression actually had 
+
+  /// \brief Determines whether this member expression actually had
   /// a C++ nested-name-specifier prior to the name of the member, e.g.,
   /// a C++ nested-name-specifier prior to the name of the member, e.g.,
   /// x->Base::foo.
   /// x->Base::foo.
   bool hasQualifier() const { return Qualifier != 0; }
   bool hasQualifier() const { return Qualifier != 0; }
-  
+
   /// \brief If the member name was qualified, retrieves the source range of
   /// \brief If the member name was qualified, retrieves the source range of
   /// the nested-name-specifier that precedes the member name. Otherwise,
   /// the nested-name-specifier that precedes the member name. Otherwise,
   /// returns an empty source range.
   /// returns an empty source range.
   SourceRange getQualifierRange() const { return QualifierRange; }
   SourceRange getQualifierRange() const { return QualifierRange; }
-  
-  /// \brief If the member name was qualified, retrieves the 
+
+  /// \brief If the member name was qualified, retrieves the
   /// nested-name-specifier that precedes the member name. Otherwise, returns
   /// nested-name-specifier that precedes the member name. Otherwise, returns
   /// NULL.
   /// NULL.
   NestedNameSpecifier *getQualifier() const { return Qualifier; }
   NestedNameSpecifier *getQualifier() const { return Qualifier; }
-    
+
   /// \brief Determine whether this pseudo-destructor expression was written
   /// \brief Determine whether this pseudo-destructor expression was written
   /// using an '->' (otherwise, it used a '.').
   /// using an '->' (otherwise, it used a '.').
   bool isArrow() const { return IsArrow; }
   bool isArrow() const { return IsArrow; }
@@ -942,27 +942,27 @@ public:
 
 
   /// \brief Retrieve the location of the '.' or '->' operator.
   /// \brief Retrieve the location of the '.' or '->' operator.
   SourceLocation getOperatorLoc() const { return OperatorLoc; }
   SourceLocation getOperatorLoc() const { return OperatorLoc; }
-  
+
   /// \brief Retrieve the type that is being destroyed.
   /// \brief Retrieve the type that is being destroyed.
   QualType getDestroyedType() const { return DestroyedType; }
   QualType getDestroyedType() const { return DestroyedType; }
-  
+
   /// \brief Retrieve the location of the type being destroyed.
   /// \brief Retrieve the location of the type being destroyed.
   SourceLocation getDestroyedTypeLoc() const { return DestroyedTypeLoc; }
   SourceLocation getDestroyedTypeLoc() const { return DestroyedTypeLoc; }
-  
+
   virtual SourceRange getSourceRange() const {
   virtual SourceRange getSourceRange() const {
     return SourceRange(Base->getLocStart(), DestroyedTypeLoc);
     return SourceRange(Base->getLocStart(), DestroyedTypeLoc);
   }
   }
-  
-  static bool classof(const Stmt *T) { 
+
+  static bool classof(const Stmt *T) {
     return T->getStmtClass() == CXXPseudoDestructorExprClass;
     return T->getStmtClass() == CXXPseudoDestructorExprClass;
   }
   }
   static bool classof(const CXXPseudoDestructorExpr *) { return true; }
   static bool classof(const CXXPseudoDestructorExpr *) { return true; }
-  
+
   // Iterators
   // Iterators
   virtual child_iterator child_begin();
   virtual child_iterator child_begin();
-  virtual child_iterator child_end();  
+  virtual child_iterator child_end();
 };
 };
-  
+
 /// \brief Represents the name of a function that has not been
 /// \brief Represents the name of a function that has not been
 /// resolved to any declaration.
 /// resolved to any declaration.
 ///
 ///
@@ -980,7 +980,7 @@ public:
 /// }
 /// }
 /// @endcode
 /// @endcode
 class UnresolvedFunctionNameExpr : public Expr {
 class UnresolvedFunctionNameExpr : public Expr {
-  /// The name that was present in the source 
+  /// The name that was present in the source
   DeclarationName Name;
   DeclarationName Name;
 
 
   /// The location of this name in the source code
   /// The location of this name in the source code
@@ -999,7 +999,7 @@ public:
 
 
   virtual SourceRange getSourceRange() const { return SourceRange(Loc); }
   virtual SourceRange getSourceRange() const { return SourceRange(Loc); }
 
 
-  static bool classof(const Stmt *T) { 
+  static bool classof(const Stmt *T) {
     return T->getStmtClass() == UnresolvedFunctionNameExprClass;
     return T->getStmtClass() == UnresolvedFunctionNameExprClass;
   }
   }
   static bool classof(const UnresolvedFunctionNameExpr *) { return true; }
   static bool classof(const UnresolvedFunctionNameExpr *) { return true; }
@@ -1064,9 +1064,9 @@ class QualifiedDeclRefExpr : public DeclRefExpr {
   NestedNameSpecifier *NNS;
   NestedNameSpecifier *NNS;
 
 
 public:
 public:
-  QualifiedDeclRefExpr(NamedDecl *d, QualType t, SourceLocation l, bool TD, 
+  QualifiedDeclRefExpr(NamedDecl *d, QualType t, SourceLocation l, bool TD,
                        bool VD, SourceRange R, NestedNameSpecifier *NNS)
                        bool VD, SourceRange R, NestedNameSpecifier *NNS)
-    : DeclRefExpr(QualifiedDeclRefExprClass, d, t, l, TD, VD), 
+    : DeclRefExpr(QualifiedDeclRefExprClass, d, t, l, TD, VD),
       QualifierRange(R), NNS(NNS) { }
       QualifierRange(R), NNS(NNS) { }
 
 
   /// \brief Retrieve the source range of the nested-name-specifier.
   /// \brief Retrieve the source range of the nested-name-specifier.
@@ -1076,8 +1076,8 @@ public:
   /// declaration.
   /// declaration.
   NestedNameSpecifier *getQualifier() const { return NNS; }
   NestedNameSpecifier *getQualifier() const { return NNS; }
 
 
-  virtual SourceRange getSourceRange() const { 
-    return SourceRange(QualifierRange.getBegin(), getLocation()); 
+  virtual SourceRange getSourceRange() const {
+    return SourceRange(QualifierRange.getBegin(), getLocation());
   }
   }
 
 
   static bool classof(const Stmt *T) {
   static bool classof(const Stmt *T) {
@@ -1117,13 +1117,13 @@ class UnresolvedDeclRefExpr : public Expr {
 
 
   /// \brief Whether this expr is an address of (&) operand.
   /// \brief Whether this expr is an address of (&) operand.
   bool IsAddressOfOperand;
   bool IsAddressOfOperand;
-  
+
 public:
 public:
   UnresolvedDeclRefExpr(DeclarationName N, QualType T, SourceLocation L,
   UnresolvedDeclRefExpr(DeclarationName N, QualType T, SourceLocation L,
-                        SourceRange R, NestedNameSpecifier *NNS, 
+                        SourceRange R, NestedNameSpecifier *NNS,
                         bool IsAddressOfOperand)
                         bool IsAddressOfOperand)
-    : Expr(UnresolvedDeclRefExprClass, T, true, true), 
-      Name(N), Loc(L), QualifierRange(R), NNS(NNS), 
+    : Expr(UnresolvedDeclRefExprClass, T, true, true),
+      Name(N), Loc(L), QualifierRange(R), NNS(NNS),
       IsAddressOfOperand(IsAddressOfOperand) { }
       IsAddressOfOperand(IsAddressOfOperand) { }
 
 
   /// \brief Retrieve the name that this expression refers to.
   /// \brief Retrieve the name that this expression refers to.
@@ -1140,10 +1140,10 @@ public:
   NestedNameSpecifier *getQualifier() const { return NNS; }
   NestedNameSpecifier *getQualifier() const { return NNS; }
 
 
   /// \brief Retrieve whether this is an address of (&) operand.
   /// \brief Retrieve whether this is an address of (&) operand.
-  
+
   bool isAddressOfOperand() const { return IsAddressOfOperand; }
   bool isAddressOfOperand() const { return IsAddressOfOperand; }
-  virtual SourceRange getSourceRange() const { 
-    return SourceRange(QualifierRange.getBegin(), getLocation()); 
+  virtual SourceRange getSourceRange() const {
+    return SourceRange(QualifierRange.getBegin(), getLocation());
   }
   }
 
 
   static bool classof(const Stmt *T) {
   static bool classof(const Stmt *T) {
@@ -1155,42 +1155,42 @@ public:
   virtual StmtIterator child_end();
   virtual StmtIterator child_end();
 };
 };
 
 
-/// \brief An expression that refers to a C++ template-id, such as 
-/// @c isa<FunctionDecl>. 
+/// \brief An expression that refers to a C++ template-id, such as
+/// @c isa<FunctionDecl>.
 class TemplateIdRefExpr : public Expr {
 class TemplateIdRefExpr : public Expr {
   /// \brief If this template-id was qualified-id, e.g., @c std::sort<int>,
   /// \brief If this template-id was qualified-id, e.g., @c std::sort<int>,
   /// this nested name specifier contains the @c std::.
   /// this nested name specifier contains the @c std::.
   NestedNameSpecifier *Qualifier;
   NestedNameSpecifier *Qualifier;
-  
+
   /// \brief If this template-id was a qualified-id, e.g., @c std::sort<int>,
   /// \brief If this template-id was a qualified-id, e.g., @c std::sort<int>,
   /// this covers the source code range of the @c std::.
   /// this covers the source code range of the @c std::.
   SourceRange QualifierRange;
   SourceRange QualifierRange;
-  
+
   /// \brief The actual template to which this template-id refers.
   /// \brief The actual template to which this template-id refers.
   TemplateName Template;
   TemplateName Template;
-  
+
   /// \brief The source location of the template name.
   /// \brief The source location of the template name.
   SourceLocation TemplateNameLoc;
   SourceLocation TemplateNameLoc;
 
 
   /// \brief The source location of the left angle bracket ('<');
   /// \brief The source location of the left angle bracket ('<');
   SourceLocation LAngleLoc;
   SourceLocation LAngleLoc;
-  
+
   /// \brief The source location of the right angle bracket ('>');
   /// \brief The source location of the right angle bracket ('>');
   SourceLocation RAngleLoc;
   SourceLocation RAngleLoc;
-  
+
   /// \brief The number of template arguments in TemplateArgs.
   /// \brief The number of template arguments in TemplateArgs.
   unsigned NumTemplateArgs;
   unsigned NumTemplateArgs;
-  
+
   TemplateIdRefExpr(QualType T,
   TemplateIdRefExpr(QualType T,
                     NestedNameSpecifier *Qualifier, SourceRange QualifierRange,
                     NestedNameSpecifier *Qualifier, SourceRange QualifierRange,
                     TemplateName Template, SourceLocation TemplateNameLoc,
                     TemplateName Template, SourceLocation TemplateNameLoc,
-                    SourceLocation LAngleLoc, 
+                    SourceLocation LAngleLoc,
                     const TemplateArgument *TemplateArgs,
                     const TemplateArgument *TemplateArgs,
                     unsigned NumTemplateArgs,
                     unsigned NumTemplateArgs,
                     SourceLocation RAngleLoc);
                     SourceLocation RAngleLoc);
-  
+
   virtual void DoDestroy(ASTContext &Context);
   virtual void DoDestroy(ASTContext &Context);
-  
+
 public:
 public:
   static TemplateIdRefExpr *
   static TemplateIdRefExpr *
   Create(ASTContext &Context, QualType T,
   Create(ASTContext &Context, QualType T,
@@ -1198,66 +1198,66 @@ public:
          TemplateName Template, SourceLocation TemplateNameLoc,
          TemplateName Template, SourceLocation TemplateNameLoc,
          SourceLocation LAngleLoc, const TemplateArgument *TemplateArgs,
          SourceLocation LAngleLoc, const TemplateArgument *TemplateArgs,
          unsigned NumTemplateArgs, SourceLocation RAngleLoc);
          unsigned NumTemplateArgs, SourceLocation RAngleLoc);
-  
+
   /// \brief Retrieve the nested name specifier used to qualify the name of
   /// \brief Retrieve the nested name specifier used to qualify the name of
   /// this template-id, e.g., the "std::sort" in @c std::sort<int>, or NULL
   /// this template-id, e.g., the "std::sort" in @c std::sort<int>, or NULL
   /// if this template-id was an unqualified-id.
   /// if this template-id was an unqualified-id.
   NestedNameSpecifier *getQualifier() const { return Qualifier; }
   NestedNameSpecifier *getQualifier() const { return Qualifier; }
-  
+
   /// \brief Retrieve the source range describing the nested name specifier
   /// \brief Retrieve the source range describing the nested name specifier
   /// used to qualified the name of this template-id, if the name was qualified.
   /// used to qualified the name of this template-id, if the name was qualified.
   SourceRange getQualifierRange() const { return QualifierRange; }
   SourceRange getQualifierRange() const { return QualifierRange; }
-  
+
   /// \brief Retrieve the name of the template referenced, e.g., "sort" in
   /// \brief Retrieve the name of the template referenced, e.g., "sort" in
   /// @c std::sort<int>;
   /// @c std::sort<int>;
   TemplateName getTemplateName() const { return Template; }
   TemplateName getTemplateName() const { return Template; }
-  
+
   /// \brief Retrieve the location of the name of the template referenced, e.g.,
   /// \brief Retrieve the location of the name of the template referenced, e.g.,
   /// the location of "sort" in @c std::sort<int>.
   /// the location of "sort" in @c std::sort<int>.
   SourceLocation getTemplateNameLoc() const { return TemplateNameLoc; }
   SourceLocation getTemplateNameLoc() const { return TemplateNameLoc; }
-  
-  /// \brief Retrieve the location of the left angle bracket following the 
+
+  /// \brief Retrieve the location of the left angle bracket following the
   /// template name ('<').
   /// template name ('<').
   SourceLocation getLAngleLoc() const { return LAngleLoc; }
   SourceLocation getLAngleLoc() const { return LAngleLoc; }
-  
+
   /// \brief Retrieve the template arguments provided as part of this
   /// \brief Retrieve the template arguments provided as part of this
   /// template-id.
   /// template-id.
-  const TemplateArgument *getTemplateArgs() const { 
+  const TemplateArgument *getTemplateArgs() const {
     return reinterpret_cast<const TemplateArgument *>(this + 1);
     return reinterpret_cast<const TemplateArgument *>(this + 1);
   }
   }
-  
+
   /// \brief Retrieve the number of template arguments provided as part of this
   /// \brief Retrieve the number of template arguments provided as part of this
   /// template-id.
   /// template-id.
   unsigned getNumTemplateArgs() const { return NumTemplateArgs; }
   unsigned getNumTemplateArgs() const { return NumTemplateArgs; }
-    
-  /// \brief Retrieve the location of the right angle bracket following the 
+
+  /// \brief Retrieve the location of the right angle bracket following the
   /// template arguments ('>').
   /// template arguments ('>').
   SourceLocation getRAngleLoc() const { return RAngleLoc; }
   SourceLocation getRAngleLoc() const { return RAngleLoc; }
-  
+
   virtual SourceRange getSourceRange() const {
   virtual SourceRange getSourceRange() const {
     return SourceRange(Qualifier? QualifierRange.getBegin() : TemplateNameLoc,
     return SourceRange(Qualifier? QualifierRange.getBegin() : TemplateNameLoc,
                        RAngleLoc);
                        RAngleLoc);
   }
   }
-  
+
   // Iterators
   // Iterators
   virtual child_iterator child_begin();
   virtual child_iterator child_begin();
   virtual child_iterator child_end();
   virtual child_iterator child_end();
-  
-  static bool classof(const Stmt *T) { 
+
+  static bool classof(const Stmt *T) {
     return T->getStmtClass() == TemplateIdRefExprClass;
     return T->getStmtClass() == TemplateIdRefExprClass;
   }
   }
   static bool classof(const TemplateIdRefExpr *) { return true; }
   static bool classof(const TemplateIdRefExpr *) { return true; }
 };
 };
-  
+
 class CXXExprWithTemporaries : public Expr {
 class CXXExprWithTemporaries : public Expr {
   Stmt *SubExpr;
   Stmt *SubExpr;
-    
+
   CXXTemporary **Temps;
   CXXTemporary **Temps;
   unsigned NumTemps;
   unsigned NumTemps;
 
 
   bool ShouldDestroyTemps;
   bool ShouldDestroyTemps;
-  
-  CXXExprWithTemporaries(Expr *SubExpr, CXXTemporary **Temps, 
+
+  CXXExprWithTemporaries(Expr *SubExpr, CXXTemporary **Temps,
                          unsigned NumTemps, bool ShouldDestroyTemps);
                          unsigned NumTemps, bool ShouldDestroyTemps);
   ~CXXExprWithTemporaries();
   ~CXXExprWithTemporaries();
 
 
@@ -1268,7 +1268,7 @@ public:
   static CXXExprWithTemporaries *Create(ASTContext &C, Expr *SubExpr,
   static CXXExprWithTemporaries *Create(ASTContext &C, Expr *SubExpr,
                                         CXXTemporary **Temps, unsigned NumTemps,
                                         CXXTemporary **Temps, unsigned NumTemps,
                                         bool ShouldDestroyTemporaries);
                                         bool ShouldDestroyTemporaries);
-  
+
   unsigned getNumTemporaries() const { return NumTemps; }
   unsigned getNumTemporaries() const { return NumTemps; }
   CXXTemporary *getTemporary(unsigned i) {
   CXXTemporary *getTemporary(unsigned i) {
     assert(i < NumTemps && "Index out of range");
     assert(i < NumTemps && "Index out of range");
@@ -1278,11 +1278,11 @@ public:
     assert(i < NumTemps && "Index out of range");
     assert(i < NumTemps && "Index out of range");
     return Temps[i];
     return Temps[i];
   }
   }
-  
+
   bool shouldDestroyTemporaries() const { return ShouldDestroyTemps; }
   bool shouldDestroyTemporaries() const { return ShouldDestroyTemps; }
-  
+
   void removeLastTemporary() { NumTemps--; }
   void removeLastTemporary() { NumTemps--; }
-  
+
   Expr *getSubExpr() { return cast<Expr>(SubExpr); }
   Expr *getSubExpr() { return cast<Expr>(SubExpr); }
   const Expr *getSubExpr() const { return cast<Expr>(SubExpr); }
   const Expr *getSubExpr() const { return cast<Expr>(SubExpr); }
   void setSubExpr(Expr *E) { SubExpr = E; }
   void setSubExpr(Expr *E) { SubExpr = E; }
@@ -1336,7 +1336,7 @@ class CXXUnresolvedConstructExpr : public Expr {
 
 
   /// \brief The number of arguments used to construct the type.
   /// \brief The number of arguments used to construct the type.
   unsigned NumArgs;
   unsigned NumArgs;
-  
+
   CXXUnresolvedConstructExpr(SourceLocation TyBegin,
   CXXUnresolvedConstructExpr(SourceLocation TyBegin,
                              QualType T,
                              QualType T,
                              SourceLocation LParenLoc,
                              SourceLocation LParenLoc,
@@ -1345,7 +1345,7 @@ class CXXUnresolvedConstructExpr : public Expr {
                              SourceLocation RParenLoc);
                              SourceLocation RParenLoc);
 
 
 public:
 public:
-  static CXXUnresolvedConstructExpr *Create(ASTContext &C, 
+  static CXXUnresolvedConstructExpr *Create(ASTContext &C,
                                             SourceLocation TyBegin,
                                             SourceLocation TyBegin,
                                             QualType T,
                                             QualType T,
                                             SourceLocation LParenLoc,
                                             SourceLocation LParenLoc,
@@ -1387,7 +1387,7 @@ public:
   virtual SourceRange getSourceRange() const {
   virtual SourceRange getSourceRange() const {
     return SourceRange(TyBeginLoc, RParenLoc);
     return SourceRange(TyBeginLoc, RParenLoc);
   }
   }
-  static bool classof(const Stmt *T) { 
+  static bool classof(const Stmt *T) {
     return T->getStmtClass() == CXXUnresolvedConstructExprClass;
     return T->getStmtClass() == CXXUnresolvedConstructExprClass;
   }
   }
   static bool classof(const CXXUnresolvedConstructExpr *) { return true; }
   static bool classof(const CXXUnresolvedConstructExpr *) { return true; }
@@ -1404,7 +1404,7 @@ class CXXUnresolvedMemberExpr : public Expr {
   /// \brief The expression for the base pointer or class reference,
   /// \brief The expression for the base pointer or class reference,
   /// e.g., the \c x in x.f.
   /// e.g., the \c x in x.f.
   Stmt *Base;
   Stmt *Base;
-  
+
   /// \brief Whether this member expression used the '->' operator or
   /// \brief Whether this member expression used the '->' operator or
   /// the '.' operator.
   /// the '.' operator.
   bool IsArrow : 1;
   bool IsArrow : 1;
@@ -1412,25 +1412,25 @@ class CXXUnresolvedMemberExpr : public Expr {
   /// \brief Whether this member expression has explicitly-specified template
   /// \brief Whether this member expression has explicitly-specified template
   /// arguments.
   /// arguments.
   bool HasExplicitTemplateArgumentList : 1;
   bool HasExplicitTemplateArgumentList : 1;
-  
+
   /// \brief The location of the '->' or '.' operator.
   /// \brief The location of the '->' or '.' operator.
   SourceLocation OperatorLoc;
   SourceLocation OperatorLoc;
 
 
   /// \brief The nested-name-specifier that precedes the member name, if any.
   /// \brief The nested-name-specifier that precedes the member name, if any.
   NestedNameSpecifier *Qualifier;
   NestedNameSpecifier *Qualifier;
-  
+
   /// \brief The source range covering the nested name specifier.
   /// \brief The source range covering the nested name specifier.
   SourceRange QualifierRange;
   SourceRange QualifierRange;
-  
+
   /// \brief In a qualified member access expression such as t->Base::f, this
   /// \brief In a qualified member access expression such as t->Base::f, this
-  /// member stores the resolves of name lookup in the context of the member 
+  /// member stores the resolves of name lookup in the context of the member
   /// access expression, to be used at instantiation time.
   /// access expression, to be used at instantiation time.
   ///
   ///
   /// FIXME: This member, along with the Qualifier and QualifierRange, could
   /// FIXME: This member, along with the Qualifier and QualifierRange, could
   /// be stuck into a structure that is optionally allocated at the end of
   /// be stuck into a structure that is optionally allocated at the end of
   /// the CXXUnresolvedMemberExpr, to save space in the common case.
   /// the CXXUnresolvedMemberExpr, to save space in the common case.
   NamedDecl *FirstQualifierFoundInScope;
   NamedDecl *FirstQualifierFoundInScope;
-  
+
   /// \brief The member to which this member expression refers, which
   /// \brief The member to which this member expression refers, which
   /// can be name, overloaded operator, or destructor.
   /// can be name, overloaded operator, or destructor.
   /// FIXME: could also be a template-id
   /// FIXME: could also be a template-id
@@ -1438,25 +1438,25 @@ class CXXUnresolvedMemberExpr : public Expr {
 
 
   /// \brief The location of the member name.
   /// \brief The location of the member name.
   SourceLocation MemberLoc;
   SourceLocation MemberLoc;
-  
+
   /// \brief Retrieve the explicit template argument list that followed the
   /// \brief Retrieve the explicit template argument list that followed the
   /// member template name, if any.
   /// member template name, if any.
   ExplicitTemplateArgumentList *getExplicitTemplateArgumentList() {
   ExplicitTemplateArgumentList *getExplicitTemplateArgumentList() {
     if (!HasExplicitTemplateArgumentList)
     if (!HasExplicitTemplateArgumentList)
       return 0;
       return 0;
-    
+
     return reinterpret_cast<ExplicitTemplateArgumentList *>(this + 1);
     return reinterpret_cast<ExplicitTemplateArgumentList *>(this + 1);
   }
   }
-  
+
   /// \brief Retrieve the explicit template argument list that followed the
   /// \brief Retrieve the explicit template argument list that followed the
   /// member template name, if any.
   /// member template name, if any.
   const ExplicitTemplateArgumentList *getExplicitTemplateArgumentList() const {
   const ExplicitTemplateArgumentList *getExplicitTemplateArgumentList() const {
     return const_cast<CXXUnresolvedMemberExpr *>(this)
     return const_cast<CXXUnresolvedMemberExpr *>(this)
              ->getExplicitTemplateArgumentList();
              ->getExplicitTemplateArgumentList();
   }
   }
-  
-  CXXUnresolvedMemberExpr(ASTContext &C, 
-                          Expr *Base, bool IsArrow, 
+
+  CXXUnresolvedMemberExpr(ASTContext &C,
+                          Expr *Base, bool IsArrow,
                           SourceLocation OperatorLoc,
                           SourceLocation OperatorLoc,
                           NestedNameSpecifier *Qualifier,
                           NestedNameSpecifier *Qualifier,
                           SourceRange QualifierRange,
                           SourceRange QualifierRange,
@@ -1468,10 +1468,10 @@ class CXXUnresolvedMemberExpr : public Expr {
                           const TemplateArgument *TemplateArgs,
                           const TemplateArgument *TemplateArgs,
                           unsigned NumTemplateArgs,
                           unsigned NumTemplateArgs,
                           SourceLocation RAngleLoc);
                           SourceLocation RAngleLoc);
-  
+
 public:
 public:
-  CXXUnresolvedMemberExpr(ASTContext &C, 
-                          Expr *Base, bool IsArrow, 
+  CXXUnresolvedMemberExpr(ASTContext &C,
+                          Expr *Base, bool IsArrow,
                           SourceLocation OperatorLoc,
                           SourceLocation OperatorLoc,
                           NestedNameSpecifier *Qualifier,
                           NestedNameSpecifier *Qualifier,
                           SourceRange QualifierRange,
                           SourceRange QualifierRange,
@@ -1484,10 +1484,10 @@ public:
     Qualifier(Qualifier), QualifierRange(QualifierRange),
     Qualifier(Qualifier), QualifierRange(QualifierRange),
     FirstQualifierFoundInScope(FirstQualifierFoundInScope),
     FirstQualifierFoundInScope(FirstQualifierFoundInScope),
     Member(Member), MemberLoc(MemberLoc) { }
     Member(Member), MemberLoc(MemberLoc) { }
-  
+
   static CXXUnresolvedMemberExpr *
   static CXXUnresolvedMemberExpr *
-  Create(ASTContext &C, 
-         Expr *Base, bool IsArrow, 
+  Create(ASTContext &C,
+         Expr *Base, bool IsArrow,
          SourceLocation OperatorLoc,
          SourceLocation OperatorLoc,
          NestedNameSpecifier *Qualifier,
          NestedNameSpecifier *Qualifier,
          SourceRange QualifierRange,
          SourceRange QualifierRange,
@@ -1499,7 +1499,7 @@ public:
          const TemplateArgument *TemplateArgs,
          const TemplateArgument *TemplateArgs,
          unsigned NumTemplateArgs,
          unsigned NumTemplateArgs,
          SourceLocation RAngleLoc);
          SourceLocation RAngleLoc);
-         
+
   /// \brief Retrieve the base object of this member expressions,
   /// \brief Retrieve the base object of this member expressions,
   /// e.g., the \c x in \c x.m.
   /// e.g., the \c x in \c x.m.
   Expr *getBase() { return cast<Expr>(Base); }
   Expr *getBase() { return cast<Expr>(Base); }
@@ -1517,26 +1517,26 @@ public:
   /// \brief Retrieve the nested-name-specifier that qualifies the member
   /// \brief Retrieve the nested-name-specifier that qualifies the member
   /// name.
   /// name.
   NestedNameSpecifier *getQualifier() const { return Qualifier; }
   NestedNameSpecifier *getQualifier() const { return Qualifier; }
-  
+
   /// \brief Retrieve the source range covering the nested-name-specifier
   /// \brief Retrieve the source range covering the nested-name-specifier
   /// that qualifies the member name.
   /// that qualifies the member name.
   SourceRange getQualifierRange() const { return QualifierRange; }
   SourceRange getQualifierRange() const { return QualifierRange; }
-  
+
   /// \brief Retrieve the first part of the nested-name-specifier that was
   /// \brief Retrieve the first part of the nested-name-specifier that was
   /// found in the scope of the member access expression when the member access
   /// found in the scope of the member access expression when the member access
   /// was initially parsed.
   /// was initially parsed.
   ///
   ///
   /// This function only returns a useful result when member access expression
   /// This function only returns a useful result when member access expression
-  /// uses a qualified member name, e.g., "x.Base::f". Here, the declaration 
-  /// returned by this function describes what was found by unqualified name 
+  /// uses a qualified member name, e.g., "x.Base::f". Here, the declaration
+  /// returned by this function describes what was found by unqualified name
   /// lookup for the identifier "Base" within the scope of the member access
   /// lookup for the identifier "Base" within the scope of the member access
   /// expression itself. At template instantiation time, this information is
   /// expression itself. At template instantiation time, this information is
   /// combined with the results of name lookup into the type of the object
   /// combined with the results of name lookup into the type of the object
   /// expression itself (the class type of x).
   /// expression itself (the class type of x).
-  NamedDecl *getFirstQualifierFoundInScope() const { 
+  NamedDecl *getFirstQualifierFoundInScope() const {
     return FirstQualifierFoundInScope;
     return FirstQualifierFoundInScope;
   }
   }
-  
+
   /// \brief Retrieve the name of the member that this expression
   /// \brief Retrieve the name of the member that this expression
   /// refers to.
   /// refers to.
   DeclarationName getMember() const { return Member; }
   DeclarationName getMember() const { return Member; }
@@ -1549,56 +1549,56 @@ public:
 
 
   /// \brief Determines whether this member expression actually had a C++
   /// \brief Determines whether this member expression actually had a C++
   /// template argument list explicitly specified, e.g., x.f<int>.
   /// template argument list explicitly specified, e.g., x.f<int>.
-  bool hasExplicitTemplateArgumentList() { 
-    return HasExplicitTemplateArgumentList; 
+  bool hasExplicitTemplateArgumentList() {
+    return HasExplicitTemplateArgumentList;
   }
   }
-  
-  /// \brief Retrieve the location of the left angle bracket following the 
+
+  /// \brief Retrieve the location of the left angle bracket following the
   /// member name ('<'), if any.
   /// member name ('<'), if any.
-  SourceLocation getLAngleLoc() const { 
+  SourceLocation getLAngleLoc() const {
     if (!HasExplicitTemplateArgumentList)
     if (!HasExplicitTemplateArgumentList)
       return SourceLocation();
       return SourceLocation();
-    
+
     return getExplicitTemplateArgumentList()->LAngleLoc;
     return getExplicitTemplateArgumentList()->LAngleLoc;
   }
   }
-  
+
   /// \brief Retrieve the template arguments provided as part of this
   /// \brief Retrieve the template arguments provided as part of this
   /// template-id.
   /// template-id.
-  const TemplateArgument *getTemplateArgs() const { 
+  const TemplateArgument *getTemplateArgs() const {
     if (!HasExplicitTemplateArgumentList)
     if (!HasExplicitTemplateArgumentList)
-      return 0;   
-    
+      return 0;
+
     return getExplicitTemplateArgumentList()->getTemplateArgs();
     return getExplicitTemplateArgumentList()->getTemplateArgs();
   }
   }
-  
+
   /// \brief Retrieve the number of template arguments provided as part of this
   /// \brief Retrieve the number of template arguments provided as part of this
   /// template-id.
   /// template-id.
-  unsigned getNumTemplateArgs() const { 
+  unsigned getNumTemplateArgs() const {
     if (!HasExplicitTemplateArgumentList)
     if (!HasExplicitTemplateArgumentList)
-      return 0;   
-    
+      return 0;
+
     return getExplicitTemplateArgumentList()->NumTemplateArgs;
     return getExplicitTemplateArgumentList()->NumTemplateArgs;
   }
   }
-  
-  /// \brief Retrieve the location of the right angle bracket following the 
+
+  /// \brief Retrieve the location of the right angle bracket following the
   /// template arguments ('>').
   /// template arguments ('>').
-  SourceLocation getRAngleLoc() const { 
+  SourceLocation getRAngleLoc() const {
     if (!HasExplicitTemplateArgumentList)
     if (!HasExplicitTemplateArgumentList)
       return SourceLocation();
       return SourceLocation();
-    
+
     return getExplicitTemplateArgumentList()->RAngleLoc;
     return getExplicitTemplateArgumentList()->RAngleLoc;
   }
   }
-  
+
   virtual SourceRange getSourceRange() const {
   virtual SourceRange getSourceRange() const {
     if (HasExplicitTemplateArgumentList)
     if (HasExplicitTemplateArgumentList)
       return SourceRange(Base->getSourceRange().getBegin(),
       return SourceRange(Base->getSourceRange().getBegin(),
                          getRAngleLoc());
                          getRAngleLoc());
-    
+
     return SourceRange(Base->getSourceRange().getBegin(),
     return SourceRange(Base->getSourceRange().getBegin(),
                        MemberLoc);
                        MemberLoc);
   }
   }
-  
-  static bool classof(const Stmt *T) { 
+
+  static bool classof(const Stmt *T) {
     return T->getStmtClass() == CXXUnresolvedMemberExprClass;
     return T->getStmtClass() == CXXUnresolvedMemberExprClass;
   }
   }
   static bool classof(const CXXUnresolvedMemberExpr *) { return true; }
   static bool classof(const CXXUnresolvedMemberExpr *) { return true; }

+ 102 - 102
include/clang/AST/ExprObjC.h

@@ -22,7 +22,7 @@ namespace clang {
   class ASTContext;
   class ASTContext;
   class ObjCMethodDecl;
   class ObjCMethodDecl;
   class ObjCPropertyDecl;
   class ObjCPropertyDecl;
-  
+
 /// ObjCStringLiteral, used for Objective-C string literals
 /// ObjCStringLiteral, used for Objective-C string literals
 /// i.e. @"foo".
 /// i.e. @"foo".
 class ObjCStringLiteral : public Expr {
 class ObjCStringLiteral : public Expr {
@@ -41,20 +41,20 @@ public:
   SourceLocation getAtLoc() const { return AtLoc; }
   SourceLocation getAtLoc() const { return AtLoc; }
   void setAtLoc(SourceLocation L) { AtLoc = L; }
   void setAtLoc(SourceLocation L) { AtLoc = L; }
 
 
-  virtual SourceRange getSourceRange() const { 
+  virtual SourceRange getSourceRange() const {
     return SourceRange(AtLoc, String->getLocEnd());
     return SourceRange(AtLoc, String->getLocEnd());
   }
   }
-  
-  static bool classof(const Stmt *T) { 
-    return T->getStmtClass() == ObjCStringLiteralClass; 
+
+  static bool classof(const Stmt *T) {
+    return T->getStmtClass() == ObjCStringLiteralClass;
   }
   }
-  static bool classof(const ObjCStringLiteral *) { return true; }  
-  
+  static bool classof(const ObjCStringLiteral *) { return true; }
+
   // Iterators
   // Iterators
   virtual child_iterator child_begin();
   virtual child_iterator child_begin();
   virtual child_iterator child_end();
   virtual child_iterator child_end();
 };
 };
-  
+
 /// ObjCEncodeExpr, used for @encode in Objective-C.  @encode has the same type
 /// ObjCEncodeExpr, used for @encode in Objective-C.  @encode has the same type
 /// and behavior as StringLiteral except that the string initializer is obtained
 /// and behavior as StringLiteral except that the string initializer is obtained
 /// from ASTContext with the encoding type as an argument.
 /// from ASTContext with the encoding type as an argument.
@@ -62,32 +62,32 @@ class ObjCEncodeExpr : public Expr {
   QualType EncType;
   QualType EncType;
   SourceLocation AtLoc, RParenLoc;
   SourceLocation AtLoc, RParenLoc;
 public:
 public:
-  ObjCEncodeExpr(QualType T, QualType ET, 
+  ObjCEncodeExpr(QualType T, QualType ET,
                  SourceLocation at, SourceLocation rp)
                  SourceLocation at, SourceLocation rp)
-    : Expr(ObjCEncodeExprClass, T, ET->isDependentType(), 
+    : Expr(ObjCEncodeExprClass, T, ET->isDependentType(),
            ET->isDependentType()), EncType(ET), AtLoc(at), RParenLoc(rp) {}
            ET->isDependentType()), EncType(ET), AtLoc(at), RParenLoc(rp) {}
-  
+
   explicit ObjCEncodeExpr(EmptyShell Empty) : Expr(ObjCEncodeExprClass, Empty){}
   explicit ObjCEncodeExpr(EmptyShell Empty) : Expr(ObjCEncodeExprClass, Empty){}
 
 
-  
+
   SourceLocation getAtLoc() const { return AtLoc; }
   SourceLocation getAtLoc() const { return AtLoc; }
   void setAtLoc(SourceLocation L) { AtLoc = L; }
   void setAtLoc(SourceLocation L) { AtLoc = L; }
   SourceLocation getRParenLoc() const { return RParenLoc; }
   SourceLocation getRParenLoc() const { return RParenLoc; }
   void setRParenLoc(SourceLocation L) { RParenLoc = L; }
   void setRParenLoc(SourceLocation L) { RParenLoc = L; }
-  
+
   QualType getEncodedType() const { return EncType; }
   QualType getEncodedType() const { return EncType; }
   void setEncodedType(QualType T) { EncType = T; }
   void setEncodedType(QualType T) { EncType = T; }
 
 
-  
+
   virtual SourceRange getSourceRange() const {
   virtual SourceRange getSourceRange() const {
     return SourceRange(AtLoc, RParenLoc);
     return SourceRange(AtLoc, RParenLoc);
   }
   }
-  
+
   static bool classof(const Stmt *T) {
   static bool classof(const Stmt *T) {
     return T->getStmtClass() == ObjCEncodeExprClass;
     return T->getStmtClass() == ObjCEncodeExprClass;
   }
   }
   static bool classof(const ObjCEncodeExpr *) { return true; }
   static bool classof(const ObjCEncodeExpr *) { return true; }
-  
+
   // Iterators
   // Iterators
   virtual child_iterator child_begin();
   virtual child_iterator child_begin();
   virtual child_iterator child_end();
   virtual child_iterator child_end();
@@ -106,7 +106,7 @@ public:
 
 
   Selector getSelector() const { return SelName; }
   Selector getSelector() const { return SelName; }
   void setSelector(Selector S) { SelName = S; }
   void setSelector(Selector S) { SelName = S; }
-  
+
   SourceLocation getAtLoc() const { return AtLoc; }
   SourceLocation getAtLoc() const { return AtLoc; }
   SourceLocation getRParenLoc() const { return RParenLoc; }
   SourceLocation getRParenLoc() const { return RParenLoc; }
   void setAtLoc(SourceLocation L) { AtLoc = L; }
   void setAtLoc(SourceLocation L) { AtLoc = L; }
@@ -115,26 +115,26 @@ public:
   virtual SourceRange getSourceRange() const {
   virtual SourceRange getSourceRange() const {
     return SourceRange(AtLoc, RParenLoc);
     return SourceRange(AtLoc, RParenLoc);
   }
   }
-  
+
   /// getNumArgs - Return the number of actual arguments to this call.
   /// getNumArgs - Return the number of actual arguments to this call.
   unsigned getNumArgs() const { return SelName.getNumArgs(); }
   unsigned getNumArgs() const { return SelName.getNumArgs(); }
-  
+
   static bool classof(const Stmt *T) {
   static bool classof(const Stmt *T) {
     return T->getStmtClass() == ObjCSelectorExprClass;
     return T->getStmtClass() == ObjCSelectorExprClass;
   }
   }
   static bool classof(const ObjCSelectorExpr *) { return true; }
   static bool classof(const ObjCSelectorExpr *) { return true; }
-  
+
   // Iterators
   // Iterators
   virtual child_iterator child_begin();
   virtual child_iterator child_begin();
   virtual child_iterator child_end();
   virtual child_iterator child_end();
 };
 };
-  
+
 /// ObjCProtocolExpr used for protocol expression in Objective-C.  This is used
 /// ObjCProtocolExpr used for protocol expression in Objective-C.  This is used
 /// as: @protocol(foo), as in:
 /// as: @protocol(foo), as in:
 ///   obj conformsToProtocol:@protocol(foo)]
 ///   obj conformsToProtocol:@protocol(foo)]
 /// The return type is "Protocol*".
 /// The return type is "Protocol*".
-class ObjCProtocolExpr : public Expr {    
-  ObjCProtocolDecl *TheProtocol;    
+class ObjCProtocolExpr : public Expr {
+  ObjCProtocolDecl *TheProtocol;
   SourceLocation AtLoc, RParenLoc;
   SourceLocation AtLoc, RParenLoc;
 public:
 public:
   ObjCProtocolExpr(QualType T, ObjCProtocolDecl *protocol,
   ObjCProtocolExpr(QualType T, ObjCProtocolDecl *protocol,
@@ -146,7 +146,7 @@ public:
 
 
   ObjCProtocolDecl *getProtocol() const { return TheProtocol; }
   ObjCProtocolDecl *getProtocol() const { return TheProtocol; }
   void setProtocol(ObjCProtocolDecl *P) { TheProtocol = P; }
   void setProtocol(ObjCProtocolDecl *P) { TheProtocol = P; }
-    
+
   SourceLocation getAtLoc() const { return AtLoc; }
   SourceLocation getAtLoc() const { return AtLoc; }
   SourceLocation getRParenLoc() const { return RParenLoc; }
   SourceLocation getRParenLoc() const { return RParenLoc; }
   void setAtLoc(SourceLocation L) { AtLoc = L; }
   void setAtLoc(SourceLocation L) { AtLoc = L; }
@@ -155,12 +155,12 @@ public:
   virtual SourceRange getSourceRange() const {
   virtual SourceRange getSourceRange() const {
     return SourceRange(AtLoc, RParenLoc);
     return SourceRange(AtLoc, RParenLoc);
   }
   }
-        
+
   static bool classof(const Stmt *T) {
   static bool classof(const Stmt *T) {
     return T->getStmtClass() == ObjCProtocolExprClass;
     return T->getStmtClass() == ObjCProtocolExprClass;
   }
   }
   static bool classof(const ObjCProtocolExpr *) { return true; }
   static bool classof(const ObjCProtocolExpr *) { return true; }
-    
+
   // Iterators
   // Iterators
   virtual child_iterator child_begin();
   virtual child_iterator child_begin();
   virtual child_iterator child_end();
   virtual child_iterator child_end();
@@ -173,44 +173,44 @@ class ObjCIvarRefExpr : public Expr {
   Stmt *Base;
   Stmt *Base;
   bool IsArrow:1;      // True if this is "X->F", false if this is "X.F".
   bool IsArrow:1;      // True if this is "X->F", false if this is "X.F".
   bool IsFreeIvar:1;   // True if ivar reference has no base (self assumed).
   bool IsFreeIvar:1;   // True if ivar reference has no base (self assumed).
-  
+
 public:
 public:
   ObjCIvarRefExpr(ObjCIvarDecl *d,
   ObjCIvarRefExpr(ObjCIvarDecl *d,
-                  QualType t, SourceLocation l, Expr *base=0, 
-                  bool arrow = false, bool freeIvar = false) : 
+                  QualType t, SourceLocation l, Expr *base=0,
+                  bool arrow = false, bool freeIvar = false) :
     Expr(ObjCIvarRefExprClass, t), D(d),
     Expr(ObjCIvarRefExprClass, t), D(d),
     Loc(l), Base(base), IsArrow(arrow),
     Loc(l), Base(base), IsArrow(arrow),
     IsFreeIvar(freeIvar) {}
     IsFreeIvar(freeIvar) {}
-  
+
   explicit ObjCIvarRefExpr(EmptyShell Empty)
   explicit ObjCIvarRefExpr(EmptyShell Empty)
     : Expr(ObjCIvarRefExprClass, Empty) {}
     : Expr(ObjCIvarRefExprClass, Empty) {}
 
 
   ObjCIvarDecl *getDecl() { return D; }
   ObjCIvarDecl *getDecl() { return D; }
   const ObjCIvarDecl *getDecl() const { return D; }
   const ObjCIvarDecl *getDecl() const { return D; }
   void setDecl(ObjCIvarDecl *d) { D = d; }
   void setDecl(ObjCIvarDecl *d) { D = d; }
-  
+
   const Expr *getBase() const { return cast<Expr>(Base); }
   const Expr *getBase() const { return cast<Expr>(Base); }
   Expr *getBase() { return cast<Expr>(Base); }
   Expr *getBase() { return cast<Expr>(Base); }
   void setBase(Expr * base) { Base = base; }
   void setBase(Expr * base) { Base = base; }
-  
+
   bool isArrow() const { return IsArrow; }
   bool isArrow() const { return IsArrow; }
   bool isFreeIvar() const { return IsFreeIvar; }
   bool isFreeIvar() const { return IsFreeIvar; }
   void setIsArrow(bool A) { IsArrow = A; }
   void setIsArrow(bool A) { IsArrow = A; }
   void setIsFreeIvar(bool A) { IsFreeIvar = A; }
   void setIsFreeIvar(bool A) { IsFreeIvar = A; }
-  
+
   SourceLocation getLocation() const { return Loc; }
   SourceLocation getLocation() const { return Loc; }
   void setLocation(SourceLocation L) { Loc = L; }
   void setLocation(SourceLocation L) { Loc = L; }
 
 
-  virtual SourceRange getSourceRange() const { 
+  virtual SourceRange getSourceRange() const {
     return isFreeIvar() ? SourceRange(Loc)
     return isFreeIvar() ? SourceRange(Loc)
-    : SourceRange(getBase()->getLocStart(), Loc); 
+    : SourceRange(getBase()->getLocStart(), Loc);
   }
   }
-  
-  static bool classof(const Stmt *T) { 
-    return T->getStmtClass() == ObjCIvarRefExprClass; 
+
+  static bool classof(const Stmt *T) {
+    return T->getStmtClass() == ObjCIvarRefExprClass;
   }
   }
   static bool classof(const ObjCIvarRefExpr *) { return true; }
   static bool classof(const ObjCIvarRefExpr *) { return true; }
-  
+
   // Iterators
   // Iterators
   virtual child_iterator child_begin();
   virtual child_iterator child_begin();
   virtual child_iterator child_end();
   virtual child_iterator child_end();
@@ -225,48 +225,48 @@ private:
   SourceLocation IdLoc;
   SourceLocation IdLoc;
   Stmt *Base;
   Stmt *Base;
 public:
 public:
-  ObjCPropertyRefExpr(ObjCPropertyDecl *PD, QualType t, 
+  ObjCPropertyRefExpr(ObjCPropertyDecl *PD, QualType t,
                       SourceLocation l, Expr *base)
                       SourceLocation l, Expr *base)
     : Expr(ObjCPropertyRefExprClass, t), AsProperty(PD), IdLoc(l), Base(base) {
     : Expr(ObjCPropertyRefExprClass, t), AsProperty(PD), IdLoc(l), Base(base) {
   }
   }
-  
+
   explicit ObjCPropertyRefExpr(EmptyShell Empty)
   explicit ObjCPropertyRefExpr(EmptyShell Empty)
     : Expr(ObjCPropertyRefExprClass, Empty) {}
     : Expr(ObjCPropertyRefExprClass, Empty) {}
 
 
   ObjCPropertyDecl *getProperty() const { return AsProperty; }
   ObjCPropertyDecl *getProperty() const { return AsProperty; }
   void setProperty(ObjCPropertyDecl *D) { AsProperty = D; }
   void setProperty(ObjCPropertyDecl *D) { AsProperty = D; }
-  
+
   const Expr *getBase() const { return cast<Expr>(Base); }
   const Expr *getBase() const { return cast<Expr>(Base); }
   Expr *getBase() { return cast<Expr>(Base); }
   Expr *getBase() { return cast<Expr>(Base); }
   void setBase(Expr *base) { Base = base; }
   void setBase(Expr *base) { Base = base; }
-  
+
   SourceLocation getLocation() const { return IdLoc; }
   SourceLocation getLocation() const { return IdLoc; }
   void setLocation(SourceLocation L) { IdLoc = L; }
   void setLocation(SourceLocation L) { IdLoc = L; }
 
 
   virtual SourceRange getSourceRange() const {
   virtual SourceRange getSourceRange() const {
     return SourceRange(getBase()->getLocStart(), IdLoc);
     return SourceRange(getBase()->getLocStart(), IdLoc);
   }
   }
-  
-  static bool classof(const Stmt *T) { 
-    return T->getStmtClass() == ObjCPropertyRefExprClass; 
+
+  static bool classof(const Stmt *T) {
+    return T->getStmtClass() == ObjCPropertyRefExprClass;
   }
   }
   static bool classof(const ObjCPropertyRefExpr *) { return true; }
   static bool classof(const ObjCPropertyRefExpr *) { return true; }
-  
+
   // Iterators
   // Iterators
   virtual child_iterator child_begin();
   virtual child_iterator child_begin();
   virtual child_iterator child_end();
   virtual child_iterator child_end();
 };
 };
 
 
-/// ObjCImplicitSetterGetterRefExpr - A dot-syntax expression to access two 
-/// methods; one to set a value to an 'ivar' (Setter) and the other to access 
-/// an 'ivar' (Setter). 
+/// ObjCImplicitSetterGetterRefExpr - A dot-syntax expression to access two
+/// methods; one to set a value to an 'ivar' (Setter) and the other to access
+/// an 'ivar' (Setter).
 /// An example for use of this AST is:
 /// An example for use of this AST is:
 /// @code
 /// @code
 ///  @interface Test { }
 ///  @interface Test { }
 ///  - (Test *)crash;
 ///  - (Test *)crash;
 ///  - (void)setCrash: (Test*)value;
 ///  - (void)setCrash: (Test*)value;
 /// @end
 /// @end
-/// void  foo(Test *p1, Test *p2) 
+/// void  foo(Test *p1, Test *p2)
 /// {
 /// {
 ///    p2.crash  = p1.crash; // Uses ObjCImplicitSetterGetterRefExpr AST
 ///    p2.crash  = p1.crash; // Uses ObjCImplicitSetterGetterRefExpr AST
 /// }
 /// }
@@ -285,10 +285,10 @@ class ObjCImplicitSetterGetterRefExpr : public Expr {
   /// Location of the receiver class in the dot syntax notation
   /// Location of the receiver class in the dot syntax notation
   /// used to call a class method setter/getter.
   /// used to call a class method setter/getter.
   SourceLocation ClassLoc;
   SourceLocation ClassLoc;
-    
+
 public:
 public:
   ObjCImplicitSetterGetterRefExpr(ObjCMethodDecl *getter,
   ObjCImplicitSetterGetterRefExpr(ObjCMethodDecl *getter,
-                 QualType t, 
+                 QualType t,
                  ObjCMethodDecl *setter,
                  ObjCMethodDecl *setter,
                  SourceLocation l, Expr *base)
                  SourceLocation l, Expr *base)
     : Expr(ObjCImplicitSetterGetterRefExprClass, t), Setter(setter),
     : Expr(ObjCImplicitSetterGetterRefExprClass, t), Setter(setter),
@@ -296,13 +296,13 @@ public:
       ClassLoc(SourceLocation()) {
       ClassLoc(SourceLocation()) {
     }
     }
   ObjCImplicitSetterGetterRefExpr(ObjCMethodDecl *getter,
   ObjCImplicitSetterGetterRefExpr(ObjCMethodDecl *getter,
-                 QualType t, 
+                 QualType t,
                  ObjCMethodDecl *setter,
                  ObjCMethodDecl *setter,
                  SourceLocation l, ObjCInterfaceDecl *C, SourceLocation CL)
                  SourceLocation l, ObjCInterfaceDecl *C, SourceLocation CL)
     : Expr(ObjCImplicitSetterGetterRefExprClass, t), Setter(setter),
     : Expr(ObjCImplicitSetterGetterRefExprClass, t), Setter(setter),
       Getter(getter), MemberLoc(l), Base(0), InterfaceDecl(C), ClassLoc(CL) {
       Getter(getter), MemberLoc(l), Base(0), InterfaceDecl(C), ClassLoc(CL) {
     }
     }
-  explicit ObjCImplicitSetterGetterRefExpr(EmptyShell Empty) 
+  explicit ObjCImplicitSetterGetterRefExpr(EmptyShell Empty)
            : Expr(ObjCImplicitSetterGetterRefExprClass, Empty){}
            : Expr(ObjCImplicitSetterGetterRefExprClass, Empty){}
 
 
   ObjCMethodDecl *getGetterMethod() const { return Getter; }
   ObjCMethodDecl *getGetterMethod() const { return Getter; }
@@ -311,7 +311,7 @@ public:
   void setGetterMethod(ObjCMethodDecl *D) { Getter = D; }
   void setGetterMethod(ObjCMethodDecl *D) { Getter = D; }
   void setSetterMethod(ObjCMethodDecl *D) { Setter = D; }
   void setSetterMethod(ObjCMethodDecl *D) { Setter = D; }
   void setInterfaceDecl(ObjCInterfaceDecl *D) { InterfaceDecl = D; }
   void setInterfaceDecl(ObjCInterfaceDecl *D) { InterfaceDecl = D; }
-  
+
   virtual SourceRange getSourceRange() const {
   virtual SourceRange getSourceRange() const {
     if (Base)
     if (Base)
       return SourceRange(getBase()->getLocStart(), MemberLoc);
       return SourceRange(getBase()->getLocStart(), MemberLoc);
@@ -320,34 +320,34 @@ public:
   const Expr *getBase() const { return cast_or_null<Expr>(Base); }
   const Expr *getBase() const { return cast_or_null<Expr>(Base); }
   Expr *getBase() { return cast_or_null<Expr>(Base); }
   Expr *getBase() { return cast_or_null<Expr>(Base); }
   void setBase(Expr *base) { Base = base; }
   void setBase(Expr *base) { Base = base; }
-    
+
   SourceLocation getLocation() const { return MemberLoc; }
   SourceLocation getLocation() const { return MemberLoc; }
   void setLocation(SourceLocation L) { MemberLoc = L; }
   void setLocation(SourceLocation L) { MemberLoc = L; }
   SourceLocation getClassLoc() const { return ClassLoc; }
   SourceLocation getClassLoc() const { return ClassLoc; }
   void setClassLoc(SourceLocation L) { ClassLoc = L; }
   void setClassLoc(SourceLocation L) { ClassLoc = L; }
-    
-  static bool classof(const Stmt *T) { 
-    return T->getStmtClass() == ObjCImplicitSetterGetterRefExprClass; 
+
+  static bool classof(const Stmt *T) {
+    return T->getStmtClass() == ObjCImplicitSetterGetterRefExprClass;
   }
   }
   static bool classof(const ObjCImplicitSetterGetterRefExpr *) { return true; }
   static bool classof(const ObjCImplicitSetterGetterRefExpr *) { return true; }
-    
+
   // Iterators
   // Iterators
   virtual child_iterator child_begin();
   virtual child_iterator child_begin();
   virtual child_iterator child_end();
   virtual child_iterator child_end();
 };
 };
-  
+
 class ObjCMessageExpr : public Expr {
 class ObjCMessageExpr : public Expr {
   // SubExprs - The receiver and arguments of the message expression.
   // SubExprs - The receiver and arguments of the message expression.
   Stmt **SubExprs;
   Stmt **SubExprs;
-  
+
   // NumArgs - The number of arguments (not including the receiver) to the
   // NumArgs - The number of arguments (not including the receiver) to the
   //  message expression.
   //  message expression.
   unsigned NumArgs;
   unsigned NumArgs;
-  
+
   // A unigue name for this message.
   // A unigue name for this message.
   Selector SelName;
   Selector SelName;
-  
-  // A method prototype for this message (optional). 
+
+  // A method prototype for this message (optional).
   // FIXME: Since method decls contain the selector, and most messages have a
   // FIXME: Since method decls contain the selector, and most messages have a
   // prototype, consider devising a scheme for unifying SelName/MethodProto.
   // prototype, consider devising a scheme for unifying SelName/MethodProto.
   ObjCMethodDecl *MethodProto;
   ObjCMethodDecl *MethodProto;
@@ -360,7 +360,7 @@ class ObjCMessageExpr : public Expr {
   // Bit-swizzling flags.
   // Bit-swizzling flags.
   enum { IsInstMeth=0, IsClsMethDeclUnknown, IsClsMethDeclKnown, Flags=0x3 };
   enum { IsInstMeth=0, IsClsMethDeclUnknown, IsClsMethDeclKnown, Flags=0x3 };
   unsigned getFlag() const { return (uintptr_t) SubExprs[RECEIVER] & Flags; }
   unsigned getFlag() const { return (uintptr_t) SubExprs[RECEIVER] & Flags; }
-  
+
 public:
 public:
   /// This constructor is used to represent class messages where the
   /// This constructor is used to represent class messages where the
   /// ObjCInterfaceDecl* of the receiver is not known.
   /// ObjCInterfaceDecl* of the receiver is not known.
@@ -376,28 +376,28 @@ public:
                   QualType retType, ObjCMethodDecl *methDecl,
                   QualType retType, ObjCMethodDecl *methDecl,
                   SourceLocation LBrac, SourceLocation RBrac,
                   SourceLocation LBrac, SourceLocation RBrac,
                   Expr **ArgExprs, unsigned NumArgs);
                   Expr **ArgExprs, unsigned NumArgs);
-  
+
   // constructor for instance messages.
   // constructor for instance messages.
   ObjCMessageExpr(Expr *receiver, Selector selInfo,
   ObjCMessageExpr(Expr *receiver, Selector selInfo,
                   QualType retType, ObjCMethodDecl *methDecl,
                   QualType retType, ObjCMethodDecl *methDecl,
                   SourceLocation LBrac, SourceLocation RBrac,
                   SourceLocation LBrac, SourceLocation RBrac,
                   Expr **ArgExprs, unsigned NumArgs);
                   Expr **ArgExprs, unsigned NumArgs);
-                  
+
   explicit ObjCMessageExpr(EmptyShell Empty)
   explicit ObjCMessageExpr(EmptyShell Empty)
     : Expr(ObjCMessageExprClass, Empty), SubExprs(0), NumArgs(0) {}
     : Expr(ObjCMessageExprClass, Empty), SubExprs(0), NumArgs(0) {}
-  
+
   ~ObjCMessageExpr() {
   ~ObjCMessageExpr() {
     delete [] SubExprs;
     delete [] SubExprs;
   }
   }
-  
+
   /// getReceiver - Returns the receiver of the message expression.
   /// getReceiver - Returns the receiver of the message expression.
   ///  This can be NULL if the message is for class methods.  For
   ///  This can be NULL if the message is for class methods.  For
   ///  class methods, use getClassName.
   ///  class methods, use getClassName.
   /// FIXME: need to handle/detect 'super' usage within a class method.
   /// FIXME: need to handle/detect 'super' usage within a class method.
-  Expr *getReceiver() { 
+  Expr *getReceiver() {
     uintptr_t x = (uintptr_t) SubExprs[RECEIVER];
     uintptr_t x = (uintptr_t) SubExprs[RECEIVER];
     return (x & Flags) == IsInstMeth ? (Expr*) x : 0;
     return (x & Flags) == IsInstMeth ? (Expr*) x : 0;
-  }  
+  }
   const Expr *getReceiver() const {
   const Expr *getReceiver() const {
     return const_cast<ObjCMessageExpr*>(this)->getReceiver();
     return const_cast<ObjCMessageExpr*>(this)->getReceiver();
   }
   }
@@ -405,36 +405,36 @@ public:
   void setReceiver(Expr *rec) { SubExprs[RECEIVER] = rec; }
   void setReceiver(Expr *rec) { SubExprs[RECEIVER] = rec; }
   Selector getSelector() const { return SelName; }
   Selector getSelector() const { return SelName; }
   void setSelector(Selector S) { SelName = S; }
   void setSelector(Selector S) { SelName = S; }
-  
+
   const ObjCMethodDecl *getMethodDecl() const { return MethodProto; }
   const ObjCMethodDecl *getMethodDecl() const { return MethodProto; }
   ObjCMethodDecl *getMethodDecl() { return MethodProto; }
   ObjCMethodDecl *getMethodDecl() { return MethodProto; }
   void setMethodDecl(ObjCMethodDecl *MD) { MethodProto = MD; }
   void setMethodDecl(ObjCMethodDecl *MD) { MethodProto = MD; }
-  
+
   typedef std::pair<ObjCInterfaceDecl*, IdentifierInfo*> ClassInfo;
   typedef std::pair<ObjCInterfaceDecl*, IdentifierInfo*> ClassInfo;
-  
+
   /// getClassInfo - For class methods, this returns both the ObjCInterfaceDecl*
   /// getClassInfo - For class methods, this returns both the ObjCInterfaceDecl*
   ///  and IdentifierInfo* of the invoked class.  Both can be NULL if this
   ///  and IdentifierInfo* of the invoked class.  Both can be NULL if this
   ///  is an instance message, and the ObjCInterfaceDecl* can be NULL if none
   ///  is an instance message, and the ObjCInterfaceDecl* can be NULL if none
-  ///  was available when this ObjCMessageExpr object was constructed.  
-  ClassInfo getClassInfo() const; 
+  ///  was available when this ObjCMessageExpr object was constructed.
+  ClassInfo getClassInfo() const;
   void setClassInfo(const ClassInfo &C);
   void setClassInfo(const ClassInfo &C);
-  
+
   /// getClassName - For class methods, this returns the invoked class,
   /// getClassName - For class methods, this returns the invoked class,
-  ///  and returns NULL otherwise.  For instance methods, use getReceiver.  
+  ///  and returns NULL otherwise.  For instance methods, use getReceiver.
   IdentifierInfo *getClassName() const {
   IdentifierInfo *getClassName() const {
     return getClassInfo().second;
     return getClassInfo().second;
   }
   }
-  
+
   /// getNumArgs - Return the number of actual arguments to this call.
   /// getNumArgs - Return the number of actual arguments to this call.
   unsigned getNumArgs() const { return NumArgs; }
   unsigned getNumArgs() const { return NumArgs; }
-  void setNumArgs(unsigned nArgs) { 
-    NumArgs = nArgs; 
+  void setNumArgs(unsigned nArgs) {
+    NumArgs = nArgs;
     // FIXME: should always allocate SubExprs via the ASTContext's
     // FIXME: should always allocate SubExprs via the ASTContext's
     // allocator.
     // allocator.
     if (!SubExprs)
     if (!SubExprs)
       SubExprs = new Stmt* [NumArgs + 1];
       SubExprs = new Stmt* [NumArgs + 1];
   }
   }
-  
+
   /// getArg - Return the specified argument.
   /// getArg - Return the specified argument.
   Expr *getArg(unsigned Arg) {
   Expr *getArg(unsigned Arg) {
     assert(Arg < NumArgs && "Arg access out of range!");
     assert(Arg < NumArgs && "Arg access out of range!");
@@ -449,13 +449,13 @@ public:
     assert(Arg < NumArgs && "Arg access out of range!");
     assert(Arg < NumArgs && "Arg access out of range!");
     SubExprs[Arg+ARGS_START] = ArgExpr;
     SubExprs[Arg+ARGS_START] = ArgExpr;
   }
   }
-  
+
   SourceLocation getLeftLoc() const { return LBracloc; }
   SourceLocation getLeftLoc() const { return LBracloc; }
   SourceLocation getRightLoc() const { return RBracloc; }
   SourceLocation getRightLoc() const { return RBracloc; }
 
 
   void setLeftLoc(SourceLocation L) { LBracloc = L; }
   void setLeftLoc(SourceLocation L) { LBracloc = L; }
   void setRightLoc(SourceLocation L) { RBracloc = L; }
   void setRightLoc(SourceLocation L) { RBracloc = L; }
-  
+
   void setSourceRange(SourceRange R) {
   void setSourceRange(SourceRange R) {
     LBracloc = R.getBegin();
     LBracloc = R.getBegin();
     RBracloc = R.getEnd();
     RBracloc = R.getEnd();
@@ -468,14 +468,14 @@ public:
     return T->getStmtClass() == ObjCMessageExprClass;
     return T->getStmtClass() == ObjCMessageExprClass;
   }
   }
   static bool classof(const ObjCMessageExpr *) { return true; }
   static bool classof(const ObjCMessageExpr *) { return true; }
-  
+
   // Iterators
   // Iterators
   virtual child_iterator child_begin();
   virtual child_iterator child_begin();
   virtual child_iterator child_end();
   virtual child_iterator child_end();
-  
+
   typedef ExprIterator arg_iterator;
   typedef ExprIterator arg_iterator;
   typedef ConstExprIterator const_arg_iterator;
   typedef ConstExprIterator const_arg_iterator;
-  
+
   arg_iterator arg_begin() { return &SubExprs[ARGS_START]; }
   arg_iterator arg_begin() { return &SubExprs[ARGS_START]; }
   arg_iterator arg_end()   { return &SubExprs[ARGS_START] + NumArgs; }
   arg_iterator arg_end()   { return &SubExprs[ARGS_START] + NumArgs; }
   const_arg_iterator arg_begin() const { return &SubExprs[ARGS_START]; }
   const_arg_iterator arg_begin() const { return &SubExprs[ARGS_START]; }
@@ -487,16 +487,16 @@ public:
 class ObjCSuperExpr : public Expr {
 class ObjCSuperExpr : public Expr {
   SourceLocation Loc;
   SourceLocation Loc;
 public:
 public:
-  ObjCSuperExpr(SourceLocation L, QualType Type) 
+  ObjCSuperExpr(SourceLocation L, QualType Type)
     : Expr(ObjCSuperExprClass, Type), Loc(L) { }
     : Expr(ObjCSuperExprClass, Type), Loc(L) { }
   explicit ObjCSuperExpr(EmptyShell Empty) : Expr(ObjCSuperExprClass, Empty) {}
   explicit ObjCSuperExpr(EmptyShell Empty) : Expr(ObjCSuperExprClass, Empty) {}
 
 
   SourceLocation getLoc() const { return Loc; }
   SourceLocation getLoc() const { return Loc; }
   void setLoc(SourceLocation L) { Loc = L; }
   void setLoc(SourceLocation L) { Loc = L; }
-  
+
   virtual SourceRange getSourceRange() const { return SourceRange(Loc); }
   virtual SourceRange getSourceRange() const { return SourceRange(Loc); }
 
 
-  static bool classof(const Stmt *T) { 
+  static bool classof(const Stmt *T) {
     return T->getStmtClass() == ObjCSuperExprClass;
     return T->getStmtClass() == ObjCSuperExprClass;
   }
   }
   static bool classof(const ObjCSuperExpr *) { return true; }
   static bool classof(const ObjCSuperExpr *) { return true; }
@@ -511,23 +511,23 @@ public:
 class ObjCIsaExpr : public Expr {
 class ObjCIsaExpr : public Expr {
   /// Base - the expression for the base object pointer.
   /// Base - the expression for the base object pointer.
   Stmt *Base;
   Stmt *Base;
-  
+
   /// IsaMemberLoc - This is the location of the 'isa'.
   /// IsaMemberLoc - This is the location of the 'isa'.
   SourceLocation IsaMemberLoc;
   SourceLocation IsaMemberLoc;
-  
+
   /// IsArrow - True if this is "X->F", false if this is "X.F".
   /// IsArrow - True if this is "X->F", false if this is "X.F".
   bool IsArrow;
   bool IsArrow;
 public:
 public:
-  ObjCIsaExpr(Expr *base, bool isarrow, SourceLocation l, QualType ty) 
+  ObjCIsaExpr(Expr *base, bool isarrow, SourceLocation l, QualType ty)
     : Expr(ObjCIsaExprClass, ty),
     : Expr(ObjCIsaExprClass, ty),
       Base(base), IsaMemberLoc(l), IsArrow(isarrow) {}
       Base(base), IsaMemberLoc(l), IsArrow(isarrow) {}
-      
+
   /// \brief Build an empty expression.
   /// \brief Build an empty expression.
   explicit ObjCIsaExpr(EmptyShell Empty) : Expr(ObjCIsaExprClass, Empty) { }
   explicit ObjCIsaExpr(EmptyShell Empty) : Expr(ObjCIsaExprClass, Empty) { }
-      
+
   void setBase(Expr *E) { Base = E; }
   void setBase(Expr *E) { Base = E; }
   Expr *getBase() const { return cast<Expr>(Base); }
   Expr *getBase() const { return cast<Expr>(Base); }
-  
+
   bool isArrow() const { return IsArrow; }
   bool isArrow() const { return IsArrow; }
   void setArrow(bool A) { IsArrow = A; }
   void setArrow(bool A) { IsArrow = A; }
 
 
@@ -539,14 +539,14 @@ public:
   virtual SourceRange getSourceRange() const {
   virtual SourceRange getSourceRange() const {
     return SourceRange(getBase()->getLocStart(), IsaMemberLoc);
     return SourceRange(getBase()->getLocStart(), IsaMemberLoc);
   }
   }
-  
+
   virtual SourceLocation getExprLoc() const { return IsaMemberLoc; }
   virtual SourceLocation getExprLoc() const { return IsaMemberLoc; }
 
 
-  static bool classof(const Stmt *T) { 
-    return T->getStmtClass() == ObjCIsaExprClass; 
+  static bool classof(const Stmt *T) {
+    return T->getStmtClass() == ObjCIsaExprClass;
   }
   }
   static bool classof(const ObjCIsaExpr *) { return true; }
   static bool classof(const ObjCIsaExpr *) { return true; }
-  
+
   // Iterators
   // Iterators
   virtual child_iterator child_begin();
   virtual child_iterator child_begin();
   virtual child_iterator child_end();
   virtual child_iterator child_end();

+ 4 - 4
include/clang/AST/ExternalASTSource.h

@@ -33,7 +33,7 @@ struct VisibleDeclaration {
   /// \brief The name of the declarations.
   /// \brief The name of the declarations.
   DeclarationName Name;
   DeclarationName Name;
 
 
-  /// \brief The ID numbers of all of the declarations with this name. 
+  /// \brief The ID numbers of all of the declarations with this name.
   ///
   ///
   /// These declarations have not necessarily been de-serialized.
   /// These declarations have not necessarily been de-serialized.
   llvm::SmallVector<unsigned, 4> Declarations;
   llvm::SmallVector<unsigned, 4> Declarations;
@@ -65,7 +65,7 @@ public:
   /// replaced with the sorted set of source ranges corresponding to
   /// replaced with the sorted set of source ranges corresponding to
   /// comments in the source code.
   /// comments in the source code.
   virtual void ReadComments(std::vector<SourceRange> &Comments) = 0;
   virtual void ReadComments(std::vector<SourceRange> &Comments) = 0;
-  
+
   /// \brief Resolve a type ID into a type, potentially building a new
   /// \brief Resolve a type ID into a type, potentially building a new
   /// type.
   /// type.
   virtual QualType GetType(uint32_t ID) = 0;
   virtual QualType GetType(uint32_t ID) = 0;
@@ -151,7 +151,7 @@ public:
     this->Ptr = reinterpret_cast<uint64_t>(Ptr);
     this->Ptr = reinterpret_cast<uint64_t>(Ptr);
     return *this;
     return *this;
   }
   }
-  
+
   LazyOffsetPtr &operator=(uint64_t Offset) {
   LazyOffsetPtr &operator=(uint64_t Offset) {
     assert((Offset << 1 >> 1) == Offset && "Offsets must require < 63 bits");
     assert((Offset << 1 >> 1) == Offset && "Offsets must require < 63 bits");
     if (Offset == 0)
     if (Offset == 0)
@@ -177,7 +177,7 @@ public:
   /// \returns a pointer to the AST node.
   /// \returns a pointer to the AST node.
   T* get(ExternalASTSource *Source) const {
   T* get(ExternalASTSource *Source) const {
     if (isOffset()) {
     if (isOffset()) {
-      assert(Source && 
+      assert(Source &&
              "Cannot deserialize a lazy pointer without an AST source");
              "Cannot deserialize a lazy pointer without an AST source");
       Ptr = reinterpret_cast<uint64_t>((Source->*Get)(Ptr >> 1));
       Ptr = reinterpret_cast<uint64_t>((Source->*Get)(Ptr >> 1));
     }
     }

+ 16 - 16
include/clang/AST/NestedNameSpecifier.h

@@ -81,8 +81,8 @@ private:
 
 
   /// \brief Copy constructor used internally to clone nested name
   /// \brief Copy constructor used internally to clone nested name
   /// specifiers.
   /// specifiers.
-  NestedNameSpecifier(const NestedNameSpecifier &Other) 
-    : llvm::FoldingSetNode(Other), Prefix(Other.Prefix), 
+  NestedNameSpecifier(const NestedNameSpecifier &Other)
+    : llvm::FoldingSetNode(Other), Prefix(Other.Prefix),
       Specifier(Other.Specifier) {
       Specifier(Other.Specifier) {
   }
   }
 
 
@@ -90,7 +90,7 @@ private:
 
 
   /// \brief Either find or insert the given nested name specifier
   /// \brief Either find or insert the given nested name specifier
   /// mockup in the given context.
   /// mockup in the given context.
-  static NestedNameSpecifier *FindOrInsert(ASTContext &Context, 
+  static NestedNameSpecifier *FindOrInsert(ASTContext &Context,
                                            const NestedNameSpecifier &Mockup);
                                            const NestedNameSpecifier &Mockup);
 
 
 public:
 public:
@@ -99,18 +99,18 @@ public:
   /// The prefix must be dependent, since nested name specifiers
   /// The prefix must be dependent, since nested name specifiers
   /// referencing an identifier are only permitted when the identifier
   /// referencing an identifier are only permitted when the identifier
   /// cannot be resolved.
   /// cannot be resolved.
-  static NestedNameSpecifier *Create(ASTContext &Context, 
-                                     NestedNameSpecifier *Prefix, 
+  static NestedNameSpecifier *Create(ASTContext &Context,
+                                     NestedNameSpecifier *Prefix,
                                      IdentifierInfo *II);
                                      IdentifierInfo *II);
 
 
   /// \brief Builds a nested name specifier that names a namespace.
   /// \brief Builds a nested name specifier that names a namespace.
-  static NestedNameSpecifier *Create(ASTContext &Context, 
-                                     NestedNameSpecifier *Prefix, 
+  static NestedNameSpecifier *Create(ASTContext &Context,
+                                     NestedNameSpecifier *Prefix,
                                      NamespaceDecl *NS);
                                      NamespaceDecl *NS);
 
 
   /// \brief Builds a nested name specifier that names a type.
   /// \brief Builds a nested name specifier that names a type.
-  static NestedNameSpecifier *Create(ASTContext &Context, 
-                                     NestedNameSpecifier *Prefix, 
+  static NestedNameSpecifier *Create(ASTContext &Context,
+                                     NestedNameSpecifier *Prefix,
                                      bool Template, Type *T);
                                      bool Template, Type *T);
 
 
   /// \brief Builds a specifier that consists of just an identifier.
   /// \brief Builds a specifier that consists of just an identifier.
@@ -120,7 +120,7 @@ public:
   /// nested name specifier, e.g., in "x->Base::f", the "x" has a dependent
   /// nested name specifier, e.g., in "x->Base::f", the "x" has a dependent
   /// type.
   /// type.
   static NestedNameSpecifier *Create(ASTContext &Context, IdentifierInfo *II);
   static NestedNameSpecifier *Create(ASTContext &Context, IdentifierInfo *II);
-  
+
   /// \brief Returns the nested name specifier representing the global
   /// \brief Returns the nested name specifier representing the global
   /// scope.
   /// scope.
   static NestedNameSpecifier *GlobalSpecifier(ASTContext &Context);
   static NestedNameSpecifier *GlobalSpecifier(ASTContext &Context);
@@ -135,10 +135,10 @@ public:
   NestedNameSpecifier *getPrefix() const { return Prefix.getPointer(); }
   NestedNameSpecifier *getPrefix() const { return Prefix.getPointer(); }
 
 
   /// \brief Determine what kind of nested name specifier is stored.
   /// \brief Determine what kind of nested name specifier is stored.
-  SpecifierKind getKind() const { 
+  SpecifierKind getKind() const {
     if (Specifier == 0)
     if (Specifier == 0)
       return Global;
       return Global;
-    return (SpecifierKind)Prefix.getInt(); 
+    return (SpecifierKind)Prefix.getInt();
   }
   }
 
 
   /// \brief Retrieve the identifier stored in this nested name
   /// \brief Retrieve the identifier stored in this nested name
@@ -149,7 +149,7 @@ public:
 
 
     return 0;
     return 0;
   }
   }
-  
+
   /// \brief Retrieve the namespace stored in this nested name
   /// \brief Retrieve the namespace stored in this nested name
   /// specifier.
   /// specifier.
   NamespaceDecl *getAsNamespace() const {
   NamespaceDecl *getAsNamespace() const {
@@ -161,7 +161,7 @@ public:
 
 
   /// \brief Retrieve the type stored in this nested name specifier.
   /// \brief Retrieve the type stored in this nested name specifier.
   Type *getAsType() const {
   Type *getAsType() const {
-    if (Prefix.getInt() == TypeSpec || 
+    if (Prefix.getInt() == TypeSpec ||
         Prefix.getInt() == TypeSpecWithTemplate)
         Prefix.getInt() == TypeSpecWithTemplate)
       return (Type *)Specifier;
       return (Type *)Specifier;
 
 
@@ -192,11 +192,11 @@ public:
 /// into a diagnostic with <<.
 /// into a diagnostic with <<.
 inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB,
 inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB,
                                            NestedNameSpecifier *NNS) {
                                            NestedNameSpecifier *NNS) {
-  DB.AddTaggedVal(reinterpret_cast<intptr_t>(NNS), 
+  DB.AddTaggedVal(reinterpret_cast<intptr_t>(NNS),
                   Diagnostic::ak_nestednamespec);
                   Diagnostic::ak_nestednamespec);
   return DB;
   return DB;
 }
 }
-  
+
 }
 }
 
 
 #endif
 #endif

+ 5 - 5
include/clang/AST/ParentMap.h

@@ -17,7 +17,7 @@
 namespace clang {
 namespace clang {
 class Stmt;
 class Stmt;
 class Expr;
 class Expr;
-  
+
 class ParentMap {
 class ParentMap {
   void* Impl;
   void* Impl;
 public:
 public:
@@ -30,7 +30,7 @@ public:
   const Stmt *getParent(const Stmt* S) const {
   const Stmt *getParent(const Stmt* S) const {
     return getParent(const_cast<Stmt*>(S));
     return getParent(const_cast<Stmt*>(S));
   }
   }
-  
+
   const Stmt *getParentIgnoreParens(const Stmt *S) const {
   const Stmt *getParentIgnoreParens(const Stmt *S) const {
     return getParentIgnoreParens(const_cast<Stmt*>(S));
     return getParentIgnoreParens(const_cast<Stmt*>(S));
   }
   }
@@ -38,13 +38,13 @@ public:
   bool hasParent(Stmt* S) const {
   bool hasParent(Stmt* S) const {
     return getParent(S) != 0;
     return getParent(S) != 0;
   }
   }
-  
+
   bool isConsumedExpr(Expr *E) const;
   bool isConsumedExpr(Expr *E) const;
-  
+
   bool isConsumedExpr(const Expr *E) const {
   bool isConsumedExpr(const Expr *E) const {
     return isConsumedExpr(const_cast<Expr*>(E));
     return isConsumedExpr(const_cast<Expr*>(E));
   }
   }
 };
 };
-  
+
 } // end clang namespace
 } // end clang namespace
 #endif
 #endif

+ 1 - 1
include/clang/AST/PrettyPrinter.h

@@ -34,7 +34,7 @@ public:
 /// declarations should be printed.
 /// declarations should be printed.
 struct PrintingPolicy {
 struct PrintingPolicy {
   /// \brief Create a default printing policy for C.
   /// \brief Create a default printing policy for C.
-  PrintingPolicy(const LangOptions &LO) 
+  PrintingPolicy(const LangOptions &LO)
     : Indentation(2), LangOpts(LO), SuppressSpecifiers(false),
     : Indentation(2), LangOpts(LO), SuppressSpecifiers(false),
       SuppressTag(false), SuppressTagKind(false), SuppressScope(false),
       SuppressTag(false), SuppressTagKind(false), SuppressScope(false),
       Dump(false), ConstantArraySizeAsWritten(false) { }
       Dump(false), ConstantArraySizeAsWritten(false) { }

+ 33 - 33
include/clang/AST/RecordLayout.h

@@ -22,38 +22,38 @@ namespace clang {
   class RecordDecl;
   class RecordDecl;
   class CXXRecordDecl;
   class CXXRecordDecl;
 
 
-/// ASTRecordLayout - 
+/// ASTRecordLayout -
 /// This class contains layout information for one RecordDecl,
 /// This class contains layout information for one RecordDecl,
 /// which is a struct/union/class.  The decl represented must be a definition,
 /// which is a struct/union/class.  The decl represented must be a definition,
-/// not a forward declaration.  
-/// This class is also used to contain layout information for one 
+/// not a forward declaration.
+/// This class is also used to contain layout information for one
 /// ObjCInterfaceDecl. FIXME - Find appropriate name.
 /// ObjCInterfaceDecl. FIXME - Find appropriate name.
 /// These objects are managed by ASTContext.
 /// These objects are managed by ASTContext.
 class ASTRecordLayout {
 class ASTRecordLayout {
   /// Size - Size of record in bits.
   /// Size - Size of record in bits.
   uint64_t Size;
   uint64_t Size;
-  
+
   /// DataSize - Size of record in bits without tail padding.
   /// DataSize - Size of record in bits without tail padding.
   uint64_t DataSize;
   uint64_t DataSize;
-  
+
   /// FieldOffsets - Array of field offsets in bits.
   /// FieldOffsets - Array of field offsets in bits.
   uint64_t *FieldOffsets;
   uint64_t *FieldOffsets;
-  
+
   // Alignment - Alignment of record in bits.
   // Alignment - Alignment of record in bits.
-  unsigned Alignment;   
-  
+  unsigned Alignment;
+
   // FieldCount - Number of fields.
   // FieldCount - Number of fields.
   unsigned FieldCount;
   unsigned FieldCount;
 
 
   struct CXXRecordLayoutInfo {
   struct CXXRecordLayoutInfo {
-    /// NonVirtualSize - The non-virtual size (in bits) of an object, which is 
+    /// NonVirtualSize - The non-virtual size (in bits) of an object, which is
     /// the size of the object without virtual bases.
     /// the size of the object without virtual bases.
     uint64_t NonVirtualSize;
     uint64_t NonVirtualSize;
-    
+
     /// NonVirtualAlign - The non-virtual alignment (in bits) of an object,
     /// NonVirtualAlign - The non-virtual alignment (in bits) of an object,
     /// which is the alignment of the object without virtual bases.
     /// which is the alignment of the object without virtual bases.
     uint64_t NonVirtualAlign;
     uint64_t NonVirtualAlign;
-    
+
     /// PrimaryBase - The primary base for our vtable.
     /// PrimaryBase - The primary base for our vtable.
     const CXXRecordDecl *PrimaryBase;
     const CXXRecordDecl *PrimaryBase;
     /// PrimaryBase - Wether or not the primary base was a virtual base.
     /// PrimaryBase - Wether or not the primary base was a virtual base.
@@ -67,16 +67,16 @@ class ASTRecordLayout {
     /// FIXME: This should really use a SmallPtrMap, once we have one in LLVM :)
     /// FIXME: This should really use a SmallPtrMap, once we have one in LLVM :)
     llvm::DenseMap<const CXXRecordDecl *, uint64_t> VBaseOffsets;
     llvm::DenseMap<const CXXRecordDecl *, uint64_t> VBaseOffsets;
   };
   };
-  
-  /// CXXInfo - If the record layout is for a C++ record, this will have 
+
+  /// CXXInfo - If the record layout is for a C++ record, this will have
   /// C++ specific information about the record.
   /// C++ specific information about the record.
   CXXRecordLayoutInfo *CXXInfo;
   CXXRecordLayoutInfo *CXXInfo;
-  
+
   friend class ASTContext;
   friend class ASTContext;
   friend class ASTRecordLayoutBuilder;
   friend class ASTRecordLayoutBuilder;
 
 
   ASTRecordLayout(uint64_t size, unsigned alignment, unsigned datasize,
   ASTRecordLayout(uint64_t size, unsigned alignment, unsigned datasize,
-                  const uint64_t *fieldoffsets, unsigned fieldcount) 
+                  const uint64_t *fieldoffsets, unsigned fieldcount)
   : Size(size), DataSize(datasize), FieldOffsets(0), Alignment(alignment),
   : Size(size), DataSize(datasize), FieldOffsets(0), Alignment(alignment),
     FieldCount(fieldcount), CXXInfo(0) {
     FieldCount(fieldcount), CXXInfo(0) {
     if (FieldCount > 0)  {
     if (FieldCount > 0)  {
@@ -85,7 +85,7 @@ class ASTRecordLayout {
         FieldOffsets[i] = fieldoffsets[i];
         FieldOffsets[i] = fieldoffsets[i];
     }
     }
   }
   }
-  
+
   // Constructor for C++ records.
   // Constructor for C++ records.
   ASTRecordLayout(uint64_t size, unsigned alignment, uint64_t datasize,
   ASTRecordLayout(uint64_t size, unsigned alignment, uint64_t datasize,
                   const uint64_t *fieldoffsets, unsigned fieldcount,
                   const uint64_t *fieldoffsets, unsigned fieldcount,
@@ -101,7 +101,7 @@ class ASTRecordLayout {
       for (unsigned i = 0; i < FieldCount; ++i)
       for (unsigned i = 0; i < FieldCount; ++i)
         FieldOffsets[i] = fieldoffsets[i];
         FieldOffsets[i] = fieldoffsets[i];
     }
     }
-    
+
     CXXInfo->PrimaryBase = PB;
     CXXInfo->PrimaryBase = PB;
     CXXInfo->PrimaryBaseWasVirtual = PBVirtual;
     CXXInfo->PrimaryBaseWasVirtual = PBVirtual;
     CXXInfo->NonVirtualSize = nonvirtualsize;
     CXXInfo->NonVirtualSize = nonvirtualsize;
@@ -111,7 +111,7 @@ class ASTRecordLayout {
     for (unsigned i = 0; i != vbasecount; ++i)
     for (unsigned i = 0; i != vbasecount; ++i)
       CXXInfo->VBaseOffsets[vbases[i]] = vbaseoffsets[i];
       CXXInfo->VBaseOffsets[vbases[i]] = vbaseoffsets[i];
   }
   }
-  
+
   ~ASTRecordLayout() {
   ~ASTRecordLayout() {
     delete [] FieldOffsets;
     delete [] FieldOffsets;
     delete CXXInfo;
     delete CXXInfo;
@@ -120,55 +120,55 @@ class ASTRecordLayout {
   ASTRecordLayout(const ASTRecordLayout&);   // DO NOT IMPLEMENT
   ASTRecordLayout(const ASTRecordLayout&);   // DO NOT IMPLEMENT
   void operator=(const ASTRecordLayout&); // DO NOT IMPLEMENT
   void operator=(const ASTRecordLayout&); // DO NOT IMPLEMENT
 public:
 public:
-  
+
   /// getAlignment - Get the record alignment in bits.
   /// getAlignment - Get the record alignment in bits.
   unsigned getAlignment() const { return Alignment; }
   unsigned getAlignment() const { return Alignment; }
 
 
   /// getSize - Get the record size in bits.
   /// getSize - Get the record size in bits.
   uint64_t getSize() const { return Size; }
   uint64_t getSize() const { return Size; }
-  
+
   /// getFieldCount - Get the number of fields in the layout.
   /// getFieldCount - Get the number of fields in the layout.
   unsigned getFieldCount() const { return FieldCount; }
   unsigned getFieldCount() const { return FieldCount; }
-  
+
   /// getFieldOffset - Get the offset of the given field index, in
   /// getFieldOffset - Get the offset of the given field index, in
   /// bits.
   /// bits.
   uint64_t getFieldOffset(unsigned FieldNo) const {
   uint64_t getFieldOffset(unsigned FieldNo) const {
     assert (FieldNo < FieldCount && "Invalid Field No");
     assert (FieldNo < FieldCount && "Invalid Field No");
     return FieldOffsets[FieldNo];
     return FieldOffsets[FieldNo];
   }
   }
-    
+
   /// getDataSize() - Get the record data size, which is the record size
   /// getDataSize() - Get the record data size, which is the record size
   /// without tail padding, in bits.
   /// without tail padding, in bits.
   uint64_t getDataSize() const {
   uint64_t getDataSize() const {
     return DataSize;
     return DataSize;
   }
   }
-  
-  /// getNonVirtualSize - Get the non-virtual size (in bits) of an object, 
+
+  /// getNonVirtualSize - Get the non-virtual size (in bits) of an object,
   /// which is the size of the object without virtual bases.
   /// which is the size of the object without virtual bases.
-  uint64_t getNonVirtualSize() const { 
+  uint64_t getNonVirtualSize() const {
     assert(CXXInfo && "Record layout does not have C++ specific info!");
     assert(CXXInfo && "Record layout does not have C++ specific info!");
-    
+
     return CXXInfo->NonVirtualSize;
     return CXXInfo->NonVirtualSize;
   }
   }
-  
+
   /// getNonVirtualSize - Get the non-virtual alignment (in bits) of an object,
   /// getNonVirtualSize - Get the non-virtual alignment (in bits) of an object,
   /// which is the alignment of the object without virtual bases.
   /// which is the alignment of the object without virtual bases.
   unsigned getNonVirtualAlign() const {
   unsigned getNonVirtualAlign() const {
     assert(CXXInfo && "Record layout does not have C++ specific info!");
     assert(CXXInfo && "Record layout does not have C++ specific info!");
-    
+
     return CXXInfo->NonVirtualAlign;
     return CXXInfo->NonVirtualAlign;
   }
   }
-  
+
   /// getPrimaryBase - Get the primary base.
   /// getPrimaryBase - Get the primary base.
   const CXXRecordDecl *getPrimaryBase() const {
   const CXXRecordDecl *getPrimaryBase() const {
     assert(CXXInfo && "Record layout does not have C++ specific info!");
     assert(CXXInfo && "Record layout does not have C++ specific info!");
-    
+
     return CXXInfo->PrimaryBase;
     return CXXInfo->PrimaryBase;
   }
   }
   /// getPrimaryBaseWasVirtual - Indicates if the primary base was virtual.
   /// getPrimaryBaseWasVirtual - Indicates if the primary base was virtual.
   bool getPrimaryBaseWasVirtual() const {
   bool getPrimaryBaseWasVirtual() const {
     assert(CXXInfo && "Record layout does not have C++ specific info!");
     assert(CXXInfo && "Record layout does not have C++ specific info!");
-    
+
     return CXXInfo->PrimaryBaseWasVirtual;
     return CXXInfo->PrimaryBaseWasVirtual;
   }
   }
 
 
@@ -176,7 +176,7 @@ public:
   uint64_t getBaseClassOffset(const CXXRecordDecl *Base) const {
   uint64_t getBaseClassOffset(const CXXRecordDecl *Base) const {
     assert(CXXInfo && "Record layout does not have C++ specific info!");
     assert(CXXInfo && "Record layout does not have C++ specific info!");
     assert(CXXInfo->BaseOffsets.count(Base) && "Did not find base!");
     assert(CXXInfo->BaseOffsets.count(Base) && "Did not find base!");
-    
+
     return CXXInfo->BaseOffsets[Base];
     return CXXInfo->BaseOffsets[Base];
   }
   }
 
 
@@ -184,7 +184,7 @@ public:
   uint64_t getVBaseClassOffset(const CXXRecordDecl *VBase) const {
   uint64_t getVBaseClassOffset(const CXXRecordDecl *VBase) const {
     assert(CXXInfo && "Record layout does not have C++ specific info!");
     assert(CXXInfo && "Record layout does not have C++ specific info!");
     assert(CXXInfo->VBaseOffsets.count(VBase) && "Did not find base!");
     assert(CXXInfo->VBaseOffsets.count(VBase) && "Did not find base!");
-    
+
     return CXXInfo->VBaseOffsets[VBase];
     return CXXInfo->VBaseOffsets[VBase];
   }
   }
 };
 };

+ 6 - 6
include/clang/AST/Redeclarable.h

@@ -26,10 +26,10 @@ protected:
   struct DeclLink : public llvm::PointerIntPair<decl_type *, 1, bool> {
   struct DeclLink : public llvm::PointerIntPair<decl_type *, 1, bool> {
     DeclLink(decl_type *D, bool isLatest)
     DeclLink(decl_type *D, bool isLatest)
       : llvm::PointerIntPair<decl_type *, 1, bool>(D, isLatest) { }
       : llvm::PointerIntPair<decl_type *, 1, bool>(D, isLatest) { }
-    
+
     typedef llvm::PointerIntPair<decl_type *, 1, bool> base_type;
     typedef llvm::PointerIntPair<decl_type *, 1, bool> base_type;
 
 
-    bool NextIsPrevious() const { return base_type::getInt() == false; }         
+    bool NextIsPrevious() const { return base_type::getInt() == false; }
     bool NextIsLatest() const { return base_type::getInt() == true; }
     bool NextIsLatest() const { return base_type::getInt() == true; }
     decl_type *getNext() const { return base_type::getPointer(); }
     decl_type *getNext() const { return base_type::getPointer(); }
   };
   };
@@ -69,7 +69,7 @@ public:
     return const_cast<decl_type *>(
     return const_cast<decl_type *>(
                  static_cast<const decl_type*>(this))->getPreviousDeclaration();
                  static_cast<const decl_type*>(this))->getPreviousDeclaration();
   }
   }
-  
+
   /// \brief Return the first declaration of this declaration or itself if this
   /// \brief Return the first declaration of this declaration or itself if this
   /// is the only declaration.
   /// is the only declaration.
   decl_type *getFirstDeclaration() {
   decl_type *getFirstDeclaration() {
@@ -91,7 +91,7 @@ public:
       assert(First->RedeclLink.NextIsLatest() && "Expected first");
       assert(First->RedeclLink.NextIsLatest() && "Expected first");
     } else {
     } else {
       // Make this first.
       // Make this first.
-      First = static_cast<decl_type*>(this); 
+      First = static_cast<decl_type*>(this);
     }
     }
 
 
     // First one will point to this one as latest.
     // First one will point to this one as latest.
@@ -131,10 +131,10 @@ public:
       return tmp;
       return tmp;
     }
     }
 
 
-    friend bool operator==(redecl_iterator x, redecl_iterator y) { 
+    friend bool operator==(redecl_iterator x, redecl_iterator y) {
       return x.Current == y.Current;
       return x.Current == y.Current;
     }
     }
-    friend bool operator!=(redecl_iterator x, redecl_iterator y) { 
+    friend bool operator!=(redecl_iterator x, redecl_iterator y) {
       return x.Current != y.Current;
       return x.Current != y.Current;
     }
     }
   };
   };

Fișier diff suprimat deoarece este prea mare
+ 198 - 198
include/clang/AST/Stmt.h


+ 14 - 14
include/clang/AST/StmtGraphTraits.h

@@ -7,7 +7,7 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 //
 //
-//  This file defines a template specialization of llvm::GraphTraits to 
+//  This file defines a template specialization of llvm::GraphTraits to
 //  treat ASTs (Stmt*) as graphs
 //  treat ASTs (Stmt*) as graphs
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
@@ -20,7 +20,7 @@
 #include "llvm/ADT/DepthFirstIterator.h"
 #include "llvm/ADT/DepthFirstIterator.h"
 
 
 namespace llvm {
 namespace llvm {
-  
+
 //template <typename T> struct GraphTraits;
 //template <typename T> struct GraphTraits;
 
 
 
 
@@ -28,23 +28,23 @@ template <> struct GraphTraits<clang::Stmt*> {
   typedef clang::Stmt                       NodeType;
   typedef clang::Stmt                       NodeType;
   typedef clang::Stmt::child_iterator       ChildIteratorType;
   typedef clang::Stmt::child_iterator       ChildIteratorType;
   typedef llvm::df_iterator<clang::Stmt*>   nodes_iterator;
   typedef llvm::df_iterator<clang::Stmt*>   nodes_iterator;
-    
+
   static NodeType* getEntryNode(clang::Stmt* S) { return S; }
   static NodeType* getEntryNode(clang::Stmt* S) { return S; }
-  
+
   static inline ChildIteratorType child_begin(NodeType* N) {
   static inline ChildIteratorType child_begin(NodeType* N) {
     if (N) return N->child_begin();
     if (N) return N->child_begin();
     else return ChildIteratorType();
     else return ChildIteratorType();
   }
   }
-  
+
   static inline ChildIteratorType child_end(NodeType* N) {
   static inline ChildIteratorType child_end(NodeType* N) {
     if (N) return N->child_end();
     if (N) return N->child_end();
     else return ChildIteratorType();
     else return ChildIteratorType();
   }
   }
-  
+
   static nodes_iterator nodes_begin(clang::Stmt* S) {
   static nodes_iterator nodes_begin(clang::Stmt* S) {
     return df_begin(S);
     return df_begin(S);
   }
   }
-  
+
   static nodes_iterator nodes_end(clang::Stmt* S) {
   static nodes_iterator nodes_end(clang::Stmt* S) {
     return df_end(S);
     return df_end(S);
   }
   }
@@ -55,29 +55,29 @@ template <> struct GraphTraits<const clang::Stmt*> {
   typedef const clang::Stmt                       NodeType;
   typedef const clang::Stmt                       NodeType;
   typedef clang::Stmt::const_child_iterator       ChildIteratorType;
   typedef clang::Stmt::const_child_iterator       ChildIteratorType;
   typedef llvm::df_iterator<const clang::Stmt*>   nodes_iterator;
   typedef llvm::df_iterator<const clang::Stmt*>   nodes_iterator;
-  
+
   static NodeType* getEntryNode(const clang::Stmt* S) { return S; }
   static NodeType* getEntryNode(const clang::Stmt* S) { return S; }
-  
+
   static inline ChildIteratorType child_begin(NodeType* N) {
   static inline ChildIteratorType child_begin(NodeType* N) {
     if (N) return N->child_begin();
     if (N) return N->child_begin();
-    else return ChildIteratorType();    
+    else return ChildIteratorType();
   }
   }
-  
+
   static inline ChildIteratorType child_end(NodeType* N) {
   static inline ChildIteratorType child_end(NodeType* N) {
     if (N) return N->child_end();
     if (N) return N->child_end();
     else return ChildIteratorType();
     else return ChildIteratorType();
   }
   }
-  
+
   static nodes_iterator nodes_begin(const clang::Stmt* S) {
   static nodes_iterator nodes_begin(const clang::Stmt* S) {
     return df_begin(S);
     return df_begin(S);
   }
   }
-  
+
   static nodes_iterator nodes_end(const clang::Stmt* S) {
   static nodes_iterator nodes_end(const clang::Stmt* S) {
     return df_end(S);
     return df_end(S);
   }
   }
 };
 };
 
 
-  
+
 } // end namespace llvm
 } // end namespace llvm
 
 
 #endif
 #endif

+ 31 - 31
include/clang/AST/StmtIterator.h

@@ -23,45 +23,45 @@ namespace clang {
 class Stmt;
 class Stmt;
 class Decl;
 class Decl;
 class VariableArrayType;
 class VariableArrayType;
-  
+
 class StmtIteratorBase {
 class StmtIteratorBase {
 protected:
 protected:
   enum { DeclMode = 0x1, SizeOfTypeVAMode = 0x2, DeclGroupMode = 0x3,
   enum { DeclMode = 0x1, SizeOfTypeVAMode = 0x2, DeclGroupMode = 0x3,
          Flags = 0x3 };
          Flags = 0x3 };
-  
+
   union { Stmt** stmt; Decl* decl; Decl** DGI; };
   union { Stmt** stmt; Decl* decl; Decl** DGI; };
-  uintptr_t RawVAPtr;  
+  uintptr_t RawVAPtr;
   Decl** DGE;
   Decl** DGE;
 
 
   bool inDecl() const {
   bool inDecl() const {
     return (RawVAPtr & Flags) == DeclMode;
     return (RawVAPtr & Flags) == DeclMode;
   }
   }
-  
+
   bool inDeclGroup() const {
   bool inDeclGroup() const {
     return (RawVAPtr & Flags) == DeclGroupMode;
     return (RawVAPtr & Flags) == DeclGroupMode;
   }
   }
-  
-  bool inSizeOfTypeVA() const { 
+
+  bool inSizeOfTypeVA() const {
     return (RawVAPtr & Flags) == SizeOfTypeVAMode;
     return (RawVAPtr & Flags) == SizeOfTypeVAMode;
   }
   }
-  
+
   bool inStmt() const {
   bool inStmt() const {
     return (RawVAPtr & Flags) == 0;
     return (RawVAPtr & Flags) == 0;
   }
   }
-    
+
   VariableArrayType* getVAPtr() const {
   VariableArrayType* getVAPtr() const {
     return reinterpret_cast<VariableArrayType*>(RawVAPtr & ~Flags);
     return reinterpret_cast<VariableArrayType*>(RawVAPtr & ~Flags);
   }
   }
-  
+
   void setVAPtr(VariableArrayType* P) {
   void setVAPtr(VariableArrayType* P) {
-    assert (inDecl() || inDeclGroup() || inSizeOfTypeVA());    
+    assert (inDecl() || inDeclGroup() || inSizeOfTypeVA());
     RawVAPtr = reinterpret_cast<uintptr_t>(P) | (RawVAPtr & Flags);
     RawVAPtr = reinterpret_cast<uintptr_t>(P) | (RawVAPtr & Flags);
   }
   }
-  
+
   void NextDecl(bool ImmediateAdvance = true);
   void NextDecl(bool ImmediateAdvance = true);
   bool HandleDecl(Decl* D);
   bool HandleDecl(Decl* D);
   void NextVA();
   void NextVA();
-  
+
   Stmt*& GetDeclExpr() const;
   Stmt*& GetDeclExpr() const;
 
 
   StmtIteratorBase(Stmt** s) : stmt(s), RawVAPtr(0) {}
   StmtIteratorBase(Stmt** s) : stmt(s), RawVAPtr(0) {}
@@ -70,22 +70,22 @@ protected:
   StmtIteratorBase(Decl** dgi, Decl** dge);
   StmtIteratorBase(Decl** dgi, Decl** dge);
   StmtIteratorBase() : stmt(NULL), RawVAPtr(0) {}
   StmtIteratorBase() : stmt(NULL), RawVAPtr(0) {}
 };
 };
-  
-  
+
+
 template <typename DERIVED, typename REFERENCE>
 template <typename DERIVED, typename REFERENCE>
-class StmtIteratorImpl : public StmtIteratorBase, 
+class StmtIteratorImpl : public StmtIteratorBase,
                          public std::iterator<std::forward_iterator_tag,
                          public std::iterator<std::forward_iterator_tag,
-                                              REFERENCE, ptrdiff_t, 
-                                              REFERENCE, REFERENCE> {  
+                                              REFERENCE, ptrdiff_t,
+                                              REFERENCE, REFERENCE> {
 protected:
 protected:
   StmtIteratorImpl(const StmtIteratorBase& RHS) : StmtIteratorBase(RHS) {}
   StmtIteratorImpl(const StmtIteratorBase& RHS) : StmtIteratorBase(RHS) {}
 public:
 public:
-  StmtIteratorImpl() {}                                                
+  StmtIteratorImpl() {}
   StmtIteratorImpl(Stmt** s) : StmtIteratorBase(s) {}
   StmtIteratorImpl(Stmt** s) : StmtIteratorBase(s) {}
   StmtIteratorImpl(Decl** dgi, Decl** dge) : StmtIteratorBase(dgi, dge) {}
   StmtIteratorImpl(Decl** dgi, Decl** dge) : StmtIteratorBase(dgi, dge) {}
   StmtIteratorImpl(Decl* d) : StmtIteratorBase(d) {}
   StmtIteratorImpl(Decl* d) : StmtIteratorBase(d) {}
   StmtIteratorImpl(VariableArrayType* t) : StmtIteratorBase(t) {}
   StmtIteratorImpl(VariableArrayType* t) : StmtIteratorBase(t) {}
-  
+
   DERIVED& operator++() {
   DERIVED& operator++() {
     if (inDecl() || inDeclGroup()) {
     if (inDecl() || inDeclGroup()) {
       if (getVAPtr()) NextVA();
       if (getVAPtr()) NextVA();
@@ -95,36 +95,36 @@ public:
       NextVA();
       NextVA();
     else
     else
       ++stmt;
       ++stmt;
-      
+
     return static_cast<DERIVED&>(*this);
     return static_cast<DERIVED&>(*this);
   }
   }
-    
+
   DERIVED operator++(int) {
   DERIVED operator++(int) {
     DERIVED tmp = static_cast<DERIVED&>(*this);
     DERIVED tmp = static_cast<DERIVED&>(*this);
     operator++();
     operator++();
     return tmp;
     return tmp;
   }
   }
-  
+
   bool operator==(const DERIVED& RHS) const {
   bool operator==(const DERIVED& RHS) const {
     return stmt == RHS.stmt && RawVAPtr == RHS.RawVAPtr;
     return stmt == RHS.stmt && RawVAPtr == RHS.RawVAPtr;
   }
   }
-  
+
   bool operator!=(const DERIVED& RHS) const {
   bool operator!=(const DERIVED& RHS) const {
     return stmt != RHS.stmt || RawVAPtr != RHS.RawVAPtr;
     return stmt != RHS.stmt || RawVAPtr != RHS.RawVAPtr;
   }
   }
-  
-  REFERENCE operator*() const { 
+
+  REFERENCE operator*() const {
     return (REFERENCE) (inStmt() ? *stmt : GetDeclExpr());
     return (REFERENCE) (inStmt() ? *stmt : GetDeclExpr());
   }
   }
-  
-  REFERENCE operator->() const { return operator*(); }   
+
+  REFERENCE operator->() const { return operator*(); }
 };
 };
 
 
 struct StmtIterator : public StmtIteratorImpl<StmtIterator,Stmt*&> {
 struct StmtIterator : public StmtIteratorImpl<StmtIterator,Stmt*&> {
   explicit StmtIterator() : StmtIteratorImpl<StmtIterator,Stmt*&>() {}
   explicit StmtIterator() : StmtIteratorImpl<StmtIterator,Stmt*&>() {}
 
 
   StmtIterator(Stmt** S) : StmtIteratorImpl<StmtIterator,Stmt*&>(S) {}
   StmtIterator(Stmt** S) : StmtIteratorImpl<StmtIterator,Stmt*&>(S) {}
-  StmtIterator(Decl** dgi, Decl** dge) 
+  StmtIterator(Decl** dgi, Decl** dge)
    : StmtIteratorImpl<StmtIterator,Stmt*&>(dgi, dge) {}
    : StmtIteratorImpl<StmtIterator,Stmt*&>(dgi, dge) {}
 
 
   StmtIterator(VariableArrayType* t):StmtIteratorImpl<StmtIterator,Stmt*&>(t) {}
   StmtIterator(VariableArrayType* t):StmtIteratorImpl<StmtIterator,Stmt*&>(t) {}
@@ -133,10 +133,10 @@ struct StmtIterator : public StmtIteratorImpl<StmtIterator,Stmt*&> {
 
 
 struct ConstStmtIterator : public StmtIteratorImpl<ConstStmtIterator,
 struct ConstStmtIterator : public StmtIteratorImpl<ConstStmtIterator,
                                                    const Stmt*> {
                                                    const Stmt*> {
-  explicit ConstStmtIterator() : 
+  explicit ConstStmtIterator() :
     StmtIteratorImpl<ConstStmtIterator,const Stmt*>() {}
     StmtIteratorImpl<ConstStmtIterator,const Stmt*>() {}
-                                                     
-  ConstStmtIterator(const StmtIterator& RHS) : 
+
+  ConstStmtIterator(const StmtIterator& RHS) :
     StmtIteratorImpl<ConstStmtIterator,const Stmt*>(RHS) {}
     StmtIteratorImpl<ConstStmtIterator,const Stmt*>(RHS) {}
 };
 };
 
 

+ 95 - 95
include/clang/AST/StmtObjC.h

@@ -27,47 +27,47 @@ class ObjCForCollectionStmt : public Stmt {
   SourceLocation ForLoc;
   SourceLocation ForLoc;
   SourceLocation RParenLoc;
   SourceLocation RParenLoc;
 public:
 public:
-  ObjCForCollectionStmt(Stmt *Elem, Expr *Collect, Stmt *Body, 
+  ObjCForCollectionStmt(Stmt *Elem, Expr *Collect, Stmt *Body,
                         SourceLocation FCL, SourceLocation RPL);
                         SourceLocation FCL, SourceLocation RPL);
-  explicit ObjCForCollectionStmt(EmptyShell Empty) : 
+  explicit ObjCForCollectionStmt(EmptyShell Empty) :
     Stmt(ObjCForCollectionStmtClass, Empty) { }
     Stmt(ObjCForCollectionStmtClass, Empty) { }
-  
+
   Stmt *getElement() { return SubExprs[ELEM]; }
   Stmt *getElement() { return SubExprs[ELEM]; }
-  Expr *getCollection() { 
-    return reinterpret_cast<Expr*>(SubExprs[COLLECTION]); 
+  Expr *getCollection() {
+    return reinterpret_cast<Expr*>(SubExprs[COLLECTION]);
   }
   }
   Stmt *getBody() { return SubExprs[BODY]; }
   Stmt *getBody() { return SubExprs[BODY]; }
-  
+
   const Stmt *getElement() const { return SubExprs[ELEM]; }
   const Stmt *getElement() const { return SubExprs[ELEM]; }
-  const Expr *getCollection() const { 
+  const Expr *getCollection() const {
     return reinterpret_cast<Expr*>(SubExprs[COLLECTION]);
     return reinterpret_cast<Expr*>(SubExprs[COLLECTION]);
   }
   }
   const Stmt *getBody() const { return SubExprs[BODY]; }
   const Stmt *getBody() const { return SubExprs[BODY]; }
-  
+
   void setElement(Stmt *S) { SubExprs[ELEM] = S; }
   void setElement(Stmt *S) { SubExprs[ELEM] = S; }
-  void setCollection(Expr *E) { 
+  void setCollection(Expr *E) {
     SubExprs[COLLECTION] = reinterpret_cast<Stmt*>(E);
     SubExprs[COLLECTION] = reinterpret_cast<Stmt*>(E);
   }
   }
   void setBody(Stmt *S) { SubExprs[BODY] = S; }
   void setBody(Stmt *S) { SubExprs[BODY] = S; }
-  
+
   SourceLocation getForLoc() const { return ForLoc; }
   SourceLocation getForLoc() const { return ForLoc; }
   void setForLoc(SourceLocation Loc) { ForLoc = Loc; }
   void setForLoc(SourceLocation Loc) { ForLoc = Loc; }
   SourceLocation getRParenLoc() const { return RParenLoc; }
   SourceLocation getRParenLoc() const { return RParenLoc; }
   void setRParenLoc(SourceLocation Loc) { RParenLoc = Loc; }
   void setRParenLoc(SourceLocation Loc) { RParenLoc = Loc; }
-  
-  virtual SourceRange getSourceRange() const { 
-    return SourceRange(ForLoc, SubExprs[BODY]->getLocEnd()); 
+
+  virtual SourceRange getSourceRange() const {
+    return SourceRange(ForLoc, SubExprs[BODY]->getLocEnd());
   }
   }
-  static bool classof(const Stmt *T) { 
-    return T->getStmtClass() == ObjCForCollectionStmtClass; 
+  static bool classof(const Stmt *T) {
+    return T->getStmtClass() == ObjCForCollectionStmtClass;
   }
   }
   static bool classof(const ObjCForCollectionStmt *) { return true; }
   static bool classof(const ObjCForCollectionStmt *) { return true; }
-  
+
   // Iterators
   // Iterators
   virtual child_iterator child_begin();
   virtual child_iterator child_begin();
   virtual child_iterator child_end();
   virtual child_iterator child_end();
-};  
-  
+};
+
 /// ObjCAtCatchStmt - This represents objective-c's @catch statement.
 /// ObjCAtCatchStmt - This represents objective-c's @catch statement.
 class ObjCAtCatchStmt : public Stmt {
 class ObjCAtCatchStmt : public Stmt {
 private:
 private:
@@ -78,95 +78,95 @@ private:
 
 
 public:
 public:
   ObjCAtCatchStmt(SourceLocation atCatchLoc, SourceLocation rparenloc,
   ObjCAtCatchStmt(SourceLocation atCatchLoc, SourceLocation rparenloc,
-                  ParmVarDecl *catchVarDecl, 
+                  ParmVarDecl *catchVarDecl,
                   Stmt *atCatchStmt, Stmt *atCatchList);
                   Stmt *atCatchStmt, Stmt *atCatchList);
 
 
-  explicit ObjCAtCatchStmt(EmptyShell Empty) : 
+  explicit ObjCAtCatchStmt(EmptyShell Empty) :
     Stmt(ObjCAtCatchStmtClass, Empty) { }
     Stmt(ObjCAtCatchStmtClass, Empty) { }
-  
+
   const Stmt *getCatchBody() const { return SubExprs[BODY]; }
   const Stmt *getCatchBody() const { return SubExprs[BODY]; }
   Stmt *getCatchBody() { return SubExprs[BODY]; }
   Stmt *getCatchBody() { return SubExprs[BODY]; }
   void setCatchBody(Stmt *S) { SubExprs[BODY] = S; }
   void setCatchBody(Stmt *S) { SubExprs[BODY] = S; }
-  
+
   const ObjCAtCatchStmt *getNextCatchStmt() const {
   const ObjCAtCatchStmt *getNextCatchStmt() const {
     return static_cast<const ObjCAtCatchStmt*>(SubExprs[NEXT_CATCH]);
     return static_cast<const ObjCAtCatchStmt*>(SubExprs[NEXT_CATCH]);
   }
   }
-  ObjCAtCatchStmt *getNextCatchStmt() { 
+  ObjCAtCatchStmt *getNextCatchStmt() {
     return static_cast<ObjCAtCatchStmt*>(SubExprs[NEXT_CATCH]);
     return static_cast<ObjCAtCatchStmt*>(SubExprs[NEXT_CATCH]);
   }
   }
   void setNextCatchStmt(Stmt *S) { SubExprs[NEXT_CATCH] = S; }
   void setNextCatchStmt(Stmt *S) { SubExprs[NEXT_CATCH] = S; }
-  
-  const ParmVarDecl *getCatchParamDecl() const { 
-    return ExceptionDecl; 
+
+  const ParmVarDecl *getCatchParamDecl() const {
+    return ExceptionDecl;
   }
   }
-  ParmVarDecl *getCatchParamDecl() { 
-    return ExceptionDecl; 
+  ParmVarDecl *getCatchParamDecl() {
+    return ExceptionDecl;
   }
   }
   void setCatchParamDecl(ParmVarDecl *D) { ExceptionDecl = D; }
   void setCatchParamDecl(ParmVarDecl *D) { ExceptionDecl = D; }
-  
+
   SourceLocation getAtCatchLoc() const { return AtCatchLoc; }
   SourceLocation getAtCatchLoc() const { return AtCatchLoc; }
   void setAtCatchLoc(SourceLocation Loc) { AtCatchLoc = Loc; }
   void setAtCatchLoc(SourceLocation Loc) { AtCatchLoc = Loc; }
   SourceLocation getRParenLoc() const { return RParenLoc; }
   SourceLocation getRParenLoc() const { return RParenLoc; }
   void setRParenLoc(SourceLocation Loc) { RParenLoc = Loc; }
   void setRParenLoc(SourceLocation Loc) { RParenLoc = Loc; }
-  
-  virtual SourceRange getSourceRange() const { 
-    return SourceRange(AtCatchLoc, SubExprs[BODY]->getLocEnd()); 
+
+  virtual SourceRange getSourceRange() const {
+    return SourceRange(AtCatchLoc, SubExprs[BODY]->getLocEnd());
   }
   }
 
 
   bool hasEllipsis() const { return getCatchParamDecl() == 0; }
   bool hasEllipsis() const { return getCatchParamDecl() == 0; }
-  
+
   static bool classof(const Stmt *T) {
   static bool classof(const Stmt *T) {
     return T->getStmtClass() == ObjCAtCatchStmtClass;
     return T->getStmtClass() == ObjCAtCatchStmtClass;
   }
   }
   static bool classof(const ObjCAtCatchStmt *) { return true; }
   static bool classof(const ObjCAtCatchStmt *) { return true; }
-  
+
   virtual child_iterator child_begin();
   virtual child_iterator child_begin();
   virtual child_iterator child_end();
   virtual child_iterator child_end();
 };
 };
-  
-/// ObjCAtFinallyStmt - This represent objective-c's @finally Statement 
+
+/// ObjCAtFinallyStmt - This represent objective-c's @finally Statement
 class ObjCAtFinallyStmt : public Stmt {
 class ObjCAtFinallyStmt : public Stmt {
   Stmt *AtFinallyStmt;
   Stmt *AtFinallyStmt;
-  SourceLocation AtFinallyLoc;    
+  SourceLocation AtFinallyLoc;
 public:
 public:
   ObjCAtFinallyStmt(SourceLocation atFinallyLoc, Stmt *atFinallyStmt)
   ObjCAtFinallyStmt(SourceLocation atFinallyLoc, Stmt *atFinallyStmt)
-  : Stmt(ObjCAtFinallyStmtClass), 
+  : Stmt(ObjCAtFinallyStmtClass),
     AtFinallyStmt(atFinallyStmt), AtFinallyLoc(atFinallyLoc) {}
     AtFinallyStmt(atFinallyStmt), AtFinallyLoc(atFinallyLoc) {}
 
 
-  explicit ObjCAtFinallyStmt(EmptyShell Empty) : 
+  explicit ObjCAtFinallyStmt(EmptyShell Empty) :
     Stmt(ObjCAtFinallyStmtClass, Empty) { }
     Stmt(ObjCAtFinallyStmtClass, Empty) { }
-  
+
   const Stmt *getFinallyBody() const { return AtFinallyStmt; }
   const Stmt *getFinallyBody() const { return AtFinallyStmt; }
   Stmt *getFinallyBody() { return AtFinallyStmt; }
   Stmt *getFinallyBody() { return AtFinallyStmt; }
   void setFinallyBody(Stmt *S) { AtFinallyStmt = S; }
   void setFinallyBody(Stmt *S) { AtFinallyStmt = S; }
-  
-  virtual SourceRange getSourceRange() const { 
-    return SourceRange(AtFinallyLoc, AtFinallyStmt->getLocEnd()); 
+
+  virtual SourceRange getSourceRange() const {
+    return SourceRange(AtFinallyLoc, AtFinallyStmt->getLocEnd());
   }
   }
-  
+
   SourceLocation getAtFinallyLoc() const { return AtFinallyLoc; }
   SourceLocation getAtFinallyLoc() const { return AtFinallyLoc; }
   void setAtFinallyLoc(SourceLocation Loc) { AtFinallyLoc = Loc; }
   void setAtFinallyLoc(SourceLocation Loc) { AtFinallyLoc = Loc; }
-  
+
   static bool classof(const Stmt *T) {
   static bool classof(const Stmt *T) {
     return T->getStmtClass() == ObjCAtFinallyStmtClass;
     return T->getStmtClass() == ObjCAtFinallyStmtClass;
   }
   }
   static bool classof(const ObjCAtFinallyStmt *) { return true; }
   static bool classof(const ObjCAtFinallyStmt *) { return true; }
-  
+
   virtual child_iterator child_begin();
   virtual child_iterator child_begin();
   virtual child_iterator child_end();
   virtual child_iterator child_end();
 };
 };
-  
-/// ObjCAtTryStmt - This represent objective-c's over-all 
+
+/// ObjCAtTryStmt - This represent objective-c's over-all
 /// @try ... @catch ... @finally statement.
 /// @try ... @catch ... @finally statement.
 class ObjCAtTryStmt : public Stmt {
 class ObjCAtTryStmt : public Stmt {
 private:
 private:
   enum { TRY, CATCH, FINALLY, END_EXPR };
   enum { TRY, CATCH, FINALLY, END_EXPR };
-  Stmt* SubStmts[END_EXPR]; 
-  
-  SourceLocation AtTryLoc;      
+  Stmt* SubStmts[END_EXPR];
+
+  SourceLocation AtTryLoc;
 public:
 public:
-  ObjCAtTryStmt(SourceLocation atTryLoc, Stmt *atTryStmt, 
-                Stmt *atCatchStmt, 
+  ObjCAtTryStmt(SourceLocation atTryLoc, Stmt *atTryStmt,
+                Stmt *atCatchStmt,
                 Stmt *atFinallyStmt)
                 Stmt *atFinallyStmt)
   : Stmt(ObjCAtTryStmtClass) {
   : Stmt(ObjCAtTryStmtClass) {
       SubStmts[TRY] = atTryStmt;
       SubStmts[TRY] = atTryStmt;
@@ -174,41 +174,41 @@ public:
       SubStmts[FINALLY] = atFinallyStmt;
       SubStmts[FINALLY] = atFinallyStmt;
       AtTryLoc = atTryLoc;
       AtTryLoc = atTryLoc;
     }
     }
-  explicit ObjCAtTryStmt(EmptyShell Empty) : 
+  explicit ObjCAtTryStmt(EmptyShell Empty) :
     Stmt(ObjCAtTryStmtClass, Empty) { }
     Stmt(ObjCAtTryStmtClass, Empty) { }
-    
+
   SourceLocation getAtTryLoc() const { return AtTryLoc; }
   SourceLocation getAtTryLoc() const { return AtTryLoc; }
   void setAtTryLoc(SourceLocation Loc) { AtTryLoc = Loc; }
   void setAtTryLoc(SourceLocation Loc) { AtTryLoc = Loc; }
-  
+
   const Stmt *getTryBody() const { return SubStmts[TRY]; }
   const Stmt *getTryBody() const { return SubStmts[TRY]; }
   Stmt *getTryBody() { return SubStmts[TRY]; }
   Stmt *getTryBody() { return SubStmts[TRY]; }
   void setTryBody(Stmt *S) { SubStmts[TRY] = S; }
   void setTryBody(Stmt *S) { SubStmts[TRY] = S; }
-  
-  const ObjCAtCatchStmt *getCatchStmts() const { 
-    return dyn_cast_or_null<ObjCAtCatchStmt>(SubStmts[CATCH]); 
+
+  const ObjCAtCatchStmt *getCatchStmts() const {
+    return dyn_cast_or_null<ObjCAtCatchStmt>(SubStmts[CATCH]);
   }
   }
-  ObjCAtCatchStmt *getCatchStmts() { 
-    return dyn_cast_or_null<ObjCAtCatchStmt>(SubStmts[CATCH]); 
+  ObjCAtCatchStmt *getCatchStmts() {
+    return dyn_cast_or_null<ObjCAtCatchStmt>(SubStmts[CATCH]);
   }
   }
   void setCatchStmts(Stmt *S) { SubStmts[CATCH] = S; }
   void setCatchStmts(Stmt *S) { SubStmts[CATCH] = S; }
-  
-  const ObjCAtFinallyStmt *getFinallyStmt() const { 
-    return dyn_cast_or_null<ObjCAtFinallyStmt>(SubStmts[FINALLY]); 
+
+  const ObjCAtFinallyStmt *getFinallyStmt() const {
+    return dyn_cast_or_null<ObjCAtFinallyStmt>(SubStmts[FINALLY]);
   }
   }
-  ObjCAtFinallyStmt *getFinallyStmt() { 
-    return dyn_cast_or_null<ObjCAtFinallyStmt>(SubStmts[FINALLY]); 
+  ObjCAtFinallyStmt *getFinallyStmt() {
+    return dyn_cast_or_null<ObjCAtFinallyStmt>(SubStmts[FINALLY]);
   }
   }
   void setFinallyStmt(Stmt *S) { SubStmts[FINALLY] = S; }
   void setFinallyStmt(Stmt *S) { SubStmts[FINALLY] = S; }
 
 
-  virtual SourceRange getSourceRange() const { 
-    return SourceRange(AtTryLoc, SubStmts[TRY]->getLocEnd()); 
+  virtual SourceRange getSourceRange() const {
+    return SourceRange(AtTryLoc, SubStmts[TRY]->getLocEnd());
   }
   }
-    
+
   static bool classof(const Stmt *T) {
   static bool classof(const Stmt *T) {
     return T->getStmtClass() == ObjCAtTryStmtClass;
     return T->getStmtClass() == ObjCAtTryStmtClass;
   }
   }
   static bool classof(const ObjCAtTryStmt *) { return true; }
   static bool classof(const ObjCAtTryStmt *) { return true; }
-    
+
   virtual child_iterator child_begin();
   virtual child_iterator child_begin();
   virtual child_iterator child_end();
   virtual child_iterator child_end();
 };
 };
@@ -223,7 +223,7 @@ private:
   enum { SYNC_EXPR, SYNC_BODY, END_EXPR };
   enum { SYNC_EXPR, SYNC_BODY, END_EXPR };
   Stmt* SubStmts[END_EXPR];
   Stmt* SubStmts[END_EXPR];
   SourceLocation AtSynchronizedLoc;
   SourceLocation AtSynchronizedLoc;
-  
+
 public:
 public:
   ObjCAtSynchronizedStmt(SourceLocation atSynchronizedLoc, Stmt *synchExpr,
   ObjCAtSynchronizedStmt(SourceLocation atSynchronizedLoc, Stmt *synchExpr,
                          Stmt *synchBody)
                          Stmt *synchBody)
@@ -232,41 +232,41 @@ public:
     SubStmts[SYNC_BODY] = synchBody;
     SubStmts[SYNC_BODY] = synchBody;
     AtSynchronizedLoc = atSynchronizedLoc;
     AtSynchronizedLoc = atSynchronizedLoc;
   }
   }
-  explicit ObjCAtSynchronizedStmt(EmptyShell Empty) : 
+  explicit ObjCAtSynchronizedStmt(EmptyShell Empty) :
     Stmt(ObjCAtSynchronizedStmtClass, Empty) { }
     Stmt(ObjCAtSynchronizedStmtClass, Empty) { }
-  
+
   SourceLocation getAtSynchronizedLoc() const { return AtSynchronizedLoc; }
   SourceLocation getAtSynchronizedLoc() const { return AtSynchronizedLoc; }
   void setAtSynchronizedLoc(SourceLocation Loc) { AtSynchronizedLoc = Loc; }
   void setAtSynchronizedLoc(SourceLocation Loc) { AtSynchronizedLoc = Loc; }
-  
+
   const CompoundStmt *getSynchBody() const {
   const CompoundStmt *getSynchBody() const {
     return reinterpret_cast<CompoundStmt*>(SubStmts[SYNC_BODY]);
     return reinterpret_cast<CompoundStmt*>(SubStmts[SYNC_BODY]);
   }
   }
-  CompoundStmt *getSynchBody() { 
-    return reinterpret_cast<CompoundStmt*>(SubStmts[SYNC_BODY]); 
+  CompoundStmt *getSynchBody() {
+    return reinterpret_cast<CompoundStmt*>(SubStmts[SYNC_BODY]);
   }
   }
   void setSynchBody(Stmt *S) { SubStmts[SYNC_BODY] = S; }
   void setSynchBody(Stmt *S) { SubStmts[SYNC_BODY] = S; }
-  
-  const Expr *getSynchExpr() const { 
-    return reinterpret_cast<Expr*>(SubStmts[SYNC_EXPR]); 
+
+  const Expr *getSynchExpr() const {
+    return reinterpret_cast<Expr*>(SubStmts[SYNC_EXPR]);
   }
   }
-  Expr *getSynchExpr() { 
-    return reinterpret_cast<Expr*>(SubStmts[SYNC_EXPR]); 
+  Expr *getSynchExpr() {
+    return reinterpret_cast<Expr*>(SubStmts[SYNC_EXPR]);
   }
   }
   void setSynchExpr(Stmt *S) { SubStmts[SYNC_EXPR] = S; }
   void setSynchExpr(Stmt *S) { SubStmts[SYNC_EXPR] = S; }
-  
-  virtual SourceRange getSourceRange() const { 
-    return SourceRange(AtSynchronizedLoc, getSynchBody()->getLocEnd()); 
+
+  virtual SourceRange getSourceRange() const {
+    return SourceRange(AtSynchronizedLoc, getSynchBody()->getLocEnd());
   }
   }
-  
+
   static bool classof(const Stmt *T) {
   static bool classof(const Stmt *T) {
     return T->getStmtClass() == ObjCAtSynchronizedStmtClass;
     return T->getStmtClass() == ObjCAtSynchronizedStmtClass;
   }
   }
   static bool classof(const ObjCAtSynchronizedStmt *) { return true; }
   static bool classof(const ObjCAtSynchronizedStmt *) { return true; }
-  
+
   virtual child_iterator child_begin();
   virtual child_iterator child_begin();
   virtual child_iterator child_end();
   virtual child_iterator child_end();
 };
 };
-  
+
 /// ObjCAtThrowStmt - This represents objective-c's @throw statement.
 /// ObjCAtThrowStmt - This represents objective-c's @throw statement.
 class ObjCAtThrowStmt : public Stmt {
 class ObjCAtThrowStmt : public Stmt {
   Stmt *Throw;
   Stmt *Throw;
@@ -276,28 +276,28 @@ public:
   : Stmt(ObjCAtThrowStmtClass), Throw(throwExpr) {
   : Stmt(ObjCAtThrowStmtClass), Throw(throwExpr) {
     AtThrowLoc = atThrowLoc;
     AtThrowLoc = atThrowLoc;
   }
   }
-  explicit ObjCAtThrowStmt(EmptyShell Empty) : 
+  explicit ObjCAtThrowStmt(EmptyShell Empty) :
     Stmt(ObjCAtThrowStmtClass, Empty) { }
     Stmt(ObjCAtThrowStmtClass, Empty) { }
-  
+
   const Expr *getThrowExpr() const { return reinterpret_cast<Expr*>(Throw); }
   const Expr *getThrowExpr() const { return reinterpret_cast<Expr*>(Throw); }
   Expr *getThrowExpr() { return reinterpret_cast<Expr*>(Throw); }
   Expr *getThrowExpr() { return reinterpret_cast<Expr*>(Throw); }
   void setThrowExpr(Stmt *S) { Throw = S; }
   void setThrowExpr(Stmt *S) { Throw = S; }
-  
+
   SourceLocation getThrowLoc() { return AtThrowLoc; }
   SourceLocation getThrowLoc() { return AtThrowLoc; }
   void setThrowLoc(SourceLocation Loc) { AtThrowLoc = Loc; }
   void setThrowLoc(SourceLocation Loc) { AtThrowLoc = Loc; }
-  
+
   virtual SourceRange getSourceRange() const {
   virtual SourceRange getSourceRange() const {
     if (Throw)
     if (Throw)
-      return SourceRange(AtThrowLoc, Throw->getLocEnd()); 
-    else 
+      return SourceRange(AtThrowLoc, Throw->getLocEnd());
+    else
       return SourceRange(AtThrowLoc);
       return SourceRange(AtThrowLoc);
   }
   }
-  
+
   static bool classof(const Stmt *T) {
   static bool classof(const Stmt *T) {
     return T->getStmtClass() == ObjCAtThrowStmtClass;
     return T->getStmtClass() == ObjCAtThrowStmtClass;
   }
   }
   static bool classof(const ObjCAtThrowStmt *) { return true; }
   static bool classof(const ObjCAtThrowStmt *) { return true; }
-  
+
   virtual child_iterator child_begin();
   virtual child_iterator child_begin();
   virtual child_iterator child_end();
   virtual child_iterator child_end();
 };
 };

+ 10 - 10
include/clang/AST/StmtVisitor.h

@@ -20,17 +20,17 @@
 #include "clang/AST/StmtObjC.h"
 #include "clang/AST/StmtObjC.h"
 
 
 namespace clang {
 namespace clang {
-  
+
 #define DISPATCH(NAME, CLASS) \
 #define DISPATCH(NAME, CLASS) \
   return static_cast<ImplClass*>(this)->Visit ## NAME(static_cast<CLASS*>(S))
   return static_cast<ImplClass*>(this)->Visit ## NAME(static_cast<CLASS*>(S))
-  
+
 /// StmtVisitor - This class implements a simple visitor for Stmt subclasses.
 /// StmtVisitor - This class implements a simple visitor for Stmt subclasses.
 /// Since Expr derives from Stmt, this also includes support for visiting Exprs.
 /// Since Expr derives from Stmt, this also includes support for visiting Exprs.
 template<typename ImplClass, typename RetTy=void>
 template<typename ImplClass, typename RetTy=void>
 class StmtVisitor {
 class StmtVisitor {
 public:
 public:
   RetTy Visit(Stmt *S) {
   RetTy Visit(Stmt *S) {
-    
+
     // If we have a binary expr, dispatch to the subcode of the binop.  A smart
     // If we have a binary expr, dispatch to the subcode of the binop.  A smart
     // optimizer (e.g. LLVM) will fold this comparison into the switch stmt
     // optimizer (e.g. LLVM) will fold this comparison into the switch stmt
     // below.
     // below.
@@ -53,7 +53,7 @@ public:
       case BinaryOperator::GE:        DISPATCH(BinGE,        BinaryOperator);
       case BinaryOperator::GE:        DISPATCH(BinGE,        BinaryOperator);
       case BinaryOperator::EQ:        DISPATCH(BinEQ,        BinaryOperator);
       case BinaryOperator::EQ:        DISPATCH(BinEQ,        BinaryOperator);
       case BinaryOperator::NE:        DISPATCH(BinNE,        BinaryOperator);
       case BinaryOperator::NE:        DISPATCH(BinNE,        BinaryOperator);
-        
+
       case BinaryOperator::And:       DISPATCH(BinAnd,       BinaryOperator);
       case BinaryOperator::And:       DISPATCH(BinAnd,       BinaryOperator);
       case BinaryOperator::Xor:       DISPATCH(BinXor,       BinaryOperator);
       case BinaryOperator::Xor:       DISPATCH(BinXor,       BinaryOperator);
       case BinaryOperator::Or :       DISPATCH(BinOr,        BinaryOperator);
       case BinaryOperator::Or :       DISPATCH(BinOr,        BinaryOperator);
@@ -101,7 +101,7 @@ public:
       case UnaryOperator::OffsetOf:     DISPATCH(UnaryOffsetOf,  UnaryOperator);
       case UnaryOperator::OffsetOf:     DISPATCH(UnaryOffsetOf,  UnaryOperator);
       }
       }
     }
     }
-    
+
     // Top switch stmt: dispatch to VisitFooStmt for each FooStmt.
     // Top switch stmt: dispatch to VisitFooStmt for each FooStmt.
     switch (S->getStmtClass()) {
     switch (S->getStmtClass()) {
     default: assert(0 && "Unknown stmt kind!");
     default: assert(0 && "Unknown stmt kind!");
@@ -110,7 +110,7 @@ public:
 #include "clang/AST/StmtNodes.def"
 #include "clang/AST/StmtNodes.def"
     }
     }
   }
   }
-  
+
   // If the implementation chooses not to implement a certain visit method, fall
   // If the implementation chooses not to implement a certain visit method, fall
   // back on VisitExpr or whatever else is the superclass.
   // back on VisitExpr or whatever else is the superclass.
 #define STMT(CLASS, PARENT)                                   \
 #define STMT(CLASS, PARENT)                                   \
@@ -127,7 +127,7 @@ public:
   BINOP_FALLBACK(Mul)   BINOP_FALLBACK(Div)  BINOP_FALLBACK(Rem)
   BINOP_FALLBACK(Mul)   BINOP_FALLBACK(Div)  BINOP_FALLBACK(Rem)
   BINOP_FALLBACK(Add)   BINOP_FALLBACK(Sub)  BINOP_FALLBACK(Shl)
   BINOP_FALLBACK(Add)   BINOP_FALLBACK(Sub)  BINOP_FALLBACK(Shl)
   BINOP_FALLBACK(Shr)
   BINOP_FALLBACK(Shr)
-  
+
   BINOP_FALLBACK(LT)    BINOP_FALLBACK(GT)   BINOP_FALLBACK(LE)
   BINOP_FALLBACK(LT)    BINOP_FALLBACK(GT)   BINOP_FALLBACK(LE)
   BINOP_FALLBACK(GE)    BINOP_FALLBACK(EQ)   BINOP_FALLBACK(NE)
   BINOP_FALLBACK(GE)    BINOP_FALLBACK(EQ)   BINOP_FALLBACK(NE)
   BINOP_FALLBACK(And)   BINOP_FALLBACK(Xor)  BINOP_FALLBACK(Or)
   BINOP_FALLBACK(And)   BINOP_FALLBACK(Xor)  BINOP_FALLBACK(Or)
@@ -148,7 +148,7 @@ public:
   CAO_FALLBACK(ShrAssign) CAO_FALLBACK(AndAssign) CAO_FALLBACK(OrAssign)
   CAO_FALLBACK(ShrAssign) CAO_FALLBACK(AndAssign) CAO_FALLBACK(OrAssign)
   CAO_FALLBACK(XorAssign)
   CAO_FALLBACK(XorAssign)
 #undef CAO_FALLBACK
 #undef CAO_FALLBACK
-  
+
   // If the implementation doesn't implement unary operator methods, fall back
   // If the implementation doesn't implement unary operator methods, fall back
   // on VisitUnaryOperator.
   // on VisitUnaryOperator.
 #define UNARYOP_FALLBACK(NAME) \
 #define UNARYOP_FALLBACK(NAME) \
@@ -158,13 +158,13 @@ public:
   UNARYOP_FALLBACK(PostInc)   UNARYOP_FALLBACK(PostDec)
   UNARYOP_FALLBACK(PostInc)   UNARYOP_FALLBACK(PostDec)
   UNARYOP_FALLBACK(PreInc)    UNARYOP_FALLBACK(PreDec)
   UNARYOP_FALLBACK(PreInc)    UNARYOP_FALLBACK(PreDec)
   UNARYOP_FALLBACK(AddrOf)    UNARYOP_FALLBACK(Deref)
   UNARYOP_FALLBACK(AddrOf)    UNARYOP_FALLBACK(Deref)
-  
+
   UNARYOP_FALLBACK(Plus)      UNARYOP_FALLBACK(Minus)
   UNARYOP_FALLBACK(Plus)      UNARYOP_FALLBACK(Minus)
   UNARYOP_FALLBACK(Not)       UNARYOP_FALLBACK(LNot)
   UNARYOP_FALLBACK(Not)       UNARYOP_FALLBACK(LNot)
   UNARYOP_FALLBACK(Real)      UNARYOP_FALLBACK(Imag)
   UNARYOP_FALLBACK(Real)      UNARYOP_FALLBACK(Imag)
   UNARYOP_FALLBACK(Extension) UNARYOP_FALLBACK(OffsetOf)
   UNARYOP_FALLBACK(Extension) UNARYOP_FALLBACK(OffsetOf)
 #undef UNARYOP_FALLBACK
 #undef UNARYOP_FALLBACK
-  
+
   // Base case, ignore it. :)
   // Base case, ignore it. :)
   RetTy VisitStmt(Stmt *Node) { return RetTy(); }
   RetTy VisitStmt(Stmt *Node) { return RetTy(); }
 };
 };

+ 19 - 19
include/clang/AST/TemplateName.h

@@ -61,7 +61,7 @@ class OverloadedFunctionDecl;
 /// only be understood in the context of
 /// only be understood in the context of
 class TemplateName {
 class TemplateName {
   typedef llvm::PointerUnion4<TemplateDecl *, OverloadedFunctionDecl *,
   typedef llvm::PointerUnion4<TemplateDecl *, OverloadedFunctionDecl *,
-                              QualifiedTemplateName *, 
+                              QualifiedTemplateName *,
                               DependentTemplateName *> StorageType;
                               DependentTemplateName *> StorageType;
 
 
   StorageType Storage;
   StorageType Storage;
@@ -80,25 +80,25 @@ public:
 
 
   /// \brief Determine whether this template name is NULL.
   /// \brief Determine whether this template name is NULL.
   bool isNull() const { return Storage.isNull(); }
   bool isNull() const { return Storage.isNull(); }
-  
+
   /// \brief Retrieve the the underlying template declaration that
   /// \brief Retrieve the the underlying template declaration that
   /// this template name refers to, if known.
   /// this template name refers to, if known.
   ///
   ///
   /// \returns The template declaration that this template name refers
   /// \returns The template declaration that this template name refers
   /// to, if any. If the template name does not refer to a specific
   /// to, if any. If the template name does not refer to a specific
-  /// declaration because it is a dependent name, or if it refers to a 
+  /// declaration because it is a dependent name, or if it refers to a
   /// set of function templates, returns NULL.
   /// set of function templates, returns NULL.
   TemplateDecl *getAsTemplateDecl() const;
   TemplateDecl *getAsTemplateDecl() const;
 
 
-  /// \brief Retrieve the the underlying, overloaded function template 
+  /// \brief Retrieve the the underlying, overloaded function template
   // declarations that this template name refers to, if known.
   // declarations that this template name refers to, if known.
   ///
   ///
-  /// \returns The set of overloaded function templates that this template 
-  /// name refers to, if known. If the template name does not refer to a 
+  /// \returns The set of overloaded function templates that this template
+  /// name refers to, if known. If the template name does not refer to a
   /// specific set of function templates because it is a dependent name or
   /// specific set of function templates because it is a dependent name or
   /// refers to a single template, returns NULL.
   /// refers to a single template, returns NULL.
   OverloadedFunctionDecl *getAsOverloadedFunctionDecl() const;
   OverloadedFunctionDecl *getAsOverloadedFunctionDecl() const;
-  
+
   /// \brief Retrieve the underlying qualified template name
   /// \brief Retrieve the underlying qualified template name
   /// structure, if any.
   /// structure, if any.
   QualifiedTemplateName *getAsQualifiedTemplateName() const {
   QualifiedTemplateName *getAsQualifiedTemplateName() const {
@@ -137,8 +137,8 @@ public:
   void *getAsVoidPointer() const { return Storage.getOpaqueValue(); }
   void *getAsVoidPointer() const { return Storage.getOpaqueValue(); }
 
 
   /// \brief Build a template name from a void pointer.
   /// \brief Build a template name from a void pointer.
-  static TemplateName getFromVoidPointer(void *Ptr) { 
-    return TemplateName(Ptr); 
+  static TemplateName getFromVoidPointer(void *Ptr) {
+    return TemplateName(Ptr);
   }
   }
 };
 };
 
 
@@ -171,14 +171,14 @@ class QualifiedTemplateName : public llvm::FoldingSetNode {
 
 
   QualifiedTemplateName(NestedNameSpecifier *NNS, bool TemplateKeyword,
   QualifiedTemplateName(NestedNameSpecifier *NNS, bool TemplateKeyword,
                         TemplateDecl *Template)
                         TemplateDecl *Template)
-    : Qualifier(NNS, TemplateKeyword? 1 : 0), 
+    : Qualifier(NNS, TemplateKeyword? 1 : 0),
       Template(reinterpret_cast<NamedDecl *>(Template)) { }
       Template(reinterpret_cast<NamedDecl *>(Template)) { }
 
 
   QualifiedTemplateName(NestedNameSpecifier *NNS, bool TemplateKeyword,
   QualifiedTemplateName(NestedNameSpecifier *NNS, bool TemplateKeyword,
                         OverloadedFunctionDecl *Template)
                         OverloadedFunctionDecl *Template)
-  : Qualifier(NNS, TemplateKeyword? 1 : 0), 
+  : Qualifier(NNS, TemplateKeyword? 1 : 0),
     Template(reinterpret_cast<NamedDecl *>(Template)) { }
     Template(reinterpret_cast<NamedDecl *>(Template)) { }
-  
+
 public:
 public:
   /// \brief Return the nested name specifier that qualifies this name.
   /// \brief Return the nested name specifier that qualifies this name.
   NestedNameSpecifier *getQualifier() const { return Qualifier.getPointer(); }
   NestedNameSpecifier *getQualifier() const { return Qualifier.getPointer(); }
@@ -190,22 +190,22 @@ public:
   /// \brief The template declaration or set of overloaded functions that
   /// \brief The template declaration or set of overloaded functions that
   /// that qualified name refers to.
   /// that qualified name refers to.
   NamedDecl *getDecl() const { return Template; }
   NamedDecl *getDecl() const { return Template; }
-  
+
   /// \brief The template declaration to which this qualified name
   /// \brief The template declaration to which this qualified name
   /// refers, or NULL if this qualified name refers to a set of overloaded
   /// refers, or NULL if this qualified name refers to a set of overloaded
   /// function templates.
   /// function templates.
   TemplateDecl *getTemplateDecl() const;
   TemplateDecl *getTemplateDecl() const;
 
 
   /// \brief The set of overloaded function tempaltes to which this qualified
   /// \brief The set of overloaded function tempaltes to which this qualified
-  /// name refers, or NULL if this qualified name refers to a single 
+  /// name refers, or NULL if this qualified name refers to a single
   /// template declaration.
   /// template declaration.
   OverloadedFunctionDecl *getOverloadedFunctionDecl() const;
   OverloadedFunctionDecl *getOverloadedFunctionDecl() const;
-  
+
   void Profile(llvm::FoldingSetNodeID &ID) {
   void Profile(llvm::FoldingSetNodeID &ID) {
     Profile(ID, getQualifier(), hasTemplateKeyword(), getDecl());
     Profile(ID, getQualifier(), hasTemplateKeyword(), getDecl());
   }
   }
 
 
-  static void Profile(llvm::FoldingSetNodeID &ID, NestedNameSpecifier *NNS, 
+  static void Profile(llvm::FoldingSetNodeID &ID, NestedNameSpecifier *NNS,
                       bool TemplateKeyword, NamedDecl *Template) {
                       bool TemplateKeyword, NamedDecl *Template) {
     ID.AddPointer(NNS);
     ID.AddPointer(NNS);
     ID.AddBoolean(TemplateKeyword);
     ID.AddBoolean(TemplateKeyword);
@@ -239,11 +239,11 @@ class DependentTemplateName : public llvm::FoldingSetNode {
 
 
   friend class ASTContext;
   friend class ASTContext;
 
 
-  DependentTemplateName(NestedNameSpecifier *Qualifier, 
+  DependentTemplateName(NestedNameSpecifier *Qualifier,
                         const IdentifierInfo *Name)
                         const IdentifierInfo *Name)
     : Qualifier(Qualifier), Name(Name), CanonicalTemplateName(this) { }
     : Qualifier(Qualifier), Name(Name), CanonicalTemplateName(this) { }
 
 
-  DependentTemplateName(NestedNameSpecifier *Qualifier, 
+  DependentTemplateName(NestedNameSpecifier *Qualifier,
                         const IdentifierInfo *Name,
                         const IdentifierInfo *Name,
                         TemplateName Canon)
                         TemplateName Canon)
     : Qualifier(Qualifier), Name(Name), CanonicalTemplateName(Canon) { }
     : Qualifier(Qualifier), Name(Name), CanonicalTemplateName(Canon) { }
@@ -260,7 +260,7 @@ public:
     Profile(ID, getQualifier(), getName());
     Profile(ID, getQualifier(), getName());
   }
   }
 
 
-  static void Profile(llvm::FoldingSetNodeID &ID, NestedNameSpecifier *NNS, 
+  static void Profile(llvm::FoldingSetNodeID &ID, NestedNameSpecifier *NNS,
                       const IdentifierInfo *Name) {
                       const IdentifierInfo *Name) {
     ID.AddPointer(NNS);
     ID.AddPointer(NNS);
     ID.AddPointer(Name);
     ID.AddPointer(Name);

Fișier diff suprimat deoarece este prea mare
+ 181 - 181
include/clang/AST/Type.h


+ 5 - 5
include/clang/AST/TypeLoc.h

@@ -30,7 +30,7 @@ class TypeLoc {
 protected:
 protected:
   QualType Ty;
   QualType Ty;
   void *Data;
   void *Data;
-  
+
   TypeLoc(QualType ty, void *data) : Ty(ty), Data(data) { }
   TypeLoc(QualType ty, void *data) : Ty(ty), Data(data) { }
   static TypeLoc Create(QualType ty, void *data) { return TypeLoc(ty,data); }
   static TypeLoc Create(QualType ty, void *data) { return TypeLoc(ty,data); }
   friend class DeclaratorInfo;
   friend class DeclaratorInfo;
@@ -86,7 +86,7 @@ public:
 class DeclaratorLoc : public TypeLoc  {
 class DeclaratorLoc : public TypeLoc  {
 public:
 public:
   /// \brief Find the TypeSpecLoc that is part of this DeclaratorLoc.
   /// \brief Find the TypeSpecLoc that is part of this DeclaratorLoc.
-  TypeSpecLoc getTypeSpecLoc() const;  
+  TypeSpecLoc getTypeSpecLoc() const;
 
 
   static bool classof(const TypeLoc *TL);
   static bool classof(const TypeLoc *TL);
   static bool classof(const DeclaratorLoc *TL) { return true; }
   static bool classof(const DeclaratorLoc *TL) { return true; }
@@ -98,7 +98,7 @@ class DefaultTypeSpecLoc : public TypeSpecLoc {
   struct Info {
   struct Info {
     SourceLocation StartLoc;
     SourceLocation StartLoc;
   };
   };
-  
+
 public:
 public:
   SourceLocation getStartLoc() const {
   SourceLocation getStartLoc() const {
     return static_cast<Info*>(Data)->StartLoc;
     return static_cast<Info*>(Data)->StartLoc;
@@ -137,7 +137,7 @@ public:
   SourceRange getSourceRange() const {
   SourceRange getSourceRange() const {
     return SourceRange(getNameLoc(), getNameLoc());
     return SourceRange(getNameLoc(), getNameLoc());
   }
   }
-  
+
   /// \brief Returns the size of the type source info data block that is
   /// \brief Returns the size of the type source info data block that is
   /// specific to this type.
   /// specific to this type.
   unsigned getLocalDataSize() const { return sizeof(Info); }
   unsigned getLocalDataSize() const { return sizeof(Info); }
@@ -445,7 +445,7 @@ class TypeLocVisitor {
 #define TYPELOC(CLASS, PARENT, TYPE)                              \
 #define TYPELOC(CLASS, PARENT, TYPE)                              \
     RetTy Visit##TYPE(TYPE *) {                                   \
     RetTy Visit##TYPE(TYPE *) {                                   \
       return Impl->Visit##CLASS(reinterpret_cast<CLASS&>(TyLoc)); \
       return Impl->Visit##CLASS(reinterpret_cast<CLASS&>(TyLoc)); \
-    } 
+    }
 #include "clang/AST/TypeLocNodes.def"
 #include "clang/AST/TypeLocNodes.def"
   };
   };
 
 

+ 3 - 3
include/clang/AST/TypeOrdering.h

@@ -37,7 +37,7 @@ namespace llvm {
   template<> struct DenseMapInfo<clang::QualType> {
   template<> struct DenseMapInfo<clang::QualType> {
     static inline clang::QualType getEmptyKey() { return clang::QualType(); }
     static inline clang::QualType getEmptyKey() { return clang::QualType(); }
 
 
-    static inline clang::QualType getTombstoneKey() { 
+    static inline clang::QualType getTombstoneKey() {
       using clang::QualType;
       using clang::QualType;
       return QualType::getFromOpaquePtr(reinterpret_cast<clang::Type *>(-1));
       return QualType::getFromOpaquePtr(reinterpret_cast<clang::Type *>(-1));
     }
     }
@@ -51,11 +51,11 @@ namespace llvm {
       return LHS == RHS;
       return LHS == RHS;
     }
     }
 
 
-    static bool isPod() { 
+    static bool isPod() {
       // QualType isn't *technically* a POD type. However, we can get
       // QualType isn't *technically* a POD type. However, we can get
       // away with calling it a POD type since its copy constructor,
       // away with calling it a POD type since its copy constructor,
       // copy assignment operator, and destructor are all trivial.
       // copy assignment operator, and destructor are all trivial.
-      return true; 
+      return true;
     }
     }
   };
   };
 }
 }

+ 4 - 4
include/clang/AST/TypeVisitor.h

@@ -17,10 +17,10 @@
 #include "clang/AST/Type.h"
 #include "clang/AST/Type.h"
 
 
 namespace clang {
 namespace clang {
-  
+
 #define DISPATCH(CLASS) \
 #define DISPATCH(CLASS) \
   return static_cast<ImplClass*>(this)->Visit ## CLASS(static_cast<CLASS*>(T))
   return static_cast<ImplClass*>(this)->Visit ## CLASS(static_cast<CLASS*>(T))
-  
+
 template<typename ImplClass, typename RetTy=void>
 template<typename ImplClass, typename RetTy=void>
 class TypeVisitor {
 class TypeVisitor {
 public:
 public:
@@ -28,12 +28,12 @@ public:
     // Top switch stmt: dispatch to VisitFooStmt for each FooStmt.
     // Top switch stmt: dispatch to VisitFooStmt for each FooStmt.
     switch (T->getTypeClass()) {
     switch (T->getTypeClass()) {
     default: assert(0 && "Unknown type class!");
     default: assert(0 && "Unknown type class!");
-#define ABSTRACT_TYPE(CLASS, PARENT) 
+#define ABSTRACT_TYPE(CLASS, PARENT)
 #define TYPE(CLASS, PARENT) case Type::CLASS: DISPATCH(CLASS##Type);
 #define TYPE(CLASS, PARENT) case Type::CLASS: DISPATCH(CLASS##Type);
 #include "clang/AST/TypeNodes.def"
 #include "clang/AST/TypeNodes.def"
     }
     }
   }
   }
-    
+
   // If the implementation chooses not to implement a certain visit method, fall
   // If the implementation chooses not to implement a certain visit method, fall
   // back on superclass.
   // back on superclass.
 #define TYPE(CLASS, PARENT) RetTy Visit##CLASS##Type(CLASS##Type *T) {       \
 #define TYPE(CLASS, PARENT) RetTy Visit##CLASS##Type(CLASS##Type *T) {       \

+ 21 - 21
include/clang/Analysis/Analyses/LiveVariables.h

@@ -23,7 +23,7 @@ namespace clang {
 class Stmt;
 class Stmt;
 class DeclRefExpr;
 class DeclRefExpr;
 class SourceManager;
 class SourceManager;
-  
+
 struct LiveVariables_ValueTypes {
 struct LiveVariables_ValueTypes {
 
 
   struct ObserverTy;
   struct ObserverTy;
@@ -35,77 +35,77 @@ struct LiveVariables_ValueTypes {
   // (so that we don't explore such expressions twice).  We also want
   // (so that we don't explore such expressions twice).  We also want
   // to compute liveness information for block-level expressions, since these
   // to compute liveness information for block-level expressions, since these
   // act as "temporary" values.
   // act as "temporary" values.
-  
+
   struct AnalysisDataTy : public StmtDeclBitVector_Types::AnalysisDataTy {
   struct AnalysisDataTy : public StmtDeclBitVector_Types::AnalysisDataTy {
     ObserverTy* Observer;
     ObserverTy* Observer;
     ValTy AlwaysLive;
     ValTy AlwaysLive;
-    
+
     AnalysisDataTy() : Observer(NULL) {}
     AnalysisDataTy() : Observer(NULL) {}
   };
   };
-  
+
   //===-----------------------------------------------------===//
   //===-----------------------------------------------------===//
   // ObserverTy - Observer for uninitialized values queries.
   // ObserverTy - Observer for uninitialized values queries.
   //===-----------------------------------------------------===//
   //===-----------------------------------------------------===//
 
 
   struct ObserverTy {
   struct ObserverTy {
     virtual ~ObserverTy() {}
     virtual ~ObserverTy() {}
-    
+
     /// ObserveStmt - A callback invoked right before invoking the
     /// ObserveStmt - A callback invoked right before invoking the
     ///  liveness transfer function on the given statement.
     ///  liveness transfer function on the given statement.
-    virtual void ObserveStmt(Stmt* S, const AnalysisDataTy& AD, 
+    virtual void ObserveStmt(Stmt* S, const AnalysisDataTy& AD,
                              const ValTy& V) {}
                              const ValTy& V) {}
-    
+
     virtual void ObserverKill(DeclRefExpr* DR) {}
     virtual void ObserverKill(DeclRefExpr* DR) {}
   };
   };
 };
 };
 
 
 class LiveVariables : public DataflowValues<LiveVariables_ValueTypes,
 class LiveVariables : public DataflowValues<LiveVariables_ValueTypes,
                                             dataflow::backward_analysis_tag> {
                                             dataflow::backward_analysis_tag> {
-                                              
-                                              
+
+
 public:
 public:
   typedef LiveVariables_ValueTypes::ObserverTy ObserverTy;
   typedef LiveVariables_ValueTypes::ObserverTy ObserverTy;
-    
+
   LiveVariables(ASTContext& Ctx, CFG& cfg);
   LiveVariables(ASTContext& Ctx, CFG& cfg);
-  
+
   /// IsLive - Return true if a variable is live at beginning of a
   /// IsLive - Return true if a variable is live at beginning of a
   /// specified block.
   /// specified block.
   bool isLive(const CFGBlock* B, const VarDecl* D) const;
   bool isLive(const CFGBlock* B, const VarDecl* D) const;
-                                              
+
   /// IsLive - Returns true if a variable is live at the beginning of the
   /// IsLive - Returns true if a variable is live at the beginning of the
   ///  the statement.  This query only works if liveness information
   ///  the statement.  This query only works if liveness information
   ///  has been recorded at the statement level (see runOnAllBlocks), and
   ///  has been recorded at the statement level (see runOnAllBlocks), and
   ///  only returns liveness information for block-level expressions.
   ///  only returns liveness information for block-level expressions.
   bool isLive(const Stmt* S, const VarDecl* D) const;
   bool isLive(const Stmt* S, const VarDecl* D) const;
-                                              
+
   /// IsLive - Returns true the block-level expression "value" is live
   /// IsLive - Returns true the block-level expression "value" is live
   ///  before the given block-level expression (see runOnAllBlocks).
   ///  before the given block-level expression (see runOnAllBlocks).
   bool isLive(const Stmt* Loc, const Stmt* StmtVal) const;
   bool isLive(const Stmt* Loc, const Stmt* StmtVal) const;
-  
+
   /// IsLive - Return true if a variable is live according to the
   /// IsLive - Return true if a variable is live according to the
   ///  provided livness bitvector.
   ///  provided livness bitvector.
   bool isLive(const ValTy& V, const VarDecl* D) const;
   bool isLive(const ValTy& V, const VarDecl* D) const;
-  
+
   /// dumpLiveness - Print to stderr the liveness information encoded
   /// dumpLiveness - Print to stderr the liveness information encoded
   ///  by a specified bitvector.
   ///  by a specified bitvector.
   void dumpLiveness(const ValTy& V, SourceManager& M) const;
   void dumpLiveness(const ValTy& V, SourceManager& M) const;
-  
+
   /// dumpBlockLiveness - Print to stderr the liveness information
   /// dumpBlockLiveness - Print to stderr the liveness information
   ///  associated with each basic block.
   ///  associated with each basic block.
   void dumpBlockLiveness(SourceManager& M) const;
   void dumpBlockLiveness(SourceManager& M) const;
-  
+
   /// getNumDecls - Return the number of variables (declarations) that
   /// getNumDecls - Return the number of variables (declarations) that
   ///  whose liveness status is being tracked by the dataflow
   ///  whose liveness status is being tracked by the dataflow
   ///  analysis.
   ///  analysis.
   unsigned getNumDecls() const { return getAnalysisData().getNumDecls(); }
   unsigned getNumDecls() const { return getAnalysisData().getNumDecls(); }
-    
+
   /// IntializeValues - This routine can perform extra initialization, but
   /// IntializeValues - This routine can perform extra initialization, but
   ///  for LiveVariables this does nothing since all that logic is in
   ///  for LiveVariables this does nothing since all that logic is in
-  ///  the constructor.                                              
+  ///  the constructor.
   void InitializeValues(const CFG& cfg) {}
   void InitializeValues(const CFG& cfg) {}
-  
+
   void runOnCFG(CFG& cfg);
   void runOnCFG(CFG& cfg);
-                                              
+
   /// runOnAllBlocks - Propagate the dataflow values once for each block,
   /// runOnAllBlocks - Propagate the dataflow values once for each block,
   ///  starting from the current dataflow values.  'recordStmtValues' indicates
   ///  starting from the current dataflow values.  'recordStmtValues' indicates
   ///  whether the method should store dataflow values per each individual
   ///  whether the method should store dataflow values per each individual

+ 12 - 12
include/clang/Analysis/Analyses/UninitializedValues.h

@@ -24,7 +24,7 @@ namespace clang {
   class Expr;
   class Expr;
   class DeclRefExpr;
   class DeclRefExpr;
   class VarDecl;
   class VarDecl;
-  
+
 /// UninitializedValues_ValueTypes - Utility class to wrap type declarations
 /// UninitializedValues_ValueTypes - Utility class to wrap type declarations
 ///   for dataflow values and dataflow analysis state for the
 ///   for dataflow values and dataflow analysis state for the
 ///   Unitialized Values analysis.
 ///   Unitialized Values analysis.
@@ -32,39 +32,39 @@ class UninitializedValues_ValueTypes {
 public:
 public:
 
 
   struct ObserverTy;
   struct ObserverTy;
-  
-  struct AnalysisDataTy : public StmtDeclBitVector_Types::AnalysisDataTy {    
+
+  struct AnalysisDataTy : public StmtDeclBitVector_Types::AnalysisDataTy {
     AnalysisDataTy() : Observer(NULL), FullUninitTaint(true) {}
     AnalysisDataTy() : Observer(NULL), FullUninitTaint(true) {}
     virtual ~AnalysisDataTy() {};
     virtual ~AnalysisDataTy() {};
-    
+
     ObserverTy* Observer;
     ObserverTy* Observer;
     bool FullUninitTaint;
     bool FullUninitTaint;
   };
   };
-  
+
   typedef StmtDeclBitVector_Types::ValTy ValTy;
   typedef StmtDeclBitVector_Types::ValTy ValTy;
-  
+
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   // ObserverTy - Observer for querying DeclRefExprs that use an uninitalized
   // ObserverTy - Observer for querying DeclRefExprs that use an uninitalized
   //   value.
   //   value.
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
-  
+
   struct ObserverTy {
   struct ObserverTy {
     virtual ~ObserverTy();
     virtual ~ObserverTy();
-    virtual void ObserveDeclRefExpr(ValTy& Val, AnalysisDataTy& AD, 
+    virtual void ObserveDeclRefExpr(ValTy& Val, AnalysisDataTy& AD,
                                     DeclRefExpr* DR, VarDecl* VD) = 0;
                                     DeclRefExpr* DR, VarDecl* VD) = 0;
-  };  
+  };
 };
 };
 
 
 /// UninitializedValues - Objects of this class encapsulate dataflow analysis
 /// UninitializedValues - Objects of this class encapsulate dataflow analysis
 ///  information regarding what variable declarations in a function are
 ///  information regarding what variable declarations in a function are
 ///  potentially unintialized.
 ///  potentially unintialized.
-class UninitializedValues : 
-  public DataflowValues<UninitializedValues_ValueTypes> {  
+class UninitializedValues :
+  public DataflowValues<UninitializedValues_ValueTypes> {
 public:
 public:
   typedef UninitializedValues_ValueTypes::ObserverTy ObserverTy;
   typedef UninitializedValues_ValueTypes::ObserverTy ObserverTy;
 
 
   UninitializedValues(CFG &cfg) { getAnalysisData().setCFG(cfg); }
   UninitializedValues(CFG &cfg) { getAnalysisData().setCFG(cfg); }
-  
+
   /// IntializeValues - Create initial dataflow values and meta data for
   /// IntializeValues - Create initial dataflow values and meta data for
   ///  a given CFG.  This is intended to be called by the dataflow solver.
   ///  a given CFG.  This is intended to be called by the dataflow solver.
   void InitializeValues(const CFG& cfg);
   void InitializeValues(const CFG& cfg);

+ 1 - 1
include/clang/Analysis/AnalysisDiagnostic.h

@@ -13,7 +13,7 @@
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/Diagnostic.h"
 
 
 namespace clang {
 namespace clang {
-  namespace diag { 
+  namespace diag {
     enum {
     enum {
 #define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,SFINAE) ENUM,
 #define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,SFINAE) ENUM,
 #define ANALYSISSTART
 #define ANALYSISSTART

+ 66 - 66
include/clang/Analysis/CFG.h

@@ -65,27 +65,27 @@ class CFGBlock {
   ///  statements in the block.  When this variable is non-NULL, it is
   ///  statements in the block.  When this variable is non-NULL, it is
   ///  either an instance of LabelStmt or SwitchCase.
   ///  either an instance of LabelStmt or SwitchCase.
   Stmt *Label;
   Stmt *Label;
-  
+
   /// Terminator - The terminator for a basic block that
   /// Terminator - The terminator for a basic block that
   ///  indicates the type of control-flow that occurs between a block
   ///  indicates the type of control-flow that occurs between a block
   ///  and its successors.
   ///  and its successors.
   Stmt *Terminator;
   Stmt *Terminator;
-  
+
   /// LoopTarget - Some blocks are used to represent the "loop edge" to
   /// LoopTarget - Some blocks are used to represent the "loop edge" to
   ///  the start of a loop from within the loop body.  This Stmt* will be
   ///  the start of a loop from within the loop body.  This Stmt* will be
   ///  refer to the loop statement for such blocks (and be null otherwise).
   ///  refer to the loop statement for such blocks (and be null otherwise).
-  const Stmt *LoopTarget; 
-  
+  const Stmt *LoopTarget;
+
   /// BlockID - A numerical ID assigned to a CFGBlock during construction
   /// BlockID - A numerical ID assigned to a CFGBlock during construction
   ///   of the CFG.
   ///   of the CFG.
   unsigned BlockID;
   unsigned BlockID;
-  
+
   /// Predecessors/Successors - Keep track of the predecessor / successor
   /// Predecessors/Successors - Keep track of the predecessor / successor
   /// CFG blocks.
   /// CFG blocks.
   typedef std::vector<CFGBlock*> AdjacentBlocks;
   typedef std::vector<CFGBlock*> AdjacentBlocks;
   AdjacentBlocks Preds;
   AdjacentBlocks Preds;
   AdjacentBlocks Succs;
   AdjacentBlocks Succs;
-  
+
 public:
 public:
   explicit CFGBlock(unsigned blockid) : Label(NULL), Terminator(NULL),
   explicit CFGBlock(unsigned blockid) : Label(NULL), Terminator(NULL),
                                         LoopTarget(NULL), BlockID(blockid) {}
                                         LoopTarget(NULL), BlockID(blockid) {}
@@ -96,25 +96,25 @@ public:
   typedef StatementListTy::const_iterator                      const_iterator;
   typedef StatementListTy::const_iterator                      const_iterator;
   typedef std::reverse_iterator<const_iterator>        const_reverse_iterator;
   typedef std::reverse_iterator<const_iterator>        const_reverse_iterator;
   typedef std::reverse_iterator<iterator>                    reverse_iterator;
   typedef std::reverse_iterator<iterator>                    reverse_iterator;
-  
+
   Stmt*                        front()       const { return Stmts.front();   }
   Stmt*                        front()       const { return Stmts.front();   }
   Stmt*                        back()        const { return Stmts.back();    }
   Stmt*                        back()        const { return Stmts.back();    }
-  
+
   iterator                     begin()             { return Stmts.begin();   }
   iterator                     begin()             { return Stmts.begin();   }
   iterator                     end()               { return Stmts.end();     }
   iterator                     end()               { return Stmts.end();     }
   const_iterator               begin()       const { return Stmts.begin();   }
   const_iterator               begin()       const { return Stmts.begin();   }
-  const_iterator               end()         const { return Stmts.end();     } 
+  const_iterator               end()         const { return Stmts.end();     }
 
 
   reverse_iterator             rbegin()            { return Stmts.rbegin();  }
   reverse_iterator             rbegin()            { return Stmts.rbegin();  }
   reverse_iterator             rend()              { return Stmts.rend();    }
   reverse_iterator             rend()              { return Stmts.rend();    }
   const_reverse_iterator       rbegin()      const { return Stmts.rbegin();  }
   const_reverse_iterator       rbegin()      const { return Stmts.rbegin();  }
   const_reverse_iterator       rend()        const { return Stmts.rend();    }
   const_reverse_iterator       rend()        const { return Stmts.rend();    }
-  
+
   unsigned                     size()        const { return Stmts.size();    }
   unsigned                     size()        const { return Stmts.size();    }
   bool                         empty()       const { return Stmts.empty();   }
   bool                         empty()       const { return Stmts.empty();   }
 
 
   Stmt*  operator[](size_t i) const  { assert (i < size()); return Stmts[i]; }
   Stmt*  operator[](size_t i) const  { assert (i < size()); return Stmts[i]; }
-  
+
   // CFG iterators
   // CFG iterators
   typedef AdjacentBlocks::iterator                              pred_iterator;
   typedef AdjacentBlocks::iterator                              pred_iterator;
   typedef AdjacentBlocks::const_iterator                  const_pred_iterator;
   typedef AdjacentBlocks::const_iterator                  const_pred_iterator;
@@ -125,22 +125,22 @@ public:
   typedef AdjacentBlocks::const_iterator                  const_succ_iterator;
   typedef AdjacentBlocks::const_iterator                  const_succ_iterator;
   typedef AdjacentBlocks::reverse_iterator              succ_reverse_iterator;
   typedef AdjacentBlocks::reverse_iterator              succ_reverse_iterator;
   typedef AdjacentBlocks::const_reverse_iterator  const_succ_reverse_iterator;
   typedef AdjacentBlocks::const_reverse_iterator  const_succ_reverse_iterator;
-  
+
   pred_iterator                pred_begin()        { return Preds.begin();   }
   pred_iterator                pred_begin()        { return Preds.begin();   }
   pred_iterator                pred_end()          { return Preds.end();     }
   pred_iterator                pred_end()          { return Preds.end();     }
   const_pred_iterator          pred_begin()  const { return Preds.begin();   }
   const_pred_iterator          pred_begin()  const { return Preds.begin();   }
   const_pred_iterator          pred_end()    const { return Preds.end();     }
   const_pred_iterator          pred_end()    const { return Preds.end();     }
-  
+
   pred_reverse_iterator        pred_rbegin()       { return Preds.rbegin();  }
   pred_reverse_iterator        pred_rbegin()       { return Preds.rbegin();  }
-  pred_reverse_iterator        pred_rend()         { return Preds.rend();    }  
+  pred_reverse_iterator        pred_rend()         { return Preds.rend();    }
   const_pred_reverse_iterator  pred_rbegin() const { return Preds.rbegin();  }
   const_pred_reverse_iterator  pred_rbegin() const { return Preds.rbegin();  }
   const_pred_reverse_iterator  pred_rend()   const { return Preds.rend();    }
   const_pred_reverse_iterator  pred_rend()   const { return Preds.rend();    }
 
 
-  succ_iterator                succ_begin()        { return Succs.begin();   }    
+  succ_iterator                succ_begin()        { return Succs.begin();   }
   succ_iterator                succ_end()          { return Succs.end();     }
   succ_iterator                succ_end()          { return Succs.end();     }
   const_succ_iterator          succ_begin()  const { return Succs.begin();   }
   const_succ_iterator          succ_begin()  const { return Succs.begin();   }
-  const_succ_iterator          succ_end()    const { return Succs.end();     }  
-    
+  const_succ_iterator          succ_end()    const { return Succs.end();     }
+
   succ_reverse_iterator        succ_rbegin()       { return Succs.rbegin();  }
   succ_reverse_iterator        succ_rbegin()       { return Succs.rbegin();  }
   succ_reverse_iterator        succ_rend()         { return Succs.rend();    }
   succ_reverse_iterator        succ_rend()         { return Succs.rend();    }
   const_succ_reverse_iterator  succ_rbegin() const { return Succs.rbegin();  }
   const_succ_reverse_iterator  succ_rbegin() const { return Succs.rbegin();  }
@@ -151,9 +151,9 @@ public:
 
 
   unsigned                     pred_size()   const { return Preds.size();    }
   unsigned                     pred_size()   const { return Preds.size();    }
   bool                         pred_empty()  const { return Preds.empty();   }
   bool                         pred_empty()  const { return Preds.empty();   }
-  
+
   // Manipulation of block contents
   // Manipulation of block contents
-  
+
   void appendStmt(Stmt* Statement) { Stmts.push_back(Statement); }
   void appendStmt(Stmt* Statement) { Stmts.push_back(Statement); }
   void setTerminator(Stmt* Statement) { Terminator = Statement; }
   void setTerminator(Stmt* Statement) { Terminator = Statement; }
   void setLabel(Stmt* Statement) { Label = Statement; }
   void setLabel(Stmt* Statement) { Label = Statement; }
@@ -161,35 +161,35 @@ public:
 
 
   Stmt* getTerminator() { return Terminator; }
   Stmt* getTerminator() { return Terminator; }
   const Stmt* getTerminator() const { return Terminator; }
   const Stmt* getTerminator() const { return Terminator; }
-  
+
   Stmt* getTerminatorCondition();
   Stmt* getTerminatorCondition();
-  
+
   const Stmt* getTerminatorCondition() const {
   const Stmt* getTerminatorCondition() const {
     return const_cast<CFGBlock*>(this)->getTerminatorCondition();
     return const_cast<CFGBlock*>(this)->getTerminatorCondition();
   }
   }
-  
+
   const Stmt *getLoopTarget() const { return LoopTarget; }
   const Stmt *getLoopTarget() const { return LoopTarget; }
-  
+
   bool hasBinaryBranchTerminator() const;
   bool hasBinaryBranchTerminator() const;
-  
+
   Stmt* getLabel() { return Label; }
   Stmt* getLabel() { return Label; }
   const Stmt* getLabel() const { return Label; }
   const Stmt* getLabel() const { return Label; }
-  
+
   void reverseStmts();
   void reverseStmts();
-  
+
   void addSuccessor(CFGBlock* Block) {
   void addSuccessor(CFGBlock* Block) {
     if (Block)
     if (Block)
       Block->Preds.push_back(this);
       Block->Preds.push_back(this);
     Succs.push_back(Block);
     Succs.push_back(Block);
   }
   }
-  
+
   unsigned getBlockID() const { return BlockID; }
   unsigned getBlockID() const { return BlockID; }
-  
+
   void dump(const CFG *cfg, const LangOptions &LO) const;
   void dump(const CFG *cfg, const LangOptions &LO) const;
   void print(llvm::raw_ostream &OS, const CFG* cfg, const LangOptions &LO) const;
   void print(llvm::raw_ostream &OS, const CFG* cfg, const LangOptions &LO) const;
   void printTerminator(llvm::raw_ostream &OS, const LangOptions &LO) const;
   void printTerminator(llvm::raw_ostream &OS, const LangOptions &LO) const;
 };
 };
-  
+
 
 
 /// CFG - Represents a source-level, intra-procedural CFG that represents the
 /// CFG - Represents a source-level, intra-procedural CFG that represents the
 ///  control-flow of a Stmt.  The Stmt can represent an entire function body,
 ///  control-flow of a Stmt.  The Stmt can represent an entire function body,
@@ -205,28 +205,28 @@ public:
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
 
 
   /// buildCFG - Builds a CFG from an AST.  The responsibility to free the
   /// buildCFG - Builds a CFG from an AST.  The responsibility to free the
-  ///   constructed CFG belongs to the caller.  
-  static CFG* buildCFG(Stmt* AST, ASTContext *C);  
-  
+  ///   constructed CFG belongs to the caller.
+  static CFG* buildCFG(Stmt* AST, ASTContext *C);
+
   /// createBlock - Create a new block in the CFG.  The CFG owns the block;
   /// createBlock - Create a new block in the CFG.  The CFG owns the block;
   ///  the caller should not directly free it.
   ///  the caller should not directly free it.
   CFGBlock* createBlock();
   CFGBlock* createBlock();
-  
+
   /// setEntry - Set the entry block of the CFG.  This is typically used
   /// setEntry - Set the entry block of the CFG.  This is typically used
   ///  only during CFG construction.  Most CFG clients expect that the
   ///  only during CFG construction.  Most CFG clients expect that the
   ///  entry block has no predecessors and contains no statements.
   ///  entry block has no predecessors and contains no statements.
   void setEntry(CFGBlock *B) { Entry = B; }
   void setEntry(CFGBlock *B) { Entry = B; }
-  
+
   /// setIndirectGotoBlock - Set the block used for indirect goto jumps.
   /// setIndirectGotoBlock - Set the block used for indirect goto jumps.
   ///  This is typically used only during CFG construction.
   ///  This is typically used only during CFG construction.
   void setIndirectGotoBlock(CFGBlock* B) { IndirectGotoBlock = B; }
   void setIndirectGotoBlock(CFGBlock* B) { IndirectGotoBlock = B; }
-  
+
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   // Block Iterators
   // Block Iterators
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
 
 
   typedef std::list<CFGBlock>                      CFGBlockListTy;
   typedef std::list<CFGBlock>                      CFGBlockListTy;
-  
+
   typedef CFGBlockListTy::iterator                 iterator;
   typedef CFGBlockListTy::iterator                 iterator;
   typedef CFGBlockListTy::const_iterator           const_iterator;
   typedef CFGBlockListTy::const_iterator           const_iterator;
   typedef std::reverse_iterator<iterator>          reverse_iterator;
   typedef std::reverse_iterator<iterator>          reverse_iterator;
@@ -234,17 +234,17 @@ public:
 
 
   CFGBlock&                 front()                { return Blocks.front(); }
   CFGBlock&                 front()                { return Blocks.front(); }
   CFGBlock&                 back()                 { return Blocks.back(); }
   CFGBlock&                 back()                 { return Blocks.back(); }
-  
+
   iterator                  begin()                { return Blocks.begin(); }
   iterator                  begin()                { return Blocks.begin(); }
   iterator                  end()                  { return Blocks.end(); }
   iterator                  end()                  { return Blocks.end(); }
   const_iterator            begin()       const    { return Blocks.begin(); }
   const_iterator            begin()       const    { return Blocks.begin(); }
-  const_iterator            end()         const    { return Blocks.end(); } 
-  
+  const_iterator            end()         const    { return Blocks.end(); }
+
   reverse_iterator          rbegin()               { return Blocks.rbegin(); }
   reverse_iterator          rbegin()               { return Blocks.rbegin(); }
   reverse_iterator          rend()                 { return Blocks.rend(); }
   reverse_iterator          rend()                 { return Blocks.rend(); }
   const_reverse_iterator    rbegin()      const    { return Blocks.rbegin(); }
   const_reverse_iterator    rbegin()      const    { return Blocks.rbegin(); }
   const_reverse_iterator    rend()        const    { return Blocks.rend(); }
   const_reverse_iterator    rend()        const    { return Blocks.rend(); }
-  
+
   CFGBlock&                 getEntry()             { return *Entry; }
   CFGBlock&                 getEntry()             { return *Entry; }
   const CFGBlock&           getEntry()    const    { return *Entry; }
   const CFGBlock&           getEntry()    const    { return *Entry; }
   CFGBlock&                 getExit()              { return *Exit; }
   CFGBlock&                 getExit()              { return *Exit; }
@@ -252,18 +252,18 @@ public:
 
 
   CFGBlock*        getIndirectGotoBlock() { return IndirectGotoBlock; }
   CFGBlock*        getIndirectGotoBlock() { return IndirectGotoBlock; }
   const CFGBlock*  getIndirectGotoBlock() const { return IndirectGotoBlock; }
   const CFGBlock*  getIndirectGotoBlock() const { return IndirectGotoBlock; }
-  
+
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   // Member templates useful for various batch operations over CFGs.
   // Member templates useful for various batch operations over CFGs.
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
-  
+
   template <typename CALLBACK>
   template <typename CALLBACK>
   void VisitBlockStmts(CALLBACK& O) const {
   void VisitBlockStmts(CALLBACK& O) const {
     for (const_iterator I=begin(), E=end(); I != E; ++I)
     for (const_iterator I=begin(), E=end(); I != E; ++I)
       for (CFGBlock::const_iterator BI=I->begin(), BE=I->end(); BI != BE; ++BI)
       for (CFGBlock::const_iterator BI=I->begin(), BE=I->end(); BI != BE; ++BI)
         O(*BI);
         O(*BI);
-  }  
-  
+  }
+
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   // CFG Introspection.
   // CFG Introspection.
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
@@ -275,11 +275,11 @@ public:
     operator bool() const { return Idx >= 0; }
     operator bool() const { return Idx >= 0; }
     operator unsigned() const { assert(Idx >=0); return (unsigned) Idx; }
     operator unsigned() const { assert(Idx >=0); return (unsigned) Idx; }
   };
   };
-    
+
   bool          isBlkExpr(const Stmt* S) { return getBlkExprNum(S); }
   bool          isBlkExpr(const Stmt* S) { return getBlkExprNum(S); }
   BlkExprNumTy  getBlkExprNum(const Stmt* S);
   BlkExprNumTy  getBlkExprNum(const Stmt* S);
   unsigned      getNumBlkExprs();
   unsigned      getNumBlkExprs();
-  
+
   /// getNumBlockIDs - Returns the total number of BlockIDs allocated (which
   /// getNumBlockIDs - Returns the total number of BlockIDs allocated (which
   /// start at 0).
   /// start at 0).
   unsigned getNumBlockIDs() const { return NumBlockIDs; }
   unsigned getNumBlockIDs() const { return NumBlockIDs; }
@@ -296,15 +296,15 @@ public:
   // Internal: constructors and data.
   // Internal: constructors and data.
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
 
 
-  CFG() : Entry(NULL), Exit(NULL), IndirectGotoBlock(NULL), NumBlockIDs(0), 
+  CFG() : Entry(NULL), Exit(NULL), IndirectGotoBlock(NULL), NumBlockIDs(0),
           BlkExprMap(NULL) {};
           BlkExprMap(NULL) {};
-  
+
   ~CFG();
   ~CFG();
-  
+
   llvm::BumpPtrAllocator& getAllocator() {
   llvm::BumpPtrAllocator& getAllocator() {
     return Alloc;
     return Alloc;
   }
   }
-    
+
 private:
 private:
   CFGBlock* Entry;
   CFGBlock* Entry;
   CFGBlock* Exit;
   CFGBlock* Exit;
@@ -312,14 +312,14 @@ private:
   // for indirect gotos
   // for indirect gotos
   CFGBlockListTy Blocks;
   CFGBlockListTy Blocks;
   unsigned  NumBlockIDs;
   unsigned  NumBlockIDs;
-  
+
   // BlkExprMap - An opaque pointer to prevent inclusion of DenseMap.h.
   // BlkExprMap - An opaque pointer to prevent inclusion of DenseMap.h.
-  //  It represents a map from Expr* to integers to record the set of 
+  //  It represents a map from Expr* to integers to record the set of
   //  block-level expressions and their "statement number" in the CFG.
   //  block-level expressions and their "statement number" in the CFG.
   void*     BlkExprMap;
   void*     BlkExprMap;
-    
+
   /// Alloc - An internal allocator.
   /// Alloc - An internal allocator.
-  llvm::BumpPtrAllocator Alloc;  
+  llvm::BumpPtrAllocator Alloc;
 };
 };
 } // end namespace clang
 } // end namespace clang
 
 
@@ -334,13 +334,13 @@ namespace llvm {
 template <> struct GraphTraits<clang::CFGBlock* > {
 template <> struct GraphTraits<clang::CFGBlock* > {
   typedef clang::CFGBlock NodeType;
   typedef clang::CFGBlock NodeType;
   typedef clang::CFGBlock::succ_iterator ChildIteratorType;
   typedef clang::CFGBlock::succ_iterator ChildIteratorType;
-  
+
   static NodeType* getEntryNode(clang::CFGBlock* BB)
   static NodeType* getEntryNode(clang::CFGBlock* BB)
   { return BB; }
   { return BB; }
 
 
   static inline ChildIteratorType child_begin(NodeType* N)
   static inline ChildIteratorType child_begin(NodeType* N)
   { return N->succ_begin(); }
   { return N->succ_begin(); }
-    
+
   static inline ChildIteratorType child_end(NodeType* N)
   static inline ChildIteratorType child_end(NodeType* N)
   { return N->succ_end(); }
   { return N->succ_end(); }
 };
 };
@@ -348,13 +348,13 @@ template <> struct GraphTraits<clang::CFGBlock* > {
 template <> struct GraphTraits<const clang::CFGBlock* > {
 template <> struct GraphTraits<const clang::CFGBlock* > {
   typedef const clang::CFGBlock NodeType;
   typedef const clang::CFGBlock NodeType;
   typedef clang::CFGBlock::const_succ_iterator ChildIteratorType;
   typedef clang::CFGBlock::const_succ_iterator ChildIteratorType;
-  
+
   static NodeType* getEntryNode(const clang::CFGBlock* BB)
   static NodeType* getEntryNode(const clang::CFGBlock* BB)
   { return BB; }
   { return BB; }
-  
+
   static inline ChildIteratorType child_begin(NodeType* N)
   static inline ChildIteratorType child_begin(NodeType* N)
   { return N->succ_begin(); }
   { return N->succ_begin(); }
-  
+
   static inline ChildIteratorType child_end(NodeType* N)
   static inline ChildIteratorType child_end(NodeType* N)
   { return N->succ_end(); }
   { return N->succ_end(); }
 };
 };
@@ -368,27 +368,27 @@ template <> struct GraphTraits<Inverse<const clang::CFGBlock*> > {
 
 
   static inline ChildIteratorType child_begin(NodeType* N)
   static inline ChildIteratorType child_begin(NodeType* N)
   { return N->pred_begin(); }
   { return N->pred_begin(); }
-  
+
   static inline ChildIteratorType child_end(NodeType* N)
   static inline ChildIteratorType child_end(NodeType* N)
   { return N->pred_end(); }
   { return N->pred_end(); }
 };
 };
 
 
 // Traits for: CFG
 // Traits for: CFG
 
 
-template <> struct GraphTraits<clang::CFG* > 
+template <> struct GraphTraits<clang::CFG* >
             : public GraphTraits<clang::CFGBlock* >  {
             : public GraphTraits<clang::CFGBlock* >  {
 
 
   typedef clang::CFG::iterator nodes_iterator;
   typedef clang::CFG::iterator nodes_iterator;
-  
-  static NodeType *getEntryNode(clang::CFG* F) { return &F->getEntry(); }  
+
+  static NodeType *getEntryNode(clang::CFG* F) { return &F->getEntry(); }
   static nodes_iterator nodes_begin(clang::CFG* F) { return F->begin(); }
   static nodes_iterator nodes_begin(clang::CFG* F) { return F->begin(); }
   static nodes_iterator nodes_end(clang::CFG* F) { return F->end(); }
   static nodes_iterator nodes_end(clang::CFG* F) { return F->end(); }
 };
 };
 
 
-template <> struct GraphTraits< const clang::CFG* > 
+template <> struct GraphTraits< const clang::CFG* >
             : public GraphTraits< const clang::CFGBlock* >  {
             : public GraphTraits< const clang::CFGBlock* >  {
 
 
-  typedef clang::CFG::const_iterator nodes_iterator;            
+  typedef clang::CFG::const_iterator nodes_iterator;
 
 
   static NodeType *getEntryNode( const clang::CFG* F) { return &F->getEntry(); }
   static NodeType *getEntryNode( const clang::CFG* F) { return &F->getEntry(); }
   static nodes_iterator nodes_begin( const clang::CFG* F) { return F->begin(); }
   static nodes_iterator nodes_begin( const clang::CFG* F) { return F->begin(); }
@@ -404,7 +404,7 @@ template <> struct GraphTraits<Inverse<const clang::CFG*> >
   static nodes_iterator nodes_begin(const clang::CFG* F) { return F->begin();}
   static nodes_iterator nodes_begin(const clang::CFG* F) { return F->begin();}
   static nodes_iterator nodes_end(const clang::CFG* F) { return F->end(); }
   static nodes_iterator nodes_end(const clang::CFG* F) { return F->end(); }
 };
 };
-  
+
 } // end llvm namespace
 } // end llvm namespace
 
 
 #endif
 #endif

+ 50 - 50
include/clang/Analysis/FlowSensitive/DataflowSolver.h

@@ -33,15 +33,15 @@ public:
   /// enqueue - Add a block to the worklist.  Blocks already on the
   /// enqueue - Add a block to the worklist.  Blocks already on the
   ///  worklist are not added a second time.
   ///  worklist are not added a second time.
   void enqueue(const CFGBlock* B) { wlist.insert(B); }
   void enqueue(const CFGBlock* B) { wlist.insert(B); }
-  
+
   /// dequeue - Remove a block from the worklist.
   /// dequeue - Remove a block from the worklist.
   const CFGBlock* dequeue() {
   const CFGBlock* dequeue() {
     assert (!wlist.empty());
     assert (!wlist.empty());
     const CFGBlock* B = *wlist.begin();
     const CFGBlock* B = *wlist.begin();
     wlist.erase(B);
     wlist.erase(B);
-    return B;          
+    return B;
   }
   }
-  
+
   /// isEmpty - Return true if the worklist is empty.
   /// isEmpty - Return true if the worklist is empty.
   bool isEmpty() const { return wlist.empty(); }
   bool isEmpty() const { return wlist.empty(); }
 };
 };
@@ -59,20 +59,20 @@ template <> struct ItrTraits<forward_analysis_tag> {
   typedef CFGBlock::const_pred_iterator PrevBItr;
   typedef CFGBlock::const_pred_iterator PrevBItr;
   typedef CFGBlock::const_succ_iterator NextBItr;
   typedef CFGBlock::const_succ_iterator NextBItr;
   typedef CFGBlock::const_iterator      StmtItr;
   typedef CFGBlock::const_iterator      StmtItr;
-  
+
   static PrevBItr PrevBegin(const CFGBlock* B) { return B->pred_begin(); }
   static PrevBItr PrevBegin(const CFGBlock* B) { return B->pred_begin(); }
   static PrevBItr PrevEnd(const CFGBlock* B) { return B->pred_end(); }
   static PrevBItr PrevEnd(const CFGBlock* B) { return B->pred_end(); }
-  
-  static NextBItr NextBegin(const CFGBlock* B) { return B->succ_begin(); }    
+
+  static NextBItr NextBegin(const CFGBlock* B) { return B->succ_begin(); }
   static NextBItr NextEnd(const CFGBlock* B) { return B->succ_end(); }
   static NextBItr NextEnd(const CFGBlock* B) { return B->succ_end(); }
-  
+
   static StmtItr StmtBegin(const CFGBlock* B) { return B->begin(); }
   static StmtItr StmtBegin(const CFGBlock* B) { return B->begin(); }
   static StmtItr StmtEnd(const CFGBlock* B) { return B->end(); }
   static StmtItr StmtEnd(const CFGBlock* B) { return B->end(); }
-  
+
   static BlockEdge PrevEdge(const CFGBlock* B, const CFGBlock* Prev) {
   static BlockEdge PrevEdge(const CFGBlock* B, const CFGBlock* Prev) {
     return BlockEdge(Prev, B, 0);
     return BlockEdge(Prev, B, 0);
   }
   }
-  
+
   static BlockEdge NextEdge(const CFGBlock* B, const CFGBlock* Next) {
   static BlockEdge NextEdge(const CFGBlock* B, const CFGBlock* Next) {
     return BlockEdge(B, Next, 0);
     return BlockEdge(B, Next, 0);
   }
   }
@@ -82,20 +82,20 @@ template <> struct ItrTraits<backward_analysis_tag> {
   typedef CFGBlock::const_succ_iterator    PrevBItr;
   typedef CFGBlock::const_succ_iterator    PrevBItr;
   typedef CFGBlock::const_pred_iterator    NextBItr;
   typedef CFGBlock::const_pred_iterator    NextBItr;
   typedef CFGBlock::const_reverse_iterator StmtItr;
   typedef CFGBlock::const_reverse_iterator StmtItr;
-  
-  static PrevBItr PrevBegin(const CFGBlock* B) { return B->succ_begin(); }    
+
+  static PrevBItr PrevBegin(const CFGBlock* B) { return B->succ_begin(); }
   static PrevBItr PrevEnd(const CFGBlock* B) { return B->succ_end(); }
   static PrevBItr PrevEnd(const CFGBlock* B) { return B->succ_end(); }
-  
-  static NextBItr NextBegin(const CFGBlock* B) { return B->pred_begin(); }    
+
+  static NextBItr NextBegin(const CFGBlock* B) { return B->pred_begin(); }
   static NextBItr NextEnd(const CFGBlock* B) { return B->pred_end(); }
   static NextBItr NextEnd(const CFGBlock* B) { return B->pred_end(); }
-  
+
   static StmtItr StmtBegin(const CFGBlock* B) { return B->rbegin(); }
   static StmtItr StmtBegin(const CFGBlock* B) { return B->rbegin(); }
-  static StmtItr StmtEnd(const CFGBlock* B) { return B->rend(); }    
-  
+  static StmtItr StmtEnd(const CFGBlock* B) { return B->rend(); }
+
   static BlockEdge PrevEdge(const CFGBlock* B, const CFGBlock* Prev) {
   static BlockEdge PrevEdge(const CFGBlock* B, const CFGBlock* Prev) {
     return BlockEdge(B, Prev, 0);
     return BlockEdge(B, Prev, 0);
   }
   }
-  
+
   static BlockEdge NextEdge(const CFGBlock* B, const CFGBlock* Next) {
   static BlockEdge NextEdge(const CFGBlock* B, const CFGBlock* Next) {
     return BlockEdge(Next, B, 0);
     return BlockEdge(Next, B, 0);
   }
   }
@@ -105,7 +105,7 @@ template <> struct ItrTraits<backward_analysis_tag> {
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 /// DataflowSolverTy - Generic dataflow solver.
 /// DataflowSolverTy - Generic dataflow solver.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
-  
+
 template <typename _DFValuesTy,      // Usually a subclass of DataflowValues
 template <typename _DFValuesTy,      // Usually a subclass of DataflowValues
           typename _TransferFuncsTy,
           typename _TransferFuncsTy,
           typename _MergeOperatorTy,
           typename _MergeOperatorTy,
@@ -120,7 +120,7 @@ public:
   typedef _DFValuesTy                              DFValuesTy;
   typedef _DFValuesTy                              DFValuesTy;
   typedef _TransferFuncsTy                         TransferFuncsTy;
   typedef _TransferFuncsTy                         TransferFuncsTy;
   typedef _MergeOperatorTy                         MergeOperatorTy;
   typedef _MergeOperatorTy                         MergeOperatorTy;
-  
+
   typedef typename _DFValuesTy::AnalysisDirTag     AnalysisDirTag;
   typedef typename _DFValuesTy::AnalysisDirTag     AnalysisDirTag;
   typedef typename _DFValuesTy::ValTy              ValTy;
   typedef typename _DFValuesTy::ValTy              ValTy;
   typedef typename _DFValuesTy::EdgeDataMapTy      EdgeDataMapTy;
   typedef typename _DFValuesTy::EdgeDataMapTy      EdgeDataMapTy;
@@ -130,24 +130,24 @@ public:
   typedef typename ItrTraits::NextBItr             NextBItr;
   typedef typename ItrTraits::NextBItr             NextBItr;
   typedef typename ItrTraits::PrevBItr             PrevBItr;
   typedef typename ItrTraits::PrevBItr             PrevBItr;
   typedef typename ItrTraits::StmtItr              StmtItr;
   typedef typename ItrTraits::StmtItr              StmtItr;
-  
+
   //===----------------------------------------------------===//
   //===----------------------------------------------------===//
   // External interface: constructing and running the solver.
   // External interface: constructing and running the solver.
   //===----------------------------------------------------===//
   //===----------------------------------------------------===//
-  
+
 public:
 public:
   DataflowSolver(DFValuesTy& d) : D(d), TF(d.getAnalysisData()) {}
   DataflowSolver(DFValuesTy& d) : D(d), TF(d.getAnalysisData()) {}
-  ~DataflowSolver() {}  
-  
+  ~DataflowSolver() {}
+
   /// runOnCFG - Computes dataflow values for all blocks in a CFG.
   /// runOnCFG - Computes dataflow values for all blocks in a CFG.
   void runOnCFG(CFG& cfg, bool recordStmtValues = false) {
   void runOnCFG(CFG& cfg, bool recordStmtValues = false) {
     // Set initial dataflow values and boundary conditions.
     // Set initial dataflow values and boundary conditions.
-    D.InitializeValues(cfg);     
+    D.InitializeValues(cfg);
     // Solve the dataflow equations.  This will populate D.EdgeDataMap
     // Solve the dataflow equations.  This will populate D.EdgeDataMap
     // with dataflow values.
     // with dataflow values.
     SolveDataflowEquations(cfg, recordStmtValues);
     SolveDataflowEquations(cfg, recordStmtValues);
   }
   }
-  
+
   /// runOnBlock - Computes dataflow values for a given block.  This
   /// runOnBlock - Computes dataflow values for a given block.  This
   ///  should usually be invoked only after previously computing
   ///  should usually be invoked only after previously computing
   ///  dataflow values using runOnCFG, as runOnBlock is intended to
   ///  dataflow values using runOnCFG, as runOnBlock is intended to
@@ -162,10 +162,10 @@ public:
       ProcessBlock(B, recordStmtValues, AnalysisDirTag());
       ProcessBlock(B, recordStmtValues, AnalysisDirTag());
     }
     }
   }
   }
-  
+
   void runOnBlock(const CFGBlock& B, bool recordStmtValues) {
   void runOnBlock(const CFGBlock& B, bool recordStmtValues) {
     runOnBlock(&B, recordStmtValues);
     runOnBlock(&B, recordStmtValues);
-  }  
+  }
   void runOnBlock(CFG::iterator& I, bool recordStmtValues) {
   void runOnBlock(CFG::iterator& I, bool recordStmtValues) {
     runOnBlock(*I, recordStmtValues);
     runOnBlock(*I, recordStmtValues);
   }
   }
@@ -177,13 +177,13 @@ public:
     for (CFG::const_iterator I=cfg.begin(), E=cfg.end(); I!=E; ++I)
     for (CFG::const_iterator I=cfg.begin(), E=cfg.end(); I!=E; ++I)
       runOnBlock(I, recordStmtValues);
       runOnBlock(I, recordStmtValues);
   }
   }
-  
+
   //===----------------------------------------------------===//
   //===----------------------------------------------------===//
   // Internal solver logic.
   // Internal solver logic.
   //===----------------------------------------------------===//
   //===----------------------------------------------------===//
-  
+
 private:
 private:
- 
+
   /// SolveDataflowEquations - Perform the actual worklist algorithm
   /// SolveDataflowEquations - Perform the actual worklist algorithm
   ///  to compute dataflow values.
   ///  to compute dataflow values.
   void SolveDataflowEquations(CFG& cfg, bool recordStmtValues) {
   void SolveDataflowEquations(CFG& cfg, bool recordStmtValues) {
@@ -191,27 +191,27 @@ private:
     // for every block.  Not all blocks are guaranteed to reach the exit block.
     // for every block.  Not all blocks are guaranteed to reach the exit block.
     for (CFG::iterator I=cfg.begin(), E=cfg.end(); I!=E; ++I)
     for (CFG::iterator I=cfg.begin(), E=cfg.end(); I!=E; ++I)
       WorkList.enqueue(&*I);
       WorkList.enqueue(&*I);
-    
+
     while (!WorkList.isEmpty()) {
     while (!WorkList.isEmpty()) {
       const CFGBlock* B = WorkList.dequeue();
       const CFGBlock* B = WorkList.dequeue();
       ProcessMerge(cfg, B);
       ProcessMerge(cfg, B);
       ProcessBlock(B, recordStmtValues, AnalysisDirTag());
       ProcessBlock(B, recordStmtValues, AnalysisDirTag());
       UpdateEdges(cfg, B, TF.getVal());
       UpdateEdges(cfg, B, TF.getVal());
     }
     }
-  }  
-  
+  }
+
   void ProcessMerge(CFG& cfg, const CFGBlock* B) {
   void ProcessMerge(CFG& cfg, const CFGBlock* B) {
-    ValTy& V = TF.getVal();  
+    ValTy& V = TF.getVal();
     TF.SetTopValue(V);
     TF.SetTopValue(V);
 
 
     // Merge dataflow values from all predecessors of this block.
     // Merge dataflow values from all predecessors of this block.
     MergeOperatorTy Merge;
     MergeOperatorTy Merge;
-    
+
     EdgeDataMapTy& M = D.getEdgeDataMap();
     EdgeDataMapTy& M = D.getEdgeDataMap();
     bool firstMerge = true;
     bool firstMerge = true;
-    
+
     for (PrevBItr I=ItrTraits::PrevBegin(B),E=ItrTraits::PrevEnd(B); I!=E; ++I){
     for (PrevBItr I=ItrTraits::PrevBegin(B),E=ItrTraits::PrevEnd(B); I!=E; ++I){
-      
+
       CFGBlock *PrevBlk = *I;
       CFGBlock *PrevBlk = *I;
 
 
       if (!PrevBlk)
       if (!PrevBlk)
@@ -229,35 +229,35 @@ private:
           Merge(V, EI->second);
           Merge(V, EI->second);
       }
       }
     }
     }
-    
+
     // Set the data for the block.
     // Set the data for the block.
     D.getBlockDataMap()[B].copyValues(V);
     D.getBlockDataMap()[B].copyValues(V);
-  }  
+  }
 
 
   /// ProcessBlock - Process the transfer functions for a given block.
   /// ProcessBlock - Process the transfer functions for a given block.
   void ProcessBlock(const CFGBlock* B, bool recordStmtValues,
   void ProcessBlock(const CFGBlock* B, bool recordStmtValues,
                     dataflow::forward_analysis_tag) {
                     dataflow::forward_analysis_tag) {
-    
+
     for (StmtItr I=ItrTraits::StmtBegin(B), E=ItrTraits::StmtEnd(B); I!=E;++I)
     for (StmtItr I=ItrTraits::StmtBegin(B), E=ItrTraits::StmtEnd(B); I!=E;++I)
       ProcessStmt(*I, recordStmtValues, AnalysisDirTag());
       ProcessStmt(*I, recordStmtValues, AnalysisDirTag());
-    
-    TF.VisitTerminator(const_cast<CFGBlock*>(B));  
+
+    TF.VisitTerminator(const_cast<CFGBlock*>(B));
   }
   }
-  
+
   void ProcessBlock(const CFGBlock* B, bool recordStmtValues,
   void ProcessBlock(const CFGBlock* B, bool recordStmtValues,
                     dataflow::backward_analysis_tag) {
                     dataflow::backward_analysis_tag) {
-    
+
     TF.VisitTerminator(const_cast<CFGBlock*>(B));
     TF.VisitTerminator(const_cast<CFGBlock*>(B));
 
 
     for (StmtItr I=ItrTraits::StmtBegin(B), E=ItrTraits::StmtEnd(B); I!=E;++I)
     for (StmtItr I=ItrTraits::StmtBegin(B), E=ItrTraits::StmtEnd(B); I!=E;++I)
       ProcessStmt(*I, recordStmtValues, AnalysisDirTag());
       ProcessStmt(*I, recordStmtValues, AnalysisDirTag());
   }
   }
-  
+
   void ProcessStmt(const Stmt* S, bool record, dataflow::forward_analysis_tag) {
   void ProcessStmt(const Stmt* S, bool record, dataflow::forward_analysis_tag) {
     if (record) D.getStmtDataMap()[S] = TF.getVal();
     if (record) D.getStmtDataMap()[S] = TF.getVal();
-    TF.BlockStmt_Visit(const_cast<Stmt*>(S));  
+    TF.BlockStmt_Visit(const_cast<Stmt*>(S));
   }
   }
-  
+
   void ProcessStmt(const Stmt* S, bool record, dataflow::backward_analysis_tag){
   void ProcessStmt(const Stmt* S, bool record, dataflow::backward_analysis_tag){
     TF.BlockStmt_Visit(const_cast<Stmt*>(S));
     TF.BlockStmt_Visit(const_cast<Stmt*>(S));
     if (record) D.getStmtDataMap()[S] = TF.getVal();
     if (record) D.getStmtDataMap()[S] = TF.getVal();
@@ -272,12 +272,12 @@ private:
       if (CFGBlock *NextBlk = *I)
       if (CFGBlock *NextBlk = *I)
         UpdateEdgeValue(ItrTraits::NextEdge(B, NextBlk),V, NextBlk);
         UpdateEdgeValue(ItrTraits::NextEdge(B, NextBlk),V, NextBlk);
   }
   }
-    
+
   /// UpdateEdgeValue - Update the value associated with a given edge.
   /// UpdateEdgeValue - Update the value associated with a given edge.
   void UpdateEdgeValue(BlockEdge E, ValTy& V, const CFGBlock* TargetBlock) {
   void UpdateEdgeValue(BlockEdge E, ValTy& V, const CFGBlock* TargetBlock) {
     EdgeDataMapTy& M = D.getEdgeDataMap();
     EdgeDataMapTy& M = D.getEdgeDataMap();
     typename EdgeDataMapTy::iterator I = M.find(E);
     typename EdgeDataMapTy::iterator I = M.find(E);
-      
+
     if (I == M.end()) {  // First computed value for this edge?
     if (I == M.end()) {  // First computed value for this edge?
       M[E].copyValues(V);
       M[E].copyValues(V);
       WorkList.enqueue(TargetBlock);
       WorkList.enqueue(TargetBlock);
@@ -287,7 +287,7 @@ private:
       WorkList.enqueue(TargetBlock);
       WorkList.enqueue(TargetBlock);
     }
     }
   }
   }
-    
+
 private:
 private:
   DFValuesTy& D;
   DFValuesTy& D;
   DataflowWorkListTy WorkList;
   DataflowWorkListTy WorkList;

+ 28 - 28
include/clang/Analysis/FlowSensitive/DataflowValues.h

@@ -24,7 +24,7 @@
 /// Dataflow Directional Tag Classes.  These are used for tag dispatching
 /// Dataflow Directional Tag Classes.  These are used for tag dispatching
 ///  within the dataflow solver/transfer functions to determine what direction
 ///  within the dataflow solver/transfer functions to determine what direction
 ///  a dataflow analysis flows.
 ///  a dataflow analysis flows.
-//===----------------------------------------------------------------------===//   
+//===----------------------------------------------------------------------===//
 
 
 namespace clang {
 namespace clang {
 namespace dataflow {
 namespace dataflow {
@@ -34,19 +34,19 @@ namespace dataflow {
 
 
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 /// DataflowValues.  Container class to store dataflow values for a CFG.
 /// DataflowValues.  Container class to store dataflow values for a CFG.
-//===----------------------------------------------------------------------===//   
-  
+//===----------------------------------------------------------------------===//
+
 template <typename ValueTypes,
 template <typename ValueTypes,
           typename _AnalysisDirTag = dataflow::forward_analysis_tag >
           typename _AnalysisDirTag = dataflow::forward_analysis_tag >
 class DataflowValues {
 class DataflowValues {
 
 
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   // Type declarations.
   // Type declarations.
-  //===--------------------------------------------------------------------===//    
+  //===--------------------------------------------------------------------===//
 
 
 public:
 public:
   typedef typename ValueTypes::ValTy               ValTy;
   typedef typename ValueTypes::ValTy               ValTy;
-  typedef typename ValueTypes::AnalysisDataTy      AnalysisDataTy;  
+  typedef typename ValueTypes::AnalysisDataTy      AnalysisDataTy;
   typedef _AnalysisDirTag                          AnalysisDirTag;
   typedef _AnalysisDirTag                          AnalysisDirTag;
   typedef llvm::DenseMap<ProgramPoint, ValTy>      EdgeDataMapTy;
   typedef llvm::DenseMap<ProgramPoint, ValTy>      EdgeDataMapTy;
   typedef llvm::DenseMap<const CFGBlock*, ValTy>   BlockDataMapTy;
   typedef llvm::DenseMap<const CFGBlock*, ValTy>   BlockDataMapTy;
@@ -60,15 +60,15 @@ public:
   /// isForwardAnalysis - Returns true if the dataflow values are computed
   /// isForwardAnalysis - Returns true if the dataflow values are computed
   ///  from a forward analysis.
   ///  from a forward analysis.
   bool isForwardAnalysis() { return isForwardAnalysis(AnalysisDirTag()); }
   bool isForwardAnalysis() { return isForwardAnalysis(AnalysisDirTag()); }
-  
+
   /// isBackwardAnalysis - Returns true if the dataflow values are computed
   /// isBackwardAnalysis - Returns true if the dataflow values are computed
   ///  from a backward analysis.
   ///  from a backward analysis.
   bool isBackwardAnalysis() { return !isForwardAnalysis(); }
   bool isBackwardAnalysis() { return !isForwardAnalysis(); }
-  
+
 private:
 private:
   bool isForwardAnalysis(dataflow::forward_analysis_tag)  { return true; }
   bool isForwardAnalysis(dataflow::forward_analysis_tag)  { return true; }
-  bool isForwardAnalysis(dataflow::backward_analysis_tag) { return false; }  
-  
+  bool isForwardAnalysis(dataflow::backward_analysis_tag) { return false; }
+
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   // Initialization and accessors methods.
   // Initialization and accessors methods.
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
@@ -76,10 +76,10 @@ private:
 public:
 public:
   DataflowValues() : StmtDataMap(NULL) {}
   DataflowValues() : StmtDataMap(NULL) {}
   ~DataflowValues() { delete StmtDataMap; }
   ~DataflowValues() { delete StmtDataMap; }
-  
+
   /// InitializeValues - Invoked by the solver to initialize state needed for
   /// InitializeValues - Invoked by the solver to initialize state needed for
   ///  dataflow analysis.  This method is usually specialized by subclasses.
   ///  dataflow analysis.  This method is usually specialized by subclasses.
-  void InitializeValues(const CFG& cfg) {};  
+  void InitializeValues(const CFG& cfg) {};
 
 
 
 
   /// getEdgeData - Retrieves the dataflow values associated with a
   /// getEdgeData - Retrieves the dataflow values associated with a
@@ -89,28 +89,28 @@ public:
     assert (I != EdgeDataMap.end() && "No data associated with Edge.");
     assert (I != EdgeDataMap.end() && "No data associated with Edge.");
     return I->second;
     return I->second;
   }
   }
-  
+
   const ValTy& getEdgeData(const BlockEdge& E) const {
   const ValTy& getEdgeData(const BlockEdge& E) const {
     return reinterpret_cast<DataflowValues*>(this)->getEdgeData(E);
     return reinterpret_cast<DataflowValues*>(this)->getEdgeData(E);
-  }  
+  }
 
 
-  /// getBlockData - Retrieves the dataflow values associated with a 
+  /// getBlockData - Retrieves the dataflow values associated with a
   ///  specified CFGBlock.  If the dataflow analysis is a forward analysis,
   ///  specified CFGBlock.  If the dataflow analysis is a forward analysis,
   ///  this data is associated with the END of the block.  If the analysis
   ///  this data is associated with the END of the block.  If the analysis
-  ///  is a backwards analysis, it is associated with the ENTRY of the block.  
+  ///  is a backwards analysis, it is associated with the ENTRY of the block.
   ValTy& getBlockData(const CFGBlock* B) {
   ValTy& getBlockData(const CFGBlock* B) {
     typename BlockDataMapTy::iterator I = BlockDataMap.find(B);
     typename BlockDataMapTy::iterator I = BlockDataMap.find(B);
     assert (I != BlockDataMap.end() && "No data associated with block.");
     assert (I != BlockDataMap.end() && "No data associated with block.");
     return I->second;
     return I->second;
   }
   }
-  
+
   const ValTy& getBlockData(const CFGBlock* B) const {
   const ValTy& getBlockData(const CFGBlock* B) const {
     return const_cast<DataflowValues*>(this)->getBlockData(B);
     return const_cast<DataflowValues*>(this)->getBlockData(B);
   }
   }
-  
-  /// getStmtData - Retrieves the dataflow values associated with a 
+
+  /// getStmtData - Retrieves the dataflow values associated with a
   ///  specified Stmt.  If the dataflow analysis is a forward analysis,
   ///  specified Stmt.  If the dataflow analysis is a forward analysis,
-  ///  this data corresponds to the point immediately before a Stmt. 
+  ///  this data corresponds to the point immediately before a Stmt.
   ///  If the analysis is a backwards analysis, it is associated with
   ///  If the analysis is a backwards analysis, it is associated with
   ///  the point after a Stmt.  This data is only computed for block-level
   ///  the point after a Stmt.  This data is only computed for block-level
   ///  expressions, and only when requested when the analysis is executed.
   ///  expressions, and only when requested when the analysis is executed.
@@ -120,11 +120,11 @@ public:
     assert (I != StmtDataMap->end() && "No data associated with statement.");
     assert (I != StmtDataMap->end() && "No data associated with statement.");
     return I->second;
     return I->second;
   }
   }
-  
+
   const ValTy& getStmtData(const Stmt* S) const {
   const ValTy& getStmtData(const Stmt* S) const {
     return const_cast<DataflowValues*>(this)->getStmtData(S);
     return const_cast<DataflowValues*>(this)->getStmtData(S);
   }
   }
-  
+
   /// getEdgeDataMap - Retrieves the internal map between CFG edges and
   /// getEdgeDataMap - Retrieves the internal map between CFG edges and
   ///  dataflow values.  Usually used by a dataflow solver to compute
   ///  dataflow values.  Usually used by a dataflow solver to compute
   ///  values for blocks.
   ///  values for blocks.
@@ -138,35 +138,35 @@ public:
   /// to the dataflow values at the end of the block.
   /// to the dataflow values at the end of the block.
   BlockDataMapTy& getBlockDataMap() { return BlockDataMap; }
   BlockDataMapTy& getBlockDataMap() { return BlockDataMap; }
   const BlockDataMapTy& getBlockDataMap() const { return BlockDataMap; }
   const BlockDataMapTy& getBlockDataMap() const { return BlockDataMap; }
-  
+
   /// getStmtDataMap - Retrieves the internal map between Stmts and
   /// getStmtDataMap - Retrieves the internal map between Stmts and
   /// dataflow values.
   /// dataflow values.
   StmtDataMapTy& getStmtDataMap() {
   StmtDataMapTy& getStmtDataMap() {
     if (!StmtDataMap) StmtDataMap = new StmtDataMapTy();
     if (!StmtDataMap) StmtDataMap = new StmtDataMapTy();
     return *StmtDataMap;
     return *StmtDataMap;
   }
   }
-    
+
   const StmtDataMapTy& getStmtDataMap() const {
   const StmtDataMapTy& getStmtDataMap() const {
     return const_cast<DataflowValues*>(this)->getStmtDataMap();
     return const_cast<DataflowValues*>(this)->getStmtDataMap();
   }
   }
 
 
-  /// getAnalysisData - Retrieves the meta data associated with a 
-  ///  dataflow analysis for analyzing a particular CFG.  
+  /// getAnalysisData - Retrieves the meta data associated with a
+  ///  dataflow analysis for analyzing a particular CFG.
   ///  This is typically consumed by transfer function code (via the solver).
   ///  This is typically consumed by transfer function code (via the solver).
   ///  This can also be used by subclasses to interpret the dataflow values.
   ///  This can also be used by subclasses to interpret the dataflow values.
   AnalysisDataTy& getAnalysisData() { return AnalysisData; }
   AnalysisDataTy& getAnalysisData() { return AnalysisData; }
   const AnalysisDataTy& getAnalysisData() const { return AnalysisData; }
   const AnalysisDataTy& getAnalysisData() const { return AnalysisData; }
-  
+
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   // Internal data.
   // Internal data.
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
-  
+
 protected:
 protected:
   EdgeDataMapTy      EdgeDataMap;
   EdgeDataMapTy      EdgeDataMap;
   BlockDataMapTy     BlockDataMap;
   BlockDataMapTy     BlockDataMap;
   StmtDataMapTy*     StmtDataMap;
   StmtDataMapTy*     StmtDataMap;
   AnalysisDataTy     AnalysisData;
   AnalysisDataTy     AnalysisData;
-};          
+};
 
 
 } // end namespace clang
 } // end namespace clang
 #endif
 #endif

+ 10 - 10
include/clang/Analysis/LocalCheckers.h

@@ -31,28 +31,28 @@ class BugReporter;
 class ObjCImplementationDecl;
 class ObjCImplementationDecl;
 class LangOptions;
 class LangOptions;
 class GRExprEngine;
 class GRExprEngine;
-  
-void CheckDeadStores(LiveVariables& L, BugReporter& BR); 
-  
+
+void CheckDeadStores(LiveVariables& L, BugReporter& BR);
+
 void CheckUninitializedValues(CFG& cfg, ASTContext& Ctx, Diagnostic& Diags,
 void CheckUninitializedValues(CFG& cfg, ASTContext& Ctx, Diagnostic& Diags,
                               bool FullUninitTaint=false);
                               bool FullUninitTaint=false);
-  
+
 GRTransferFuncs* MakeCFRefCountTF(ASTContext& Ctx, bool GCEnabled,
 GRTransferFuncs* MakeCFRefCountTF(ASTContext& Ctx, bool GCEnabled,
-                                  const LangOptions& lopts); 
-  
+                                  const LangOptions& lopts);
+
 void CheckObjCDealloc(const ObjCImplementationDecl* D, const LangOptions& L,
 void CheckObjCDealloc(const ObjCImplementationDecl* D, const LangOptions& L,
                       BugReporter& BR);
                       BugReporter& BR);
-  
+
 void CheckObjCInstMethSignature(const ObjCImplementationDecl *ID,
 void CheckObjCInstMethSignature(const ObjCImplementationDecl *ID,
                                 BugReporter& BR);
                                 BugReporter& BR);
 
 
 void CheckObjCUnusedIvar(const ObjCImplementationDecl *D, BugReporter& BR);
 void CheckObjCUnusedIvar(const ObjCImplementationDecl *D, BugReporter& BR);
-  
+
 void RegisterAppleChecks(GRExprEngine& Eng, const Decl &D);
 void RegisterAppleChecks(GRExprEngine& Eng, const Decl &D);
-  
+
 void CheckSecuritySyntaxOnly(const Decl *D, BugReporter &BR);
 void CheckSecuritySyntaxOnly(const Decl *D, BugReporter &BR);
 
 
-  
+
 } // end namespace clang
 } // end namespace clang
 
 
 #endif
 #endif

+ 104 - 104
include/clang/Analysis/PathDiagnostic.h

@@ -38,21 +38,21 @@ class PathDiagnosticClient : public DiagnosticClient  {
 public:
 public:
   PathDiagnosticClient() {}
   PathDiagnosticClient() {}
   virtual ~PathDiagnosticClient() {}
   virtual ~PathDiagnosticClient() {}
-  
+
   virtual void SetPreprocessor(Preprocessor *PP) {}
   virtual void SetPreprocessor(Preprocessor *PP) {}
-  
+
   virtual void HandleDiagnostic(Diagnostic::Level DiagLevel,
   virtual void HandleDiagnostic(Diagnostic::Level DiagLevel,
                                 const DiagnosticInfo &Info);
                                 const DiagnosticInfo &Info);
-  
+
   virtual void HandlePathDiagnostic(const PathDiagnostic* D) = 0;
   virtual void HandlePathDiagnostic(const PathDiagnostic* D) = 0;
-  
-  enum PathGenerationScheme { Minimal, Extensive };  
-  virtual PathGenerationScheme getGenerationScheme() const { return Minimal; }   
+
+  enum PathGenerationScheme { Minimal, Extensive };
+  virtual PathGenerationScheme getGenerationScheme() const { return Minimal; }
   virtual bool supportsLogicalOpControlFlow() const { return false; }
   virtual bool supportsLogicalOpControlFlow() const { return false; }
   virtual bool supportsAllBlockEdges() const { return false; }
   virtual bool supportsAllBlockEdges() const { return false; }
   virtual bool useVerboseDescription() const { return true; }
   virtual bool useVerboseDescription() const { return true; }
-};  
-  
+};
+
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // Path-sensitive diagnostics.
 // Path-sensitive diagnostics.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
@@ -60,11 +60,11 @@ public:
 class PathDiagnosticRange : public SourceRange {
 class PathDiagnosticRange : public SourceRange {
 public:
 public:
   const bool isPoint;
   const bool isPoint;
-  
+
   PathDiagnosticRange(const SourceRange &R, bool isP = false)
   PathDiagnosticRange(const SourceRange &R, bool isP = false)
     : SourceRange(R), isPoint(isP) {}
     : SourceRange(R), isPoint(isP) {}
 };
 };
-  
+
 class PathDiagnosticLocation {
 class PathDiagnosticLocation {
 private:
 private:
   enum Kind { RangeK, SingleLocK, StmtK, DeclK } K;
   enum Kind { RangeK, SingleLocK, StmtK, DeclK } K;
@@ -75,27 +75,27 @@ private:
 public:
 public:
   PathDiagnosticLocation()
   PathDiagnosticLocation()
     : K(SingleLocK), S(0), D(0), SM(0) {}
     : K(SingleLocK), S(0), D(0), SM(0) {}
-  
+
   PathDiagnosticLocation(FullSourceLoc L)
   PathDiagnosticLocation(FullSourceLoc L)
     : K(SingleLocK), R(L, L), S(0), D(0), SM(&L.getManager()) {}
     : K(SingleLocK), R(L, L), S(0), D(0), SM(&L.getManager()) {}
-  
+
   PathDiagnosticLocation(const Stmt *s, const SourceManager &sm)
   PathDiagnosticLocation(const Stmt *s, const SourceManager &sm)
     : K(StmtK), S(s), D(0), SM(&sm) {}
     : K(StmtK), S(s), D(0), SM(&sm) {}
-  
+
   PathDiagnosticLocation(SourceRange r, const SourceManager &sm)
   PathDiagnosticLocation(SourceRange r, const SourceManager &sm)
     : K(RangeK), R(r), S(0), D(0), SM(&sm) {}
     : K(RangeK), R(r), S(0), D(0), SM(&sm) {}
-  
+
   PathDiagnosticLocation(const Decl *d, const SourceManager &sm)
   PathDiagnosticLocation(const Decl *d, const SourceManager &sm)
     : K(DeclK), S(0), D(d), SM(&sm) {}
     : K(DeclK), S(0), D(d), SM(&sm) {}
-  
+
   bool operator==(const PathDiagnosticLocation &X) const {
   bool operator==(const PathDiagnosticLocation &X) const {
     return K == X.K && R == X.R && S == X.S && D == X.D;
     return K == X.K && R == X.R && S == X.S && D == X.D;
   }
   }
-  
+
   bool operator!=(const PathDiagnosticLocation &X) const {
   bool operator!=(const PathDiagnosticLocation &X) const {
     return K != X.K || R != X.R || S != X.S || D != X.D;;
     return K != X.K || R != X.R || S != X.S || D != X.D;;
   }
   }
-  
+
   PathDiagnosticLocation& operator=(const PathDiagnosticLocation &X) {
   PathDiagnosticLocation& operator=(const PathDiagnosticLocation &X) {
     K = X.K;
     K = X.K;
     R = X.R;
     R = X.R;
@@ -104,26 +104,26 @@ public:
     SM = X.SM;
     SM = X.SM;
     return *this;
     return *this;
   }
   }
-  
+
   bool isValid() const {
   bool isValid() const {
     return SM != 0;
     return SM != 0;
   }
   }
-  
+
   const SourceManager& getSourceManager() const { assert(isValid());return *SM;}
   const SourceManager& getSourceManager() const { assert(isValid());return *SM;}
-    
+
   FullSourceLoc asLocation() const;
   FullSourceLoc asLocation() const;
   PathDiagnosticRange asRange() const;
   PathDiagnosticRange asRange() const;
   const Stmt *asStmt() const { assert(isValid()); return S; }
   const Stmt *asStmt() const { assert(isValid()); return S; }
   const Decl *asDecl() const { assert(isValid()); return D; }
   const Decl *asDecl() const { assert(isValid()); return D; }
-  
+
   bool hasRange() const { return K == StmtK || K == RangeK || K == DeclK; }
   bool hasRange() const { return K == StmtK || K == RangeK || K == DeclK; }
-  
+
   void invalidate() {
   void invalidate() {
     *this = PathDiagnosticLocation();
     *this = PathDiagnosticLocation();
   }
   }
-  
+
   void flatten();
   void flatten();
-  
+
   const SourceManager& getManager() const { assert(isValid()); return *SM; }
   const SourceManager& getManager() const { assert(isValid()); return *SM; }
 };
 };
 
 
@@ -134,10 +134,10 @@ public:
   PathDiagnosticLocationPair(const PathDiagnosticLocation &start,
   PathDiagnosticLocationPair(const PathDiagnosticLocation &start,
                              const PathDiagnosticLocation &end)
                              const PathDiagnosticLocation &end)
     : Start(start), End(end) {}
     : Start(start), End(end) {}
-  
+
   const PathDiagnosticLocation &getStart() const { return Start; }
   const PathDiagnosticLocation &getStart() const { return Start; }
   const PathDiagnosticLocation &getEnd() const { return End; }
   const PathDiagnosticLocation &getEnd() const { return End; }
-  
+
   void flatten() {
   void flatten() {
     Start.flatten();
     Start.flatten();
     End.flatten();
     End.flatten();
@@ -146,7 +146,7 @@ public:
 
 
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // Path "pieces" for path-sensitive diagnostics.
 // Path "pieces" for path-sensitive diagnostics.
-//===----------------------------------------------------------------------===//  
+//===----------------------------------------------------------------------===//
 
 
 class PathDiagnosticPiece {
 class PathDiagnosticPiece {
 public:
 public:
@@ -159,7 +159,7 @@ private:
   const Kind kind;
   const Kind kind;
   const DisplayHint Hint;
   const DisplayHint Hint;
   std::vector<SourceRange> ranges;
   std::vector<SourceRange> ranges;
-  
+
   // Do not implement:
   // Do not implement:
   PathDiagnosticPiece();
   PathDiagnosticPiece();
   PathDiagnosticPiece(const PathDiagnosticPiece &P);
   PathDiagnosticPiece(const PathDiagnosticPiece &P);
@@ -167,42 +167,42 @@ private:
 
 
 protected:
 protected:
   PathDiagnosticPiece(const std::string& s, Kind k, DisplayHint hint = Below);
   PathDiagnosticPiece(const std::string& s, Kind k, DisplayHint hint = Below);
-  
+
   PathDiagnosticPiece(const char* s, Kind k, DisplayHint hint = Below);
   PathDiagnosticPiece(const char* s, Kind k, DisplayHint hint = Below);
 
 
   PathDiagnosticPiece(Kind k, DisplayHint hint = Below);
   PathDiagnosticPiece(Kind k, DisplayHint hint = Below);
-  
+
 public:
 public:
   virtual ~PathDiagnosticPiece();
   virtual ~PathDiagnosticPiece();
-  
+
   const std::string& getString() const { return str; }
   const std::string& getString() const { return str; }
-  
+
   /// getDisplayHint - Return a hint indicating where the diagnostic should
   /// getDisplayHint - Return a hint indicating where the diagnostic should
   ///  be displayed by the PathDiagnosticClient.
   ///  be displayed by the PathDiagnosticClient.
   DisplayHint getDisplayHint() const { return Hint; }
   DisplayHint getDisplayHint() const { return Hint; }
-  
+
   virtual PathDiagnosticLocation getLocation() const = 0;
   virtual PathDiagnosticLocation getLocation() const = 0;
   virtual void flattenLocations() = 0;
   virtual void flattenLocations() = 0;
-  
+
   Kind getKind() const { return kind; }
   Kind getKind() const { return kind; }
-  
+
   void addRange(SourceRange R) { ranges.push_back(R); }
   void addRange(SourceRange R) { ranges.push_back(R); }
-  
+
   void addRange(SourceLocation B, SourceLocation E) {
   void addRange(SourceLocation B, SourceLocation E) {
     ranges.push_back(SourceRange(B,E));
     ranges.push_back(SourceRange(B,E));
   }
   }
-  
+
   void addCodeModificationHint(const CodeModificationHint& Hint) {
   void addCodeModificationHint(const CodeModificationHint& Hint) {
     CodeModificationHints.push_back(Hint);
     CodeModificationHints.push_back(Hint);
   }
   }
-  
+
   typedef const SourceRange* range_iterator;
   typedef const SourceRange* range_iterator;
-  
+
   range_iterator ranges_begin() const {
   range_iterator ranges_begin() const {
     return ranges.empty() ? NULL : &ranges[0];
     return ranges.empty() ? NULL : &ranges[0];
   }
   }
-  
-  range_iterator ranges_end() const { 
+
+  range_iterator ranges_end() const {
     return ranges_begin() + ranges.size();
     return ranges_begin() + ranges.size();
   }
   }
 
 
@@ -213,7 +213,7 @@ public:
   }
   }
 
 
   code_modifications_iterator code_modifications_end() const {
   code_modifications_iterator code_modifications_end() const {
-    return CodeModificationHints.empty()? 0 
+    return CodeModificationHints.empty()? 0
                    : &CodeModificationHints[0] + CodeModificationHints.size();
                    : &CodeModificationHints[0] + CodeModificationHints.size();
   }
   }
 
 
@@ -221,7 +221,7 @@ public:
     return true;
     return true;
   }
   }
 };
 };
-  
+
 class PathDiagnosticSpotPiece : public PathDiagnosticPiece {
 class PathDiagnosticSpotPiece : public PathDiagnosticPiece {
 private:
 private:
   PathDiagnosticLocation Pos;
   PathDiagnosticLocation Pos;
@@ -234,30 +234,30 @@ public:
     assert(Pos.asLocation().isValid() &&
     assert(Pos.asLocation().isValid() &&
            "PathDiagnosticSpotPiece's must have a valid location.");
            "PathDiagnosticSpotPiece's must have a valid location.");
     if (addPosRange && Pos.hasRange()) addRange(Pos.asRange());
     if (addPosRange && Pos.hasRange()) addRange(Pos.asRange());
-  }  
+  }
 
 
   PathDiagnosticLocation getLocation() const { return Pos; }
   PathDiagnosticLocation getLocation() const { return Pos; }
   virtual void flattenLocations() { Pos.flatten(); }
   virtual void flattenLocations() { Pos.flatten(); }
 };
 };
-  
+
 class PathDiagnosticEventPiece : public PathDiagnosticSpotPiece {
 class PathDiagnosticEventPiece : public PathDiagnosticSpotPiece {
 
 
 public:
 public:
   PathDiagnosticEventPiece(const PathDiagnosticLocation &pos,
   PathDiagnosticEventPiece(const PathDiagnosticLocation &pos,
                            const std::string& s, bool addPosRange = true)
                            const std::string& s, bool addPosRange = true)
     : PathDiagnosticSpotPiece(pos, s, Event, addPosRange) {}
     : PathDiagnosticSpotPiece(pos, s, Event, addPosRange) {}
-  
+
   PathDiagnosticEventPiece(const PathDiagnosticLocation &pos, const char* s,
   PathDiagnosticEventPiece(const PathDiagnosticLocation &pos, const char* s,
                            bool addPosRange = true)
                            bool addPosRange = true)
     : PathDiagnosticSpotPiece(pos, s, Event, addPosRange) {}
     : PathDiagnosticSpotPiece(pos, s, Event, addPosRange) {}
-  
+
   ~PathDiagnosticEventPiece();
   ~PathDiagnosticEventPiece();
 
 
   static inline bool classof(const PathDiagnosticPiece* P) {
   static inline bool classof(const PathDiagnosticPiece* P) {
     return P->getKind() == Event;
     return P->getKind() == Event;
   }
   }
 };
 };
-  
+
 class PathDiagnosticControlFlowPiece : public PathDiagnosticPiece {
 class PathDiagnosticControlFlowPiece : public PathDiagnosticPiece {
   std::vector<PathDiagnosticLocationPair> LPairs;
   std::vector<PathDiagnosticLocationPair> LPairs;
 public:
 public:
@@ -267,40 +267,40 @@ public:
     : PathDiagnosticPiece(s, ControlFlow) {
     : PathDiagnosticPiece(s, ControlFlow) {
       LPairs.push_back(PathDiagnosticLocationPair(startPos, endPos));
       LPairs.push_back(PathDiagnosticLocationPair(startPos, endPos));
     }
     }
-  
+
   PathDiagnosticControlFlowPiece(const PathDiagnosticLocation &startPos,
   PathDiagnosticControlFlowPiece(const PathDiagnosticLocation &startPos,
                                  const PathDiagnosticLocation &endPos,
                                  const PathDiagnosticLocation &endPos,
                                  const char* s)
                                  const char* s)
     : PathDiagnosticPiece(s, ControlFlow) {
     : PathDiagnosticPiece(s, ControlFlow) {
       LPairs.push_back(PathDiagnosticLocationPair(startPos, endPos));
       LPairs.push_back(PathDiagnosticLocationPair(startPos, endPos));
     }
     }
-  
+
   PathDiagnosticControlFlowPiece(const PathDiagnosticLocation &startPos,
   PathDiagnosticControlFlowPiece(const PathDiagnosticLocation &startPos,
                                  const PathDiagnosticLocation &endPos)
                                  const PathDiagnosticLocation &endPos)
     : PathDiagnosticPiece(ControlFlow) {
     : PathDiagnosticPiece(ControlFlow) {
       LPairs.push_back(PathDiagnosticLocationPair(startPos, endPos));
       LPairs.push_back(PathDiagnosticLocationPair(startPos, endPos));
     }
     }
-  
+
   ~PathDiagnosticControlFlowPiece();
   ~PathDiagnosticControlFlowPiece();
-  
+
   PathDiagnosticLocation getStartLocation() const {
   PathDiagnosticLocation getStartLocation() const {
     assert(!LPairs.empty() &&
     assert(!LPairs.empty() &&
            "PathDiagnosticControlFlowPiece needs at least one location.");
            "PathDiagnosticControlFlowPiece needs at least one location.");
     return LPairs[0].getStart();
     return LPairs[0].getStart();
   }
   }
-    
+
   PathDiagnosticLocation getEndLocation() const {
   PathDiagnosticLocation getEndLocation() const {
     assert(!LPairs.empty() &&
     assert(!LPairs.empty() &&
            "PathDiagnosticControlFlowPiece needs at least one location.");
            "PathDiagnosticControlFlowPiece needs at least one location.");
     return LPairs[0].getEnd();
     return LPairs[0].getEnd();
   }
   }
-  
+
   void push_back(const PathDiagnosticLocationPair &X) { LPairs.push_back(X); }
   void push_back(const PathDiagnosticLocationPair &X) { LPairs.push_back(X); }
-  
+
   virtual PathDiagnosticLocation getLocation() const {
   virtual PathDiagnosticLocation getLocation() const {
     return getStartLocation();
     return getStartLocation();
   }
   }
-  
+
   typedef std::vector<PathDiagnosticLocationPair>::iterator iterator;
   typedef std::vector<PathDiagnosticLocationPair>::iterator iterator;
   iterator begin() { return LPairs.begin(); }
   iterator begin() { return LPairs.begin(); }
   iterator end()   { return LPairs.end(); }
   iterator end()   { return LPairs.end(); }
@@ -308,7 +308,7 @@ public:
   virtual void flattenLocations() {
   virtual void flattenLocations() {
     for (iterator I=begin(), E=end(); I!=E; ++I) I->flatten();
     for (iterator I=begin(), E=end(); I!=E; ++I) I->flatten();
   }
   }
-  
+
   typedef std::vector<PathDiagnosticLocationPair>::const_iterator
   typedef std::vector<PathDiagnosticLocationPair>::const_iterator
           const_iterator;
           const_iterator;
   const_iterator begin() const { return LPairs.begin(); }
   const_iterator begin() const { return LPairs.begin(); }
@@ -318,32 +318,32 @@ public:
     return P->getKind() == ControlFlow;
     return P->getKind() == ControlFlow;
   }
   }
 };
 };
-  
+
 class PathDiagnosticMacroPiece : public PathDiagnosticSpotPiece {
 class PathDiagnosticMacroPiece : public PathDiagnosticSpotPiece {
   std::vector<PathDiagnosticPiece*> SubPieces;
   std::vector<PathDiagnosticPiece*> SubPieces;
 public:
 public:
   PathDiagnosticMacroPiece(const PathDiagnosticLocation &pos)
   PathDiagnosticMacroPiece(const PathDiagnosticLocation &pos)
     : PathDiagnosticSpotPiece(pos, "", Macro) {}
     : PathDiagnosticSpotPiece(pos, "", Macro) {}
-  
+
   ~PathDiagnosticMacroPiece();
   ~PathDiagnosticMacroPiece();
-  
+
   bool containsEvent() const;
   bool containsEvent() const;
 
 
   void push_back(PathDiagnosticPiece* P) { SubPieces.push_back(P); }
   void push_back(PathDiagnosticPiece* P) { SubPieces.push_back(P); }
-  
+
   typedef std::vector<PathDiagnosticPiece*>::iterator iterator;
   typedef std::vector<PathDiagnosticPiece*>::iterator iterator;
   iterator begin() { return SubPieces.begin(); }
   iterator begin() { return SubPieces.begin(); }
   iterator end() { return SubPieces.end(); }
   iterator end() { return SubPieces.end(); }
-  
+
   virtual void flattenLocations() {
   virtual void flattenLocations() {
     PathDiagnosticSpotPiece::flattenLocations();
     PathDiagnosticSpotPiece::flattenLocations();
     for (iterator I=begin(), E=end(); I!=E; ++I) (*I)->flattenLocations();
     for (iterator I=begin(), E=end(); I!=E; ++I) (*I)->flattenLocations();
   }
   }
-  
+
   typedef std::vector<PathDiagnosticPiece*>::const_iterator const_iterator;
   typedef std::vector<PathDiagnosticPiece*>::const_iterator const_iterator;
   const_iterator begin() const { return SubPieces.begin(); }
   const_iterator begin() const { return SubPieces.begin(); }
   const_iterator end() const { return SubPieces.end(); }
   const_iterator end() const { return SubPieces.end(); }
-  
+
   static inline bool classof(const PathDiagnosticPiece* P) {
   static inline bool classof(const PathDiagnosticPiece* P) {
     return P->getKind() == Macro;
     return P->getKind() == Macro;
   }
   }
@@ -359,129 +359,129 @@ class PathDiagnostic {
   std::string Desc;
   std::string Desc;
   std::string Category;
   std::string Category;
   std::deque<std::string> OtherDesc;
   std::deque<std::string> OtherDesc;
-  
-public:  
+
+public:
   PathDiagnostic();
   PathDiagnostic();
-  
+
   PathDiagnostic(const char* bugtype, const char* desc, const char* category);
   PathDiagnostic(const char* bugtype, const char* desc, const char* category);
-  
-  PathDiagnostic(const std::string& bugtype, const std::string& desc, 
+
+  PathDiagnostic(const std::string& bugtype, const std::string& desc,
                  const std::string& category);
                  const std::string& category);
-  
+
   ~PathDiagnostic();
   ~PathDiagnostic();
-  
+
   const std::string& getDescription() const { return Desc; }
   const std::string& getDescription() const { return Desc; }
   const std::string& getBugType() const { return BugType; }
   const std::string& getBugType() const { return BugType; }
-  const std::string& getCategory() const { return Category; }  
-  
+  const std::string& getCategory() const { return Category; }
+
   typedef std::deque<std::string>::const_iterator meta_iterator;
   typedef std::deque<std::string>::const_iterator meta_iterator;
   meta_iterator meta_begin() const { return OtherDesc.begin(); }
   meta_iterator meta_begin() const { return OtherDesc.begin(); }
   meta_iterator meta_end() const { return OtherDesc.end(); }
   meta_iterator meta_end() const { return OtherDesc.end(); }
   void addMeta(const std::string& s) { OtherDesc.push_back(s); }
   void addMeta(const std::string& s) { OtherDesc.push_back(s); }
   void addMeta(const char* s) { OtherDesc.push_back(s); }
   void addMeta(const char* s) { OtherDesc.push_back(s); }
-  
+
   PathDiagnosticLocation getLocation() const {
   PathDiagnosticLocation getLocation() const {
     assert(Size > 0 && "getLocation() requires a non-empty PathDiagnostic.");
     assert(Size > 0 && "getLocation() requires a non-empty PathDiagnostic.");
     return rbegin()->getLocation();
     return rbegin()->getLocation();
   }
   }
-  
+
   void push_front(PathDiagnosticPiece* piece) {
   void push_front(PathDiagnosticPiece* piece) {
     path.push_front(piece);
     path.push_front(piece);
     ++Size;
     ++Size;
   }
   }
-  
+
   void push_back(PathDiagnosticPiece* piece) {
   void push_back(PathDiagnosticPiece* piece) {
     path.push_back(piece);
     path.push_back(piece);
     ++Size;
     ++Size;
   }
   }
-  
+
   PathDiagnosticPiece* back() {
   PathDiagnosticPiece* back() {
     return path.back();
     return path.back();
   }
   }
-  
+
   const PathDiagnosticPiece* back() const {
   const PathDiagnosticPiece* back() const {
     return path.back();
     return path.back();
   }
   }
-  
+
   unsigned size() const { return Size; }
   unsigned size() const { return Size; }
   bool empty() const { return Size == 0; }
   bool empty() const { return Size == 0; }
-  
+
   void resetPath(bool deletePieces = true);
   void resetPath(bool deletePieces = true);
-  
+
   class iterator {
   class iterator {
-  public:  
+  public:
     typedef std::deque<PathDiagnosticPiece*>::iterator ImplTy;
     typedef std::deque<PathDiagnosticPiece*>::iterator ImplTy;
-    
+
     typedef PathDiagnosticPiece              value_type;
     typedef PathDiagnosticPiece              value_type;
     typedef value_type&                      reference;
     typedef value_type&                      reference;
     typedef value_type*                      pointer;
     typedef value_type*                      pointer;
     typedef ptrdiff_t                        difference_type;
     typedef ptrdiff_t                        difference_type;
     typedef std::bidirectional_iterator_tag  iterator_category;
     typedef std::bidirectional_iterator_tag  iterator_category;
-    
+
   private:
   private:
     ImplTy I;
     ImplTy I;
-    
+
   public:
   public:
     iterator(const ImplTy& i) : I(i) {}
     iterator(const ImplTy& i) : I(i) {}
-    
+
     bool operator==(const iterator& X) const { return I == X.I; }
     bool operator==(const iterator& X) const { return I == X.I; }
     bool operator!=(const iterator& X) const { return I != X.I; }
     bool operator!=(const iterator& X) const { return I != X.I; }
-    
+
     PathDiagnosticPiece& operator*() const { return **I; }
     PathDiagnosticPiece& operator*() const { return **I; }
     PathDiagnosticPiece* operator->() const { return *I; }
     PathDiagnosticPiece* operator->() const { return *I; }
-    
+
     iterator& operator++() { ++I; return *this; }
     iterator& operator++() { ++I; return *this; }
     iterator& operator--() { --I; return *this; }
     iterator& operator--() { --I; return *this; }
   };
   };
-  
+
   class const_iterator {
   class const_iterator {
-  public:  
+  public:
     typedef std::deque<PathDiagnosticPiece*>::const_iterator ImplTy;
     typedef std::deque<PathDiagnosticPiece*>::const_iterator ImplTy;
-    
+
     typedef const PathDiagnosticPiece        value_type;
     typedef const PathDiagnosticPiece        value_type;
     typedef value_type&                      reference;
     typedef value_type&                      reference;
     typedef value_type*                      pointer;
     typedef value_type*                      pointer;
     typedef ptrdiff_t                        difference_type;
     typedef ptrdiff_t                        difference_type;
     typedef std::bidirectional_iterator_tag  iterator_category;
     typedef std::bidirectional_iterator_tag  iterator_category;
-    
+
   private:
   private:
     ImplTy I;
     ImplTy I;
-    
+
   public:
   public:
     const_iterator(const ImplTy& i) : I(i) {}
     const_iterator(const ImplTy& i) : I(i) {}
-    
+
     bool operator==(const const_iterator& X) const { return I == X.I; }
     bool operator==(const const_iterator& X) const { return I == X.I; }
     bool operator!=(const const_iterator& X) const { return I != X.I; }
     bool operator!=(const const_iterator& X) const { return I != X.I; }
-    
+
     reference operator*() const { return **I; }
     reference operator*() const { return **I; }
     pointer operator->() const { return *I; }
     pointer operator->() const { return *I; }
-    
+
     const_iterator& operator++() { ++I; return *this; }
     const_iterator& operator++() { ++I; return *this; }
     const_iterator& operator--() { --I; return *this; }
     const_iterator& operator--() { --I; return *this; }
   };
   };
-  
+
   typedef std::reverse_iterator<iterator>       reverse_iterator;
   typedef std::reverse_iterator<iterator>       reverse_iterator;
   typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
   typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
-  
+
   // forward iterator creation methods.
   // forward iterator creation methods.
-  
+
   iterator begin() { return path.begin(); }
   iterator begin() { return path.begin(); }
   iterator end() { return path.end(); }
   iterator end() { return path.end(); }
-  
+
   const_iterator begin() const { return path.begin(); }
   const_iterator begin() const { return path.begin(); }
   const_iterator end() const { return path.end(); }
   const_iterator end() const { return path.end(); }
-  
+
   // reverse iterator creation methods.
   // reverse iterator creation methods.
   reverse_iterator rbegin()            { return reverse_iterator(end()); }
   reverse_iterator rbegin()            { return reverse_iterator(end()); }
   const_reverse_iterator rbegin() const{ return const_reverse_iterator(end()); }
   const_reverse_iterator rbegin() const{ return const_reverse_iterator(end()); }
   reverse_iterator rend()              { return reverse_iterator(begin()); }
   reverse_iterator rend()              { return reverse_iterator(begin()); }
   const_reverse_iterator rend() const { return const_reverse_iterator(begin());}
   const_reverse_iterator rend() const { return const_reverse_iterator(begin());}
-  
+
   void flattenLocations() {
   void flattenLocations() {
     for (iterator I = begin(), E = end(); I != E; ++I) I->flattenLocations();
     for (iterator I = begin(), E = end(); I != E; ++I) I->flattenLocations();
   }
   }
 };
 };
-  
-  
+
+
 } //end clang namespace
 } //end clang namespace
 #endif
 #endif

+ 10 - 10
include/clang/Analysis/PathSensitive/AnalysisContext.h

@@ -27,7 +27,7 @@ class CFG;
 class LiveVariables;
 class LiveVariables;
 class ParentMap;
 class ParentMap;
 class ImplicitParamDecl;
 class ImplicitParamDecl;
-  
+
 /// AnalysisContext contains the context data for the function or method under
 /// AnalysisContext contains the context data for the function or method under
 /// analysis.
 /// analysis.
 class AnalysisContext {
 class AnalysisContext {
@@ -47,7 +47,7 @@ public:
   CFG *getCFG();
   CFG *getCFG();
   ParentMap &getParentMap();
   ParentMap &getParentMap();
   LiveVariables *getLiveVariables();
   LiveVariables *getLiveVariables();
-  
+
   /// Return the ImplicitParamDecl* associated with 'self' if this
   /// Return the ImplicitParamDecl* associated with 'self' if this
   /// AnalysisContext wraps an ObjCMethodDecl.  Returns NULL otherwise.
   /// AnalysisContext wraps an ObjCMethodDecl.  Returns NULL otherwise.
   const ImplicitParamDecl *getSelfDecl() const;
   const ImplicitParamDecl *getSelfDecl() const;
@@ -58,7 +58,7 @@ class AnalysisContextManager {
   ContextMap Contexts;
   ContextMap Contexts;
 public:
 public:
   ~AnalysisContextManager();
   ~AnalysisContextManager();
-  
+
   AnalysisContext *getContext(const Decl *D);
   AnalysisContext *getContext(const Decl *D);
 };
 };
 
 
@@ -87,10 +87,10 @@ public:
 
 
   CFG *getCFG() const { return getAnalysisContext()->getCFG(); }
   CFG *getCFG() const { return getAnalysisContext()->getCFG(); }
 
 
-  LiveVariables *getLiveVariables() const { 
+  LiveVariables *getLiveVariables() const {
     return getAnalysisContext()->getLiveVariables();
     return getAnalysisContext()->getLiveVariables();
   }
   }
-  
+
   const ImplicitParamDecl *getSelfDecl() const {
   const ImplicitParamDecl *getSelfDecl() const {
     return Ctx->getSelfDecl();
     return Ctx->getSelfDecl();
   }
   }
@@ -120,8 +120,8 @@ public:
   static void Profile(llvm::FoldingSetNodeID &ID, AnalysisContext *ctx,
   static void Profile(llvm::FoldingSetNodeID &ID, AnalysisContext *ctx,
                       const LocationContext *parent, const Stmt *s);
                       const LocationContext *parent, const Stmt *s);
 
 
-  static bool classof(const LocationContext* Ctx) { 
-    return Ctx->getKind() == StackFrame; 
+  static bool classof(const LocationContext* Ctx) {
+    return Ctx->getKind() == StackFrame;
   }
   }
 };
 };
 
 
@@ -140,8 +140,8 @@ public:
   static void Profile(llvm::FoldingSetNodeID &ID, AnalysisContext *ctx,
   static void Profile(llvm::FoldingSetNodeID &ID, AnalysisContext *ctx,
                       const LocationContext *parent, const Stmt *s);
                       const LocationContext *parent, const Stmt *s);
 
 
-  static bool classof(const LocationContext* Ctx) { 
-    return Ctx->getKind() == Scope; 
+  static bool classof(const LocationContext* Ctx) {
+    return Ctx->getKind() == Scope;
   }
   }
 };
 };
 
 
@@ -156,6 +156,6 @@ public:
   ScopeContext *getScope(AnalysisContext *ctx, const LocationContext *parent,
   ScopeContext *getScope(AnalysisContext *ctx, const LocationContext *parent,
                          const Stmt *s);
                          const Stmt *s);
 };
 };
-  
+
 } // end clang namespace
 } // end clang namespace
 #endif
 #endif

+ 21 - 21
include/clang/Analysis/PathSensitive/AnalysisManager.h

@@ -38,7 +38,7 @@ class AnalysisManager : public BugReporterData {
   ConstraintManagerCreator CreateConstraintMgr;
   ConstraintManagerCreator CreateConstraintMgr;
 
 
   enum AnalysisScope { ScopeTU, ScopeDecl } AScope;
   enum AnalysisScope { ScopeTU, ScopeDecl } AScope;
-      
+
   bool DisplayedFunction;
   bool DisplayedFunction;
   bool VisualizeEGDot;
   bool VisualizeEGDot;
   bool VisualizeEGUbi;
   bool VisualizeEGUbi;
@@ -55,13 +55,13 @@ class AnalysisManager : public BugReporterData {
   bool TrimGraph;
   bool TrimGraph;
 
 
 public:
 public:
-  AnalysisManager(Decl *d, ASTContext &ctx, Diagnostic &diags, 
+  AnalysisManager(Decl *d, ASTContext &ctx, Diagnostic &diags,
                   const LangOptions &lang, PathDiagnosticClient *pd,
                   const LangOptions &lang, PathDiagnosticClient *pd,
                   StoreManagerCreator storemgr,
                   StoreManagerCreator storemgr,
                   ConstraintManagerCreator constraintmgr,
                   ConstraintManagerCreator constraintmgr,
-                  bool displayProgress, bool vizdot, bool vizubi, 
+                  bool displayProgress, bool vizdot, bool vizubi,
                   bool purge, bool eager, bool trim)
                   bool purge, bool eager, bool trim)
-    : Ctx(ctx), Diags(diags), LangInfo(lang), PD(pd), 
+    : Ctx(ctx), Diags(diags), LangInfo(lang), PD(pd),
       CreateStoreMgr(storemgr), CreateConstraintMgr(constraintmgr),
       CreateStoreMgr(storemgr), CreateConstraintMgr(constraintmgr),
       AScope(ScopeDecl), DisplayedFunction(!displayProgress),
       AScope(ScopeDecl), DisplayedFunction(!displayProgress),
       VisualizeEGDot(vizdot), VisualizeEGUbi(vizubi), PurgeDead(purge),
       VisualizeEGDot(vizdot), VisualizeEGUbi(vizubi), PurgeDead(purge),
@@ -69,15 +69,15 @@ public:
 
 
     EntryContext = ContextMgr.getContext(d);
     EntryContext = ContextMgr.getContext(d);
   }
   }
-    
-  AnalysisManager(ASTContext &ctx, Diagnostic &diags, 
+
+  AnalysisManager(ASTContext &ctx, Diagnostic &diags,
                   const LangOptions &lang, PathDiagnosticClient *pd,
                   const LangOptions &lang, PathDiagnosticClient *pd,
                   StoreManagerCreator storemgr,
                   StoreManagerCreator storemgr,
                   ConstraintManagerCreator constraintmgr,
                   ConstraintManagerCreator constraintmgr,
-                  bool displayProgress, bool vizdot, bool vizubi, 
+                  bool displayProgress, bool vizdot, bool vizubi,
                   bool purge, bool eager, bool trim)
                   bool purge, bool eager, bool trim)
 
 
-    : Ctx(ctx), Diags(diags), LangInfo(lang), PD(pd), 
+    : Ctx(ctx), Diags(diags), LangInfo(lang), PD(pd),
       CreateStoreMgr(storemgr), CreateConstraintMgr(constraintmgr),
       CreateStoreMgr(storemgr), CreateConstraintMgr(constraintmgr),
       AScope(ScopeDecl), DisplayedFunction(!displayProgress),
       AScope(ScopeDecl), DisplayedFunction(!displayProgress),
       VisualizeEGDot(vizdot), VisualizeEGUbi(vizubi), PurgeDead(purge),
       VisualizeEGDot(vizdot), VisualizeEGUbi(vizubi), PurgeDead(purge),
@@ -90,17 +90,17 @@ public:
     EntryContext = ContextMgr.getContext(D);
     EntryContext = ContextMgr.getContext(D);
     DisplayedFunction = false;
     DisplayedFunction = false;
   }
   }
-    
-  const Decl *getCodeDecl() const { 
+
+  const Decl *getCodeDecl() const {
     assert (AScope == ScopeDecl);
     assert (AScope == ScopeDecl);
     return EntryContext->getDecl();
     return EntryContext->getDecl();
   }
   }
-    
+
   Stmt *getBody() const {
   Stmt *getBody() const {
     assert (AScope == ScopeDecl);
     assert (AScope == ScopeDecl);
     return EntryContext->getBody();
     return EntryContext->getBody();
   }
   }
-    
+
   StoreManagerCreator getStoreManagerCreator() {
   StoreManagerCreator getStoreManagerCreator() {
     return CreateStoreMgr;
     return CreateStoreMgr;
   };
   };
@@ -108,11 +108,11 @@ public:
   ConstraintManagerCreator getConstraintManagerCreator() {
   ConstraintManagerCreator getConstraintManagerCreator() {
     return CreateConstraintMgr;
     return CreateConstraintMgr;
   }
   }
-    
+
   virtual CFG *getCFG() {
   virtual CFG *getCFG() {
     return EntryContext->getCFG();
     return EntryContext->getCFG();
   }
   }
-    
+
   virtual ParentMap &getParentMap() {
   virtual ParentMap &getParentMap() {
     return EntryContext->getParentMap();
     return EntryContext->getParentMap();
   }
   }
@@ -120,31 +120,31 @@ public:
   virtual LiveVariables *getLiveVariables() {
   virtual LiveVariables *getLiveVariables() {
     return EntryContext->getLiveVariables();
     return EntryContext->getLiveVariables();
   }
   }
-    
+
   virtual ASTContext &getASTContext() {
   virtual ASTContext &getASTContext() {
     return Ctx;
     return Ctx;
   }
   }
-    
+
   virtual SourceManager &getSourceManager() {
   virtual SourceManager &getSourceManager() {
     return getASTContext().getSourceManager();
     return getASTContext().getSourceManager();
   }
   }
-    
+
   virtual Diagnostic &getDiagnostic() {
   virtual Diagnostic &getDiagnostic() {
     return Diags;
     return Diags;
   }
   }
-    
+
   const LangOptions &getLangOptions() const {
   const LangOptions &getLangOptions() const {
     return LangInfo;
     return LangInfo;
   }
   }
-    
+
   virtual PathDiagnosticClient *getPathDiagnosticClient() {
   virtual PathDiagnosticClient *getPathDiagnosticClient() {
-    return PD.get();      
+    return PD.get();
   }
   }
 
 
   StackFrameContext *getEntryStackFrame() {
   StackFrameContext *getEntryStackFrame() {
     return LocCtxMgr.getStackFrame(EntryContext, 0, 0);
     return LocCtxMgr.getStackFrame(EntryContext, 0, 0);
   }
   }
-    
+
   bool shouldVisualizeGraphviz() const { return VisualizeEGDot; }
   bool shouldVisualizeGraphviz() const { return VisualizeEGDot; }
 
 
   bool shouldVisualizeUbigraph() const { return VisualizeEGUbi; }
   bool shouldVisualizeUbigraph() const { return VisualizeEGUbi; }

+ 30 - 30
include/clang/Analysis/PathSensitive/BasicValueFactory.h

@@ -8,7 +8,7 @@
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 //
 //
 //  This file defines BasicValueFactory, a class that manages the lifetime
 //  This file defines BasicValueFactory, a class that manages the lifetime
-//  of APSInt objects and symbolic constraints used by GRExprEngine 
+//  of APSInt objects and symbolic constraints used by GRExprEngine
 //  and related classes.
 //  and related classes.
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
@@ -24,7 +24,7 @@
 #include "llvm/ADT/ImmutableList.h"
 #include "llvm/ADT/ImmutableList.h"
 
 
 namespace clang {
 namespace clang {
-  
+
   class GRState;
   class GRState;
 
 
 class CompoundValData : public llvm::FoldingSetNode {
 class CompoundValData : public llvm::FoldingSetNode {
@@ -32,13 +32,13 @@ class CompoundValData : public llvm::FoldingSetNode {
   llvm::ImmutableList<SVal> L;
   llvm::ImmutableList<SVal> L;
 
 
 public:
 public:
-  CompoundValData(QualType t, llvm::ImmutableList<SVal> l) 
+  CompoundValData(QualType t, llvm::ImmutableList<SVal> l)
     : T(t), L(l) {}
     : T(t), L(l) {}
 
 
   typedef llvm::ImmutableList<SVal>::iterator iterator;
   typedef llvm::ImmutableList<SVal>::iterator iterator;
   iterator begin() const { return L.begin(); }
   iterator begin() const { return L.begin(); }
-  iterator end() const { return L.end(); }  
-  
+  iterator end() const { return L.end(); }
+
   static void Profile(llvm::FoldingSetNodeID& ID, QualType T,
   static void Profile(llvm::FoldingSetNodeID& ID, QualType T,
                       llvm::ImmutableList<SVal> L);
                       llvm::ImmutableList<SVal> L);
 
 
@@ -51,16 +51,16 @@ class LazyCompoundValData : public llvm::FoldingSetNode {
 public:
 public:
   LazyCompoundValData(const GRState *st, const TypedRegion *r)
   LazyCompoundValData(const GRState *st, const TypedRegion *r)
     : state(st), region(r) {}
     : state(st), region(r) {}
-  
+
   const GRState *getState() const { return state; }
   const GRState *getState() const { return state; }
   const TypedRegion *getRegion() const { return region; }
   const TypedRegion *getRegion() const { return region; }
-    
+
   static void Profile(llvm::FoldingSetNodeID& ID, const GRState *state,
   static void Profile(llvm::FoldingSetNodeID& ID, const GRState *state,
                       const TypedRegion *region);
                       const TypedRegion *region);
-  
+
   void Profile(llvm::FoldingSetNodeID& ID) { Profile(ID, state, region); }
   void Profile(llvm::FoldingSetNodeID& ID) { Profile(ID, state, region); }
 };
 };
-  
+
 class BasicValueFactory {
 class BasicValueFactory {
   typedef llvm::FoldingSet<llvm::FoldingSetNodeWrapper<llvm::APSInt> >
   typedef llvm::FoldingSet<llvm::FoldingSetNodeWrapper<llvm::APSInt> >
           APSIntSetTy;
           APSIntSetTy;
@@ -77,28 +77,28 @@ class BasicValueFactory {
   llvm::FoldingSet<LazyCompoundValData> LazyCompoundValDataSet;
   llvm::FoldingSet<LazyCompoundValData> LazyCompoundValDataSet;
 
 
 public:
 public:
-  BasicValueFactory(ASTContext& ctx, llvm::BumpPtrAllocator& Alloc) 
+  BasicValueFactory(ASTContext& ctx, llvm::BumpPtrAllocator& Alloc)
   : Ctx(ctx), BPAlloc(Alloc), PersistentSVals(0), PersistentSValPairs(0),
   : Ctx(ctx), BPAlloc(Alloc), PersistentSVals(0), PersistentSValPairs(0),
     SValListFactory(Alloc) {}
     SValListFactory(Alloc) {}
 
 
   ~BasicValueFactory();
   ~BasicValueFactory();
 
 
-  ASTContext& getContext() const { return Ctx; }  
+  ASTContext& getContext() const { return Ctx; }
 
 
   const llvm::APSInt& getValue(const llvm::APSInt& X);
   const llvm::APSInt& getValue(const llvm::APSInt& X);
   const llvm::APSInt& getValue(const llvm::APInt& X, bool isUnsigned);
   const llvm::APSInt& getValue(const llvm::APInt& X, bool isUnsigned);
   const llvm::APSInt& getValue(uint64_t X, unsigned BitWidth, bool isUnsigned);
   const llvm::APSInt& getValue(uint64_t X, unsigned BitWidth, bool isUnsigned);
   const llvm::APSInt& getValue(uint64_t X, QualType T);
   const llvm::APSInt& getValue(uint64_t X, QualType T);
-  
+
   /// Convert - Create a new persistent APSInt with the same value as 'From'
   /// Convert - Create a new persistent APSInt with the same value as 'From'
   ///  but with the bitwidth and signedness of 'To'.
   ///  but with the bitwidth and signedness of 'To'.
   const llvm::APSInt& Convert(const llvm::APSInt& To,
   const llvm::APSInt& Convert(const llvm::APSInt& To,
                               const llvm::APSInt& From) {
                               const llvm::APSInt& From) {
-    
+
     if (To.isUnsigned() == From.isUnsigned() &&
     if (To.isUnsigned() == From.isUnsigned() &&
         To.getBitWidth() == From.getBitWidth())
         To.getBitWidth() == From.getBitWidth())
       return From;
       return From;
-    
+
     return getValue(From.getSExtValue(),
     return getValue(From.getSExtValue(),
                     To.getBitWidth(),
                     To.getBitWidth(),
                     To.isUnsigned());
                     To.isUnsigned());
@@ -108,11 +108,11 @@ public:
     QualType T = isUnsigned ? Ctx.UnsignedIntTy : Ctx.IntTy;
     QualType T = isUnsigned ? Ctx.UnsignedIntTy : Ctx.IntTy;
     return getValue(X, T);
     return getValue(X, T);
   }
   }
-  
+
   inline const llvm::APSInt& getMaxValue(const llvm::APSInt &v) {
   inline const llvm::APSInt& getMaxValue(const llvm::APSInt &v) {
     return getValue(llvm::APSInt::getMaxValue(v.getBitWidth(), v.isUnsigned()));
     return getValue(llvm::APSInt::getMaxValue(v.getBitWidth(), v.isUnsigned()));
   }
   }
-  
+
   inline const llvm::APSInt& getMinValue(const llvm::APSInt &v) {
   inline const llvm::APSInt& getMinValue(const llvm::APSInt &v) {
     return getValue(llvm::APSInt::getMinValue(v.getBitWidth(), v.isUnsigned()));
     return getValue(llvm::APSInt::getMinValue(v.getBitWidth(), v.isUnsigned()));
   }
   }
@@ -122,25 +122,25 @@ public:
     bool isUnsigned = T->isUnsignedIntegerType() || Loc::IsLocType(T);
     bool isUnsigned = T->isUnsignedIntegerType() || Loc::IsLocType(T);
     return getValue(llvm::APSInt::getMaxValue(Ctx.getTypeSize(T), isUnsigned));
     return getValue(llvm::APSInt::getMaxValue(Ctx.getTypeSize(T), isUnsigned));
   }
   }
-  
+
   inline const llvm::APSInt& getMinValue(QualType T) {
   inline const llvm::APSInt& getMinValue(QualType T) {
     assert(T->isIntegerType() || Loc::IsLocType(T));
     assert(T->isIntegerType() || Loc::IsLocType(T));
     bool isUnsigned = T->isUnsignedIntegerType() || Loc::IsLocType(T);
     bool isUnsigned = T->isUnsignedIntegerType() || Loc::IsLocType(T);
     return getValue(llvm::APSInt::getMinValue(Ctx.getTypeSize(T), isUnsigned));
     return getValue(llvm::APSInt::getMinValue(Ctx.getTypeSize(T), isUnsigned));
   }
   }
-  
+
   inline const llvm::APSInt& Add1(const llvm::APSInt& V) {
   inline const llvm::APSInt& Add1(const llvm::APSInt& V) {
     llvm::APSInt X = V;
     llvm::APSInt X = V;
     ++X;
     ++X;
     return getValue(X);
     return getValue(X);
   }
   }
-  
+
   inline const llvm::APSInt& Sub1(const llvm::APSInt& V) {
   inline const llvm::APSInt& Sub1(const llvm::APSInt& V) {
     llvm::APSInt X = V;
     llvm::APSInt X = V;
     --X;
     --X;
     return getValue(X);
     return getValue(X);
   }
   }
-  
+
   inline const llvm::APSInt& getZeroWithPtrWidth(bool isUnsigned = true) {
   inline const llvm::APSInt& getZeroWithPtrWidth(bool isUnsigned = true) {
     return getValue(0, Ctx.getTypeSize(Ctx.VoidPtrTy), isUnsigned);
     return getValue(0, Ctx.getTypeSize(Ctx.VoidPtrTy), isUnsigned);
   }
   }
@@ -152,21 +152,21 @@ public:
   inline const llvm::APSInt& getTruthValue(bool b, QualType T) {
   inline const llvm::APSInt& getTruthValue(bool b, QualType T) {
     return getValue(b ? 1 : 0, Ctx.getTypeSize(T), false);
     return getValue(b ? 1 : 0, Ctx.getTypeSize(T), false);
   }
   }
-  
+
   inline const llvm::APSInt& getTruthValue(bool b) {
   inline const llvm::APSInt& getTruthValue(bool b) {
     return getTruthValue(b, Ctx.IntTy);
     return getTruthValue(b, Ctx.IntTy);
   }
   }
-  
-  const CompoundValData *getCompoundValData(QualType T, 
+
+  const CompoundValData *getCompoundValData(QualType T,
                                             llvm::ImmutableList<SVal> Vals);
                                             llvm::ImmutableList<SVal> Vals);
-  
+
   const LazyCompoundValData *getLazyCompoundValData(const GRState *state,
   const LazyCompoundValData *getLazyCompoundValData(const GRState *state,
                                                     const TypedRegion *region);
                                                     const TypedRegion *region);
-  
+
   llvm::ImmutableList<SVal> getEmptySValList() {
   llvm::ImmutableList<SVal> getEmptySValList() {
     return SValListFactory.GetEmptyList();
     return SValListFactory.GetEmptyList();
   }
   }
-  
+
   llvm::ImmutableList<SVal> consVals(SVal X, llvm::ImmutableList<SVal> L) {
   llvm::ImmutableList<SVal> consVals(SVal X, llvm::ImmutableList<SVal> L) {
     return SValListFactory.Add(X, L);
     return SValListFactory.Add(X, L);
   }
   }
@@ -174,13 +174,13 @@ public:
   const llvm::APSInt* EvaluateAPSInt(BinaryOperator::Opcode Op,
   const llvm::APSInt* EvaluateAPSInt(BinaryOperator::Opcode Op,
                                      const llvm::APSInt& V1,
                                      const llvm::APSInt& V1,
                                      const llvm::APSInt& V2);
                                      const llvm::APSInt& V2);
-  
+
   const std::pair<SVal, uintptr_t>&
   const std::pair<SVal, uintptr_t>&
   getPersistentSValWithData(const SVal& V, uintptr_t Data);
   getPersistentSValWithData(const SVal& V, uintptr_t Data);
-  
+
   const std::pair<SVal, SVal>&
   const std::pair<SVal, SVal>&
-  getPersistentSValPair(const SVal& V1, const SVal& V2);  
-  
+  getPersistentSValPair(const SVal& V1, const SVal& V2);
+
   const SVal* getPersistentSVal(SVal X);
   const SVal* getPersistentSVal(SVal X);
 };
 };
 
 

+ 96 - 96
include/clang/Analysis/PathSensitive/BugReporter.h

@@ -27,7 +27,7 @@
 #include <list>
 #include <list>
 
 
 namespace clang {
 namespace clang {
-  
+
 class PathDiagnostic;
 class PathDiagnostic;
 class PathDiagnosticPiece;
 class PathDiagnosticPiece;
 class PathDiagnosticClient;
 class PathDiagnosticClient;
@@ -40,7 +40,7 @@ class GRState;
 class Stmt;
 class Stmt;
 class BugType;
 class BugType;
 class ParentMap;
 class ParentMap;
-  
+
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // Interface for individual bug reports.
 // Interface for individual bug reports.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
@@ -51,10 +51,10 @@ public:
   virtual PathDiagnosticPiece* VisitNode(const ExplodedNode* N,
   virtual PathDiagnosticPiece* VisitNode(const ExplodedNode* N,
                                          const ExplodedNode* PrevN,
                                          const ExplodedNode* PrevN,
                                          BugReporterContext& BRC) = 0;
                                          BugReporterContext& BRC) = 0;
-  
+
   virtual bool isOwnedByReporterContext() { return true; }
   virtual bool isOwnedByReporterContext() { return true; }
 };
 };
-  
+
 // FIXME: Combine this with RangedBugReport and remove RangedBugReport.
 // FIXME: Combine this with RangedBugReport and remove RangedBugReport.
 class BugReport : public BugReporterVisitor {
 class BugReport : public BugReporterVisitor {
 protected:
 protected:
@@ -63,7 +63,7 @@ protected:
   std::string Description;
   std::string Description;
   const ExplodedNode *EndNode;
   const ExplodedNode *EndNode;
   SourceRange R;
   SourceRange R;
-  
+
 protected:
 protected:
   friend class BugReporter;
   friend class BugReporter;
   friend class BugReportEquivClass;
   friend class BugReportEquivClass;
@@ -71,7 +71,7 @@ protected:
   virtual void Profile(llvm::FoldingSetNodeID& hash) const {
   virtual void Profile(llvm::FoldingSetNodeID& hash) const {
     hash.AddInteger(getLocation().getRawEncoding());
     hash.AddInteger(getLocation().getRawEncoding());
   }
   }
-  
+
 public:
 public:
   class NodeResolver {
   class NodeResolver {
   public:
   public:
@@ -79,58 +79,58 @@ public:
     virtual const ExplodedNode*
     virtual const ExplodedNode*
             getOriginalNode(const ExplodedNode* N) = 0;
             getOriginalNode(const ExplodedNode* N) = 0;
   };
   };
-  
+
   BugReport(BugType& bt, const char* desc, const ExplodedNode *n)
   BugReport(BugType& bt, const char* desc, const ExplodedNode *n)
     : BT(bt), Description(desc), EndNode(n) {}
     : BT(bt), Description(desc), EndNode(n) {}
-  
+
   BugReport(BugType& bt, const char* shortDesc, const char* desc,
   BugReport(BugType& bt, const char* shortDesc, const char* desc,
             const ExplodedNode *n)
             const ExplodedNode *n)
   : BT(bt), ShortDescription(shortDesc), Description(desc), EndNode(n) {}
   : BT(bt), ShortDescription(shortDesc), Description(desc), EndNode(n) {}
 
 
   virtual ~BugReport();
   virtual ~BugReport();
-  
+
   virtual bool isOwnedByReporterContext() { return false; }
   virtual bool isOwnedByReporterContext() { return false; }
 
 
   const BugType& getBugType() const { return BT; }
   const BugType& getBugType() const { return BT; }
   BugType& getBugType() { return BT; }
   BugType& getBugType() { return BT; }
-  
+
   // FIXME: Perhaps this should be moved into a subclass?
   // FIXME: Perhaps this should be moved into a subclass?
   const ExplodedNode* getEndNode() const { return EndNode; }
   const ExplodedNode* getEndNode() const { return EndNode; }
-  
+
   // FIXME: Do we need this?  Maybe getLocation() should return a ProgramPoint
   // FIXME: Do we need this?  Maybe getLocation() should return a ProgramPoint
   // object.
   // object.
   // FIXME: If we do need it, we can probably just make it private to
   // FIXME: If we do need it, we can probably just make it private to
   // BugReporter.
   // BugReporter.
   const Stmt* getStmt() const;
   const Stmt* getStmt() const;
-  
+
   const std::string& getDescription() const { return Description; }
   const std::string& getDescription() const { return Description; }
 
 
   const std::string& getShortDescription() const {
   const std::string& getShortDescription() const {
     return ShortDescription.empty() ? Description : ShortDescription;
     return ShortDescription.empty() ? Description : ShortDescription;
   }
   }
-  
+
   // FIXME: Is this needed?
   // FIXME: Is this needed?
   virtual std::pair<const char**,const char**> getExtraDescriptiveText() {
   virtual std::pair<const char**,const char**> getExtraDescriptiveText() {
     return std::make_pair((const char**)0,(const char**)0);
     return std::make_pair((const char**)0,(const char**)0);
   }
   }
-  
+
   // FIXME: Perhaps move this into a subclass.
   // FIXME: Perhaps move this into a subclass.
   virtual PathDiagnosticPiece* getEndPath(BugReporterContext& BRC,
   virtual PathDiagnosticPiece* getEndPath(BugReporterContext& BRC,
                                           const ExplodedNode* N);
                                           const ExplodedNode* N);
-  
+
   /// getLocation - Return the "definitive" location of the reported bug.
   /// getLocation - Return the "definitive" location of the reported bug.
   ///  While a bug can span an entire path, usually there is a specific
   ///  While a bug can span an entire path, usually there is a specific
   ///  location that can be used to identify where the key issue occured.
   ///  location that can be used to identify where the key issue occured.
   ///  This location is used by clients rendering diagnostics.
   ///  This location is used by clients rendering diagnostics.
   virtual SourceLocation getLocation() const;
   virtual SourceLocation getLocation() const;
-  
+
   /// getRanges - Returns the source ranges associated with this bug.
   /// getRanges - Returns the source ranges associated with this bug.
   virtual void getRanges(const SourceRange*& beg, const SourceRange*& end);
   virtual void getRanges(const SourceRange*& beg, const SourceRange*& end);
 
 
   virtual PathDiagnosticPiece* VisitNode(const ExplodedNode* N,
   virtual PathDiagnosticPiece* VisitNode(const ExplodedNode* N,
                                          const ExplodedNode* PrevN,
                                          const ExplodedNode* PrevN,
                                          BugReporterContext& BR);
                                          BugReporterContext& BR);
-  
+
   virtual void registerInitialVisitors(BugReporterContext& BRC,
   virtual void registerInitialVisitors(BugReporterContext& BRC,
                                        const ExplodedNode* N) {}
                                        const ExplodedNode* N) {}
 };
 };
@@ -138,11 +138,11 @@ public:
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // BugTypes (collections of related reports).
 // BugTypes (collections of related reports).
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
-  
+
 class BugReportEquivClass : public llvm::FoldingSetNode {
 class BugReportEquivClass : public llvm::FoldingSetNode {
   // List of *owned* BugReport objects.
   // List of *owned* BugReport objects.
   std::list<BugReport*> Reports;
   std::list<BugReport*> Reports;
-  
+
   friend class BugReporter;
   friend class BugReporter;
   void AddReport(BugReport* R) { Reports.push_back(R); }
   void AddReport(BugReport* R) { Reports.push_back(R); }
 public:
 public:
@@ -164,7 +164,7 @@ public:
     BugReport* operator*() const { return *impl; }
     BugReport* operator*() const { return *impl; }
     BugReport* operator->() const { return *impl; }
     BugReport* operator->() const { return *impl; }
   };
   };
-  
+
   class const_iterator {
   class const_iterator {
     std::list<BugReport*>::const_iterator impl;
     std::list<BugReport*>::const_iterator impl;
   public:
   public:
@@ -175,14 +175,14 @@ public:
     const BugReport* operator*() const { return *impl; }
     const BugReport* operator*() const { return *impl; }
     const BugReport* operator->() const { return *impl; }
     const BugReport* operator->() const { return *impl; }
   };
   };
-    
+
   iterator begin() { return iterator(Reports.begin()); }
   iterator begin() { return iterator(Reports.begin()); }
   iterator end() { return iterator(Reports.end()); }
   iterator end() { return iterator(Reports.end()); }
-  
+
   const_iterator begin() const { return const_iterator(Reports.begin()); }
   const_iterator begin() const { return const_iterator(Reports.begin()); }
   const_iterator end() const { return const_iterator(Reports.end()); }
   const_iterator end() const { return const_iterator(Reports.end()); }
 };
 };
-  
+
 class BugType {
 class BugType {
 private:
 private:
   const std::string Name;
   const std::string Name;
@@ -192,45 +192,45 @@ private:
 public:
 public:
   BugType(const char *name, const char* cat) : Name(name), Category(cat) {}
   BugType(const char *name, const char* cat) : Name(name), Category(cat) {}
   virtual ~BugType();
   virtual ~BugType();
-  
+
   // FIXME: Should these be made strings as well?
   // FIXME: Should these be made strings as well?
   const std::string& getName() const { return Name; }
   const std::string& getName() const { return Name; }
   const std::string& getCategory() const { return Category; }
   const std::string& getCategory() const { return Category; }
 
 
-  virtual void FlushReports(BugReporter& BR);  
+  virtual void FlushReports(BugReporter& BR);
 
 
   typedef llvm::FoldingSet<BugReportEquivClass>::iterator iterator;
   typedef llvm::FoldingSet<BugReportEquivClass>::iterator iterator;
   iterator begin() { return EQClasses.begin(); }
   iterator begin() { return EQClasses.begin(); }
   iterator end() { return EQClasses.end(); }
   iterator end() { return EQClasses.end(); }
-  
+
   typedef llvm::FoldingSet<BugReportEquivClass>::const_iterator const_iterator;
   typedef llvm::FoldingSet<BugReportEquivClass>::const_iterator const_iterator;
   const_iterator begin() const { return EQClasses.begin(); }
   const_iterator begin() const { return EQClasses.begin(); }
   const_iterator end() const { return EQClasses.end(); }
   const_iterator end() const { return EQClasses.end(); }
 };
 };
-  
+
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // Specialized subclasses of BugReport.
 // Specialized subclasses of BugReport.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
-  
+
 // FIXME: Collapse this with the default BugReport class.
 // FIXME: Collapse this with the default BugReport class.
 class RangedBugReport : public BugReport {
 class RangedBugReport : public BugReport {
   std::vector<SourceRange> Ranges;
   std::vector<SourceRange> Ranges;
 public:
 public:
   RangedBugReport(BugType& D, const char* description, ExplodedNode *n)
   RangedBugReport(BugType& D, const char* description, ExplodedNode *n)
     : BugReport(D, description, n) {}
     : BugReport(D, description, n) {}
-  
+
   RangedBugReport(BugType& D, const char *shortDescription,
   RangedBugReport(BugType& D, const char *shortDescription,
                   const char *description, ExplodedNode *n)
                   const char *description, ExplodedNode *n)
   : BugReport(D, shortDescription, description, n) {}
   : BugReport(D, shortDescription, description, n) {}
-  
+
   ~RangedBugReport();
   ~RangedBugReport();
 
 
   // FIXME: Move this out of line.
   // FIXME: Move this out of line.
   void addRange(SourceRange R) { Ranges.push_back(R); }
   void addRange(SourceRange R) { Ranges.push_back(R); }
-  
+
   // FIXME: Move this out of line.
   // FIXME: Move this out of line.
   void getRanges(const SourceRange*& beg, const SourceRange*& end) {
   void getRanges(const SourceRange*& beg, const SourceRange*& end) {
-    
+
     if (Ranges.empty()) {
     if (Ranges.empty()) {
       beg = NULL;
       beg = NULL;
       end = NULL;
       end = NULL;
@@ -241,36 +241,36 @@ public:
     }
     }
   }
   }
 };
 };
-  
+
 class EnhancedBugReport : public RangedBugReport {
 class EnhancedBugReport : public RangedBugReport {
 public:
 public:
   typedef void (*VisitorCreator)(BugReporterContext &BRcC, const void *data,
   typedef void (*VisitorCreator)(BugReporterContext &BRcC, const void *data,
                                  const ExplodedNode *N);
                                  const ExplodedNode *N);
-  
+
 private:
 private:
   typedef std::vector<std::pair<VisitorCreator, const void*> > Creators;
   typedef std::vector<std::pair<VisitorCreator, const void*> > Creators;
   Creators creators;
   Creators creators;
-  
+
 public:
 public:
   EnhancedBugReport(BugType& D, const char* description, ExplodedNode *n)
   EnhancedBugReport(BugType& D, const char* description, ExplodedNode *n)
    : RangedBugReport(D, description, n) {}
    : RangedBugReport(D, description, n) {}
-  
+
   EnhancedBugReport(BugType& D, const char *shortDescription,
   EnhancedBugReport(BugType& D, const char *shortDescription,
                   const char *description, ExplodedNode *n)
                   const char *description, ExplodedNode *n)
     : RangedBugReport(D, shortDescription, description, n) {}
     : RangedBugReport(D, shortDescription, description, n) {}
-  
+
   ~EnhancedBugReport() {}
   ~EnhancedBugReport() {}
-  
-  void registerInitialVisitors(BugReporterContext& BRC, const ExplodedNode* N) {    
+
+  void registerInitialVisitors(BugReporterContext& BRC, const ExplodedNode* N) {
     for (Creators::iterator I = creators.begin(), E = creators.end(); I!=E; ++I)
     for (Creators::iterator I = creators.begin(), E = creators.end(); I!=E; ++I)
       I->first(BRC, I->second, N);
       I->first(BRC, I->second, N);
   }
   }
-  
+
   void addVisitorCreator(VisitorCreator creator, const void *data) {
   void addVisitorCreator(VisitorCreator creator, const void *data) {
     creators.push_back(std::make_pair(creator, data));
     creators.push_back(std::make_pair(creator, data));
   }
   }
 };
 };
-  
+
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // BugReporter and friends.
 // BugReporter and friends.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
@@ -278,15 +278,15 @@ public:
 class BugReporterData {
 class BugReporterData {
 public:
 public:
   virtual ~BugReporterData();
   virtual ~BugReporterData();
-  virtual Diagnostic& getDiagnostic() = 0;  
-  virtual PathDiagnosticClient* getPathDiagnosticClient() = 0;  
+  virtual Diagnostic& getDiagnostic() = 0;
+  virtual PathDiagnosticClient* getPathDiagnosticClient() = 0;
   virtual ASTContext& getASTContext() = 0;
   virtual ASTContext& getASTContext() = 0;
   virtual SourceManager& getSourceManager() = 0;
   virtual SourceManager& getSourceManager() = 0;
   virtual CFG* getCFG() = 0;
   virtual CFG* getCFG() = 0;
   virtual ParentMap& getParentMap() = 0;
   virtual ParentMap& getParentMap() = 0;
   virtual LiveVariables* getLiveVariables() = 0;
   virtual LiveVariables* getLiveVariables() = 0;
 };
 };
-  
+
 class BugReporter {
 class BugReporter {
 public:
 public:
   enum Kind { BaseBRKind, GRBugReporterKind };
   enum Kind { BaseBRKind, GRBugReporterKind };
@@ -296,9 +296,9 @@ private:
   BugTypesTy::Factory F;
   BugTypesTy::Factory F;
   BugTypesTy BugTypes;
   BugTypesTy BugTypes;
 
 
-  const Kind kind;  
+  const Kind kind;
   BugReporterData& D;
   BugReporterData& D;
-  
+
   void FlushReport(BugReportEquivClass& EQ);
   void FlushReport(BugReportEquivClass& EQ);
 
 
 protected:
 protected:
@@ -307,40 +307,40 @@ protected:
 public:
 public:
   BugReporter(BugReporterData& d) : BugTypes(F.GetEmptySet()), kind(BaseBRKind), D(d) {}
   BugReporter(BugReporterData& d) : BugTypes(F.GetEmptySet()), kind(BaseBRKind), D(d) {}
   virtual ~BugReporter();
   virtual ~BugReporter();
-  
+
   void FlushReports();
   void FlushReports();
-  
+
   Kind getKind() const { return kind; }
   Kind getKind() const { return kind; }
-  
+
   Diagnostic& getDiagnostic() {
   Diagnostic& getDiagnostic() {
     return D.getDiagnostic();
     return D.getDiagnostic();
   }
   }
-  
+
   PathDiagnosticClient* getPathDiagnosticClient() {
   PathDiagnosticClient* getPathDiagnosticClient() {
     return D.getPathDiagnosticClient();
     return D.getPathDiagnosticClient();
   }
   }
-  
+
   typedef BugTypesTy::iterator iterator;
   typedef BugTypesTy::iterator iterator;
   iterator begin() { return BugTypes.begin(); }
   iterator begin() { return BugTypes.begin(); }
   iterator end() { return BugTypes.end(); }
   iterator end() { return BugTypes.end(); }
-  
+
   ASTContext& getContext() { return D.getASTContext(); }
   ASTContext& getContext() { return D.getASTContext(); }
-  
+
   SourceManager& getSourceManager() { return D.getSourceManager(); }
   SourceManager& getSourceManager() { return D.getSourceManager(); }
-  
+
   CFG* getCFG() { return D.getCFG(); }
   CFG* getCFG() { return D.getCFG(); }
-  
+
   ParentMap& getParentMap() { return D.getParentMap(); }
   ParentMap& getParentMap() { return D.getParentMap(); }
-  
+
   LiveVariables* getLiveVariables() { return D.getLiveVariables(); }
   LiveVariables* getLiveVariables() { return D.getLiveVariables(); }
-  
+
   virtual void GeneratePathDiagnostic(PathDiagnostic& PD,
   virtual void GeneratePathDiagnostic(PathDiagnostic& PD,
                                       BugReportEquivClass& EQ) {}
                                       BugReportEquivClass& EQ) {}
 
 
   void Register(BugType *BT);
   void Register(BugType *BT);
-  
+
   void EmitReport(BugReport *R);
   void EmitReport(BugReport *R);
-  
+
   void EmitBasicReport(const char* BugName, const char* BugStr,
   void EmitBasicReport(const char* BugName, const char* BugStr,
                        SourceLocation Loc,
                        SourceLocation Loc,
                        SourceRange* RangeBeg, unsigned NumRanges);
                        SourceRange* RangeBeg, unsigned NumRanges);
@@ -348,28 +348,28 @@ public:
   void EmitBasicReport(const char* BugName, const char* BugCategory,
   void EmitBasicReport(const char* BugName, const char* BugCategory,
                        const char* BugStr, SourceLocation Loc,
                        const char* BugStr, SourceLocation Loc,
                        SourceRange* RangeBeg, unsigned NumRanges);
                        SourceRange* RangeBeg, unsigned NumRanges);
-  
-  
+
+
   void EmitBasicReport(const char* BugName, const char* BugStr,
   void EmitBasicReport(const char* BugName, const char* BugStr,
                        SourceLocation Loc) {
                        SourceLocation Loc) {
     EmitBasicReport(BugName, BugStr, Loc, 0, 0);
     EmitBasicReport(BugName, BugStr, Loc, 0, 0);
   }
   }
-  
+
   void EmitBasicReport(const char* BugName, const char* BugCategory,
   void EmitBasicReport(const char* BugName, const char* BugCategory,
                        const char* BugStr, SourceLocation Loc) {
                        const char* BugStr, SourceLocation Loc) {
     EmitBasicReport(BugName, BugCategory, BugStr, Loc, 0, 0);
     EmitBasicReport(BugName, BugCategory, BugStr, Loc, 0, 0);
   }
   }
-  
+
   void EmitBasicReport(const char* BugName, const char* BugStr,
   void EmitBasicReport(const char* BugName, const char* BugStr,
                        SourceLocation Loc, SourceRange R) {
                        SourceLocation Loc, SourceRange R) {
     EmitBasicReport(BugName, BugStr, Loc, &R, 1);
     EmitBasicReport(BugName, BugStr, Loc, &R, 1);
   }
   }
-  
+
   void EmitBasicReport(const char* BugName, const char* Category,
   void EmitBasicReport(const char* BugName, const char* Category,
                        const char* BugStr, SourceLocation Loc, SourceRange R) {
                        const char* BugStr, SourceLocation Loc, SourceRange R) {
     EmitBasicReport(BugName, Category, BugStr, Loc, &R, 1);
     EmitBasicReport(BugName, Category, BugStr, Loc, &R, 1);
   }
   }
-  
+
   static bool classof(const BugReporter* R) { return true; }
   static bool classof(const BugReporter* R) { return true; }
 };
 };
 
 
@@ -377,12 +377,12 @@ public:
 class GRBugReporter : public BugReporter {
 class GRBugReporter : public BugReporter {
   GRExprEngine& Eng;
   GRExprEngine& Eng;
   llvm::SmallSet<SymbolRef, 10> NotableSymbols;
   llvm::SmallSet<SymbolRef, 10> NotableSymbols;
-public:  
+public:
   GRBugReporter(BugReporterData& d, GRExprEngine& eng)
   GRBugReporter(BugReporterData& d, GRExprEngine& eng)
     : BugReporter(d, GRBugReporterKind), Eng(eng) {}
     : BugReporter(d, GRBugReporterKind), Eng(eng) {}
-  
+
   virtual ~GRBugReporter();
   virtual ~GRBugReporter();
-  
+
   /// getEngine - Return the analysis engine used to analyze a given
   /// getEngine - Return the analysis engine used to analyze a given
   ///  function or method.
   ///  function or method.
   GRExprEngine &getEngine() { return Eng; }
   GRExprEngine &getEngine() { return Eng; }
@@ -390,76 +390,76 @@ public:
   /// getGraph - Get the exploded graph created by the analysis engine
   /// getGraph - Get the exploded graph created by the analysis engine
   ///  for the analyzed method or function.
   ///  for the analyzed method or function.
   ExplodedGraph &getGraph();
   ExplodedGraph &getGraph();
-  
+
   /// getStateManager - Return the state manager used by the analysis
   /// getStateManager - Return the state manager used by the analysis
   ///  engine.
   ///  engine.
   GRStateManager &getStateManager();
   GRStateManager &getStateManager();
-  
+
   virtual void GeneratePathDiagnostic(PathDiagnostic& PD,
   virtual void GeneratePathDiagnostic(PathDiagnostic& PD,
                                       BugReportEquivClass& R);
                                       BugReportEquivClass& R);
 
 
   void addNotableSymbol(SymbolRef Sym) {
   void addNotableSymbol(SymbolRef Sym) {
     NotableSymbols.insert(Sym);
     NotableSymbols.insert(Sym);
   }
   }
-  
+
   bool isNotable(SymbolRef Sym) const {
   bool isNotable(SymbolRef Sym) const {
     return (bool) NotableSymbols.count(Sym);
     return (bool) NotableSymbols.count(Sym);
   }
   }
-    
+
   /// classof - Used by isa<>, cast<>, and dyn_cast<>.
   /// classof - Used by isa<>, cast<>, and dyn_cast<>.
   static bool classof(const BugReporter* R) {
   static bool classof(const BugReporter* R) {
     return R->getKind() == GRBugReporterKind;
     return R->getKind() == GRBugReporterKind;
   }
   }
 };
 };
-  
+
 class BugReporterContext {
 class BugReporterContext {
   GRBugReporter &BR;
   GRBugReporter &BR;
   std::vector<BugReporterVisitor*> Callbacks;
   std::vector<BugReporterVisitor*> Callbacks;
 public:
 public:
   BugReporterContext(GRBugReporter& br) : BR(br) {}
   BugReporterContext(GRBugReporter& br) : BR(br) {}
   virtual ~BugReporterContext();
   virtual ~BugReporterContext();
-  
+
   void addVisitor(BugReporterVisitor* visitor) {
   void addVisitor(BugReporterVisitor* visitor) {
     if (visitor) Callbacks.push_back(visitor);
     if (visitor) Callbacks.push_back(visitor);
   }
   }
-  
+
   typedef std::vector<BugReporterVisitor*>::iterator visitor_iterator;
   typedef std::vector<BugReporterVisitor*>::iterator visitor_iterator;
   visitor_iterator visitor_begin() { return Callbacks.begin(); }
   visitor_iterator visitor_begin() { return Callbacks.begin(); }
-  visitor_iterator visitor_end() { return Callbacks.end(); }  
-  
-  GRBugReporter& getBugReporter() { return BR; }  
-  
+  visitor_iterator visitor_end() { return Callbacks.end(); }
+
+  GRBugReporter& getBugReporter() { return BR; }
+
   ExplodedGraph &getGraph() { return BR.getGraph(); }
   ExplodedGraph &getGraph() { return BR.getGraph(); }
-  
+
   void addNotableSymbol(SymbolRef Sym) {
   void addNotableSymbol(SymbolRef Sym) {
     // FIXME: For now forward to GRBugReporter.
     // FIXME: For now forward to GRBugReporter.
     BR.addNotableSymbol(Sym);
     BR.addNotableSymbol(Sym);
   }
   }
-  
+
   bool isNotable(SymbolRef Sym) const {
   bool isNotable(SymbolRef Sym) const {
     // FIXME: For now forward to GRBugReporter.
     // FIXME: For now forward to GRBugReporter.
     return BR.isNotable(Sym);
     return BR.isNotable(Sym);
   }
   }
-  
+
   GRStateManager& getStateManager() {
   GRStateManager& getStateManager() {
     return BR.getStateManager();
     return BR.getStateManager();
   }
   }
-  
+
   ValueManager& getValueManager() {
   ValueManager& getValueManager() {
     return getStateManager().getValueManager();
     return getStateManager().getValueManager();
   }
   }
-  
+
   ASTContext& getASTContext() {
   ASTContext& getASTContext() {
     return BR.getContext();
     return BR.getContext();
   }
   }
-  
+
   SourceManager& getSourceManager() {
   SourceManager& getSourceManager() {
     return BR.getSourceManager();
     return BR.getSourceManager();
   }
   }
-  
+
   const Decl &getCodeDecl();
   const Decl &getCodeDecl();
   const CFG &getCFG();
   const CFG &getCFG();
-  virtual BugReport::NodeResolver& getNodeResolver() = 0;  
+  virtual BugReport::NodeResolver& getNodeResolver() = 0;
 };
 };
 
 
 class DiagBugReport : public RangedBugReport {
 class DiagBugReport : public RangedBugReport {
@@ -468,24 +468,24 @@ class DiagBugReport : public RangedBugReport {
 public:
 public:
   DiagBugReport(BugType& D, const char* desc, FullSourceLoc l) :
   DiagBugReport(BugType& D, const char* desc, FullSourceLoc l) :
   RangedBugReport(D, desc, 0), L(l) {}
   RangedBugReport(D, desc, 0), L(l) {}
-  
+
   virtual ~DiagBugReport() {}
   virtual ~DiagBugReport() {}
-  
+
   // FIXME: Move out-of-line (virtual function).
   // FIXME: Move out-of-line (virtual function).
   SourceLocation getLocation() const { return L; }
   SourceLocation getLocation() const { return L; }
-  
-  void addString(const std::string& s) { Strs.push_back(s); }  
-  
+
+  void addString(const std::string& s) { Strs.push_back(s); }
+
   typedef std::list<std::string>::const_iterator str_iterator;
   typedef std::list<std::string>::const_iterator str_iterator;
   str_iterator str_begin() const { return Strs.begin(); }
   str_iterator str_begin() const { return Strs.begin(); }
   str_iterator str_end() const { return Strs.end(); }
   str_iterator str_end() const { return Strs.end(); }
 };
 };
-  
+
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
-  
+
 namespace bugreporter {
 namespace bugreporter {
-  
+
 const Stmt *GetDerefExpr(const ExplodedNode *N);
 const Stmt *GetDerefExpr(const ExplodedNode *N);
 const Stmt *GetReceiverExpr(const ExplodedNode *N);
 const Stmt *GetReceiverExpr(const ExplodedNode *N);
 const Stmt *GetDenomExpr(const ExplodedNode *N);
 const Stmt *GetDenomExpr(const ExplodedNode *N);
@@ -496,7 +496,7 @@ void registerTrackNullOrUndefValue(BugReporterContext& BRC, const void *stmt,
                                    const ExplodedNode* N);
                                    const ExplodedNode* N);
 
 
 } // end namespace clang::bugreporter
 } // end namespace clang::bugreporter
-  
+
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
 } // end clang namespace
 } // end clang namespace

+ 16 - 16
include/clang/Analysis/PathSensitive/Checker.h

@@ -46,21 +46,21 @@ public:
                  GRExprEngine &eng,
                  GRExprEngine &eng,
                  ExplodedNode *pred,
                  ExplodedNode *pred,
                  const void *tag, bool preVisit)
                  const void *tag, bool preVisit)
-    : Dst(dst), B(builder), Eng(eng), Pred(pred), 
+    : Dst(dst), B(builder), Eng(eng), Pred(pred),
       OldSink(B.BuildSinks), OldTag(B.Tag),
       OldSink(B.BuildSinks), OldTag(B.Tag),
       OldPointKind(B.PointKind), OldHasGen(B.HasGeneratedNode) {
       OldPointKind(B.PointKind), OldHasGen(B.HasGeneratedNode) {
-        //assert(Dst.empty()); // This is a fake assertion. 
+        //assert(Dst.empty()); // This is a fake assertion.
               // See GRExprEngine::CheckerVisit(), CurrSet is repeatedly used.
               // See GRExprEngine::CheckerVisit(), CurrSet is repeatedly used.
         B.Tag = tag;
         B.Tag = tag;
         if (preVisit)
         if (preVisit)
-          B.PointKind = ProgramPoint::PreStmtKind;        
+          B.PointKind = ProgramPoint::PreStmtKind;
       }
       }
-  
+
   ~CheckerContext() {
   ~CheckerContext() {
     if (!B.BuildSinks && !B.HasGeneratedNode)
     if (!B.BuildSinks && !B.HasGeneratedNode)
       Dst.Add(Pred);
       Dst.Add(Pred);
   }
   }
-  
+
   ConstraintManager &getConstraintManager() {
   ConstraintManager &getConstraintManager() {
       return Eng.getConstraintManager();
       return Eng.getConstraintManager();
   }
   }
@@ -68,7 +68,7 @@ public:
   GRStmtNodeBuilder &getNodeBuilder() { return B; }
   GRStmtNodeBuilder &getNodeBuilder() { return B; }
   ExplodedNode *&getPredecessor() { return Pred; }
   ExplodedNode *&getPredecessor() { return Pred; }
   const GRState *getState() { return B.GetState(Pred); }
   const GRState *getState() { return B.GetState(Pred); }
-  
+
   ASTContext &getASTContext() {
   ASTContext &getASTContext() {
     return Eng.getContext();
     return Eng.getContext();
   }
   }
@@ -76,26 +76,26 @@ public:
   ExplodedNode *GenerateNode(const Stmt *S, bool markAsSink = false) {
   ExplodedNode *GenerateNode(const Stmt *S, bool markAsSink = false) {
     return GenerateNode(S, getState(), markAsSink);
     return GenerateNode(S, getState(), markAsSink);
   }
   }
-  
+
   ExplodedNode *GenerateNode(const Stmt* S, const GRState *state,
   ExplodedNode *GenerateNode(const Stmt* S, const GRState *state,
-                             bool markAsSink = false) {    
+                             bool markAsSink = false) {
     ExplodedNode *node = B.generateNode(S, state, Pred);
     ExplodedNode *node = B.generateNode(S, state, Pred);
-    
+
     if (markAsSink && node)
     if (markAsSink && node)
       node->markAsSink();
       node->markAsSink();
-    
+
     return node;
     return node;
   }
   }
-  
+
   void addTransition(ExplodedNode *node) {
   void addTransition(ExplodedNode *node) {
     Dst.Add(node);
     Dst.Add(node);
   }
   }
-  
+
   void EmitReport(BugReport *R) {
   void EmitReport(BugReport *R) {
     Eng.getBugReporter().EmitReport(R);
     Eng.getBugReporter().EmitReport(R);
   }
   }
 };
 };
-  
+
 class Checker {
 class Checker {
 private:
 private:
   friend class GRExprEngine;
   friend class GRExprEngine;
@@ -105,11 +105,11 @@ private:
                 GRExprEngine &Eng,
                 GRExprEngine &Eng,
                 const Stmt *stmt,
                 const Stmt *stmt,
                 ExplodedNode *Pred, bool isPrevisit) {
                 ExplodedNode *Pred, bool isPrevisit) {
-    CheckerContext C(Dst, Builder, Eng, Pred, getTag(), isPrevisit);    
+    CheckerContext C(Dst, Builder, Eng, Pred, getTag(), isPrevisit);
     assert(isPrevisit && "Only previsit supported for now.");
     assert(isPrevisit && "Only previsit supported for now.");
     _PreVisit(C, stmt);
     _PreVisit(C, stmt);
   }
   }
-  
+
 public:
 public:
   virtual ~Checker() {}
   virtual ~Checker() {}
   virtual void _PreVisit(CheckerContext &C, const Stmt *stmt) = 0;
   virtual void _PreVisit(CheckerContext &C, const Stmt *stmt) = 0;
@@ -119,4 +119,4 @@ public:
 } // end clang namespace
 } // end clang namespace
 
 
 #endif
 #endif
-  
+

+ 5 - 5
include/clang/Analysis/PathSensitive/CheckerVisitor.h

@@ -14,14 +14,14 @@
 #ifndef LLVM_CLANG_ANALYSIS_CHECKERVISITOR
 #ifndef LLVM_CLANG_ANALYSIS_CHECKERVISITOR
 #define LLVM_CLANG_ANALYSIS_CHECKERVISITOR
 #define LLVM_CLANG_ANALYSIS_CHECKERVISITOR
 #include "clang/Analysis/PathSensitive/Checker.h"
 #include "clang/Analysis/PathSensitive/Checker.h"
-  
+
 namespace clang {
 namespace clang {
 
 
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // Checker visitor interface.  Used by subclasses of Checker to specify their
 // Checker visitor interface.  Used by subclasses of Checker to specify their
 // own checker visitor logic.
 // own checker visitor logic.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
-  
+
 /// CheckerVisitor - This class implements a simple visitor for Stmt subclasses.
 /// CheckerVisitor - This class implements a simple visitor for Stmt subclasses.
 /// Since Expr derives from Stmt, this also includes support for visiting Exprs.
 /// Since Expr derives from Stmt, this also includes support for visiting Exprs.
 template<typename ImplClass>
 template<typename ImplClass>
@@ -47,13 +47,13 @@ break;
 #include "clang/Analysis/PathSensitive/CheckerVisitor.def"
 #include "clang/Analysis/PathSensitive/CheckerVisitor.def"
     }
     }
   }
   }
-  
+
 #define PREVISIT(NAME) \
 #define PREVISIT(NAME) \
 void PreVisit ## NAME(CheckerContext &C, const NAME* S) {}
 void PreVisit ## NAME(CheckerContext &C, const NAME* S) {}
 #include "clang/Analysis/PathSensitive/CheckerVisitor.def"
 #include "clang/Analysis/PathSensitive/CheckerVisitor.def"
 };
 };
-  
+
 } // end clang namespace
 } // end clang namespace
 
 
 #endif
 #endif
-  
+

+ 7 - 7
include/clang/Analysis/PathSensitive/ConstraintManager.h

@@ -30,32 +30,32 @@ class SVal;
 class ConstraintManager {
 class ConstraintManager {
 public:
 public:
   virtual ~ConstraintManager();
   virtual ~ConstraintManager();
-  virtual const GRState *Assume(const GRState *state, SVal Cond, 
+  virtual const GRState *Assume(const GRState *state, SVal Cond,
                                 bool Assumption) = 0;
                                 bool Assumption) = 0;
 
 
-  virtual const GRState *AssumeInBound(const GRState *state, SVal Idx, 
+  virtual const GRState *AssumeInBound(const GRState *state, SVal Idx,
                                        SVal UpperBound, bool Assumption) = 0;
                                        SVal UpperBound, bool Assumption) = 0;
-  
+
   std::pair<const GRState*, const GRState*> AssumeDual(const GRState *state,
   std::pair<const GRState*, const GRState*> AssumeDual(const GRState *state,
                                                        DefinedSVal Cond) {
                                                        DefinedSVal Cond) {
     return std::make_pair(Assume(state, Cond, true),
     return std::make_pair(Assume(state, Cond, true),
-                          Assume(state, Cond, false));    
+                          Assume(state, Cond, false));
   }
   }
 
 
   virtual const llvm::APSInt* getSymVal(const GRState *state,
   virtual const llvm::APSInt* getSymVal(const GRState *state,
                                         SymbolRef sym) const = 0;
                                         SymbolRef sym) const = 0;
 
 
-  virtual bool isEqual(const GRState *state, SymbolRef sym, 
+  virtual bool isEqual(const GRState *state, SymbolRef sym,
                        const llvm::APSInt& V) const = 0;
                        const llvm::APSInt& V) const = 0;
 
 
   virtual const GRState *RemoveDeadBindings(const GRState *state,
   virtual const GRState *RemoveDeadBindings(const GRState *state,
                                             SymbolReaper& SymReaper) = 0;
                                             SymbolReaper& SymReaper) = 0;
 
 
-  virtual void print(const GRState *state, llvm::raw_ostream& Out, 
+  virtual void print(const GRState *state, llvm::raw_ostream& Out,
                      const char* nl, const char *sep) = 0;
                      const char* nl, const char *sep) = 0;
 
 
   virtual void EndPath(const GRState *state) {}
   virtual void EndPath(const GRState *state) {}
-  
+
   /// canReasonAbout - Not all ConstraintManagers can accurately reason about
   /// canReasonAbout - Not all ConstraintManagers can accurately reason about
   ///  all SVal values.  This method returns true if the ConstraintManager can
   ///  all SVal values.  This method returns true if the ConstraintManager can
   ///  reasonably handle a given SVal value.  This is typically queried by
   ///  reasonably handle a given SVal value.  This is typically queried by

+ 16 - 16
include/clang/Analysis/PathSensitive/Environment.h

@@ -35,61 +35,61 @@ class LiveVariables;
 class Environment {
 class Environment {
 private:
 private:
   friend class EnvironmentManager;
   friend class EnvironmentManager;
-  
+
   // Type definitions.
   // Type definitions.
   typedef llvm::ImmutableMap<const Stmt*,SVal> BindingsTy;
   typedef llvm::ImmutableMap<const Stmt*,SVal> BindingsTy;
 
 
   // Data.
   // Data.
   BindingsTy ExprBindings;
   BindingsTy ExprBindings;
   AnalysisContext *ACtx;
   AnalysisContext *ACtx;
-  
+
   Environment(BindingsTy eb, AnalysisContext *aCtx)
   Environment(BindingsTy eb, AnalysisContext *aCtx)
     : ExprBindings(eb), ACtx(aCtx) {}
     : ExprBindings(eb), ACtx(aCtx) {}
-  
-public:    
+
+public:
   typedef BindingsTy::iterator iterator;
   typedef BindingsTy::iterator iterator;
   iterator begin() const { return ExprBindings.begin(); }
   iterator begin() const { return ExprBindings.begin(); }
   iterator end() const { return ExprBindings.end(); }
   iterator end() const { return ExprBindings.end(); }
-    
+
   SVal LookupExpr(const Stmt* E) const {
   SVal LookupExpr(const Stmt* E) const {
     const SVal* X = ExprBindings.lookup(E);
     const SVal* X = ExprBindings.lookup(E);
     return X ? *X : UnknownVal();
     return X ? *X : UnknownVal();
   }
   }
-  
+
   SVal GetSVal(const Stmt* Ex, ValueManager& ValMgr) const;
   SVal GetSVal(const Stmt* Ex, ValueManager& ValMgr) const;
-  
+
   AnalysisContext &getAnalysisContext() const { return *ACtx; }
   AnalysisContext &getAnalysisContext() const { return *ACtx; }
-  
+
   /// Profile - Profile the contents of an Environment object for use
   /// Profile - Profile the contents of an Environment object for use
   ///  in a FoldingSet.
   ///  in a FoldingSet.
   static void Profile(llvm::FoldingSetNodeID& ID, const Environment* E) {
   static void Profile(llvm::FoldingSetNodeID& ID, const Environment* E) {
     E->ExprBindings.Profile(ID);
     E->ExprBindings.Profile(ID);
   }
   }
-  
+
   /// Profile - Used to profile the contents of this object for inclusion
   /// Profile - Used to profile the contents of this object for inclusion
   ///  in a FoldingSet.
   ///  in a FoldingSet.
   void Profile(llvm::FoldingSetNodeID& ID) const {
   void Profile(llvm::FoldingSetNodeID& ID) const {
     Profile(ID, this);
     Profile(ID, this);
   }
   }
-  
+
   bool operator==(const Environment& RHS) const {
   bool operator==(const Environment& RHS) const {
     return ExprBindings == RHS.ExprBindings;
     return ExprBindings == RHS.ExprBindings;
   }
   }
 };
 };
-  
+
 class EnvironmentManager {
 class EnvironmentManager {
 private:
 private:
   typedef Environment::BindingsTy::Factory FactoryTy;
   typedef Environment::BindingsTy::Factory FactoryTy;
   FactoryTy F;
   FactoryTy F;
-  
-public:  
+
+public:
   EnvironmentManager(llvm::BumpPtrAllocator& Allocator) : F(Allocator) {}
   EnvironmentManager(llvm::BumpPtrAllocator& Allocator) : F(Allocator) {}
   ~EnvironmentManager() {}
   ~EnvironmentManager() {}
-  
+
   Environment getInitialEnvironment(AnalysisContext *ACtx) {
   Environment getInitialEnvironment(AnalysisContext *ACtx) {
     return Environment(F.GetEmptyMap(), ACtx);
     return Environment(F.GetEmptyMap(), ACtx);
   }
   }
-  
+
   Environment BindExpr(Environment Env, const Stmt *S, SVal V,
   Environment BindExpr(Environment Env, const Stmt *S, SVal V,
                        bool Invalidate);
                        bool Invalidate);
 
 
@@ -97,7 +97,7 @@ public:
                                  SymbolReaper &SymReaper, const GRState *ST,
                                  SymbolReaper &SymReaper, const GRState *ST,
                           llvm::SmallVectorImpl<const MemRegion*>& RegionRoots);
                           llvm::SmallVectorImpl<const MemRegion*>& RegionRoots);
 };
 };
-  
+
 } // end clang namespace
 } // end clang namespace
 
 
 #endif
 #endif

+ 71 - 71
include/clang/Analysis/PathSensitive/ExplodedGraph.h

@@ -38,7 +38,7 @@ class ASTContext;
 // contain a specific kind of state.  Typed-specialized versions are defined
 // contain a specific kind of state.  Typed-specialized versions are defined
 // on top of these classes.
 // on top of these classes.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
-  
+
 class ExplodedNode : public llvm::FoldingSetNode {
 class ExplodedNode : public llvm::FoldingSetNode {
   friend class ExplodedGraph;
   friend class ExplodedGraph;
   friend class GRCoreEngine;
   friend class GRCoreEngine;
@@ -46,16 +46,16 @@ class ExplodedNode : public llvm::FoldingSetNode {
   friend class GRBranchNodeBuilder;
   friend class GRBranchNodeBuilder;
   friend class GRIndirectGotoNodeBuilder;
   friend class GRIndirectGotoNodeBuilder;
   friend class GRSwitchNodeBuilder;
   friend class GRSwitchNodeBuilder;
-  friend class GREndPathNodeBuilder;  
-  
+  friend class GREndPathNodeBuilder;
+
   class NodeGroup {
   class NodeGroup {
     enum { Size1 = 0x0, SizeOther = 0x1, AuxFlag = 0x2, Mask = 0x3 };
     enum { Size1 = 0x0, SizeOther = 0x1, AuxFlag = 0x2, Mask = 0x3 };
     uintptr_t P;
     uintptr_t P;
-    
+
     unsigned getKind() const {
     unsigned getKind() const {
       return P & 0x1;
       return P & 0x1;
     }
     }
-    
+
     void* getPtr() const {
     void* getPtr() const {
       assert (!getFlag());
       assert (!getFlag());
       return reinterpret_cast<void*>(P & ~Mask);
       return reinterpret_cast<void*>(P & ~Mask);
@@ -64,55 +64,55 @@ class ExplodedNode : public llvm::FoldingSetNode {
     ExplodedNode *getNode() const {
     ExplodedNode *getNode() const {
       return reinterpret_cast<ExplodedNode*>(getPtr());
       return reinterpret_cast<ExplodedNode*>(getPtr());
     }
     }
-    
+
   public:
   public:
     NodeGroup() : P(0) {}
     NodeGroup() : P(0) {}
-    
+
     ~NodeGroup();
     ~NodeGroup();
-    
+
     ExplodedNode** begin() const;
     ExplodedNode** begin() const;
-    
+
     ExplodedNode** end() const;
     ExplodedNode** end() const;
-    
+
     unsigned size() const;
     unsigned size() const;
-    
+
     bool empty() const { return size() == 0; }
     bool empty() const { return size() == 0; }
-    
+
     void addNode(ExplodedNode* N);
     void addNode(ExplodedNode* N);
-    
+
     void setFlag() {
     void setFlag() {
       assert (P == 0);
       assert (P == 0);
       P = AuxFlag;
       P = AuxFlag;
     }
     }
-    
+
     bool getFlag() const {
     bool getFlag() const {
       return P & AuxFlag ? true : false;
       return P & AuxFlag ? true : false;
     }
     }
-  };  
-  
+  };
+
   /// Location - The program location (within a function body) associated
   /// Location - The program location (within a function body) associated
   ///  with this node.
   ///  with this node.
   const ProgramPoint Location;
   const ProgramPoint Location;
-  
+
   /// State - The state associated with this node.
   /// State - The state associated with this node.
   const GRState* State;
   const GRState* State;
-  
+
   /// Preds - The predecessors of this node.
   /// Preds - The predecessors of this node.
   NodeGroup Preds;
   NodeGroup Preds;
-  
+
   /// Succs - The successors of this node.
   /// Succs - The successors of this node.
   NodeGroup Succs;
   NodeGroup Succs;
 
 
 public:
 public:
 
 
-  explicit ExplodedNode(const ProgramPoint& loc, const GRState* state) 
+  explicit ExplodedNode(const ProgramPoint& loc, const GRState* state)
     : Location(loc), State(state) {}
     : Location(loc), State(state) {}
 
 
   /// getLocation - Returns the edge associated with the given node.
   /// getLocation - Returns the edge associated with the given node.
   ProgramPoint getLocation() const { return Location; }
   ProgramPoint getLocation() const { return Location; }
 
 
-  const LocationContext *getLocationContext() const { 
-    return getLocation().getLocationContext(); 
+  const LocationContext *getLocationContext() const {
+    return getLocation().getLocationContext();
   }
   }
 
 
   const Decl &getCodeDecl() const { return *getLocationContext()->getDecl(); }
   const Decl &getCodeDecl() const { return *getLocationContext()->getDecl(); }
@@ -126,14 +126,14 @@ public:
   template <typename T>
   template <typename T>
   const T* getLocationAs() const { return llvm::dyn_cast<T>(&Location); }
   const T* getLocationAs() const { return llvm::dyn_cast<T>(&Location); }
 
 
-  static void Profile(llvm::FoldingSetNodeID &ID, 
+  static void Profile(llvm::FoldingSetNodeID &ID,
                       const ProgramPoint& Loc, const GRState* state);
                       const ProgramPoint& Loc, const GRState* state);
 
 
   void Profile(llvm::FoldingSetNodeID& ID) const {
   void Profile(llvm::FoldingSetNodeID& ID) const {
     Profile(ID, getLocation(), getState());
     Profile(ID, getLocation(), getState());
   }
   }
 
 
-  /// addPredeccessor - Adds a predecessor to the current node, and 
+  /// addPredeccessor - Adds a predecessor to the current node, and
   ///  in tandem add this node as a successor of the other node.
   ///  in tandem add this node as a successor of the other node.
   void addPredecessor(ExplodedNode* V);
   void addPredecessor(ExplodedNode* V);
 
 
@@ -141,18 +141,18 @@ public:
   unsigned pred_size() const { return Preds.size(); }
   unsigned pred_size() const { return Preds.size(); }
   bool succ_empty() const { return Succs.empty(); }
   bool succ_empty() const { return Succs.empty(); }
   bool pred_empty() const { return Preds.empty(); }
   bool pred_empty() const { return Preds.empty(); }
-  
+
   bool isSink() const { return Succs.getFlag(); }
   bool isSink() const { return Succs.getFlag(); }
-  void markAsSink() { Succs.setFlag(); } 
+  void markAsSink() { Succs.setFlag(); }
 
 
   ExplodedNode* getFirstPred() {
   ExplodedNode* getFirstPred() {
     return pred_empty() ? NULL : *(pred_begin());
     return pred_empty() ? NULL : *(pred_begin());
   }
   }
-  
+
   const ExplodedNode* getFirstPred() const {
   const ExplodedNode* getFirstPred() const {
     return const_cast<ExplodedNode*>(this)->getFirstPred();
     return const_cast<ExplodedNode*>(this)->getFirstPred();
   }
   }
-  
+
   // Iterators over successor and predecessor vertices.
   // Iterators over successor and predecessor vertices.
   typedef ExplodedNode**       succ_iterator;
   typedef ExplodedNode**       succ_iterator;
   typedef const ExplodedNode* const * const_succ_iterator;
   typedef const ExplodedNode* const * const_succ_iterator;
@@ -164,7 +164,7 @@ public:
 
 
   const_pred_iterator pred_begin() const {
   const_pred_iterator pred_begin() const {
     return const_cast<ExplodedNode*>(this)->pred_begin();
     return const_cast<ExplodedNode*>(this)->pred_begin();
-  }  
+  }
   const_pred_iterator pred_end() const {
   const_pred_iterator pred_end() const {
     return const_cast<ExplodedNode*>(this)->pred_end();
     return const_cast<ExplodedNode*>(this)->pred_end();
   }
   }
@@ -180,26 +180,26 @@ public:
   }
   }
 
 
   // For debugging.
   // For debugging.
-  
+
 public:
 public:
-  
+
   class Auditor {
   class Auditor {
   public:
   public:
     virtual ~Auditor();
     virtual ~Auditor();
     virtual void AddEdge(ExplodedNode* Src, ExplodedNode* Dst) = 0;
     virtual void AddEdge(ExplodedNode* Src, ExplodedNode* Dst) = 0;
   };
   };
-  
+
   static void SetAuditor(Auditor* A);
   static void SetAuditor(Auditor* A);
 };
 };
 
 
 // FIXME: Is this class necessary?
 // FIXME: Is this class necessary?
 class InterExplodedGraphMap {
 class InterExplodedGraphMap {
   llvm::DenseMap<const ExplodedNode*, ExplodedNode*> M;
   llvm::DenseMap<const ExplodedNode*, ExplodedNode*> M;
-  friend class ExplodedGraph;  
+  friend class ExplodedGraph;
 
 
 public:
 public:
   ExplodedNode* getMappedNode(const ExplodedNode* N) const;
   ExplodedNode* getMappedNode(const ExplodedNode* N) const;
-  
+
   InterExplodedGraphMap() {};
   InterExplodedGraphMap() {};
   virtual ~InterExplodedGraphMap() {}
   virtual ~InterExplodedGraphMap() {}
 };
 };
@@ -211,7 +211,7 @@ protected:
   // Type definitions.
   // Type definitions.
   typedef llvm::SmallVector<ExplodedNode*,2>    RootsTy;
   typedef llvm::SmallVector<ExplodedNode*,2>    RootsTy;
   typedef llvm::SmallVector<ExplodedNode*,10>   EndNodesTy;
   typedef llvm::SmallVector<ExplodedNode*,10>   EndNodesTy;
-    
+
   /// Roots - The roots of the simulation graph. Usually there will be only
   /// Roots - The roots of the simulation graph. Usually there will be only
   /// one, but clients are free to establish multiple subgraphs within a single
   /// one, but clients are free to establish multiple subgraphs within a single
   /// SimulGraph. Moreover, these subgraphs can often merge when paths from
   /// SimulGraph. Moreover, these subgraphs can often merge when paths from
@@ -227,10 +227,10 @@ protected:
 
 
   /// Allocator - BumpPtrAllocator to create nodes.
   /// Allocator - BumpPtrAllocator to create nodes.
   llvm::BumpPtrAllocator Allocator;
   llvm::BumpPtrAllocator Allocator;
-  
+
   /// Ctx - The ASTContext used to "interpret" CodeDecl.
   /// Ctx - The ASTContext used to "interpret" CodeDecl.
   ASTContext& Ctx;
   ASTContext& Ctx;
-  
+
   /// NumNodes - The number of nodes in the graph.
   /// NumNodes - The number of nodes in the graph.
   unsigned NumNodes;
   unsigned NumNodes;
 
 
@@ -242,7 +242,7 @@ public:
 
 
   ExplodedNode* getNode(const ProgramPoint& L, const GRState *State,
   ExplodedNode* getNode(const ProgramPoint& L, const GRState *State,
                         bool* IsNew = 0);
                         bool* IsNew = 0);
-  
+
   ExplodedGraph* MakeEmptyGraph() const {
   ExplodedGraph* MakeEmptyGraph() const {
     return new ExplodedGraph(Ctx);
     return new ExplodedGraph(Ctx);
   }
   }
@@ -265,7 +265,7 @@ public:
 
 
   unsigned num_roots() const { return Roots.size(); }
   unsigned num_roots() const { return Roots.size(); }
   unsigned num_eops() const { return EndNodes.size(); }
   unsigned num_eops() const { return EndNodes.size(); }
-  
+
   bool empty() const { return NumNodes == 0; }
   bool empty() const { return NumNodes == 0; }
   unsigned size() const { return NumNodes; }
   unsigned size() const { return NumNodes; }
 
 
@@ -278,29 +278,29 @@ public:
   typedef NodeTy* const *                     const_eop_iterator;
   typedef NodeTy* const *                     const_eop_iterator;
   typedef AllNodesTy::iterator                node_iterator;
   typedef AllNodesTy::iterator                node_iterator;
   typedef AllNodesTy::const_iterator          const_node_iterator;
   typedef AllNodesTy::const_iterator          const_node_iterator;
-  
+
   node_iterator nodes_begin() { return Nodes.begin(); }
   node_iterator nodes_begin() { return Nodes.begin(); }
 
 
   node_iterator nodes_end() { return Nodes.end(); }
   node_iterator nodes_end() { return Nodes.end(); }
-  
+
   const_node_iterator nodes_begin() const { return Nodes.begin(); }
   const_node_iterator nodes_begin() const { return Nodes.begin(); }
-  
+
   const_node_iterator nodes_end() const { return Nodes.end(); }
   const_node_iterator nodes_end() const { return Nodes.end(); }
-  
+
   roots_iterator roots_begin() { return Roots.begin(); }
   roots_iterator roots_begin() { return Roots.begin(); }
-  
+
   roots_iterator roots_end() { return Roots.end(); }
   roots_iterator roots_end() { return Roots.end(); }
-  
+
   const_roots_iterator roots_begin() const { return Roots.begin(); }
   const_roots_iterator roots_begin() const { return Roots.begin(); }
-  
-  const_roots_iterator roots_end() const { return Roots.end(); }  
+
+  const_roots_iterator roots_end() const { return Roots.end(); }
 
 
   eop_iterator eop_begin() { return EndNodes.begin(); }
   eop_iterator eop_begin() { return EndNodes.begin(); }
-    
+
   eop_iterator eop_end() { return EndNodes.end(); }
   eop_iterator eop_end() { return EndNodes.end(); }
-  
+
   const_eop_iterator eop_begin() const { return EndNodes.begin(); }
   const_eop_iterator eop_begin() const { return EndNodes.begin(); }
-  
+
   const_eop_iterator eop_end() const { return EndNodes.end(); }
   const_eop_iterator eop_end() const { return EndNodes.end(); }
 
 
   llvm::BumpPtrAllocator& getAllocator() { return Allocator; }
   llvm::BumpPtrAllocator& getAllocator() { return Allocator; }
@@ -322,24 +322,24 @@ public:
 class ExplodedNodeSet {
 class ExplodedNodeSet {
   typedef llvm::SmallPtrSet<ExplodedNode*,5> ImplTy;
   typedef llvm::SmallPtrSet<ExplodedNode*,5> ImplTy;
   ImplTy Impl;
   ImplTy Impl;
-  
+
 public:
 public:
   ExplodedNodeSet(ExplodedNode* N) {
   ExplodedNodeSet(ExplodedNode* N) {
     assert (N && !static_cast<ExplodedNode*>(N)->isSink());
     assert (N && !static_cast<ExplodedNode*>(N)->isSink());
     Impl.insert(N);
     Impl.insert(N);
   }
   }
-  
+
   ExplodedNodeSet() {}
   ExplodedNodeSet() {}
-  
+
   inline void Add(ExplodedNode* N) {
   inline void Add(ExplodedNode* N) {
     if (N && !static_cast<ExplodedNode*>(N)->isSink()) Impl.insert(N);
     if (N && !static_cast<ExplodedNode*>(N)->isSink()) Impl.insert(N);
   }
   }
-  
+
   ExplodedNodeSet& operator=(const ExplodedNodeSet &X) {
   ExplodedNodeSet& operator=(const ExplodedNodeSet &X) {
     Impl = X.Impl;
     Impl = X.Impl;
     return *this;
     return *this;
   }
   }
-  
+
   typedef ImplTy::iterator       iterator;
   typedef ImplTy::iterator       iterator;
   typedef ImplTy::const_iterator const_iterator;
   typedef ImplTy::const_iterator const_iterator;
 
 
@@ -347,14 +347,14 @@ public:
   inline bool empty()    const { return Impl.empty(); }
   inline bool empty()    const { return Impl.empty(); }
 
 
   inline void clear() { Impl.clear(); }
   inline void clear() { Impl.clear(); }
-  
+
   inline iterator begin() { return Impl.begin(); }
   inline iterator begin() { return Impl.begin(); }
   inline iterator end()   { return Impl.end();   }
   inline iterator end()   { return Impl.end();   }
-  
+
   inline const_iterator begin() const { return Impl.begin(); }
   inline const_iterator begin() const { return Impl.begin(); }
   inline const_iterator end()   const { return Impl.end();   }
   inline const_iterator end()   const { return Impl.end();   }
-};  
-  
+};
+
 } // end clang namespace
 } // end clang namespace
 
 
 // GraphTraits
 // GraphTraits
@@ -364,54 +364,54 @@ namespace llvm {
     typedef clang::ExplodedNode NodeType;
     typedef clang::ExplodedNode NodeType;
     typedef NodeType::succ_iterator  ChildIteratorType;
     typedef NodeType::succ_iterator  ChildIteratorType;
     typedef llvm::df_iterator<NodeType*>      nodes_iterator;
     typedef llvm::df_iterator<NodeType*>      nodes_iterator;
-    
+
     static inline NodeType* getEntryNode(NodeType* N) {
     static inline NodeType* getEntryNode(NodeType* N) {
       return N;
       return N;
     }
     }
-    
+
     static inline ChildIteratorType child_begin(NodeType* N) {
     static inline ChildIteratorType child_begin(NodeType* N) {
       return N->succ_begin();
       return N->succ_begin();
     }
     }
-    
+
     static inline ChildIteratorType child_end(NodeType* N) {
     static inline ChildIteratorType child_end(NodeType* N) {
       return N->succ_end();
       return N->succ_end();
     }
     }
-    
+
     static inline nodes_iterator nodes_begin(NodeType* N) {
     static inline nodes_iterator nodes_begin(NodeType* N) {
       return df_begin(N);
       return df_begin(N);
     }
     }
-    
+
     static inline nodes_iterator nodes_end(NodeType* N) {
     static inline nodes_iterator nodes_end(NodeType* N) {
       return df_end(N);
       return df_end(N);
     }
     }
   };
   };
-  
+
   template<> struct GraphTraits<const clang::ExplodedNode*> {
   template<> struct GraphTraits<const clang::ExplodedNode*> {
     typedef const clang::ExplodedNode NodeType;
     typedef const clang::ExplodedNode NodeType;
     typedef NodeType::const_succ_iterator   ChildIteratorType;
     typedef NodeType::const_succ_iterator   ChildIteratorType;
     typedef llvm::df_iterator<NodeType*>       nodes_iterator;
     typedef llvm::df_iterator<NodeType*>       nodes_iterator;
-    
+
     static inline NodeType* getEntryNode(NodeType* N) {
     static inline NodeType* getEntryNode(NodeType* N) {
       return N;
       return N;
     }
     }
-    
+
     static inline ChildIteratorType child_begin(NodeType* N) {
     static inline ChildIteratorType child_begin(NodeType* N) {
       return N->succ_begin();
       return N->succ_begin();
     }
     }
-    
+
     static inline ChildIteratorType child_end(NodeType* N) {
     static inline ChildIteratorType child_end(NodeType* N) {
       return N->succ_end();
       return N->succ_end();
     }
     }
-    
+
     static inline nodes_iterator nodes_begin(NodeType* N) {
     static inline nodes_iterator nodes_begin(NodeType* N) {
       return df_begin(N);
       return df_begin(N);
     }
     }
-    
+
     static inline nodes_iterator nodes_end(NodeType* N) {
     static inline nodes_iterator nodes_end(NodeType* N) {
       return df_end(N);
       return df_end(N);
     }
     }
   };
   };
-  
+
 } // end llvm namespace
 } // end llvm namespace
 
 
 #endif
 #endif

+ 4 - 4
include/clang/Analysis/PathSensitive/GRAuditor.h

@@ -1,5 +1,5 @@
 //==- GRAuditor.h - Observers of the creation of ExplodedNodes------*- C++ -*-//
 //==- GRAuditor.h - Observers of the creation of ExplodedNodes------*- C++ -*-//
-//             
+//
 //                     The LLVM Compiler Infrastructure
 //                     The LLVM Compiler Infrastructure
 //
 //
 // This file is distributed under the University of Illinois Open Source
 // This file is distributed under the University of Illinois Open Source
@@ -22,14 +22,14 @@ namespace clang {
 
 
 class ExplodedNode;
 class ExplodedNode;
 class GRStateManager;
 class GRStateManager;
-  
+
 class GRAuditor {
 class GRAuditor {
 public:
 public:
   virtual ~GRAuditor() {}
   virtual ~GRAuditor() {}
   virtual bool Audit(ExplodedNode* N, GRStateManager& M) = 0;
   virtual bool Audit(ExplodedNode* N, GRStateManager& M) = 0;
 };
 };
-  
-  
+
+
 } // end clang namespace
 } // end clang namespace
 
 
 #endif
 #endif

+ 8 - 8
include/clang/Analysis/PathSensitive/GRBlockCounter.h

@@ -1,5 +1,5 @@
 //==- GRBlockCounter.h - ADT for counting block visits -------------*- C++ -*-//
 //==- GRBlockCounter.h - ADT for counting block visits -------------*- C++ -*-//
-//             
+//
 //                     The LLVM Compiler Infrastructure
 //                     The LLVM Compiler Infrastructure
 //
 //
 // This file is distributed under the University of Illinois Open Source
 // This file is distributed under the University of Illinois Open Source
@@ -24,27 +24,27 @@ namespace clang {
 
 
 class GRBlockCounter {
 class GRBlockCounter {
   void* Data;
   void* Data;
-  
-  GRBlockCounter(void* D) : Data(D) {}  
+
+  GRBlockCounter(void* D) : Data(D) {}
 
 
 public:
 public:
   GRBlockCounter() : Data(0) {}
   GRBlockCounter() : Data(0) {}
-  
+
   unsigned getNumVisited(unsigned BlockID) const;
   unsigned getNumVisited(unsigned BlockID) const;
-  
+
   class Factory {
   class Factory {
     void* F;
     void* F;
   public:
   public:
     Factory(llvm::BumpPtrAllocator& Alloc);
     Factory(llvm::BumpPtrAllocator& Alloc);
     ~Factory();
     ~Factory();
-    
+
     GRBlockCounter GetEmptyCounter();
     GRBlockCounter GetEmptyCounter();
     GRBlockCounter IncrementCount(GRBlockCounter BC, unsigned BlockID);
     GRBlockCounter IncrementCount(GRBlockCounter BC, unsigned BlockID);
   };
   };
-  
+
   friend class Factory;
   friend class Factory;
 };
 };
 
 
 } // end clang namespace
 } // end clang namespace
-  
+
 #endif
 #endif

+ 95 - 95
include/clang/Analysis/PathSensitive/GRCoreEngine.h

@@ -1,5 +1,5 @@
 //==- GRCoreEngine.h - Path-Sensitive Dataflow Engine --------------*- C++ -*-//
 //==- GRCoreEngine.h - Path-Sensitive Dataflow Engine --------------*- C++ -*-//
-//             
+//
 //                     The LLVM Compiler Infrastructure
 //                     The LLVM Compiler Infrastructure
 //
 //
 // This file is distributed under the University of Illinois Open Source
 // This file is distributed under the University of Illinois Open Source
@@ -26,7 +26,7 @@
 namespace clang {
 namespace clang {
 
 
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
-/// GRCoreEngine - Implements the core logic of the graph-reachability 
+/// GRCoreEngine - Implements the core logic of the graph-reachability
 ///   analysis. It traverses the CFG and generates the ExplodedGraph.
 ///   analysis. It traverses the CFG and generates the ExplodedGraph.
 ///   Program "states" are treated as opaque void pointers.
 ///   Program "states" are treated as opaque void pointers.
 ///   The template class GRCoreEngine (which subclasses GRCoreEngine)
 ///   The template class GRCoreEngine (which subclasses GRCoreEngine)
@@ -45,61 +45,61 @@ class GRCoreEngine {
 
 
   /// G - The simulation graph.  Each node is a (location,state) pair.
   /// G - The simulation graph.  Each node is a (location,state) pair.
   llvm::OwningPtr<ExplodedGraph> G;
   llvm::OwningPtr<ExplodedGraph> G;
-      
+
   /// WList - A set of queued nodes that need to be processed by the
   /// WList - A set of queued nodes that need to be processed by the
   ///  worklist algorithm.  It is up to the implementation of WList to decide
   ///  worklist algorithm.  It is up to the implementation of WList to decide
   ///  the order that nodes are processed.
   ///  the order that nodes are processed.
   GRWorkList* WList;
   GRWorkList* WList;
-  
+
   /// BCounterFactory - A factory object for created GRBlockCounter objects.
   /// BCounterFactory - A factory object for created GRBlockCounter objects.
   ///   These are used to record for key nodes in the ExplodedGraph the
   ///   These are used to record for key nodes in the ExplodedGraph the
   ///   number of times different CFGBlocks have been visited along a path.
   ///   number of times different CFGBlocks have been visited along a path.
   GRBlockCounter::Factory BCounterFactory;
   GRBlockCounter::Factory BCounterFactory;
-  
+
   void GenerateNode(const ProgramPoint& Loc, const GRState* State,
   void GenerateNode(const ProgramPoint& Loc, const GRState* State,
                     ExplodedNode* Pred);
                     ExplodedNode* Pred);
-  
+
   void HandleBlockEdge(const BlockEdge& E, ExplodedNode* Pred);
   void HandleBlockEdge(const BlockEdge& E, ExplodedNode* Pred);
   void HandleBlockEntrance(const BlockEntrance& E, ExplodedNode* Pred);
   void HandleBlockEntrance(const BlockEntrance& E, ExplodedNode* Pred);
   void HandleBlockExit(CFGBlock* B, ExplodedNode* Pred);
   void HandleBlockExit(CFGBlock* B, ExplodedNode* Pred);
   void HandlePostStmt(const PostStmt& S, CFGBlock* B,
   void HandlePostStmt(const PostStmt& S, CFGBlock* B,
                       unsigned StmtIdx, ExplodedNode *Pred);
                       unsigned StmtIdx, ExplodedNode *Pred);
-  
+
   void HandleBranch(Stmt* Cond, Stmt* Term, CFGBlock* B,
   void HandleBranch(Stmt* Cond, Stmt* Term, CFGBlock* B,
-                    ExplodedNode* Pred);  
+                    ExplodedNode* Pred);
 
 
   /// Get the initial state from the subengine.
   /// Get the initial state from the subengine.
-  const GRState* getInitialState(const LocationContext *InitLoc) { 
+  const GRState* getInitialState(const LocationContext *InitLoc) {
     return SubEngine.getInitialState(InitLoc);
     return SubEngine.getInitialState(InitLoc);
   }
   }
 
 
   void ProcessEndPath(GREndPathNodeBuilder& Builder);
   void ProcessEndPath(GREndPathNodeBuilder& Builder);
-  
+
   void ProcessStmt(Stmt* S, GRStmtNodeBuilder& Builder);
   void ProcessStmt(Stmt* S, GRStmtNodeBuilder& Builder);
 
 
-  
+
   bool ProcessBlockEntrance(CFGBlock* Blk, const GRState* State,
   bool ProcessBlockEntrance(CFGBlock* Blk, const GRState* State,
                             GRBlockCounter BC);
                             GRBlockCounter BC);
 
 
-  
+
   void ProcessBranch(Stmt* Condition, Stmt* Terminator,
   void ProcessBranch(Stmt* Condition, Stmt* Terminator,
                      GRBranchNodeBuilder& Builder);
                      GRBranchNodeBuilder& Builder);
 
 
 
 
   void ProcessIndirectGoto(GRIndirectGotoNodeBuilder& Builder);
   void ProcessIndirectGoto(GRIndirectGotoNodeBuilder& Builder);
 
 
-  
+
   void ProcessSwitch(GRSwitchNodeBuilder& Builder);
   void ProcessSwitch(GRSwitchNodeBuilder& Builder);
 
 
 private:
 private:
   GRCoreEngine(const GRCoreEngine&); // Do not implement.
   GRCoreEngine(const GRCoreEngine&); // Do not implement.
   GRCoreEngine& operator=(const GRCoreEngine&);
   GRCoreEngine& operator=(const GRCoreEngine&);
-  
+
 public:
 public:
   /// Construct a GRCoreEngine object to analyze the provided CFG using
   /// Construct a GRCoreEngine object to analyze the provided CFG using
   ///  a DFS exploration of the exploded graph.
   ///  a DFS exploration of the exploded graph.
   GRCoreEngine(ASTContext& ctx, GRSubEngine& subengine)
   GRCoreEngine(ASTContext& ctx, GRSubEngine& subengine)
-    : SubEngine(subengine), G(new ExplodedGraph(ctx)), 
+    : SubEngine(subengine), G(new ExplodedGraph(ctx)),
       WList(GRWorkList::MakeBFS()),
       WList(GRWorkList::MakeBFS()),
       BCounterFactory(G->getAllocator()) {}
       BCounterFactory(G->getAllocator()) {}
 
 
@@ -116,7 +116,7 @@ public:
 
 
   /// getGraph - Returns the exploded graph.
   /// getGraph - Returns the exploded graph.
   ExplodedGraph& getGraph() { return *G.get(); }
   ExplodedGraph& getGraph() { return *G.get(); }
-  
+
   /// takeGraph - Returns the exploded graph.  Ownership of the graph is
   /// takeGraph - Returns the exploded graph.  Ownership of the graph is
   ///  transfered to the caller.
   ///  transfered to the caller.
   ExplodedGraph* takeGraph() { return G.take(); }
   ExplodedGraph* takeGraph() { return G.take(); }
@@ -125,13 +125,13 @@ public:
   ///  steps.  Returns true if there is still simulation state on the worklist.
   ///  steps.  Returns true if there is still simulation state on the worklist.
   bool ExecuteWorkList(const LocationContext *L, unsigned Steps);
   bool ExecuteWorkList(const LocationContext *L, unsigned Steps);
 };
 };
-  
+
 class GRStmtNodeBuilder {
 class GRStmtNodeBuilder {
   GRCoreEngine& Eng;
   GRCoreEngine& Eng;
   CFGBlock& B;
   CFGBlock& B;
   const unsigned Idx;
   const unsigned Idx;
   ExplodedNode* Pred;
   ExplodedNode* Pred;
-  ExplodedNode* LastNode;  
+  ExplodedNode* LastNode;
   GRStateManager& Mgr;
   GRStateManager& Mgr;
   GRAuditor* Auditor;
   GRAuditor* Auditor;
 
 
@@ -141,23 +141,23 @@ public:
   bool HasGeneratedNode;
   bool HasGeneratedNode;
   ProgramPoint::Kind PointKind;
   ProgramPoint::Kind PointKind;
   const void *Tag;
   const void *Tag;
-  
-  const GRState* CleanedState;  
-  
+
+  const GRState* CleanedState;
+
 
 
   typedef llvm::SmallPtrSet<ExplodedNode*,5> DeferredTy;
   typedef llvm::SmallPtrSet<ExplodedNode*,5> DeferredTy;
   DeferredTy Deferred;
   DeferredTy Deferred;
-  
+
   void GenerateAutoTransition(ExplodedNode* N);
   void GenerateAutoTransition(ExplodedNode* N);
-  
+
 public:
 public:
-  GRStmtNodeBuilder(CFGBlock* b, unsigned idx, ExplodedNode* N, 
-                    GRCoreEngine* e, GRStateManager &mgr);      
-  
+  GRStmtNodeBuilder(CFGBlock* b, unsigned idx, ExplodedNode* N,
+                    GRCoreEngine* e, GRStateManager &mgr);
+
   ~GRStmtNodeBuilder();
   ~GRStmtNodeBuilder();
-  
+
   ExplodedNode* getBasePredecessor() const { return Pred; }
   ExplodedNode* getBasePredecessor() const { return Pred; }
-  
+
   ExplodedNode* getLastNode() const {
   ExplodedNode* getLastNode() const {
     return LastNode ? (LastNode->isSink() ? NULL : LastNode) : NULL;
     return LastNode ? (LastNode->isSink() ? NULL : LastNode) : NULL;
   }
   }
@@ -167,26 +167,26 @@ public:
   }
   }
 
 
   GRBlockCounter getBlockCounter() const { return Eng.WList->getBlockCounter();}
   GRBlockCounter getBlockCounter() const { return Eng.WList->getBlockCounter();}
-  
+
   unsigned getCurrentBlockCount() const {
   unsigned getCurrentBlockCount() const {
     return getBlockCounter().getNumVisited(B.getBlockID());
     return getBlockCounter().getNumVisited(B.getBlockID());
-  }  
+  }
 
 
   ExplodedNode* generateNode(PostStmt PP,const GRState* St,ExplodedNode* Pred) {
   ExplodedNode* generateNode(PostStmt PP,const GRState* St,ExplodedNode* Pred) {
     HasGeneratedNode = true;
     HasGeneratedNode = true;
     return generateNodeInternal(PP, St, Pred);
     return generateNodeInternal(PP, St, Pred);
   }
   }
-  
+
   ExplodedNode* generateNode(const Stmt *S, const GRState *St,
   ExplodedNode* generateNode(const Stmt *S, const GRState *St,
                              ExplodedNode *Pred, ProgramPoint::Kind K) {
                              ExplodedNode *Pred, ProgramPoint::Kind K) {
     HasGeneratedNode = true;
     HasGeneratedNode = true;
 
 
-    if (PurgingDeadSymbols) 
-      K = ProgramPoint::PostPurgeDeadSymbolsKind;      
+    if (PurgingDeadSymbols)
+      K = ProgramPoint::PostPurgeDeadSymbolsKind;
 
 
     return generateNodeInternal(S, St, Pred, K, Tag);
     return generateNodeInternal(S, St, Pred, K, Tag);
   }
   }
-  
+
   ExplodedNode* generateNode(const Stmt *S, const GRState *St,
   ExplodedNode* generateNode(const Stmt *S, const GRState *St,
                              ExplodedNode *Pred) {
                              ExplodedNode *Pred) {
     return generateNode(S, St, Pred, PointKind);
     return generateNode(S, St, Pred, PointKind);
@@ -195,16 +195,16 @@ public:
   ExplodedNode*
   ExplodedNode*
   generateNodeInternal(const ProgramPoint &PP, const GRState* State,
   generateNodeInternal(const ProgramPoint &PP, const GRState* State,
                        ExplodedNode* Pred);
                        ExplodedNode* Pred);
-  
+
   ExplodedNode*
   ExplodedNode*
   generateNodeInternal(const Stmt* S, const GRState* State, ExplodedNode* Pred,
   generateNodeInternal(const Stmt* S, const GRState* State, ExplodedNode* Pred,
                    ProgramPoint::Kind K = ProgramPoint::PostStmtKind,
                    ProgramPoint::Kind K = ProgramPoint::PostStmtKind,
                    const void *tag = 0);
                    const void *tag = 0);
-  
+
   /// getStmt - Return the current block-level expression associated with
   /// getStmt - Return the current block-level expression associated with
   ///  this builder.
   ///  this builder.
   Stmt* getStmt() const { return B[Idx]; }
   Stmt* getStmt() const { return B[Idx]; }
-  
+
   /// getBlock - Return the CFGBlock associated with the block-level expression
   /// getBlock - Return the CFGBlock associated with the block-level expression
   ///  of this builder.
   ///  of this builder.
   CFGBlock* getBlock() const { return &B; }
   CFGBlock* getBlock() const { return &B; }
@@ -218,40 +218,40 @@ public:
       return Pred->getState();
       return Pred->getState();
   }
   }
 
 
-  ExplodedNode* MakeNode(ExplodedNodeSet& Dst, Stmt* S, ExplodedNode* Pred, 
+  ExplodedNode* MakeNode(ExplodedNodeSet& Dst, Stmt* S, ExplodedNode* Pred,
                    const GRState* St) {
                    const GRState* St) {
     return MakeNode(Dst, S, Pred, St, PointKind);
     return MakeNode(Dst, S, Pred, St, PointKind);
   }
   }
-  
+
   ExplodedNode* MakeNode(ExplodedNodeSet& Dst, Stmt* S, ExplodedNode* Pred,
   ExplodedNode* MakeNode(ExplodedNodeSet& Dst, Stmt* S, ExplodedNode* Pred,
-                         const GRState* St, ProgramPoint::Kind K) {    
-    
+                         const GRState* St, ProgramPoint::Kind K) {
+
     const GRState* PredState = GetState(Pred);
     const GRState* PredState = GetState(Pred);
-        
+
     // If the state hasn't changed, don't generate a new node.
     // If the state hasn't changed, don't generate a new node.
     if (!BuildSinks && St == PredState && Auditor == 0) {
     if (!BuildSinks && St == PredState && Auditor == 0) {
       Dst.Add(Pred);
       Dst.Add(Pred);
       return NULL;
       return NULL;
     }
     }
-    
+
     ExplodedNode* N = generateNode(S, St, Pred, K);
     ExplodedNode* N = generateNode(S, St, Pred, K);
-    
-    if (N) {      
+
+    if (N) {
       if (BuildSinks)
       if (BuildSinks)
         N->markAsSink();
         N->markAsSink();
       else {
       else {
         if (Auditor && Auditor->Audit(N, Mgr))
         if (Auditor && Auditor->Audit(N, Mgr))
           N->markAsSink();
           N->markAsSink();
-        
+
         Dst.Add(N);
         Dst.Add(N);
       }
       }
     }
     }
-    
+
     return N;
     return N;
   }
   }
-  
+
   ExplodedNode* MakeSinkNode(ExplodedNodeSet& Dst, Stmt* S,
   ExplodedNode* MakeSinkNode(ExplodedNodeSet& Dst, Stmt* S,
-                       ExplodedNode* Pred, const GRState* St) { 
+                       ExplodedNode* Pred, const GRState* St) {
     bool Tmp = BuildSinks;
     bool Tmp = BuildSinks;
     BuildSinks = true;
     BuildSinks = true;
     ExplodedNode* N = MakeNode(Dst, S, Pred, St);
     ExplodedNode* N = MakeNode(Dst, S, Pred, St);
@@ -260,7 +260,7 @@ public:
   }
   }
 
 
 };
 };
-  
+
 class GRBranchNodeBuilder {
 class GRBranchNodeBuilder {
   GRCoreEngine& Eng;
   GRCoreEngine& Eng;
   CFGBlock* Src;
   CFGBlock* Src;
@@ -270,44 +270,44 @@ class GRBranchNodeBuilder {
 
 
   typedef llvm::SmallVector<ExplodedNode*,3> DeferredTy;
   typedef llvm::SmallVector<ExplodedNode*,3> DeferredTy;
   DeferredTy Deferred;
   DeferredTy Deferred;
-  
+
   bool GeneratedTrue;
   bool GeneratedTrue;
   bool GeneratedFalse;
   bool GeneratedFalse;
   bool InFeasibleTrue;
   bool InFeasibleTrue;
   bool InFeasibleFalse;
   bool InFeasibleFalse;
-  
+
 public:
 public:
   GRBranchNodeBuilder(CFGBlock* src, CFGBlock* dstT, CFGBlock* dstF,
   GRBranchNodeBuilder(CFGBlock* src, CFGBlock* dstT, CFGBlock* dstF,
-                          ExplodedNode* pred, GRCoreEngine* e) 
+                          ExplodedNode* pred, GRCoreEngine* e)
   : Eng(*e), Src(src), DstT(dstT), DstF(dstF), Pred(pred),
   : Eng(*e), Src(src), DstT(dstT), DstF(dstF), Pred(pred),
     GeneratedTrue(false), GeneratedFalse(false),
     GeneratedTrue(false), GeneratedFalse(false),
     InFeasibleTrue(!DstT), InFeasibleFalse(!DstF) {}
     InFeasibleTrue(!DstT), InFeasibleFalse(!DstF) {}
-  
+
   ~GRBranchNodeBuilder();
   ~GRBranchNodeBuilder();
-  
+
   ExplodedNode* getPredecessor() const { return Pred; }
   ExplodedNode* getPredecessor() const { return Pred; }
 
 
   const ExplodedGraph& getGraph() const { return *Eng.G; }
   const ExplodedGraph& getGraph() const { return *Eng.G; }
 
 
   GRBlockCounter getBlockCounter() const { return Eng.WList->getBlockCounter();}
   GRBlockCounter getBlockCounter() const { return Eng.WList->getBlockCounter();}
-    
+
   ExplodedNode* generateNode(const GRState* State, bool branch);
   ExplodedNode* generateNode(const GRState* State, bool branch);
-  
+
   CFGBlock* getTargetBlock(bool branch) const {
   CFGBlock* getTargetBlock(bool branch) const {
     return branch ? DstT : DstF;
     return branch ? DstT : DstF;
-  }    
-  
+  }
+
   void markInfeasible(bool branch) {
   void markInfeasible(bool branch) {
     if (branch)
     if (branch)
       InFeasibleTrue = GeneratedTrue = true;
       InFeasibleTrue = GeneratedTrue = true;
     else
     else
       InFeasibleFalse = GeneratedFalse = true;
       InFeasibleFalse = GeneratedFalse = true;
   }
   }
-  
+
   bool isFeasible(bool branch) {
   bool isFeasible(bool branch) {
     return branch ? !InFeasibleTrue : !InFeasibleFalse;
     return branch ? !InFeasibleTrue : !InFeasibleFalse;
   }
   }
-  
+
   const GRState* getState() const {
   const GRState* getState() const {
     return getPredecessor()->getState();
     return getPredecessor()->getState();
   }
   }
@@ -318,81 +318,81 @@ class GRIndirectGotoNodeBuilder {
   CFGBlock* Src;
   CFGBlock* Src;
   CFGBlock& DispatchBlock;
   CFGBlock& DispatchBlock;
   Expr* E;
   Expr* E;
-  ExplodedNode* Pred;  
+  ExplodedNode* Pred;
 
 
 public:
 public:
-  GRIndirectGotoNodeBuilder(ExplodedNode* pred, CFGBlock* src, Expr* e, 
+  GRIndirectGotoNodeBuilder(ExplodedNode* pred, CFGBlock* src, Expr* e,
                             CFGBlock* dispatch, GRCoreEngine* eng)
                             CFGBlock* dispatch, GRCoreEngine* eng)
   : Eng(*eng), Src(src), DispatchBlock(*dispatch), E(e), Pred(pred) {}
   : Eng(*eng), Src(src), DispatchBlock(*dispatch), E(e), Pred(pred) {}
 
 
   class iterator {
   class iterator {
     CFGBlock::succ_iterator I;
     CFGBlock::succ_iterator I;
-    
-    friend class GRIndirectGotoNodeBuilder;    
-    iterator(CFGBlock::succ_iterator i) : I(i) {}    
+
+    friend class GRIndirectGotoNodeBuilder;
+    iterator(CFGBlock::succ_iterator i) : I(i) {}
   public:
   public:
-    
+
     iterator& operator++() { ++I; return *this; }
     iterator& operator++() { ++I; return *this; }
     bool operator!=(const iterator& X) const { return I != X.I; }
     bool operator!=(const iterator& X) const { return I != X.I; }
-    
+
     LabelStmt* getLabel() const {
     LabelStmt* getLabel() const {
       return llvm::cast<LabelStmt>((*I)->getLabel());
       return llvm::cast<LabelStmt>((*I)->getLabel());
     }
     }
-    
+
     CFGBlock*  getBlock() const {
     CFGBlock*  getBlock() const {
       return *I;
       return *I;
     }
     }
   };
   };
-  
+
   iterator begin() { return iterator(DispatchBlock.succ_begin()); }
   iterator begin() { return iterator(DispatchBlock.succ_begin()); }
   iterator end() { return iterator(DispatchBlock.succ_end()); }
   iterator end() { return iterator(DispatchBlock.succ_end()); }
-  
+
   ExplodedNode* generateNode(const iterator& I, const GRState* State,
   ExplodedNode* generateNode(const iterator& I, const GRState* State,
                              bool isSink = false);
                              bool isSink = false);
-  
+
   Expr* getTarget() const { return E; }
   Expr* getTarget() const { return E; }
 
 
   const GRState* getState() const { return Pred->State; }
   const GRState* getState() const { return Pred->State; }
 };
 };
-  
+
 class GRSwitchNodeBuilder {
 class GRSwitchNodeBuilder {
   GRCoreEngine& Eng;
   GRCoreEngine& Eng;
   CFGBlock* Src;
   CFGBlock* Src;
   Expr* Condition;
   Expr* Condition;
-  ExplodedNode* Pred;  
+  ExplodedNode* Pred;
 
 
 public:
 public:
   GRSwitchNodeBuilder(ExplodedNode* pred, CFGBlock* src,
   GRSwitchNodeBuilder(ExplodedNode* pred, CFGBlock* src,
                       Expr* condition, GRCoreEngine* eng)
                       Expr* condition, GRCoreEngine* eng)
   : Eng(*eng), Src(src), Condition(condition), Pred(pred) {}
   : Eng(*eng), Src(src), Condition(condition), Pred(pred) {}
-  
+
   class iterator {
   class iterator {
     CFGBlock::succ_reverse_iterator I;
     CFGBlock::succ_reverse_iterator I;
-    
-    friend class GRSwitchNodeBuilder;    
-    iterator(CFGBlock::succ_reverse_iterator i) : I(i) {}    
+
+    friend class GRSwitchNodeBuilder;
+    iterator(CFGBlock::succ_reverse_iterator i) : I(i) {}
 
 
   public:
   public:
     iterator& operator++() { ++I; return *this; }
     iterator& operator++() { ++I; return *this; }
     bool operator!=(const iterator& X) const { return I != X.I; }
     bool operator!=(const iterator& X) const { return I != X.I; }
-    
+
     CaseStmt* getCase() const {
     CaseStmt* getCase() const {
       return llvm::cast<CaseStmt>((*I)->getLabel());
       return llvm::cast<CaseStmt>((*I)->getLabel());
     }
     }
-    
+
     CFGBlock* getBlock() const {
     CFGBlock* getBlock() const {
       return *I;
       return *I;
     }
     }
   };
   };
-  
+
   iterator begin() { return iterator(Src->succ_rbegin()+1); }
   iterator begin() { return iterator(Src->succ_rbegin()+1); }
   iterator end() { return iterator(Src->succ_rend()); }
   iterator end() { return iterator(Src->succ_rend()); }
-  
+
   ExplodedNode* generateCaseStmtNode(const iterator& I, const GRState* State);
   ExplodedNode* generateCaseStmtNode(const iterator& I, const GRState* State);
-  
+
   ExplodedNode* generateDefaultCaseNode(const GRState* State,
   ExplodedNode* generateDefaultCaseNode(const GRState* State,
                                         bool isSink = false);
                                         bool isSink = false);
-  
+
   Expr* getCondition() const { return Condition; }
   Expr* getCondition() const { return Condition; }
 
 
   const GRState* getState() const { return Pred->State; }
   const GRState* getState() const { return Pred->State; }
@@ -401,28 +401,28 @@ public:
 class GREndPathNodeBuilder {
 class GREndPathNodeBuilder {
   GRCoreEngine& Eng;
   GRCoreEngine& Eng;
   CFGBlock& B;
   CFGBlock& B;
-  ExplodedNode* Pred;  
+  ExplodedNode* Pred;
   bool HasGeneratedNode;
   bool HasGeneratedNode;
-  
+
 public:
 public:
   GREndPathNodeBuilder(CFGBlock* b, ExplodedNode* N, GRCoreEngine* e)
   GREndPathNodeBuilder(CFGBlock* b, ExplodedNode* N, GRCoreEngine* e)
-    : Eng(*e), B(*b), Pred(N), HasGeneratedNode(false) {}      
-  
+    : Eng(*e), B(*b), Pred(N), HasGeneratedNode(false) {}
+
   ~GREndPathNodeBuilder();
   ~GREndPathNodeBuilder();
-  
+
   ExplodedNode* getPredecessor() const { return Pred; }
   ExplodedNode* getPredecessor() const { return Pred; }
-    
-  GRBlockCounter getBlockCounter() const { 
+
+  GRBlockCounter getBlockCounter() const {
     return Eng.WList->getBlockCounter();
     return Eng.WList->getBlockCounter();
   }
   }
-  
+
   unsigned getCurrentBlockCount() const {
   unsigned getCurrentBlockCount() const {
     return getBlockCounter().getNumVisited(B.getBlockID());
     return getBlockCounter().getNumVisited(B.getBlockID());
-  }  
-  
+  }
+
   ExplodedNode* generateNode(const GRState* State, const void *tag = 0,
   ExplodedNode* generateNode(const GRState* State, const void *tag = 0,
                              ExplodedNode *P = 0);
                              ExplodedNode *P = 0);
-    
+
   CFGBlock* getBlock() const { return &B; }
   CFGBlock* getBlock() const { return &B; }
 
 
   const GRState* getState() const {
   const GRState* getState() const {

+ 148 - 148
include/clang/Analysis/PathSensitive/GRExprEngine.h

@@ -26,54 +26,54 @@
 #include "clang/AST/Type.h"
 #include "clang/AST/Type.h"
 #include "clang/AST/ExprObjC.h"
 #include "clang/AST/ExprObjC.h"
 
 
-namespace clang {  
-  
+namespace clang {
+
   class PathDiagnosticClient;
   class PathDiagnosticClient;
   class Diagnostic;
   class Diagnostic;
   class ObjCForCollectionStmt;
   class ObjCForCollectionStmt;
   class Checker;
   class Checker;
 
 
-class GRExprEngine : public GRSubEngine {  
+class GRExprEngine : public GRSubEngine {
   AnalysisManager &AMgr;
   AnalysisManager &AMgr;
 
 
   GRCoreEngine CoreEngine;
   GRCoreEngine CoreEngine;
-  
+
   /// G - the simulation graph.
   /// G - the simulation graph.
   ExplodedGraph& G;
   ExplodedGraph& G;
-  
+
   /// Builder - The current GRStmtNodeBuilder which is used when building the
   /// Builder - The current GRStmtNodeBuilder which is used when building the
   ///  nodes for a given statement.
   ///  nodes for a given statement.
   GRStmtNodeBuilder* Builder;
   GRStmtNodeBuilder* Builder;
-  
+
   /// StateMgr - Object that manages the data for all created states.
   /// StateMgr - Object that manages the data for all created states.
   GRStateManager StateMgr;
   GRStateManager StateMgr;
 
 
   /// SymMgr - Object that manages the symbol information.
   /// SymMgr - Object that manages the symbol information.
   SymbolManager& SymMgr;
   SymbolManager& SymMgr;
-  
+
   /// ValMgr - Object that manages/creates SVals.
   /// ValMgr - Object that manages/creates SVals.
   ValueManager &ValMgr;
   ValueManager &ValMgr;
-  
+
   /// SVator - SValuator object that creates SVals from expressions.
   /// SVator - SValuator object that creates SVals from expressions.
   SValuator &SVator;
   SValuator &SVator;
-  
+
   /// EntryNode - The immediate predecessor node.
   /// EntryNode - The immediate predecessor node.
   ExplodedNode* EntryNode;
   ExplodedNode* EntryNode;
 
 
   /// CleanedState - The state for EntryNode "cleaned" of all dead
   /// CleanedState - The state for EntryNode "cleaned" of all dead
   ///  variables and symbols (as determined by a liveness analysis).
   ///  variables and symbols (as determined by a liveness analysis).
-  const GRState* CleanedState;  
-  
+  const GRState* CleanedState;
+
   /// CurrentStmt - The current block-level statement.
   /// CurrentStmt - The current block-level statement.
   Stmt* CurrentStmt;
   Stmt* CurrentStmt;
-  
+
   // Obj-C Class Identifiers.
   // Obj-C Class Identifiers.
   IdentifierInfo* NSExceptionII;
   IdentifierInfo* NSExceptionII;
-  
+
   // Obj-C Selectors.
   // Obj-C Selectors.
   Selector* NSExceptionInstanceRaiseSelectors;
   Selector* NSExceptionInstanceRaiseSelectors;
   Selector RaiseSel;
   Selector RaiseSel;
-  
+
   llvm::OwningPtr<GRSimpleAPICheck> BatchAuditor;
   llvm::OwningPtr<GRSimpleAPICheck> BatchAuditor;
   std::vector<Checker*> Checkers;
   std::vector<Checker*> Checkers;
 
 
@@ -81,21 +81,21 @@ class GRExprEngine : public GRSubEngine {
   //   this object be placed at the very end of member variables so that its
   //   this object be placed at the very end of member variables so that its
   //   destructor is called before the rest of the GRExprEngine is destroyed.
   //   destructor is called before the rest of the GRExprEngine is destroyed.
   GRBugReporter BR;
   GRBugReporter BR;
-  
+
 public:
 public:
-  typedef llvm::SmallPtrSet<ExplodedNode*,2> ErrorNodes;  
+  typedef llvm::SmallPtrSet<ExplodedNode*,2> ErrorNodes;
   typedef llvm::DenseMap<ExplodedNode*, Expr*> UndefArgsTy;
   typedef llvm::DenseMap<ExplodedNode*, Expr*> UndefArgsTy;
-  
+
   /// NilReceiverStructRetExplicit - Nodes in the ExplodedGraph that resulted
   /// NilReceiverStructRetExplicit - Nodes in the ExplodedGraph that resulted
   ///  from [x ...] with 'x' definitely being nil and the result was a 'struct'
   ///  from [x ...] with 'x' definitely being nil and the result was a 'struct'
   //  (an undefined value).
   //  (an undefined value).
   ErrorNodes NilReceiverStructRetExplicit;
   ErrorNodes NilReceiverStructRetExplicit;
-  
+
   /// NilReceiverStructRetImplicit - Nodes in the ExplodedGraph that resulted
   /// NilReceiverStructRetImplicit - Nodes in the ExplodedGraph that resulted
   ///  from [x ...] with 'x' possibly being nil and the result was a 'struct'
   ///  from [x ...] with 'x' possibly being nil and the result was a 'struct'
   //  (an undefined value).
   //  (an undefined value).
   ErrorNodes NilReceiverStructRetImplicit;
   ErrorNodes NilReceiverStructRetImplicit;
-  
+
   /// NilReceiverLargerThanVoidPtrRetExplicit - Nodes in the ExplodedGraph that
   /// NilReceiverLargerThanVoidPtrRetExplicit - Nodes in the ExplodedGraph that
   /// resulted from [x ...] with 'x' definitely being nil and the result's size
   /// resulted from [x ...] with 'x' definitely being nil and the result's size
   // was larger than sizeof(void *) (an undefined value).
   // was larger than sizeof(void *) (an undefined value).
@@ -105,7 +105,7 @@ public:
   /// resulted from [x ...] with 'x' possibly being nil and the result's size
   /// resulted from [x ...] with 'x' possibly being nil and the result's size
   // was larger than sizeof(void *) (an undefined value).
   // was larger than sizeof(void *) (an undefined value).
   ErrorNodes NilReceiverLargerThanVoidPtrRetImplicit;
   ErrorNodes NilReceiverLargerThanVoidPtrRetImplicit;
-  
+
   /// RetsStackAddr - Nodes in the ExplodedGraph that result from returning
   /// RetsStackAddr - Nodes in the ExplodedGraph that result from returning
   ///  the address of a stack variable.
   ///  the address of a stack variable.
   ErrorNodes RetsStackAddr;
   ErrorNodes RetsStackAddr;
@@ -113,65 +113,65 @@ public:
   /// RetsUndef - Nodes in the ExplodedGraph that result from returning
   /// RetsUndef - Nodes in the ExplodedGraph that result from returning
   ///  an undefined value.
   ///  an undefined value.
   ErrorNodes RetsUndef;
   ErrorNodes RetsUndef;
-  
+
   /// UndefBranches - Nodes in the ExplodedGraph that result from
   /// UndefBranches - Nodes in the ExplodedGraph that result from
   ///  taking a branch based on an undefined value.
   ///  taking a branch based on an undefined value.
   ErrorNodes UndefBranches;
   ErrorNodes UndefBranches;
-  
+
   /// UndefStores - Sinks in the ExplodedGraph that result from
   /// UndefStores - Sinks in the ExplodedGraph that result from
   ///  making a store to an undefined lvalue.
   ///  making a store to an undefined lvalue.
   ErrorNodes UndefStores;
   ErrorNodes UndefStores;
-  
+
   /// NoReturnCalls - Sinks in the ExplodedGraph that result from
   /// NoReturnCalls - Sinks in the ExplodedGraph that result from
   //  calling a function with the attribute "noreturn".
   //  calling a function with the attribute "noreturn".
   ErrorNodes NoReturnCalls;
   ErrorNodes NoReturnCalls;
-  
+
   /// ImplicitNullDeref - Nodes in the ExplodedGraph that result from
   /// ImplicitNullDeref - Nodes in the ExplodedGraph that result from
   ///  taking a dereference on a symbolic pointer that MAY be NULL.
   ///  taking a dereference on a symbolic pointer that MAY be NULL.
   ErrorNodes ImplicitNullDeref;
   ErrorNodes ImplicitNullDeref;
-    
+
   /// ExplicitNullDeref - Nodes in the ExplodedGraph that result from
   /// ExplicitNullDeref - Nodes in the ExplodedGraph that result from
   ///  taking a dereference on a symbolic pointer that MUST be NULL.
   ///  taking a dereference on a symbolic pointer that MUST be NULL.
   ErrorNodes ExplicitNullDeref;
   ErrorNodes ExplicitNullDeref;
-  
+
   /// UnitDeref - Nodes in the ExplodedGraph that result from
   /// UnitDeref - Nodes in the ExplodedGraph that result from
   ///  taking a dereference on an undefined value.
   ///  taking a dereference on an undefined value.
   ErrorNodes UndefDeref;
   ErrorNodes UndefDeref;
 
 
-  /// ImplicitBadDivides - Nodes in the ExplodedGraph that result from 
+  /// ImplicitBadDivides - Nodes in the ExplodedGraph that result from
   ///  evaluating a divide or modulo operation where the denominator
   ///  evaluating a divide or modulo operation where the denominator
   ///  MAY be zero.
   ///  MAY be zero.
   ErrorNodes ImplicitBadDivides;
   ErrorNodes ImplicitBadDivides;
-  
-  /// ExplicitBadDivides - Nodes in the ExplodedGraph that result from 
+
+  /// ExplicitBadDivides - Nodes in the ExplodedGraph that result from
   ///  evaluating a divide or modulo operation where the denominator
   ///  evaluating a divide or modulo operation where the denominator
   ///  MUST be zero or undefined.
   ///  MUST be zero or undefined.
   ErrorNodes ExplicitBadDivides;
   ErrorNodes ExplicitBadDivides;
-  
-  /// ImplicitBadSizedVLA - Nodes in the ExplodedGraph that result from 
+
+  /// ImplicitBadSizedVLA - Nodes in the ExplodedGraph that result from
   ///  constructing a zero-sized VLA where the size may be zero.
   ///  constructing a zero-sized VLA where the size may be zero.
   ErrorNodes ImplicitBadSizedVLA;
   ErrorNodes ImplicitBadSizedVLA;
-  
-  /// ExplicitBadSizedVLA - Nodes in the ExplodedGraph that result from 
+
+  /// ExplicitBadSizedVLA - Nodes in the ExplodedGraph that result from
   ///  constructing a zero-sized VLA where the size must be zero.
   ///  constructing a zero-sized VLA where the size must be zero.
   ErrorNodes ExplicitBadSizedVLA;
   ErrorNodes ExplicitBadSizedVLA;
-  
+
   /// UndefResults - Nodes in the ExplodedGraph where the operands are defined
   /// UndefResults - Nodes in the ExplodedGraph where the operands are defined
   ///  by the result is not.  Excludes divide-by-zero errors.
   ///  by the result is not.  Excludes divide-by-zero errors.
   ErrorNodes UndefResults;
   ErrorNodes UndefResults;
-  
+
   /// BadCalls - Nodes in the ExplodedGraph resulting from calls to function
   /// BadCalls - Nodes in the ExplodedGraph resulting from calls to function
   ///  pointers that are NULL (or other constants) or Undefined.
   ///  pointers that are NULL (or other constants) or Undefined.
   ErrorNodes BadCalls;
   ErrorNodes BadCalls;
-  
+
   /// UndefReceiver - Nodes in the ExplodedGraph resulting from message
   /// UndefReceiver - Nodes in the ExplodedGraph resulting from message
   ///  ObjC message expressions where the receiver is undefined (uninitialized).
   ///  ObjC message expressions where the receiver is undefined (uninitialized).
   ErrorNodes UndefReceivers;
   ErrorNodes UndefReceivers;
-  
+
   /// UndefArg - Nodes in the ExplodedGraph resulting from calls to functions
   /// UndefArg - Nodes in the ExplodedGraph resulting from calls to functions
   ///   where a pass-by-value argument has an undefined value.
   ///   where a pass-by-value argument has an undefined value.
   UndefArgsTy UndefArgs;
   UndefArgsTy UndefArgs;
-  
+
   /// MsgExprUndefArgs - Nodes in the ExplodedGraph resulting from
   /// MsgExprUndefArgs - Nodes in the ExplodedGraph resulting from
   ///   message expressions where a pass-by-value argument has an undefined
   ///   message expressions where a pass-by-value argument has an undefined
   ///  value.
   ///  value.
@@ -184,132 +184,132 @@ public:
   /// OutOfBoundMemAccesses - Nodes in the ExplodedGraph resulting from
   /// OutOfBoundMemAccesses - Nodes in the ExplodedGraph resulting from
   /// out-of-bound memory accesses where the index MUST be out-of-bound.
   /// out-of-bound memory accesses where the index MUST be out-of-bound.
   ErrorNodes ExplicitOOBMemAccesses;
   ErrorNodes ExplicitOOBMemAccesses;
-  
+
 public:
 public:
   GRExprEngine(AnalysisManager &mgr);
   GRExprEngine(AnalysisManager &mgr);
 
 
   ~GRExprEngine();
   ~GRExprEngine();
-  
+
   void ExecuteWorkList(const LocationContext *L, unsigned Steps = 150000) {
   void ExecuteWorkList(const LocationContext *L, unsigned Steps = 150000) {
     CoreEngine.ExecuteWorkList(L, Steps);
     CoreEngine.ExecuteWorkList(L, Steps);
   }
   }
-  
+
   /// getContext - Return the ASTContext associated with this analysis.
   /// getContext - Return the ASTContext associated with this analysis.
   ASTContext& getContext() const { return G.getContext(); }
   ASTContext& getContext() const { return G.getContext(); }
 
 
   AnalysisManager &getAnalysisManager() const { return AMgr; }
   AnalysisManager &getAnalysisManager() const { return AMgr; }
-  
+
   SValuator &getSValuator() { return SVator; }
   SValuator &getSValuator() { return SVator; }
-  
+
   GRTransferFuncs& getTF() { return *StateMgr.TF; }
   GRTransferFuncs& getTF() { return *StateMgr.TF; }
-  
+
   BugReporter& getBugReporter() { return BR; }
   BugReporter& getBugReporter() { return BR; }
-  
+
   /// setTransferFunctions
   /// setTransferFunctions
   void setTransferFunctions(GRTransferFuncs* tf);
   void setTransferFunctions(GRTransferFuncs* tf);
 
 
   void setTransferFunctions(GRTransferFuncs& tf) {
   void setTransferFunctions(GRTransferFuncs& tf) {
     setTransferFunctions(&tf);
     setTransferFunctions(&tf);
   }
   }
-  
+
   /// ViewGraph - Visualize the ExplodedGraph created by executing the
   /// ViewGraph - Visualize the ExplodedGraph created by executing the
   ///  simulation.
   ///  simulation.
   void ViewGraph(bool trim = false);
   void ViewGraph(bool trim = false);
-  
+
   void ViewGraph(ExplodedNode** Beg, ExplodedNode** End);
   void ViewGraph(ExplodedNode** Beg, ExplodedNode** End);
-  
+
   /// getInitialState - Return the initial state used for the root vertex
   /// getInitialState - Return the initial state used for the root vertex
   ///  in the ExplodedGraph.
   ///  in the ExplodedGraph.
   const GRState* getInitialState(const LocationContext *InitLoc);
   const GRState* getInitialState(const LocationContext *InitLoc);
-  
+
   ExplodedGraph& getGraph() { return G; }
   ExplodedGraph& getGraph() { return G; }
   const ExplodedGraph& getGraph() const { return G; }
   const ExplodedGraph& getGraph() const { return G; }
 
 
   void RegisterInternalChecks();
   void RegisterInternalChecks();
-  
+
   void registerCheck(Checker *check) {
   void registerCheck(Checker *check) {
     Checkers.push_back(check);
     Checkers.push_back(check);
   }
   }
-  
+
   bool isRetStackAddr(const ExplodedNode* N) const {
   bool isRetStackAddr(const ExplodedNode* N) const {
     return N->isSink() && RetsStackAddr.count(const_cast<ExplodedNode*>(N)) != 0;
     return N->isSink() && RetsStackAddr.count(const_cast<ExplodedNode*>(N)) != 0;
   }
   }
-  
+
   bool isUndefControlFlow(const ExplodedNode* N) const {
   bool isUndefControlFlow(const ExplodedNode* N) const {
     return N->isSink() && UndefBranches.count(const_cast<ExplodedNode*>(N)) != 0;
     return N->isSink() && UndefBranches.count(const_cast<ExplodedNode*>(N)) != 0;
   }
   }
-  
+
   bool isUndefStore(const ExplodedNode* N) const {
   bool isUndefStore(const ExplodedNode* N) const {
     return N->isSink() && UndefStores.count(const_cast<ExplodedNode*>(N)) != 0;
     return N->isSink() && UndefStores.count(const_cast<ExplodedNode*>(N)) != 0;
   }
   }
-  
+
   bool isImplicitNullDeref(const ExplodedNode* N) const {
   bool isImplicitNullDeref(const ExplodedNode* N) const {
     return N->isSink() && ImplicitNullDeref.count(const_cast<ExplodedNode*>(N)) != 0;
     return N->isSink() && ImplicitNullDeref.count(const_cast<ExplodedNode*>(N)) != 0;
   }
   }
-  
+
   bool isExplicitNullDeref(const ExplodedNode* N) const {
   bool isExplicitNullDeref(const ExplodedNode* N) const {
     return N->isSink() && ExplicitNullDeref.count(const_cast<ExplodedNode*>(N)) != 0;
     return N->isSink() && ExplicitNullDeref.count(const_cast<ExplodedNode*>(N)) != 0;
   }
   }
-  
+
   bool isUndefDeref(const ExplodedNode* N) const {
   bool isUndefDeref(const ExplodedNode* N) const {
     return N->isSink() && UndefDeref.count(const_cast<ExplodedNode*>(N)) != 0;
     return N->isSink() && UndefDeref.count(const_cast<ExplodedNode*>(N)) != 0;
   }
   }
-  
+
   bool isImplicitBadDivide(const ExplodedNode* N) const {
   bool isImplicitBadDivide(const ExplodedNode* N) const {
     return N->isSink() && ImplicitBadDivides.count(const_cast<ExplodedNode*>(N)) != 0;
     return N->isSink() && ImplicitBadDivides.count(const_cast<ExplodedNode*>(N)) != 0;
   }
   }
-  
+
   bool isExplicitBadDivide(const ExplodedNode* N) const {
   bool isExplicitBadDivide(const ExplodedNode* N) const {
     return N->isSink() && ExplicitBadDivides.count(const_cast<ExplodedNode*>(N)) != 0;
     return N->isSink() && ExplicitBadDivides.count(const_cast<ExplodedNode*>(N)) != 0;
   }
   }
-  
+
   bool isNoReturnCall(const ExplodedNode* N) const {
   bool isNoReturnCall(const ExplodedNode* N) const {
     return N->isSink() && NoReturnCalls.count(const_cast<ExplodedNode*>(N)) != 0;
     return N->isSink() && NoReturnCalls.count(const_cast<ExplodedNode*>(N)) != 0;
   }
   }
-  
+
   bool isUndefResult(const ExplodedNode* N) const {
   bool isUndefResult(const ExplodedNode* N) const {
     return N->isSink() && UndefResults.count(const_cast<ExplodedNode*>(N)) != 0;
     return N->isSink() && UndefResults.count(const_cast<ExplodedNode*>(N)) != 0;
   }
   }
-  
+
   bool isBadCall(const ExplodedNode* N) const {
   bool isBadCall(const ExplodedNode* N) const {
     return N->isSink() && BadCalls.count(const_cast<ExplodedNode*>(N)) != 0;
     return N->isSink() && BadCalls.count(const_cast<ExplodedNode*>(N)) != 0;
   }
   }
-  
+
   bool isUndefArg(const ExplodedNode* N) const {
   bool isUndefArg(const ExplodedNode* N) const {
     return N->isSink() &&
     return N->isSink() &&
       (UndefArgs.find(const_cast<ExplodedNode*>(N)) != UndefArgs.end() ||
       (UndefArgs.find(const_cast<ExplodedNode*>(N)) != UndefArgs.end() ||
        MsgExprUndefArgs.find(const_cast<ExplodedNode*>(N)) != MsgExprUndefArgs.end());
        MsgExprUndefArgs.find(const_cast<ExplodedNode*>(N)) != MsgExprUndefArgs.end());
   }
   }
-  
+
   bool isUndefReceiver(const ExplodedNode* N) const {
   bool isUndefReceiver(const ExplodedNode* N) const {
     return N->isSink() && UndefReceivers.count(const_cast<ExplodedNode*>(N)) != 0;
     return N->isSink() && UndefReceivers.count(const_cast<ExplodedNode*>(N)) != 0;
   }
   }
-  
+
   typedef ErrorNodes::iterator ret_stackaddr_iterator;
   typedef ErrorNodes::iterator ret_stackaddr_iterator;
   ret_stackaddr_iterator ret_stackaddr_begin() { return RetsStackAddr.begin(); }
   ret_stackaddr_iterator ret_stackaddr_begin() { return RetsStackAddr.begin(); }
-  ret_stackaddr_iterator ret_stackaddr_end() { return RetsStackAddr.end(); }  
-  
+  ret_stackaddr_iterator ret_stackaddr_end() { return RetsStackAddr.end(); }
+
   typedef ErrorNodes::iterator ret_undef_iterator;
   typedef ErrorNodes::iterator ret_undef_iterator;
   ret_undef_iterator ret_undef_begin() { return RetsUndef.begin(); }
   ret_undef_iterator ret_undef_begin() { return RetsUndef.begin(); }
   ret_undef_iterator ret_undef_end() { return RetsUndef.end(); }
   ret_undef_iterator ret_undef_end() { return RetsUndef.end(); }
-  
+
   typedef ErrorNodes::iterator undef_branch_iterator;
   typedef ErrorNodes::iterator undef_branch_iterator;
   undef_branch_iterator undef_branches_begin() { return UndefBranches.begin(); }
   undef_branch_iterator undef_branches_begin() { return UndefBranches.begin(); }
-  undef_branch_iterator undef_branches_end() { return UndefBranches.end(); }  
-  
+  undef_branch_iterator undef_branches_end() { return UndefBranches.end(); }
+
   typedef ErrorNodes::iterator null_deref_iterator;
   typedef ErrorNodes::iterator null_deref_iterator;
   null_deref_iterator null_derefs_begin() { return ExplicitNullDeref.begin(); }
   null_deref_iterator null_derefs_begin() { return ExplicitNullDeref.begin(); }
   null_deref_iterator null_derefs_end() { return ExplicitNullDeref.end(); }
   null_deref_iterator null_derefs_end() { return ExplicitNullDeref.end(); }
-  
+
   null_deref_iterator implicit_null_derefs_begin() {
   null_deref_iterator implicit_null_derefs_begin() {
     return ImplicitNullDeref.begin();
     return ImplicitNullDeref.begin();
   }
   }
   null_deref_iterator implicit_null_derefs_end() {
   null_deref_iterator implicit_null_derefs_end() {
     return ImplicitNullDeref.end();
     return ImplicitNullDeref.end();
   }
   }
-  
+
   typedef ErrorNodes::iterator nil_receiver_struct_ret_iterator;
   typedef ErrorNodes::iterator nil_receiver_struct_ret_iterator;
-  
+
   nil_receiver_struct_ret_iterator nil_receiver_struct_ret_begin() {
   nil_receiver_struct_ret_iterator nil_receiver_struct_ret_begin() {
     return NilReceiverStructRetExplicit.begin();
     return NilReceiverStructRetExplicit.begin();
   }
   }
@@ -317,9 +317,9 @@ public:
   nil_receiver_struct_ret_iterator nil_receiver_struct_ret_end() {
   nil_receiver_struct_ret_iterator nil_receiver_struct_ret_end() {
     return NilReceiverStructRetExplicit.end();
     return NilReceiverStructRetExplicit.end();
   }
   }
-  
+
   typedef ErrorNodes::iterator nil_receiver_larger_than_voidptr_ret_iterator;
   typedef ErrorNodes::iterator nil_receiver_larger_than_voidptr_ret_iterator;
-  
+
   nil_receiver_larger_than_voidptr_ret_iterator
   nil_receiver_larger_than_voidptr_ret_iterator
   nil_receiver_larger_than_voidptr_ret_begin() {
   nil_receiver_larger_than_voidptr_ret_begin() {
     return NilReceiverLargerThanVoidPtrRetExplicit.begin();
     return NilReceiverLargerThanVoidPtrRetExplicit.begin();
@@ -329,60 +329,60 @@ public:
   nil_receiver_larger_than_voidptr_ret_end() {
   nil_receiver_larger_than_voidptr_ret_end() {
     return NilReceiverLargerThanVoidPtrRetExplicit.end();
     return NilReceiverLargerThanVoidPtrRetExplicit.end();
   }
   }
-  
+
   typedef ErrorNodes::iterator undef_deref_iterator;
   typedef ErrorNodes::iterator undef_deref_iterator;
   undef_deref_iterator undef_derefs_begin() { return UndefDeref.begin(); }
   undef_deref_iterator undef_derefs_begin() { return UndefDeref.begin(); }
   undef_deref_iterator undef_derefs_end() { return UndefDeref.end(); }
   undef_deref_iterator undef_derefs_end() { return UndefDeref.end(); }
-  
+
   typedef ErrorNodes::iterator bad_divide_iterator;
   typedef ErrorNodes::iterator bad_divide_iterator;
 
 
   bad_divide_iterator explicit_bad_divides_begin() {
   bad_divide_iterator explicit_bad_divides_begin() {
     return ExplicitBadDivides.begin();
     return ExplicitBadDivides.begin();
   }
   }
-  
+
   bad_divide_iterator explicit_bad_divides_end() {
   bad_divide_iterator explicit_bad_divides_end() {
     return ExplicitBadDivides.end();
     return ExplicitBadDivides.end();
   }
   }
-  
+
   bad_divide_iterator implicit_bad_divides_begin() {
   bad_divide_iterator implicit_bad_divides_begin() {
     return ImplicitBadDivides.begin();
     return ImplicitBadDivides.begin();
   }
   }
-  
+
   bad_divide_iterator implicit_bad_divides_end() {
   bad_divide_iterator implicit_bad_divides_end() {
     return ImplicitBadDivides.end();
     return ImplicitBadDivides.end();
   }
   }
-  
+
   typedef ErrorNodes::iterator undef_result_iterator;
   typedef ErrorNodes::iterator undef_result_iterator;
   undef_result_iterator undef_results_begin() { return UndefResults.begin(); }
   undef_result_iterator undef_results_begin() { return UndefResults.begin(); }
   undef_result_iterator undef_results_end() { return UndefResults.end(); }
   undef_result_iterator undef_results_end() { return UndefResults.end(); }
 
 
   typedef ErrorNodes::iterator bad_calls_iterator;
   typedef ErrorNodes::iterator bad_calls_iterator;
   bad_calls_iterator bad_calls_begin() { return BadCalls.begin(); }
   bad_calls_iterator bad_calls_begin() { return BadCalls.begin(); }
-  bad_calls_iterator bad_calls_end() { return BadCalls.end(); }  
-  
+  bad_calls_iterator bad_calls_end() { return BadCalls.end(); }
+
   typedef UndefArgsTy::iterator undef_arg_iterator;
   typedef UndefArgsTy::iterator undef_arg_iterator;
   undef_arg_iterator undef_arg_begin() { return UndefArgs.begin(); }
   undef_arg_iterator undef_arg_begin() { return UndefArgs.begin(); }
-  undef_arg_iterator undef_arg_end() { return UndefArgs.end(); }  
-  
+  undef_arg_iterator undef_arg_end() { return UndefArgs.end(); }
+
   undef_arg_iterator msg_expr_undef_arg_begin() {
   undef_arg_iterator msg_expr_undef_arg_begin() {
     return MsgExprUndefArgs.begin();
     return MsgExprUndefArgs.begin();
   }
   }
   undef_arg_iterator msg_expr_undef_arg_end() {
   undef_arg_iterator msg_expr_undef_arg_end() {
     return MsgExprUndefArgs.end();
     return MsgExprUndefArgs.end();
-  }  
-  
+  }
+
   typedef ErrorNodes::iterator undef_receivers_iterator;
   typedef ErrorNodes::iterator undef_receivers_iterator;
 
 
   undef_receivers_iterator undef_receivers_begin() {
   undef_receivers_iterator undef_receivers_begin() {
     return UndefReceivers.begin();
     return UndefReceivers.begin();
   }
   }
-  
+
   undef_receivers_iterator undef_receivers_end() {
   undef_receivers_iterator undef_receivers_end() {
     return UndefReceivers.end();
     return UndefReceivers.end();
   }
   }
 
 
   typedef ErrorNodes::iterator oob_memacc_iterator;
   typedef ErrorNodes::iterator oob_memacc_iterator;
-  oob_memacc_iterator implicit_oob_memacc_begin() { 
+  oob_memacc_iterator implicit_oob_memacc_begin() {
     return ImplicitOOBMemAccesses.begin();
     return ImplicitOOBMemAccesses.begin();
   }
   }
   oob_memacc_iterator implicit_oob_memacc_end() {
   oob_memacc_iterator implicit_oob_memacc_end() {
@@ -397,45 +397,45 @@ public:
 
 
   void AddCheck(GRSimpleAPICheck* A, Stmt::StmtClass C);
   void AddCheck(GRSimpleAPICheck* A, Stmt::StmtClass C);
   void AddCheck(GRSimpleAPICheck* A);
   void AddCheck(GRSimpleAPICheck* A);
-  
+
   /// ProcessStmt - Called by GRCoreEngine. Used to generate new successor
   /// ProcessStmt - Called by GRCoreEngine. Used to generate new successor
-  ///  nodes by processing the 'effects' of a block-level statement.  
-  void ProcessStmt(Stmt* S, GRStmtNodeBuilder& builder);    
-  
+  ///  nodes by processing the 'effects' of a block-level statement.
+  void ProcessStmt(Stmt* S, GRStmtNodeBuilder& builder);
+
   /// ProcessBlockEntrance - Called by GRCoreEngine when start processing
   /// ProcessBlockEntrance - Called by GRCoreEngine when start processing
   ///  a CFGBlock.  This method returns true if the analysis should continue
   ///  a CFGBlock.  This method returns true if the analysis should continue
   ///  exploring the given path, and false otherwise.
   ///  exploring the given path, and false otherwise.
   bool ProcessBlockEntrance(CFGBlock* B, const GRState* St,
   bool ProcessBlockEntrance(CFGBlock* B, const GRState* St,
                             GRBlockCounter BC);
                             GRBlockCounter BC);
-  
+
   /// ProcessBranch - Called by GRCoreEngine.  Used to generate successor
   /// ProcessBranch - Called by GRCoreEngine.  Used to generate successor
   ///  nodes by processing the 'effects' of a branch condition.
   ///  nodes by processing the 'effects' of a branch condition.
   void ProcessBranch(Stmt* Condition, Stmt* Term, GRBranchNodeBuilder& builder);
   void ProcessBranch(Stmt* Condition, Stmt* Term, GRBranchNodeBuilder& builder);
-  
+
   /// ProcessIndirectGoto - Called by GRCoreEngine.  Used to generate successor
   /// ProcessIndirectGoto - Called by GRCoreEngine.  Used to generate successor
   ///  nodes by processing the 'effects' of a computed goto jump.
   ///  nodes by processing the 'effects' of a computed goto jump.
   void ProcessIndirectGoto(GRIndirectGotoNodeBuilder& builder);
   void ProcessIndirectGoto(GRIndirectGotoNodeBuilder& builder);
-  
+
   /// ProcessSwitch - Called by GRCoreEngine.  Used to generate successor
   /// ProcessSwitch - Called by GRCoreEngine.  Used to generate successor
   ///  nodes by processing the 'effects' of a switch statement.
   ///  nodes by processing the 'effects' of a switch statement.
   void ProcessSwitch(GRSwitchNodeBuilder& builder);
   void ProcessSwitch(GRSwitchNodeBuilder& builder);
-  
+
   /// ProcessEndPath - Called by GRCoreEngine.  Used to generate end-of-path
   /// ProcessEndPath - Called by GRCoreEngine.  Used to generate end-of-path
   ///  nodes when the control reaches the end of a function.
   ///  nodes when the control reaches the end of a function.
   void ProcessEndPath(GREndPathNodeBuilder& builder) {
   void ProcessEndPath(GREndPathNodeBuilder& builder) {
     getTF().EvalEndPath(*this, builder);
     getTF().EvalEndPath(*this, builder);
     StateMgr.EndPath(builder.getState());
     StateMgr.EndPath(builder.getState());
   }
   }
-  
+
   GRStateManager& getStateManager() { return StateMgr; }
   GRStateManager& getStateManager() { return StateMgr; }
   const GRStateManager& getStateManager() const { return StateMgr; }
   const GRStateManager& getStateManager() const { return StateMgr; }
 
 
   StoreManager& getStoreManager() { return StateMgr.getStoreManager(); }
   StoreManager& getStoreManager() { return StateMgr.getStoreManager(); }
-  
+
   ConstraintManager& getConstraintManager() {
   ConstraintManager& getConstraintManager() {
     return StateMgr.getConstraintManager();
     return StateMgr.getConstraintManager();
   }
   }
-  
+
   // FIXME: Remove when we migrate over to just using ValueManager.
   // FIXME: Remove when we migrate over to just using ValueManager.
   BasicValueFactory& getBasicVals() {
   BasicValueFactory& getBasicVals() {
     return StateMgr.getBasicVals();
     return StateMgr.getBasicVals();
@@ -443,19 +443,19 @@ public:
   const BasicValueFactory& getBasicVals() const {
   const BasicValueFactory& getBasicVals() const {
     return StateMgr.getBasicVals();
     return StateMgr.getBasicVals();
   }
   }
-  
-  ValueManager &getValueManager() { return ValMgr; }  
+
+  ValueManager &getValueManager() { return ValMgr; }
   const ValueManager &getValueManager() const { return ValMgr; }
   const ValueManager &getValueManager() const { return ValMgr; }
-  
+
   // FIXME: Remove when we migrate over to just using ValueManager.
   // FIXME: Remove when we migrate over to just using ValueManager.
   SymbolManager& getSymbolManager() { return SymMgr; }
   SymbolManager& getSymbolManager() { return SymMgr; }
   const SymbolManager& getSymbolManager() const { return SymMgr; }
   const SymbolManager& getSymbolManager() const { return SymMgr; }
-  
+
 protected:
 protected:
   const GRState* GetState(ExplodedNode* N) {
   const GRState* GetState(ExplodedNode* N) {
     return N == EntryNode ? CleanedState : N->getState();
     return N == EntryNode ? CleanedState : N->getState();
   }
   }
-  
+
 public:
 public:
   ExplodedNode* MakeNode(ExplodedNodeSet& Dst, Stmt* S, ExplodedNode* Pred, const GRState* St,
   ExplodedNode* MakeNode(ExplodedNodeSet& Dst, Stmt* S, ExplodedNode* Pred, const GRState* St,
                    ProgramPoint::Kind K = ProgramPoint::PostStmtKind,
                    ProgramPoint::Kind K = ProgramPoint::PostStmtKind,
@@ -464,60 +464,60 @@ protected:
   /// CheckerVisit - Dispatcher for performing checker-specific logic
   /// CheckerVisit - Dispatcher for performing checker-specific logic
   ///  at specific statements.
   ///  at specific statements.
   void CheckerVisit(Stmt *S, ExplodedNodeSet &Dst, ExplodedNodeSet &Src, bool isPrevisit);
   void CheckerVisit(Stmt *S, ExplodedNodeSet &Dst, ExplodedNodeSet &Src, bool isPrevisit);
-  
+
   /// Visit - Transfer function logic for all statements.  Dispatches to
   /// Visit - Transfer function logic for all statements.  Dispatches to
   ///  other functions that handle specific kinds of statements.
   ///  other functions that handle specific kinds of statements.
   void Visit(Stmt* S, ExplodedNode* Pred, ExplodedNodeSet& Dst);
   void Visit(Stmt* S, ExplodedNode* Pred, ExplodedNodeSet& Dst);
-  
+
   /// VisitLValue - Evaluate the lvalue of the expression. For example, if Ex is
   /// VisitLValue - Evaluate the lvalue of the expression. For example, if Ex is
   /// a DeclRefExpr, it evaluates to the MemRegionVal which represents its
   /// a DeclRefExpr, it evaluates to the MemRegionVal which represents its
   /// storage location. Note that not all kinds of expressions has lvalue.
   /// storage location. Note that not all kinds of expressions has lvalue.
   void VisitLValue(Expr* Ex, ExplodedNode* Pred, ExplodedNodeSet& Dst);
   void VisitLValue(Expr* Ex, ExplodedNode* Pred, ExplodedNodeSet& Dst);
-  
+
   /// VisitArraySubscriptExpr - Transfer function for array accesses.
   /// VisitArraySubscriptExpr - Transfer function for array accesses.
   void VisitArraySubscriptExpr(ArraySubscriptExpr* Ex, ExplodedNode* Pred,
   void VisitArraySubscriptExpr(ArraySubscriptExpr* Ex, ExplodedNode* Pred,
                                ExplodedNodeSet& Dst, bool asLValue);
                                ExplodedNodeSet& Dst, bool asLValue);
-  
+
   /// VisitAsmStmt - Transfer function logic for inline asm.
   /// VisitAsmStmt - Transfer function logic for inline asm.
   void VisitAsmStmt(AsmStmt* A, ExplodedNode* Pred, ExplodedNodeSet& Dst);
   void VisitAsmStmt(AsmStmt* A, ExplodedNode* Pred, ExplodedNodeSet& Dst);
-  
+
   void VisitAsmStmtHelperOutputs(AsmStmt* A,
   void VisitAsmStmtHelperOutputs(AsmStmt* A,
                                  AsmStmt::outputs_iterator I,
                                  AsmStmt::outputs_iterator I,
                                  AsmStmt::outputs_iterator E,
                                  AsmStmt::outputs_iterator E,
                                  ExplodedNode* Pred, ExplodedNodeSet& Dst);
                                  ExplodedNode* Pred, ExplodedNodeSet& Dst);
-  
+
   void VisitAsmStmtHelperInputs(AsmStmt* A,
   void VisitAsmStmtHelperInputs(AsmStmt* A,
                                 AsmStmt::inputs_iterator I,
                                 AsmStmt::inputs_iterator I,
                                 AsmStmt::inputs_iterator E,
                                 AsmStmt::inputs_iterator E,
                                 ExplodedNode* Pred, ExplodedNodeSet& Dst);
                                 ExplodedNode* Pred, ExplodedNodeSet& Dst);
-  
+
   /// VisitBinaryOperator - Transfer function logic for binary operators.
   /// VisitBinaryOperator - Transfer function logic for binary operators.
   void VisitBinaryOperator(BinaryOperator* B, ExplodedNode* Pred, ExplodedNodeSet& Dst);
   void VisitBinaryOperator(BinaryOperator* B, ExplodedNode* Pred, ExplodedNodeSet& Dst);
 
 
-  
+
   /// VisitCall - Transfer function for function calls.
   /// VisitCall - Transfer function for function calls.
   void VisitCall(CallExpr* CE, ExplodedNode* Pred,
   void VisitCall(CallExpr* CE, ExplodedNode* Pred,
                  CallExpr::arg_iterator AI, CallExpr::arg_iterator AE,
                  CallExpr::arg_iterator AI, CallExpr::arg_iterator AE,
                  ExplodedNodeSet& Dst);
                  ExplodedNodeSet& Dst);
   void VisitCallRec(CallExpr* CE, ExplodedNode* Pred,
   void VisitCallRec(CallExpr* CE, ExplodedNode* Pred,
                     CallExpr::arg_iterator AI, CallExpr::arg_iterator AE,
                     CallExpr::arg_iterator AI, CallExpr::arg_iterator AE,
-                    ExplodedNodeSet& Dst, const FunctionProtoType *, 
+                    ExplodedNodeSet& Dst, const FunctionProtoType *,
                     unsigned ParamIdx = 0);
                     unsigned ParamIdx = 0);
-  
+
   /// VisitCast - Transfer function logic for all casts (implicit and explicit).
   /// VisitCast - Transfer function logic for all casts (implicit and explicit).
   void VisitCast(Expr* CastE, Expr* Ex, ExplodedNode* Pred, ExplodedNodeSet& Dst);
   void VisitCast(Expr* CastE, Expr* Ex, ExplodedNode* Pred, ExplodedNodeSet& Dst);
 
 
   /// VisitCompoundLiteralExpr - Transfer function logic for compound literals.
   /// VisitCompoundLiteralExpr - Transfer function logic for compound literals.
   void VisitCompoundLiteralExpr(CompoundLiteralExpr* CL, ExplodedNode* Pred,
   void VisitCompoundLiteralExpr(CompoundLiteralExpr* CL, ExplodedNode* Pred,
                                 ExplodedNodeSet& Dst, bool asLValue);
                                 ExplodedNodeSet& Dst, bool asLValue);
-  
+
   /// VisitDeclRefExpr - Transfer function logic for DeclRefExprs.
   /// VisitDeclRefExpr - Transfer function logic for DeclRefExprs.
   void VisitDeclRefExpr(DeclRefExpr* DR, ExplodedNode* Pred, ExplodedNodeSet& Dst,
   void VisitDeclRefExpr(DeclRefExpr* DR, ExplodedNode* Pred, ExplodedNodeSet& Dst,
-                        bool asLValue); 
-  
+                        bool asLValue);
+
   /// VisitDeclStmt - Transfer function logic for DeclStmts.
   /// VisitDeclStmt - Transfer function logic for DeclStmts.
-  void VisitDeclStmt(DeclStmt* DS, ExplodedNode* Pred, ExplodedNodeSet& Dst); 
-  
+  void VisitDeclStmt(DeclStmt* DS, ExplodedNode* Pred, ExplodedNodeSet& Dst);
+
   /// VisitGuardedExpr - Transfer function logic for ?, __builtin_choose
   /// VisitGuardedExpr - Transfer function logic for ?, __builtin_choose
   void VisitGuardedExpr(Expr* Ex, Expr* L, Expr* R, ExplodedNode* Pred, ExplodedNodeSet& Dst);
   void VisitGuardedExpr(Expr* Ex, Expr* L, Expr* R, ExplodedNode* Pred, ExplodedNodeSet& Dst);
 
 
@@ -525,65 +525,65 @@ protected:
 
 
   /// VisitLogicalExpr - Transfer function logic for '&&', '||'
   /// VisitLogicalExpr - Transfer function logic for '&&', '||'
   void VisitLogicalExpr(BinaryOperator* B, ExplodedNode* Pred, ExplodedNodeSet& Dst);
   void VisitLogicalExpr(BinaryOperator* B, ExplodedNode* Pred, ExplodedNodeSet& Dst);
-  
+
   /// VisitMemberExpr - Transfer function for member expressions.
   /// VisitMemberExpr - Transfer function for member expressions.
   void VisitMemberExpr(MemberExpr* M, ExplodedNode* Pred, ExplodedNodeSet& Dst,bool asLValue);
   void VisitMemberExpr(MemberExpr* M, ExplodedNode* Pred, ExplodedNodeSet& Dst,bool asLValue);
-  
+
   /// VisitObjCIvarRefExpr - Transfer function logic for ObjCIvarRefExprs.
   /// VisitObjCIvarRefExpr - Transfer function logic for ObjCIvarRefExprs.
   void VisitObjCIvarRefExpr(ObjCIvarRefExpr* DR, ExplodedNode* Pred, ExplodedNodeSet& Dst,
   void VisitObjCIvarRefExpr(ObjCIvarRefExpr* DR, ExplodedNode* Pred, ExplodedNodeSet& Dst,
-                            bool asLValue); 
+                            bool asLValue);
 
 
   /// VisitObjCForCollectionStmt - Transfer function logic for
   /// VisitObjCForCollectionStmt - Transfer function logic for
   ///  ObjCForCollectionStmt.
   ///  ObjCForCollectionStmt.
   void VisitObjCForCollectionStmt(ObjCForCollectionStmt* S, ExplodedNode* Pred,
   void VisitObjCForCollectionStmt(ObjCForCollectionStmt* S, ExplodedNode* Pred,
                                   ExplodedNodeSet& Dst);
                                   ExplodedNodeSet& Dst);
-  
+
   void VisitObjCForCollectionStmtAux(ObjCForCollectionStmt* S, ExplodedNode* Pred,
   void VisitObjCForCollectionStmtAux(ObjCForCollectionStmt* S, ExplodedNode* Pred,
                                      ExplodedNodeSet& Dst, SVal ElementV);
                                      ExplodedNodeSet& Dst, SVal ElementV);
-  
+
   /// VisitObjCMessageExpr - Transfer function for ObjC message expressions.
   /// VisitObjCMessageExpr - Transfer function for ObjC message expressions.
   void VisitObjCMessageExpr(ObjCMessageExpr* ME, ExplodedNode* Pred, ExplodedNodeSet& Dst);
   void VisitObjCMessageExpr(ObjCMessageExpr* ME, ExplodedNode* Pred, ExplodedNodeSet& Dst);
-  
+
   void VisitObjCMessageExprArgHelper(ObjCMessageExpr* ME,
   void VisitObjCMessageExprArgHelper(ObjCMessageExpr* ME,
                                      ObjCMessageExpr::arg_iterator I,
                                      ObjCMessageExpr::arg_iterator I,
                                      ObjCMessageExpr::arg_iterator E,
                                      ObjCMessageExpr::arg_iterator E,
                                      ExplodedNode* Pred, ExplodedNodeSet& Dst);
                                      ExplodedNode* Pred, ExplodedNodeSet& Dst);
-  
+
   void VisitObjCMessageExprDispatchHelper(ObjCMessageExpr* ME, ExplodedNode* Pred,
   void VisitObjCMessageExprDispatchHelper(ObjCMessageExpr* ME, ExplodedNode* Pred,
                                           ExplodedNodeSet& Dst);
                                           ExplodedNodeSet& Dst);
-  
+
   /// VisitReturnStmt - Transfer function logic for return statements.
   /// VisitReturnStmt - Transfer function logic for return statements.
   void VisitReturnStmt(ReturnStmt* R, ExplodedNode* Pred, ExplodedNodeSet& Dst);
   void VisitReturnStmt(ReturnStmt* R, ExplodedNode* Pred, ExplodedNodeSet& Dst);
-  
+
   /// VisitSizeOfAlignOfExpr - Transfer function for sizeof.
   /// VisitSizeOfAlignOfExpr - Transfer function for sizeof.
   void VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr* Ex, ExplodedNode* Pred,
   void VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr* Ex, ExplodedNode* Pred,
                               ExplodedNodeSet& Dst);
                               ExplodedNodeSet& Dst);
-    
+
   /// VisitUnaryOperator - Transfer function logic for unary operators.
   /// VisitUnaryOperator - Transfer function logic for unary operators.
   void VisitUnaryOperator(UnaryOperator* B, ExplodedNode* Pred, ExplodedNodeSet& Dst,
   void VisitUnaryOperator(UnaryOperator* B, ExplodedNode* Pred, ExplodedNodeSet& Dst,
                           bool asLValue);
                           bool asLValue);
- 
+
   const GRState* CheckDivideZero(Expr* Ex, const GRState* St, ExplodedNode* Pred,
   const GRState* CheckDivideZero(Expr* Ex, const GRState* St, ExplodedNode* Pred,
-                                 SVal Denom);  
-  
+                                 SVal Denom);
+
   /// EvalEagerlyAssume - Given the nodes in 'Src', eagerly assume symbolic
   /// EvalEagerlyAssume - Given the nodes in 'Src', eagerly assume symbolic
   ///  expressions of the form 'x != 0' and generate new nodes (stored in Dst)
   ///  expressions of the form 'x != 0' and generate new nodes (stored in Dst)
   ///  with those assumptions.
   ///  with those assumptions.
   void EvalEagerlyAssume(ExplodedNodeSet& Dst, ExplodedNodeSet& Src, Expr *Ex);
   void EvalEagerlyAssume(ExplodedNodeSet& Dst, ExplodedNodeSet& Src, Expr *Ex);
-    
+
   SVal EvalMinus(SVal X) {
   SVal EvalMinus(SVal X) {
     return X.isValid() ? SVator.EvalMinus(cast<NonLoc>(X)) : X;
     return X.isValid() ? SVator.EvalMinus(cast<NonLoc>(X)) : X;
   }
   }
-  
+
   SVal EvalComplement(SVal X) {
   SVal EvalComplement(SVal X) {
     return X.isValid() ? SVator.EvalComplement(cast<NonLoc>(X)) : X;
     return X.isValid() ? SVator.EvalComplement(cast<NonLoc>(X)) : X;
   }
   }
 
 
   bool EvalBuiltinFunction(const FunctionDecl *FD, CallExpr *CE,
   bool EvalBuiltinFunction(const FunctionDecl *FD, CallExpr *CE,
                            ExplodedNode *Pred, ExplodedNodeSet &Dst);
                            ExplodedNode *Pred, ExplodedNodeSet &Dst);
-  
+
 public:
 public:
-  
+
   SVal EvalBinOp(BinaryOperator::Opcode op, NonLoc L, NonLoc R, QualType T) {
   SVal EvalBinOp(BinaryOperator::Opcode op, NonLoc L, NonLoc R, QualType T) {
     return SVator.EvalBinOpNN(op, L, R, T);
     return SVator.EvalBinOpNN(op, L, R, T);
   }
   }
@@ -591,49 +591,49 @@ public:
   SVal EvalBinOp(BinaryOperator::Opcode op, NonLoc L, SVal R, QualType T) {
   SVal EvalBinOp(BinaryOperator::Opcode op, NonLoc L, SVal R, QualType T) {
     return R.isValid() ? SVator.EvalBinOpNN(op, L, cast<NonLoc>(R), T) : R;
     return R.isValid() ? SVator.EvalBinOpNN(op, L, cast<NonLoc>(R), T) : R;
   }
   }
-  
+
   SVal EvalBinOp(const GRState *ST, BinaryOperator::Opcode Op,
   SVal EvalBinOp(const GRState *ST, BinaryOperator::Opcode Op,
                  SVal LHS, SVal RHS, QualType T) {
                  SVal LHS, SVal RHS, QualType T) {
     return SVator.EvalBinOp(ST, Op, LHS, RHS, T);
     return SVator.EvalBinOp(ST, Op, LHS, RHS, T);
   }
   }
 
 
 protected:
 protected:
-  
+
   void EvalCall(ExplodedNodeSet& Dst, CallExpr* CE, SVal L, ExplodedNode* Pred);
   void EvalCall(ExplodedNodeSet& Dst, CallExpr* CE, SVal L, ExplodedNode* Pred);
-  
+
   void EvalObjCMessageExpr(ExplodedNodeSet& Dst, ObjCMessageExpr* ME, ExplodedNode* Pred) {
   void EvalObjCMessageExpr(ExplodedNodeSet& Dst, ObjCMessageExpr* ME, ExplodedNode* Pred) {
     assert (Builder && "GRStmtNodeBuilder must be defined.");
     assert (Builder && "GRStmtNodeBuilder must be defined.");
     getTF().EvalObjCMessageExpr(Dst, *this, *Builder, ME, Pred);
     getTF().EvalObjCMessageExpr(Dst, *this, *Builder, ME, Pred);
   }
   }
 
 
   void EvalReturn(ExplodedNodeSet& Dst, ReturnStmt* s, ExplodedNode* Pred);
   void EvalReturn(ExplodedNodeSet& Dst, ReturnStmt* s, ExplodedNode* Pred);
-  
-  const GRState* MarkBranch(const GRState* St, Stmt* Terminator, 
+
+  const GRState* MarkBranch(const GRState* St, Stmt* Terminator,
                             bool branchTaken);
                             bool branchTaken);
-  
+
   /// EvalBind - Handle the semantics of binding a value to a specific location.
   /// EvalBind - Handle the semantics of binding a value to a specific location.
   ///  This method is used by EvalStore, VisitDeclStmt, and others.
   ///  This method is used by EvalStore, VisitDeclStmt, and others.
   void EvalBind(ExplodedNodeSet& Dst, Expr* Ex, ExplodedNode* Pred,
   void EvalBind(ExplodedNodeSet& Dst, Expr* Ex, ExplodedNode* Pred,
                 const GRState* St, SVal location, SVal Val);
                 const GRState* St, SVal location, SVal Val);
-  
+
 public:
 public:
   void EvalLoad(ExplodedNodeSet& Dst, Expr* Ex, ExplodedNode* Pred,
   void EvalLoad(ExplodedNodeSet& Dst, Expr* Ex, ExplodedNode* Pred,
                 const GRState* St, SVal location, const void *tag = 0);
                 const GRState* St, SVal location, const void *tag = 0);
-  
+
   ExplodedNode* EvalLocation(Stmt* Ex, ExplodedNode* Pred,
   ExplodedNode* EvalLocation(Stmt* Ex, ExplodedNode* Pred,
                        const GRState* St, SVal location,
                        const GRState* St, SVal location,
                        const void *tag = 0);
                        const void *tag = 0);
 
 
-  
+
   void EvalStore(ExplodedNodeSet& Dst, Expr* E, ExplodedNode* Pred, const GRState* St,
   void EvalStore(ExplodedNodeSet& Dst, Expr* E, ExplodedNode* Pred, const GRState* St,
                  SVal TargetLV, SVal Val, const void *tag = 0);
                  SVal TargetLV, SVal Val, const void *tag = 0);
-  
+
   void EvalStore(ExplodedNodeSet& Dst, Expr* E, Expr* StoreE, ExplodedNode* Pred,
   void EvalStore(ExplodedNodeSet& Dst, Expr* E, Expr* StoreE, ExplodedNode* Pred,
                  const GRState* St, SVal TargetLV, SVal Val,
                  const GRState* St, SVal TargetLV, SVal Val,
                  const void *tag = 0);
                  const void *tag = 0);
-  
+
 };
 };
-  
+
 } // end clang namespace
 } // end clang namespace
 
 
 #endif
 #endif

+ 8 - 8
include/clang/Analysis/PathSensitive/GRExprEngineBuilders.h

@@ -34,10 +34,10 @@ class GRStmtNodeBuilderRef {
 
 
 private:
 private:
   friend class GRExprEngine;
   friend class GRExprEngine;
-  
+
   GRStmtNodeBuilderRef(); // do not implement
   GRStmtNodeBuilderRef(); // do not implement
   void operator=(const GRStmtNodeBuilderRef&); // do not implement
   void operator=(const GRStmtNodeBuilderRef&); // do not implement
-  
+
   GRStmtNodeBuilderRef(ExplodedNodeSet &dst,
   GRStmtNodeBuilderRef(ExplodedNodeSet &dst,
                        GRStmtNodeBuilder &builder,
                        GRStmtNodeBuilder &builder,
                        GRExprEngine& eng,
                        GRExprEngine& eng,
@@ -47,12 +47,12 @@ private:
   : Dst(dst), B(builder), Eng(eng), Pred(pred),
   : Dst(dst), B(builder), Eng(eng), Pred(pred),
     state(st), stmt(s), OldSize(Dst.size()), AutoCreateNode(auto_create_node),
     state(st), stmt(s), OldSize(Dst.size()), AutoCreateNode(auto_create_node),
     OldSink(B.BuildSinks), OldTag(B.Tag), OldHasGen(B.HasGeneratedNode) {}
     OldSink(B.BuildSinks), OldTag(B.Tag), OldHasGen(B.HasGeneratedNode) {}
-  
+
 public:
 public:
 
 
   ~GRStmtNodeBuilderRef() {
   ~GRStmtNodeBuilderRef() {
     // Handle the case where no nodes where generated.  Auto-generate that
     // Handle the case where no nodes where generated.  Auto-generate that
-    // contains the updated state if we aren't generating sinks.  
+    // contains the updated state if we aren't generating sinks.
     if (!B.BuildSinks && Dst.size() == OldSize && !B.HasGeneratedNode) {
     if (!B.BuildSinks && Dst.size() == OldSize && !B.HasGeneratedNode) {
       if (AutoCreateNode)
       if (AutoCreateNode)
         B.MakeNode(Dst, const_cast<Stmt*>(stmt), Pred, state);
         B.MakeNode(Dst, const_cast<Stmt*>(stmt), Pred, state);
@@ -62,14 +62,14 @@ public:
   }
   }
 
 
   const GRState *getState() { return state; }
   const GRState *getState() { return state; }
-  
+
   GRStateManager& getStateManager() {
   GRStateManager& getStateManager() {
     return Eng.getStateManager();
     return Eng.getStateManager();
   }
   }
-  
+
   ExplodedNode* MakeNode(const GRState* state) {
   ExplodedNode* MakeNode(const GRState* state) {
-    return B.MakeNode(Dst, const_cast<Stmt*>(stmt), Pred, state);    
-  }    
+    return B.MakeNode(Dst, const_cast<Stmt*>(stmt), Pred, state);
+  }
 };
 };
 
 
 } // end clang namespace
 } // end clang namespace

+ 3 - 3
include/clang/Analysis/PathSensitive/GRSimpleAPICheck.h

@@ -20,15 +20,15 @@
 #include "clang/Analysis/PathSensitive/GRState.h"
 #include "clang/Analysis/PathSensitive/GRState.h"
 
 
 namespace clang {
 namespace clang {
-  
+
 class Diagnostic;
 class Diagnostic;
 class BugReporter;
 class BugReporter;
 class ASTContext;
 class ASTContext;
 class GRExprEngine;
 class GRExprEngine;
 class PathDiagnosticClient;
 class PathDiagnosticClient;
 class ExplodedGraph;
 class ExplodedGraph;
-  
-  
+
+
 class GRSimpleAPICheck : public GRAuditor {
 class GRSimpleAPICheck : public GRAuditor {
 public:
 public:
   GRSimpleAPICheck() {}
   GRSimpleAPICheck() {}

+ 122 - 122
include/clang/Analysis/PathSensitive/GRState.h

@@ -49,12 +49,12 @@ typedef StoreManager* (*StoreManagerCreator)(GRStateManager&);
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // GRStateTrait - Traits used by the Generic Data Map of a GRState.
 // GRStateTrait - Traits used by the Generic Data Map of a GRState.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
-  
+
 template <typename T> struct GRStatePartialTrait;
 template <typename T> struct GRStatePartialTrait;
 
 
 template <typename T> struct GRStateTrait {
 template <typename T> struct GRStateTrait {
   typedef typename T::data_type data_type;
   typedef typename T::data_type data_type;
-  static inline void* GDMIndex() { return &T::TagInt; }   
+  static inline void* GDMIndex() { return &T::TagInt; }
   static inline void* MakeVoidPtr(data_type D) { return (void*) D; }
   static inline void* MakeVoidPtr(data_type D) { return (void*) D; }
   static inline data_type MakeData(void* const* P) {
   static inline data_type MakeData(void* const* P) {
     return P ? (data_type) *P : (data_type) 0;
     return P ? (data_type) *P : (data_type) 0;
@@ -66,19 +66,19 @@ template <typename T> struct GRStateTrait {
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
 class GRStateManager;
 class GRStateManager;
-  
+
 /// GRState - This class encapsulates the actual data values for
 /// GRState - This class encapsulates the actual data values for
 ///  for a "state" in our symbolic value tracking.  It is intended to be
 ///  for a "state" in our symbolic value tracking.  It is intended to be
 ///  used as a functional object; that is once it is created and made
 ///  used as a functional object; that is once it is created and made
 ///  "persistent" in a FoldingSet its values will never change.
 ///  "persistent" in a FoldingSet its values will never change.
 class GRState : public llvm::FoldingSetNode {
 class GRState : public llvm::FoldingSetNode {
-public: 
+public:
   typedef llvm::ImmutableSet<llvm::APSInt*>                IntSetTy;
   typedef llvm::ImmutableSet<llvm::APSInt*>                IntSetTy;
-  typedef llvm::ImmutableMap<void*, void*>                 GenericDataMap;  
-  
+  typedef llvm::ImmutableMap<void*, void*>                 GenericDataMap;
+
 private:
 private:
   void operator=(const GRState& R) const;
   void operator=(const GRState& R) const;
-  
+
   friend class GRStateManager;
   friend class GRStateManager;
 
 
   GRStateManager *StateMgr;
   GRStateManager *StateMgr;
@@ -88,9 +88,9 @@ private:
   // FIXME: Make these private.
   // FIXME: Make these private.
 public:
 public:
   GenericDataMap   GDM;
   GenericDataMap   GDM;
-  
+
 public:
 public:
-  
+
   /// This ctor is used when creating the first GRState object.
   /// This ctor is used when creating the first GRState object.
   GRState(GRStateManager *mgr, const Environment& env,
   GRState(GRStateManager *mgr, const Environment& env,
           Store st, GenericDataMap gdm)
           Store st, GenericDataMap gdm)
@@ -98,7 +98,7 @@ public:
       Env(env),
       Env(env),
       St(st),
       St(st),
       GDM(gdm) {}
       GDM(gdm) {}
-  
+
   /// Copy ctor - We must explicitly define this or else the "Next" ptr
   /// Copy ctor - We must explicitly define this or else the "Next" ptr
   ///  in FoldingSetNode will also get copied.
   ///  in FoldingSetNode will also get copied.
   GRState(const GRState& RHS)
   GRState(const GRState& RHS)
@@ -107,33 +107,33 @@ public:
       Env(RHS.Env),
       Env(RHS.Env),
       St(RHS.St),
       St(RHS.St),
       GDM(RHS.GDM) {}
       GDM(RHS.GDM) {}
-  
+
   /// getStateManager - Return the GRStateManager associated with this state.
   /// getStateManager - Return the GRStateManager associated with this state.
   GRStateManager &getStateManager() const {
   GRStateManager &getStateManager() const {
     return *StateMgr;
     return *StateMgr;
   }
   }
-  
+
   /// getAnalysisContext - Return the AnalysisContext associated with this
   /// getAnalysisContext - Return the AnalysisContext associated with this
   /// state.
   /// state.
   AnalysisContext &getAnalysisContext() const {
   AnalysisContext &getAnalysisContext() const {
     return Env.getAnalysisContext();
     return Env.getAnalysisContext();
   }
   }
-  
+
   /// getEnvironment - Return the environment associated with this state.
   /// getEnvironment - Return the environment associated with this state.
   ///  The environment is the mapping from expressions to values.
   ///  The environment is the mapping from expressions to values.
   const Environment& getEnvironment() const { return Env; }
   const Environment& getEnvironment() const { return Env; }
-  
+
   /// getStore - Return the store associated with this state.  The store
   /// getStore - Return the store associated with this state.  The store
   ///  is a mapping from locations to values.
   ///  is a mapping from locations to values.
   Store getStore() const { return St; }
   Store getStore() const { return St; }
-  
+
   void setStore(Store s) { St = s; }
   void setStore(Store s) { St = s; }
-  
+
   /// getGDM - Return the generic data map associated with this state.
   /// getGDM - Return the generic data map associated with this state.
   GenericDataMap getGDM() const { return GDM; }
   GenericDataMap getGDM() const { return GDM; }
-  
+
   void setGDM(GenericDataMap gdm) { GDM = gdm; }
   void setGDM(GenericDataMap gdm) { GDM = gdm; }
-  
+
   /// Profile - Profile the contents of a GRState object for use
   /// Profile - Profile the contents of a GRState object for use
   ///  in a FoldingSet.
   ///  in a FoldingSet.
   static void Profile(llvm::FoldingSetNodeID& ID, const GRState* V) {
   static void Profile(llvm::FoldingSetNodeID& ID, const GRState* V) {
@@ -148,19 +148,19 @@ public:
   void Profile(llvm::FoldingSetNodeID& ID) const {
   void Profile(llvm::FoldingSetNodeID& ID) const {
     Profile(ID, this);
     Profile(ID, this);
   }
   }
-  
+
   SVal LookupExpr(Expr* E) const {
   SVal LookupExpr(Expr* E) const {
     return Env.LookupExpr(E);
     return Env.LookupExpr(E);
   }
   }
-  
+
   /// makeWithStore - Return a GRState with the same values as the current
   /// makeWithStore - Return a GRState with the same values as the current
   /// state with the exception of using the specified Store.
   /// state with the exception of using the specified Store.
   const GRState *makeWithStore(Store store) const;
   const GRState *makeWithStore(Store store) const;
-    
+
   BasicValueFactory &getBasicVals() const;
   BasicValueFactory &getBasicVals() const;
   SymbolManager &getSymbolManager() const;
   SymbolManager &getSymbolManager() const;
   GRTransferFuncs &getTransferFuncs() const;
   GRTransferFuncs &getTransferFuncs() const;
-    
+
   //==---------------------------------------------------------------------==//
   //==---------------------------------------------------------------------==//
   // Constraints on values.
   // Constraints on values.
   //==---------------------------------------------------------------------==//
   //==---------------------------------------------------------------------==//
@@ -193,12 +193,12 @@ public:
   // FIXME: (a) should probably disappear since it is redundant with (b).
   // FIXME: (a) should probably disappear since it is redundant with (b).
   //  (i.e., (b) could just be set to NULL).
   //  (i.e., (b) could just be set to NULL).
   //
   //
-  
+
   const GRState *assume(SVal condition, bool assumption) const;
   const GRState *assume(SVal condition, bool assumption) const;
-  
-  const GRState *assumeInBound(SVal idx, SVal upperBound, 
+
+  const GRState *assumeInBound(SVal idx, SVal upperBound,
                                bool assumption) const;
                                bool assumption) const;
-  
+
   //==---------------------------------------------------------------------==//
   //==---------------------------------------------------------------------==//
   // Utility methods for getting regions.
   // Utility methods for getting regions.
   //==---------------------------------------------------------------------==//
   //==---------------------------------------------------------------------==//
@@ -208,67 +208,67 @@ public:
   //==---------------------------------------------------------------------==//
   //==---------------------------------------------------------------------==//
   // Binding and retrieving values to/from the environment and symbolic store.
   // Binding and retrieving values to/from the environment and symbolic store.
   //==---------------------------------------------------------------------==//
   //==---------------------------------------------------------------------==//
-  
+
   /// BindCompoundLiteral - Return the state that has the bindings currently
   /// BindCompoundLiteral - Return the state that has the bindings currently
   ///  in 'state' plus the bindings for the CompoundLiteral.  'R' is the region
   ///  in 'state' plus the bindings for the CompoundLiteral.  'R' is the region
   ///  for the compound literal and 'BegInit' and 'EndInit' represent an
   ///  for the compound literal and 'BegInit' and 'EndInit' represent an
   ///  array of initializer values.
   ///  array of initializer values.
   const GRState* bindCompoundLiteral(const CompoundLiteralExpr* CL,
   const GRState* bindCompoundLiteral(const CompoundLiteralExpr* CL,
                                      SVal V) const;
                                      SVal V) const;
-  
+
   const GRState *BindExpr(const Stmt *S, SVal V, bool Invalidate = true) const;
   const GRState *BindExpr(const Stmt *S, SVal V, bool Invalidate = true) const;
-    
+
   const GRState *bindDecl(const VarDecl *VD, const LocationContext *LC,
   const GRState *bindDecl(const VarDecl *VD, const LocationContext *LC,
                           SVal V) const;
                           SVal V) const;
-  
+
   const GRState *bindDeclWithNoInit(const VarDecl *VD,
   const GRState *bindDeclWithNoInit(const VarDecl *VD,
-                                    const LocationContext *LC) const;  
-  
+                                    const LocationContext *LC) const;
+
   const GRState *bindLoc(Loc location, SVal V) const;
   const GRState *bindLoc(Loc location, SVal V) const;
-  
+
   const GRState *bindLoc(SVal location, SVal V) const;
   const GRState *bindLoc(SVal location, SVal V) const;
-  
+
   const GRState *unbindLoc(Loc LV) const;
   const GRState *unbindLoc(Loc LV) const;
 
 
   /// Get the lvalue for a variable reference.
   /// Get the lvalue for a variable reference.
   SVal getLValue(const VarDecl *D, const LocationContext *LC) const;
   SVal getLValue(const VarDecl *D, const LocationContext *LC) const;
-  
+
   /// Get the lvalue for a StringLiteral.
   /// Get the lvalue for a StringLiteral.
   SVal getLValue(const StringLiteral *literal) const;
   SVal getLValue(const StringLiteral *literal) const;
-  
+
   SVal getLValue(const CompoundLiteralExpr *literal) const;
   SVal getLValue(const CompoundLiteralExpr *literal) const;
-  
+
   /// Get the lvalue for an ivar reference.
   /// Get the lvalue for an ivar reference.
   SVal getLValue(const ObjCIvarDecl *decl, SVal base) const;
   SVal getLValue(const ObjCIvarDecl *decl, SVal base) const;
-  
+
   /// Get the lvalue for a field reference.
   /// Get the lvalue for a field reference.
   SVal getLValue(SVal Base, const FieldDecl *decl) const;
   SVal getLValue(SVal Base, const FieldDecl *decl) const;
-  
+
   /// Get the lvalue for an array index.
   /// Get the lvalue for an array index.
   SVal getLValue(QualType ElementType, SVal Base, SVal Idx) const;
   SVal getLValue(QualType ElementType, SVal Base, SVal Idx) const;
-  
+
   const llvm::APSInt *getSymVal(SymbolRef sym) const;
   const llvm::APSInt *getSymVal(SymbolRef sym) const;
 
 
   SVal getSVal(const Stmt* Ex) const;
   SVal getSVal(const Stmt* Ex) const;
-  
+
   SVal getSValAsScalarOrLoc(const Stmt *Ex) const;
   SVal getSValAsScalarOrLoc(const Stmt *Ex) const;
-  
+
   SVal getSVal(Loc LV, QualType T = QualType()) const;
   SVal getSVal(Loc LV, QualType T = QualType()) const;
-  
+
   SVal getSVal(const MemRegion* R) const;
   SVal getSVal(const MemRegion* R) const;
-  
+
   SVal getSValAsScalarOrLoc(const MemRegion *R) const;
   SVal getSValAsScalarOrLoc(const MemRegion *R) const;
-  
+
   bool scanReachableSymbols(SVal val, SymbolVisitor& visitor) const;
   bool scanReachableSymbols(SVal val, SymbolVisitor& visitor) const;
 
 
   template <typename CB> CB scanReachableSymbols(SVal val) const;
   template <typename CB> CB scanReachableSymbols(SVal val) const;
-  
+
   //==---------------------------------------------------------------------==//
   //==---------------------------------------------------------------------==//
   // Accessing the Generic Data Map (GDM).
   // Accessing the Generic Data Map (GDM).
   //==---------------------------------------------------------------------==//
   //==---------------------------------------------------------------------==//
 
 
   void* const* FindGDM(void* K) const;
   void* const* FindGDM(void* K) const;
-  
+
   template<typename T>
   template<typename T>
   const GRState *add(typename GRStateTrait<T>::key_type K) const;
   const GRState *add(typename GRStateTrait<T>::key_type K) const;
 
 
@@ -277,31 +277,31 @@ public:
   get() const {
   get() const {
     return GRStateTrait<T>::MakeData(FindGDM(GRStateTrait<T>::GDMIndex()));
     return GRStateTrait<T>::MakeData(FindGDM(GRStateTrait<T>::GDMIndex()));
   }
   }
-  
+
   template<typename T>
   template<typename T>
   typename GRStateTrait<T>::lookup_type
   typename GRStateTrait<T>::lookup_type
   get(typename GRStateTrait<T>::key_type key) const {
   get(typename GRStateTrait<T>::key_type key) const {
     void* const* d = FindGDM(GRStateTrait<T>::GDMIndex());
     void* const* d = FindGDM(GRStateTrait<T>::GDMIndex());
     return GRStateTrait<T>::Lookup(GRStateTrait<T>::MakeData(d), key);
     return GRStateTrait<T>::Lookup(GRStateTrait<T>::MakeData(d), key);
   }
   }
-  
+
   template <typename T>
   template <typename T>
   typename GRStateTrait<T>::context_type get_context() const;
   typename GRStateTrait<T>::context_type get_context() const;
-    
-  
+
+
   template<typename T>
   template<typename T>
   const GRState *remove(typename GRStateTrait<T>::key_type K) const;
   const GRState *remove(typename GRStateTrait<T>::key_type K) const;
 
 
   template<typename T>
   template<typename T>
   const GRState *remove(typename GRStateTrait<T>::key_type K,
   const GRState *remove(typename GRStateTrait<T>::key_type K,
                         typename GRStateTrait<T>::context_type C) const;
                         typename GRStateTrait<T>::context_type C) const;
-  
+
   template<typename T>
   template<typename T>
   const GRState *set(typename GRStateTrait<T>::data_type D) const;
   const GRState *set(typename GRStateTrait<T>::data_type D) const;
-  
+
   template<typename T>
   template<typename T>
   const GRState *set(typename GRStateTrait<T>::key_type K,
   const GRState *set(typename GRStateTrait<T>::key_type K,
-                     typename GRStateTrait<T>::value_type E) const;  
+                     typename GRStateTrait<T>::value_type E) const;
 
 
   template<typename T>
   template<typename T>
   const GRState *set(typename GRStateTrait<T>::key_type K,
   const GRState *set(typename GRStateTrait<T>::key_type K,
@@ -313,7 +313,7 @@ public:
     void* const* d = FindGDM(GRStateTrait<T>::GDMIndex());
     void* const* d = FindGDM(GRStateTrait<T>::GDMIndex());
     return GRStateTrait<T>::Contains(GRStateTrait<T>::MakeData(d), key);
     return GRStateTrait<T>::Contains(GRStateTrait<T>::MakeData(d), key);
   }
   }
-  
+
   // State pretty-printing.
   // State pretty-printing.
   class Printer {
   class Printer {
   public:
   public:
@@ -321,55 +321,55 @@ public:
     virtual void Print(llvm::raw_ostream& Out, const GRState* state,
     virtual void Print(llvm::raw_ostream& Out, const GRState* state,
                        const char* nl, const char* sep) = 0;
                        const char* nl, const char* sep) = 0;
   };
   };
-  
+
   // Pretty-printing.
   // Pretty-printing.
   void print(llvm::raw_ostream& Out, const char *nl = "\n",
   void print(llvm::raw_ostream& Out, const char *nl = "\n",
-             const char *sep = "") const;  
+             const char *sep = "") const;
+
+  void printStdErr() const;
+
+  void printDOT(llvm::raw_ostream& Out) const;
 
 
-  void printStdErr() const; 
-  
-  void printDOT(llvm::raw_ostream& Out) const;  
-  
   // Tags used for the Generic Data Map.
   // Tags used for the Generic Data Map.
   struct NullDerefTag {
   struct NullDerefTag {
     static int TagInt;
     static int TagInt;
     typedef const SVal* data_type;
     typedef const SVal* data_type;
   };
   };
 };
 };
-  
+
 class GRStateSet {
 class GRStateSet {
   typedef llvm::SmallPtrSet<const GRState*,5> ImplTy;
   typedef llvm::SmallPtrSet<const GRState*,5> ImplTy;
-  ImplTy Impl;  
+  ImplTy Impl;
 public:
 public:
   GRStateSet() {}
   GRStateSet() {}
 
 
   inline void Add(const GRState* St) {
   inline void Add(const GRState* St) {
     Impl.insert(St);
     Impl.insert(St);
   }
   }
-  
+
   typedef ImplTy::const_iterator iterator;
   typedef ImplTy::const_iterator iterator;
-  
+
   inline unsigned size() const { return Impl.size();  }
   inline unsigned size() const { return Impl.size();  }
   inline bool empty()    const { return Impl.empty(); }
   inline bool empty()    const { return Impl.empty(); }
-  
+
   inline iterator begin() const { return Impl.begin(); }
   inline iterator begin() const { return Impl.begin(); }
   inline iterator end() const { return Impl.end();   }
   inline iterator end() const { return Impl.end();   }
-  
+
   class AutoPopulate {
   class AutoPopulate {
     GRStateSet& S;
     GRStateSet& S;
     unsigned StartSize;
     unsigned StartSize;
     const GRState* St;
     const GRState* St;
   public:
   public:
-    AutoPopulate(GRStateSet& s, const GRState* st) 
+    AutoPopulate(GRStateSet& s, const GRState* st)
       : S(s), StartSize(S.size()), St(st) {}
       : S(s), StartSize(S.size()), St(st) {}
-    
+
     ~AutoPopulate() {
     ~AutoPopulate() {
       if (StartSize == S.size())
       if (StartSize == S.size())
         S.Add(St);
         S.Add(St);
     }
     }
   };
   };
-};  
-  
+};
+
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // GRStateManager - Factory object for GRStates.
 // GRStateManager - Factory object for GRStates.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
@@ -377,21 +377,21 @@ public:
 class GRStateManager {
 class GRStateManager {
   friend class GRExprEngine;
   friend class GRExprEngine;
   friend class GRState;
   friend class GRState;
-  
+
 private:
 private:
   EnvironmentManager                   EnvMgr;
   EnvironmentManager                   EnvMgr;
   llvm::OwningPtr<StoreManager>        StoreMgr;
   llvm::OwningPtr<StoreManager>        StoreMgr;
   llvm::OwningPtr<ConstraintManager>   ConstraintMgr;
   llvm::OwningPtr<ConstraintManager>   ConstraintMgr;
-  
+
   GRState::GenericDataMap::Factory     GDMFactory;
   GRState::GenericDataMap::Factory     GDMFactory;
-  
+
   typedef llvm::DenseMap<void*,std::pair<void*,void (*)(void*)> > GDMContextsTy;
   typedef llvm::DenseMap<void*,std::pair<void*,void (*)(void*)> > GDMContextsTy;
   GDMContextsTy GDMContexts;
   GDMContextsTy GDMContexts;
-    
+
   /// Printers - A set of printer objects used for pretty-printing a GRState.
   /// Printers - A set of printer objects used for pretty-printing a GRState.
   ///  GRStateManager owns these objects.
   ///  GRStateManager owns these objects.
   std::vector<GRState::Printer*> Printers;
   std::vector<GRState::Printer*> Printers;
-  
+
   /// StateSet - FoldingSet containing all the states created for analyzing
   /// StateSet - FoldingSet containing all the states created for analyzing
   ///  a particular function.  This is used to unique states.
   ///  a particular function.  This is used to unique states.
   llvm::FoldingSet<GRState> StateSet;
   llvm::FoldingSet<GRState> StateSet;
@@ -401,36 +401,36 @@ private:
 
 
   /// Alloc - A BumpPtrAllocator to allocate states.
   /// Alloc - A BumpPtrAllocator to allocate states.
   llvm::BumpPtrAllocator& Alloc;
   llvm::BumpPtrAllocator& Alloc;
-  
+
   /// CurrentStmt - The block-level statement currently being visited.  This
   /// CurrentStmt - The block-level statement currently being visited.  This
   ///  is set by GRExprEngine.
   ///  is set by GRExprEngine.
   Stmt* CurrentStmt;
   Stmt* CurrentStmt;
-  
+
   /// TF - Object that represents a bundle of transfer functions
   /// TF - Object that represents a bundle of transfer functions
   ///  for manipulating and creating SVals.
   ///  for manipulating and creating SVals.
   GRTransferFuncs* TF;
   GRTransferFuncs* TF;
 
 
 public:
 public:
-  
+
   GRStateManager(ASTContext& Ctx,
   GRStateManager(ASTContext& Ctx,
                  StoreManagerCreator CreateStoreManager,
                  StoreManagerCreator CreateStoreManager,
                  ConstraintManagerCreator CreateConstraintManager,
                  ConstraintManagerCreator CreateConstraintManager,
                  llvm::BumpPtrAllocator& alloc)
                  llvm::BumpPtrAllocator& alloc)
-    : EnvMgr(alloc), 
-      GDMFactory(alloc), 
-      ValueMgr(alloc, Ctx, *this), 
+    : EnvMgr(alloc),
+      GDMFactory(alloc),
+      ValueMgr(alloc, Ctx, *this),
       Alloc(alloc) {
       Alloc(alloc) {
     StoreMgr.reset((*CreateStoreManager)(*this));
     StoreMgr.reset((*CreateStoreManager)(*this));
     ConstraintMgr.reset((*CreateConstraintManager)(*this));
     ConstraintMgr.reset((*CreateConstraintManager)(*this));
   }
   }
-  
+
   ~GRStateManager();
   ~GRStateManager();
 
 
   const GRState *getInitialState(const LocationContext *InitLoc);
   const GRState *getInitialState(const LocationContext *InitLoc);
-        
+
   ASTContext &getContext() { return ValueMgr.getContext(); }
   ASTContext &getContext() { return ValueMgr.getContext(); }
   const ASTContext &getContext() const { return ValueMgr.getContext(); }
   const ASTContext &getContext() const { return ValueMgr.getContext(); }
-                 
+
   GRTransferFuncs& getTransferFuncs() { return *TF; }
   GRTransferFuncs& getTransferFuncs() { return *TF; }
 
 
   BasicValueFactory &getBasicVals() {
   BasicValueFactory &getBasicVals() {
@@ -439,17 +439,17 @@ public:
   const BasicValueFactory& getBasicVals() const {
   const BasicValueFactory& getBasicVals() const {
     return ValueMgr.getBasicValueFactory();
     return ValueMgr.getBasicValueFactory();
   }
   }
-                 
+
   SymbolManager &getSymbolManager() {
   SymbolManager &getSymbolManager() {
     return ValueMgr.getSymbolManager();
     return ValueMgr.getSymbolManager();
   }
   }
   const SymbolManager &getSymbolManager() const {
   const SymbolManager &getSymbolManager() const {
     return ValueMgr.getSymbolManager();
     return ValueMgr.getSymbolManager();
   }
   }
-  
+
   ValueManager &getValueManager() { return ValueMgr; }
   ValueManager &getValueManager() { return ValueMgr; }
   const ValueManager &getValueManager() const { return ValueMgr; }
   const ValueManager &getValueManager() const { return ValueMgr; }
-  
+
   llvm::BumpPtrAllocator& getAllocator() { return Alloc; }
   llvm::BumpPtrAllocator& getAllocator() { return Alloc; }
 
 
   MemRegionManager& getRegionManager() {
   MemRegionManager& getRegionManager() {
@@ -458,11 +458,11 @@ public:
   const MemRegionManager& getRegionManager() const {
   const MemRegionManager& getRegionManager() const {
     return ValueMgr.getRegionManager();
     return ValueMgr.getRegionManager();
   }
   }
-  
+
   StoreManager& getStoreManager() { return *StoreMgr; }
   StoreManager& getStoreManager() { return *StoreMgr; }
   ConstraintManager& getConstraintManager() { return *ConstraintMgr; }
   ConstraintManager& getConstraintManager() { return *ConstraintMgr; }
 
 
-  const GRState* RemoveDeadBindings(const GRState* St, Stmt* Loc, 
+  const GRState* RemoveDeadBindings(const GRState* St, Stmt* Loc,
                                     SymbolReaper& SymReaper);
                                     SymbolReaper& SymReaper);
 
 
 public:
 public:
@@ -470,10 +470,10 @@ public:
   SVal ArrayToPointer(Loc Array) {
   SVal ArrayToPointer(Loc Array) {
     return StoreMgr->ArrayToPointer(Array);
     return StoreMgr->ArrayToPointer(Array);
   }
   }
-  
+
   // Methods that manipulate the GDM.
   // Methods that manipulate the GDM.
   const GRState* addGDM(const GRState* St, void* Key, void* Data);
   const GRState* addGDM(const GRState* St, void* Key, void* Data);
-  
+
   // Methods that query & manipulate the Store.
   // Methods that query & manipulate the Store.
 
 
   void iterBindings(const GRState* state, StoreManager::BindingsHandler& F) {
   void iterBindings(const GRState* state, StoreManager::BindingsHandler& F) {
@@ -484,7 +484,7 @@ public:
 
 
   bool isEqual(const GRState* state, const Expr* Ex, const llvm::APSInt& V);
   bool isEqual(const GRState* state, const Expr* Ex, const llvm::APSInt& V);
   bool isEqual(const GRState* state, const Expr* Ex, uint64_t);
   bool isEqual(const GRState* state, const Expr* Ex, uint64_t);
-  
+
   //==---------------------------------------------------------------------==//
   //==---------------------------------------------------------------------==//
   // Generic Data Map methods.
   // Generic Data Map methods.
   //==---------------------------------------------------------------------==//
   //==---------------------------------------------------------------------==//
@@ -502,21 +502,21 @@ public:
   // The templated methods below use the GRStateTrait<T> class
   // The templated methods below use the GRStateTrait<T> class
   // to resolve keys into the GDM and to return data values to clients.
   // to resolve keys into the GDM and to return data values to clients.
   //
   //
-  
-  // Trait based GDM dispatch.  
+
+  // Trait based GDM dispatch.
   template <typename T>
   template <typename T>
   const GRState* set(const GRState* st, typename GRStateTrait<T>::data_type D) {
   const GRState* set(const GRState* st, typename GRStateTrait<T>::data_type D) {
     return addGDM(st, GRStateTrait<T>::GDMIndex(),
     return addGDM(st, GRStateTrait<T>::GDMIndex(),
                   GRStateTrait<T>::MakeVoidPtr(D));
                   GRStateTrait<T>::MakeVoidPtr(D));
   }
   }
-  
+
   template<typename T>
   template<typename T>
   const GRState* set(const GRState* st,
   const GRState* set(const GRState* st,
                      typename GRStateTrait<T>::key_type K,
                      typename GRStateTrait<T>::key_type K,
                      typename GRStateTrait<T>::value_type V,
                      typename GRStateTrait<T>::value_type V,
                      typename GRStateTrait<T>::context_type C) {
                      typename GRStateTrait<T>::context_type C) {
-    
-    return addGDM(st, GRStateTrait<T>::GDMIndex(), 
+
+    return addGDM(st, GRStateTrait<T>::GDMIndex(),
      GRStateTrait<T>::MakeVoidPtr(GRStateTrait<T>::Set(st->get<T>(), K, V, C)));
      GRStateTrait<T>::MakeVoidPtr(GRStateTrait<T>::Set(st->get<T>(), K, V, C)));
   }
   }
 
 
@@ -532,22 +532,22 @@ public:
   const GRState* remove(const GRState* st,
   const GRState* remove(const GRState* st,
                         typename GRStateTrait<T>::key_type K,
                         typename GRStateTrait<T>::key_type K,
                         typename GRStateTrait<T>::context_type C) {
                         typename GRStateTrait<T>::context_type C) {
-    
-    return addGDM(st, GRStateTrait<T>::GDMIndex(), 
+
+    return addGDM(st, GRStateTrait<T>::GDMIndex(),
      GRStateTrait<T>::MakeVoidPtr(GRStateTrait<T>::Remove(st->get<T>(), K, C)));
      GRStateTrait<T>::MakeVoidPtr(GRStateTrait<T>::Remove(st->get<T>(), K, C)));
   }
   }
-  
+
 
 
   void* FindGDMContext(void* index,
   void* FindGDMContext(void* index,
                        void* (*CreateContext)(llvm::BumpPtrAllocator&),
                        void* (*CreateContext)(llvm::BumpPtrAllocator&),
                        void  (*DeleteContext)(void*));
                        void  (*DeleteContext)(void*));
-  
+
   template <typename T>
   template <typename T>
   typename GRStateTrait<T>::context_type get_context() {
   typename GRStateTrait<T>::context_type get_context() {
     void* p = FindGDMContext(GRStateTrait<T>::GDMIndex(),
     void* p = FindGDMContext(GRStateTrait<T>::GDMIndex(),
                              GRStateTrait<T>::CreateContext,
                              GRStateTrait<T>::CreateContext,
                              GRStateTrait<T>::DeleteContext);
                              GRStateTrait<T>::DeleteContext);
-    
+
     return GRStateTrait<T>::MakeContext(p);
     return GRStateTrait<T>::MakeContext(p);
   }
   }
 
 
@@ -559,7 +559,7 @@ public:
     ConstraintMgr->EndPath(St);
     ConstraintMgr->EndPath(St);
   }
   }
 };
 };
-  
+
 
 
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // Out-of-line method definitions for GRState.
 // Out-of-line method definitions for GRState.
@@ -577,13 +577,13 @@ inline const GRState *GRState::assume(SVal Cond, bool Assumption) const {
 inline const GRState *GRState::assumeInBound(SVal Idx, SVal UpperBound,
 inline const GRState *GRState::assumeInBound(SVal Idx, SVal UpperBound,
                                              bool Assumption) const {
                                              bool Assumption) const {
   return getStateManager().ConstraintMgr->AssumeInBound(this, Idx, UpperBound, Assumption);
   return getStateManager().ConstraintMgr->AssumeInBound(this, Idx, UpperBound, Assumption);
-} 
+}
 
 
 inline const GRState *GRState::bindCompoundLiteral(const CompoundLiteralExpr* CL,
 inline const GRState *GRState::bindCompoundLiteral(const CompoundLiteralExpr* CL,
                                             SVal V) const {
                                             SVal V) const {
   return getStateManager().StoreMgr->BindCompoundLiteral(this, CL, V);
   return getStateManager().StoreMgr->BindCompoundLiteral(this, CL, V);
 }
 }
-  
+
 inline const GRState *GRState::bindDecl(const VarDecl* VD,
 inline const GRState *GRState::bindDecl(const VarDecl* VD,
                                         const LocationContext *LC,
                                         const LocationContext *LC,
                                         SVal IVal) const {
                                         SVal IVal) const {
@@ -594,7 +594,7 @@ inline const GRState *GRState::bindDeclWithNoInit(const VarDecl* VD,
                                                   const LocationContext *LC) const {
                                                   const LocationContext *LC) const {
   return getStateManager().StoreMgr->BindDeclWithNoInit(this, VD, LC);
   return getStateManager().StoreMgr->BindDeclWithNoInit(this, VD, LC);
 }
 }
-  
+
 inline const GRState *GRState::bindLoc(Loc LV, SVal V) const {
 inline const GRState *GRState::bindLoc(Loc LV, SVal V) const {
   return getStateManager().StoreMgr->Bind(this, LV, V);
   return getStateManager().StoreMgr->Bind(this, LV, V);
 }
 }
@@ -602,7 +602,7 @@ inline const GRState *GRState::bindLoc(Loc LV, SVal V) const {
 inline const GRState *GRState::bindLoc(SVal LV, SVal V) const {
 inline const GRState *GRState::bindLoc(SVal LV, SVal V) const {
   return !isa<Loc>(LV) ? this : bindLoc(cast<Loc>(LV), V);
   return !isa<Loc>(LV) ? this : bindLoc(cast<Loc>(LV), V);
 }
 }
-  
+
 inline SVal GRState::getLValue(const VarDecl* VD,
 inline SVal GRState::getLValue(const VarDecl* VD,
                                const LocationContext *LC) const {
                                const LocationContext *LC) const {
   return getStateManager().StoreMgr->getLValueVar(this, VD, LC);
   return getStateManager().StoreMgr->getLValueVar(this, VD, LC);
@@ -611,7 +611,7 @@ inline SVal GRState::getLValue(const VarDecl* VD,
 inline SVal GRState::getLValue(const StringLiteral *literal) const {
 inline SVal GRState::getLValue(const StringLiteral *literal) const {
   return getStateManager().StoreMgr->getLValueString(this, literal);
   return getStateManager().StoreMgr->getLValueString(this, literal);
 }
 }
-  
+
 inline SVal GRState::getLValue(const CompoundLiteralExpr *literal) const {
 inline SVal GRState::getLValue(const CompoundLiteralExpr *literal) const {
   return getStateManager().StoreMgr->getLValueCompoundLiteral(this, literal);
   return getStateManager().StoreMgr->getLValueCompoundLiteral(this, literal);
 }
 }
@@ -619,19 +619,19 @@ inline SVal GRState::getLValue(const CompoundLiteralExpr *literal) const {
 inline SVal GRState::getLValue(const ObjCIvarDecl *D, SVal Base) const {
 inline SVal GRState::getLValue(const ObjCIvarDecl *D, SVal Base) const {
   return getStateManager().StoreMgr->getLValueIvar(this, D, Base);
   return getStateManager().StoreMgr->getLValueIvar(this, D, Base);
 }
 }
-  
+
 inline SVal GRState::getLValue(SVal Base, const FieldDecl* D) const {
 inline SVal GRState::getLValue(SVal Base, const FieldDecl* D) const {
   return getStateManager().StoreMgr->getLValueField(this, Base, D);
   return getStateManager().StoreMgr->getLValueField(this, Base, D);
 }
 }
-  
+
 inline SVal GRState::getLValue(QualType ElementType, SVal Base, SVal Idx) const{
 inline SVal GRState::getLValue(QualType ElementType, SVal Base, SVal Idx) const{
   return getStateManager().StoreMgr->getLValueElement(this, ElementType, Base, Idx);
   return getStateManager().StoreMgr->getLValueElement(this, ElementType, Base, Idx);
 }
 }
-  
+
 inline const llvm::APSInt *GRState::getSymVal(SymbolRef sym) const {
 inline const llvm::APSInt *GRState::getSymVal(SymbolRef sym) const {
   return getStateManager().getSymVal(this, sym);
   return getStateManager().getSymVal(this, sym);
 }
 }
-  
+
 inline SVal GRState::getSVal(const Stmt* Ex) const {
 inline SVal GRState::getSVal(const Stmt* Ex) const {
   return Env.GetSVal(Ex, getStateManager().ValueMgr);
   return Env.GetSVal(Ex, getStateManager().ValueMgr);
 }
 }
@@ -642,7 +642,7 @@ inline SVal GRState::getSValAsScalarOrLoc(const Stmt *S) const {
     if (Loc::IsLocType(T) || T->isIntegerType())
     if (Loc::IsLocType(T) || T->isIntegerType())
       return getSVal(S);
       return getSVal(S);
   }
   }
-    
+
   return UnknownVal();
   return UnknownVal();
 }
 }
 
 
@@ -653,7 +653,7 @@ inline SVal GRState::getSVal(Loc LV, QualType T) const {
 inline SVal GRState::getSVal(const MemRegion* R) const {
 inline SVal GRState::getSVal(const MemRegion* R) const {
   return getStateManager().StoreMgr->Retrieve(this, loc::MemRegionVal(R)).getSVal();
   return getStateManager().StoreMgr->Retrieve(this, loc::MemRegionVal(R)).getSVal();
 }
 }
-  
+
 inline BasicValueFactory &GRState::getBasicVals() const {
 inline BasicValueFactory &GRState::getBasicVals() const {
   return getStateManager().getBasicVals();
   return getStateManager().getBasicVals();
 }
 }
@@ -661,7 +661,7 @@ inline BasicValueFactory &GRState::getBasicVals() const {
 inline SymbolManager &GRState::getSymbolManager() const {
 inline SymbolManager &GRState::getSymbolManager() const {
   return getStateManager().getSymbolManager();
   return getStateManager().getSymbolManager();
 }
 }
-  
+
 inline GRTransferFuncs &GRState::getTransferFuncs() const {
 inline GRTransferFuncs &GRState::getTransferFuncs() const {
   return getStateManager().getTransferFuncs();
   return getStateManager().getTransferFuncs();
 }
 }
@@ -670,12 +670,12 @@ template<typename T>
 const GRState *GRState::add(typename GRStateTrait<T>::key_type K) const {
 const GRState *GRState::add(typename GRStateTrait<T>::key_type K) const {
   return getStateManager().add<T>(this, K, get_context<T>());
   return getStateManager().add<T>(this, K, get_context<T>());
 }
 }
-  
+
 template <typename T>
 template <typename T>
 typename GRStateTrait<T>::context_type GRState::get_context() const {
 typename GRStateTrait<T>::context_type GRState::get_context() const {
   return getStateManager().get_context<T>();
   return getStateManager().get_context<T>();
 }
 }
-  
+
 template<typename T>
 template<typename T>
 const GRState *GRState::remove(typename GRStateTrait<T>::key_type K) const {
 const GRState *GRState::remove(typename GRStateTrait<T>::key_type K) const {
   return getStateManager().remove<T>(this, K, get_context<T>());
   return getStateManager().remove<T>(this, K, get_context<T>());
@@ -686,25 +686,25 @@ const GRState *GRState::remove(typename GRStateTrait<T>::key_type K,
                                typename GRStateTrait<T>::context_type C) const {
                                typename GRStateTrait<T>::context_type C) const {
   return getStateManager().remove<T>(this, K, C);
   return getStateManager().remove<T>(this, K, C);
 }
 }
-  
+
 template<typename T>
 template<typename T>
 const GRState *GRState::set(typename GRStateTrait<T>::data_type D) const {
 const GRState *GRState::set(typename GRStateTrait<T>::data_type D) const {
   return getStateManager().set<T>(this, D);
   return getStateManager().set<T>(this, D);
 }
 }
-  
+
 template<typename T>
 template<typename T>
 const GRState *GRState::set(typename GRStateTrait<T>::key_type K,
 const GRState *GRState::set(typename GRStateTrait<T>::key_type K,
                             typename GRStateTrait<T>::value_type E) const {
                             typename GRStateTrait<T>::value_type E) const {
   return getStateManager().set<T>(this, K, E, get_context<T>());
   return getStateManager().set<T>(this, K, E, get_context<T>());
 }
 }
-  
+
 template<typename T>
 template<typename T>
 const GRState *GRState::set(typename GRStateTrait<T>::key_type K,
 const GRState *GRState::set(typename GRStateTrait<T>::key_type K,
                             typename GRStateTrait<T>::value_type E,
                             typename GRStateTrait<T>::value_type E,
                             typename GRStateTrait<T>::context_type C) const {
                             typename GRStateTrait<T>::context_type C) const {
   return getStateManager().set<T>(this, K, E, C);
   return getStateManager().set<T>(this, K, E, C);
 }
 }
-  
+
 template <typename CB>
 template <typename CB>
 CB GRState::scanReachableSymbols(SVal val) const {
 CB GRState::scanReachableSymbols(SVal val) const {
   CB cb(this);
   CB cb(this);

+ 41 - 41
include/clang/Analysis/PathSensitive/GRStateTrait.h

@@ -1,5 +1,5 @@
 //==- GRStateTrait.h - Partial implementations of GRStateTrait -----*- C++ -*-//
 //==- GRStateTrait.h - Partial implementations of GRStateTrait -----*- C++ -*-//
-//             
+//
 //                     The LLVM Compiler Infrastructure
 //                     The LLVM Compiler Infrastructure
 //
 //
 // This file is distributed under the University of Illinois Open Source
 // This file is distributed under the University of Illinois Open Source
@@ -27,59 +27,59 @@ namespace llvm {
 
 
 namespace clang {
 namespace clang {
   template <typename T> struct GRStatePartialTrait;
   template <typename T> struct GRStatePartialTrait;
-  
+
   // Partial-specialization for ImmutableMap.
   // Partial-specialization for ImmutableMap.
-  
+
   template <typename Key, typename Data, typename Info>
   template <typename Key, typename Data, typename Info>
   struct GRStatePartialTrait< llvm::ImmutableMap<Key,Data,Info> > {
   struct GRStatePartialTrait< llvm::ImmutableMap<Key,Data,Info> > {
     typedef llvm::ImmutableMap<Key,Data,Info> data_type;
     typedef llvm::ImmutableMap<Key,Data,Info> data_type;
-    typedef typename data_type::Factory&      context_type;  
+    typedef typename data_type::Factory&      context_type;
     typedef Key                               key_type;
     typedef Key                               key_type;
     typedef Data                              value_type;
     typedef Data                              value_type;
     typedef const value_type*                 lookup_type;
     typedef const value_type*                 lookup_type;
-    
+
     static inline data_type MakeData(void* const* p) {
     static inline data_type MakeData(void* const* p) {
       return p ? data_type((typename data_type::TreeTy*) *p) : data_type(0);
       return p ? data_type((typename data_type::TreeTy*) *p) : data_type(0);
-    }  
+    }
     static inline void* MakeVoidPtr(data_type B) {
     static inline void* MakeVoidPtr(data_type B) {
       return B.getRoot();
       return B.getRoot();
-    }  
+    }
     static lookup_type Lookup(data_type B, key_type K) {
     static lookup_type Lookup(data_type B, key_type K) {
       return B.lookup(K);
       return B.lookup(K);
-    }  
+    }
     static data_type Set(data_type B, key_type K, value_type E,context_type F){
     static data_type Set(data_type B, key_type K, value_type E,context_type F){
       return F.Add(B, K, E);
       return F.Add(B, K, E);
     }
     }
-    
+
     static data_type Remove(data_type B, key_type K, context_type F) {
     static data_type Remove(data_type B, key_type K, context_type F) {
       return F.Remove(B, K);
       return F.Remove(B, K);
     }
     }
-    
+
     static inline context_type MakeContext(void* p) {
     static inline context_type MakeContext(void* p) {
       return *((typename data_type::Factory*) p);
       return *((typename data_type::Factory*) p);
     }
     }
-    
+
     static void* CreateContext(llvm::BumpPtrAllocator& Alloc) {
     static void* CreateContext(llvm::BumpPtrAllocator& Alloc) {
-      return new typename data_type::Factory(Alloc);      
+      return new typename data_type::Factory(Alloc);
     }
     }
-    
+
     static void DeleteContext(void* Ctx) {
     static void DeleteContext(void* Ctx) {
       delete (typename data_type::Factory*) Ctx;
       delete (typename data_type::Factory*) Ctx;
-    }      
+    }
   };
   };
-  
-  
+
+
   // Partial-specialization for ImmutableSet.
   // Partial-specialization for ImmutableSet.
-  
+
   template <typename Key, typename Info>
   template <typename Key, typename Info>
   struct GRStatePartialTrait< llvm::ImmutableSet<Key,Info> > {
   struct GRStatePartialTrait< llvm::ImmutableSet<Key,Info> > {
     typedef llvm::ImmutableSet<Key,Info>      data_type;
     typedef llvm::ImmutableSet<Key,Info>      data_type;
-    typedef typename data_type::Factory&      context_type;  
+    typedef typename data_type::Factory&      context_type;
     typedef Key                               key_type;
     typedef Key                               key_type;
-    
+
     static inline data_type MakeData(void* const* p) {
     static inline data_type MakeData(void* const* p) {
       return p ? data_type((typename data_type::TreeTy*) *p) : data_type(0);
       return p ? data_type((typename data_type::TreeTy*) *p) : data_type(0);
-    }  
+    }
 
 
     static inline void* MakeVoidPtr(data_type B) {
     static inline void* MakeVoidPtr(data_type B) {
       return B.getRoot();
       return B.getRoot();
@@ -88,60 +88,60 @@ namespace clang {
     static data_type Add(data_type B, key_type K, context_type F) {
     static data_type Add(data_type B, key_type K, context_type F) {
       return F.Add(B, K);
       return F.Add(B, K);
     }
     }
-    
+
     static data_type Remove(data_type B, key_type K, context_type F) {
     static data_type Remove(data_type B, key_type K, context_type F) {
       return F.Remove(B, K);
       return F.Remove(B, K);
     }
     }
-    
+
     static bool Contains(data_type B, key_type K) {
     static bool Contains(data_type B, key_type K) {
       return B.contains(K);
       return B.contains(K);
     }
     }
-    
+
     static inline context_type MakeContext(void* p) {
     static inline context_type MakeContext(void* p) {
       return *((typename data_type::Factory*) p);
       return *((typename data_type::Factory*) p);
     }
     }
-    
+
     static void* CreateContext(llvm::BumpPtrAllocator& Alloc) {
     static void* CreateContext(llvm::BumpPtrAllocator& Alloc) {
-      return new typename data_type::Factory(Alloc);      
+      return new typename data_type::Factory(Alloc);
     }
     }
-    
+
     static void DeleteContext(void* Ctx) {
     static void DeleteContext(void* Ctx) {
       delete (typename data_type::Factory*) Ctx;
       delete (typename data_type::Factory*) Ctx;
-    }      
+    }
   };
   };
-    
+
   // Partial-specialization for ImmutableList.
   // Partial-specialization for ImmutableList.
-  
+
   template <typename T>
   template <typename T>
   struct GRStatePartialTrait< llvm::ImmutableList<T> > {
   struct GRStatePartialTrait< llvm::ImmutableList<T> > {
     typedef llvm::ImmutableList<T>            data_type;
     typedef llvm::ImmutableList<T>            data_type;
     typedef T                                 key_type;
     typedef T                                 key_type;
-    typedef typename data_type::Factory&      context_type;  
-    
+    typedef typename data_type::Factory&      context_type;
+
     static data_type Add(data_type L, key_type K, context_type F) {
     static data_type Add(data_type L, key_type K, context_type F) {
       return F.Add(K, L);
       return F.Add(K, L);
     }
     }
-    
+
     static inline data_type MakeData(void* const* p) {
     static inline data_type MakeData(void* const* p) {
-      return p ? data_type((const llvm::ImmutableListImpl<T>*) *p) 
+      return p ? data_type((const llvm::ImmutableListImpl<T>*) *p)
                : data_type(0);
                : data_type(0);
-    }  
-    
+    }
+
     static inline void* MakeVoidPtr(data_type D) {
     static inline void* MakeVoidPtr(data_type D) {
       return  (void*) D.getInternalPointer();
       return  (void*) D.getInternalPointer();
-    }  
-    
+    }
+
     static inline context_type MakeContext(void* p) {
     static inline context_type MakeContext(void* p) {
       return *((typename data_type::Factory*) p);
       return *((typename data_type::Factory*) p);
     }
     }
-    
+
     static void* CreateContext(llvm::BumpPtrAllocator& Alloc) {
     static void* CreateContext(llvm::BumpPtrAllocator& Alloc) {
-      return new typename data_type::Factory(Alloc);      
+      return new typename data_type::Factory(Alloc);
     }
     }
-    
+
     static void DeleteContext(void* Ctx) {
     static void DeleteContext(void* Ctx) {
       delete (typename data_type::Factory*) Ctx;
       delete (typename data_type::Factory*) Ctx;
-    }      
+    }
   };
   };
 } // end clang namespace
 } // end clang namespace
 
 

+ 9 - 9
include/clang/Analysis/PathSensitive/GRSubEngine.h

@@ -7,7 +7,7 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 //
 //
-// This file defines the interface of a subengine of the GRCoreEngine. 
+// This file defines the interface of a subengine of the GRCoreEngine.
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 #ifndef LLVM_CLANG_ANALYSIS_GRSUBENGINE_H
 #ifndef LLVM_CLANG_ANALYSIS_GRSUBENGINE_H
@@ -36,28 +36,28 @@ public:
   virtual GRStateManager& getStateManager() = 0;
   virtual GRStateManager& getStateManager() = 0;
 
 
   /// ProcessStmt - Called by GRCoreEngine. Used to generate new successor
   /// ProcessStmt - Called by GRCoreEngine. Used to generate new successor
-  ///  nodes by processing the 'effects' of a block-level statement.  
-  virtual void ProcessStmt(Stmt* S, GRStmtNodeBuilder& builder) = 0; 
-  
+  ///  nodes by processing the 'effects' of a block-level statement.
+  virtual void ProcessStmt(Stmt* S, GRStmtNodeBuilder& builder) = 0;
+
   /// ProcessBlockEntrance - Called by GRCoreEngine when start processing
   /// ProcessBlockEntrance - Called by GRCoreEngine when start processing
   ///  a CFGBlock.  This method returns true if the analysis should continue
   ///  a CFGBlock.  This method returns true if the analysis should continue
   ///  exploring the given path, and false otherwise.
   ///  exploring the given path, and false otherwise.
   virtual bool ProcessBlockEntrance(CFGBlock* B, const GRState* St,
   virtual bool ProcessBlockEntrance(CFGBlock* B, const GRState* St,
                                     GRBlockCounter BC) = 0;
                                     GRBlockCounter BC) = 0;
-  
+
   /// ProcessBranch - Called by GRCoreEngine.  Used to generate successor
   /// ProcessBranch - Called by GRCoreEngine.  Used to generate successor
   ///  nodes by processing the 'effects' of a branch condition.
   ///  nodes by processing the 'effects' of a branch condition.
-  virtual void ProcessBranch(Stmt* Condition, Stmt* Term, 
+  virtual void ProcessBranch(Stmt* Condition, Stmt* Term,
                              GRBranchNodeBuilder& builder) = 0;
                              GRBranchNodeBuilder& builder) = 0;
-  
+
   /// ProcessIndirectGoto - Called by GRCoreEngine.  Used to generate successor
   /// ProcessIndirectGoto - Called by GRCoreEngine.  Used to generate successor
   ///  nodes by processing the 'effects' of a computed goto jump.
   ///  nodes by processing the 'effects' of a computed goto jump.
   virtual void ProcessIndirectGoto(GRIndirectGotoNodeBuilder& builder) = 0;
   virtual void ProcessIndirectGoto(GRIndirectGotoNodeBuilder& builder) = 0;
-  
+
   /// ProcessSwitch - Called by GRCoreEngine.  Used to generate successor
   /// ProcessSwitch - Called by GRCoreEngine.  Used to generate successor
   ///  nodes by processing the 'effects' of a switch statement.
   ///  nodes by processing the 'effects' of a switch statement.
   virtual void ProcessSwitch(GRSwitchNodeBuilder& builder) = 0;
   virtual void ProcessSwitch(GRSwitchNodeBuilder& builder) = 0;
-  
+
   /// ProcessEndPath - Called by GRCoreEngine.  Used to generate end-of-path
   /// ProcessEndPath - Called by GRCoreEngine.  Used to generate end-of-path
   ///  nodes when the control reaches the end of a function.
   ///  nodes when the control reaches the end of a function.
   virtual void ProcessEndPath(GREndPathNodeBuilder& builder) = 0;
   virtual void ProcessEndPath(GREndPathNodeBuilder& builder) = 0;

+ 16 - 16
include/clang/Analysis/PathSensitive/GRTransferFuncs.h

@@ -21,66 +21,66 @@
 #include <vector>
 #include <vector>
 
 
 namespace clang {
 namespace clang {
-  
+
 class GRExprEngine;
 class GRExprEngine;
 class BugReporter;
 class BugReporter;
 class ObjCMessageExpr;
 class ObjCMessageExpr;
 class GRStmtNodeBuilderRef;
 class GRStmtNodeBuilderRef;
-  
+
 class GRTransferFuncs {
 class GRTransferFuncs {
 public:
 public:
   GRTransferFuncs() {}
   GRTransferFuncs() {}
   virtual ~GRTransferFuncs() {}
   virtual ~GRTransferFuncs() {}
-  
+
   virtual void RegisterPrinters(std::vector<GRState::Printer*>& Printers) {}
   virtual void RegisterPrinters(std::vector<GRState::Printer*>& Printers) {}
   virtual void RegisterChecks(BugReporter& BR) {}
   virtual void RegisterChecks(BugReporter& BR) {}
-  
+
 
 
   // Calls.
   // Calls.
-  
+
   virtual void EvalCall(ExplodedNodeSet& Dst,
   virtual void EvalCall(ExplodedNodeSet& Dst,
                         GRExprEngine& Engine,
                         GRExprEngine& Engine,
                         GRStmtNodeBuilder& Builder,
                         GRStmtNodeBuilder& Builder,
                         CallExpr* CE, SVal L,
                         CallExpr* CE, SVal L,
                         ExplodedNode* Pred) {}
                         ExplodedNode* Pred) {}
-  
+
   virtual void EvalObjCMessageExpr(ExplodedNodeSet& Dst,
   virtual void EvalObjCMessageExpr(ExplodedNodeSet& Dst,
                                    GRExprEngine& Engine,
                                    GRExprEngine& Engine,
                                    GRStmtNodeBuilder& Builder,
                                    GRStmtNodeBuilder& Builder,
                                    ObjCMessageExpr* ME,
                                    ObjCMessageExpr* ME,
                                    ExplodedNode* Pred) {}
                                    ExplodedNode* Pred) {}
-  
+
   // Stores.
   // Stores.
-  
+
   virtual void EvalBind(GRStmtNodeBuilderRef& B, SVal location, SVal val) {}
   virtual void EvalBind(GRStmtNodeBuilderRef& B, SVal location, SVal val) {}
-  
+
   // End-of-path and dead symbol notification.
   // End-of-path and dead symbol notification.
-  
+
   virtual void EvalEndPath(GRExprEngine& Engine,
   virtual void EvalEndPath(GRExprEngine& Engine,
                            GREndPathNodeBuilder& Builder) {}
                            GREndPathNodeBuilder& Builder) {}
-  
-  
+
+
   virtual void EvalDeadSymbols(ExplodedNodeSet& Dst,
   virtual void EvalDeadSymbols(ExplodedNodeSet& Dst,
                                GRExprEngine& Engine,
                                GRExprEngine& Engine,
                                GRStmtNodeBuilder& Builder,
                                GRStmtNodeBuilder& Builder,
                                ExplodedNode* Pred,
                                ExplodedNode* Pred,
                                Stmt* S, const GRState* state,
                                Stmt* S, const GRState* state,
                                SymbolReaper& SymReaper) {}
                                SymbolReaper& SymReaper) {}
-  
-  // Return statements.  
+
+  // Return statements.
   virtual void EvalReturn(ExplodedNodeSet& Dst,
   virtual void EvalReturn(ExplodedNodeSet& Dst,
                           GRExprEngine& Engine,
                           GRExprEngine& Engine,
                           GRStmtNodeBuilder& Builder,
                           GRStmtNodeBuilder& Builder,
                           ReturnStmt* S,
                           ReturnStmt* S,
                           ExplodedNode* Pred) {}
                           ExplodedNode* Pred) {}
 
 
-  // Assumptions.  
+  // Assumptions.
   virtual const GRState* EvalAssume(const GRState *state,
   virtual const GRState* EvalAssume(const GRState *state,
                                     SVal Cond, bool Assumption) {
                                     SVal Cond, bool Assumption) {
     return state;
     return state;
   }
   }
 };
 };
-  
+
 } // end clang namespace
 } // end clang namespace
 
 
 #endif
 #endif

+ 13 - 13
include/clang/Analysis/PathSensitive/GRWorkList.h

@@ -1,5 +1,5 @@
 //==- GRWorkList.h - Worklist class used by GRCoreEngine -----------*- C++ -*-//
 //==- GRWorkList.h - Worklist class used by GRCoreEngine -----------*- C++ -*-//
-//             
+//
 //                     The LLVM Compiler Infrastructure
 //                     The LLVM Compiler Infrastructure
 //
 //
 // This file is distributed under the University of Illinois Open Source
 // This file is distributed under the University of Illinois Open Source
@@ -17,16 +17,16 @@
 
 
 #include "clang/Analysis/PathSensitive/GRBlockCounter.h"
 #include "clang/Analysis/PathSensitive/GRBlockCounter.h"
 
 
-namespace clang {  
+namespace clang {
 
 
 class ExplodedNodeImpl;
 class ExplodedNodeImpl;
-  
+
 class GRWorkListUnit {
 class GRWorkListUnit {
   ExplodedNode* Node;
   ExplodedNode* Node;
   GRBlockCounter Counter;
   GRBlockCounter Counter;
   CFGBlock* Block;
   CFGBlock* Block;
   unsigned BlockIdx;
   unsigned BlockIdx;
-  
+
 public:
 public:
   GRWorkListUnit(ExplodedNode* N, GRBlockCounter C,
   GRWorkListUnit(ExplodedNode* N, GRBlockCounter C,
                  CFGBlock* B, unsigned idx)
                  CFGBlock* B, unsigned idx)
@@ -34,13 +34,13 @@ public:
     Counter(C),
     Counter(C),
     Block(B),
     Block(B),
     BlockIdx(idx) {}
     BlockIdx(idx) {}
-  
+
   explicit GRWorkListUnit(ExplodedNode* N, GRBlockCounter C)
   explicit GRWorkListUnit(ExplodedNode* N, GRBlockCounter C)
   : Node(N),
   : Node(N),
     Counter(C),
     Counter(C),
     Block(NULL),
     Block(NULL),
     BlockIdx(0) {}
     BlockIdx(0) {}
-  
+
   ExplodedNode* getNode()         const { return Node; }
   ExplodedNode* getNode()         const { return Node; }
   GRBlockCounter    getBlockCounter() const { return Counter; }
   GRBlockCounter    getBlockCounter() const { return Counter; }
   CFGBlock*         getBlock()        const { return Block; }
   CFGBlock*         getBlock()        const { return Block; }
@@ -52,25 +52,25 @@ class GRWorkList {
 public:
 public:
   virtual ~GRWorkList();
   virtual ~GRWorkList();
   virtual bool hasWork() const = 0;
   virtual bool hasWork() const = 0;
-    
+
   virtual void Enqueue(const GRWorkListUnit& U) = 0;
   virtual void Enqueue(const GRWorkListUnit& U) = 0;
 
 
-  void Enqueue(ExplodedNode* N, CFGBlock& B, unsigned idx) {    
+  void Enqueue(ExplodedNode* N, CFGBlock& B, unsigned idx) {
     Enqueue(GRWorkListUnit(N, CurrentCounter, &B, idx));
     Enqueue(GRWorkListUnit(N, CurrentCounter, &B, idx));
   }
   }
-  
+
   void Enqueue(ExplodedNode* N) {
   void Enqueue(ExplodedNode* N) {
     Enqueue(GRWorkListUnit(N, CurrentCounter));
     Enqueue(GRWorkListUnit(N, CurrentCounter));
   }
   }
-  
+
   virtual GRWorkListUnit Dequeue() = 0;
   virtual GRWorkListUnit Dequeue() = 0;
-  
+
   void setBlockCounter(GRBlockCounter C) { CurrentCounter = C; }
   void setBlockCounter(GRBlockCounter C) { CurrentCounter = C; }
   GRBlockCounter getBlockCounter() const { return CurrentCounter; }
   GRBlockCounter getBlockCounter() const { return CurrentCounter; }
-  
+
   static GRWorkList *MakeDFS();
   static GRWorkList *MakeDFS();
   static GRWorkList *MakeBFS();
   static GRWorkList *MakeBFS();
   static GRWorkList *MakeBFSBlockDFSContents();
   static GRWorkList *MakeBFSBlockDFSContents();
 };
 };
-} // end clang namespace  
+} // end clang namespace
 #endif
 #endif

+ 141 - 141
include/clang/Analysis/PathSensitive/MemRegion.h

@@ -31,15 +31,15 @@
 namespace llvm { class raw_ostream; }
 namespace llvm { class raw_ostream; }
 
 
 namespace clang {
 namespace clang {
- 
+
 class MemRegionManager;
 class MemRegionManager;
 class MemSpaceRegion;
 class MemSpaceRegion;
 class LocationContext;
 class LocationContext;
-      
+
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // Base region classes.
 // Base region classes.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
-  
+
 /// MemRegion - The root abstract class for all memory regions.
 /// MemRegion - The root abstract class for all memory regions.
 class MemRegion : public llvm::FoldingSetNode {
 class MemRegion : public llvm::FoldingSetNode {
 public:
 public:
@@ -56,52 +56,52 @@ public:
                   VarRegionKind, FieldRegionKind,
                   VarRegionKind, FieldRegionKind,
                   ObjCIvarRegionKind, ObjCObjectRegionKind,
                   ObjCIvarRegionKind, ObjCObjectRegionKind,
                  END_DECL_REGIONS,
                  END_DECL_REGIONS,
-              END_TYPED_REGIONS };  
+              END_TYPED_REGIONS };
 private:
 private:
   const Kind kind;
   const Kind kind;
-  
+
 protected:
 protected:
   MemRegion(Kind k) : kind(k) {}
   MemRegion(Kind k) : kind(k) {}
   virtual ~MemRegion();
   virtual ~MemRegion();
 
 
 public:
 public:
   ASTContext &getContext() const;
   ASTContext &getContext() const;
-  
+
   virtual void Profile(llvm::FoldingSetNodeID& ID) const = 0;
   virtual void Profile(llvm::FoldingSetNodeID& ID) const = 0;
 
 
   virtual MemRegionManager* getMemRegionManager() const = 0;
   virtual MemRegionManager* getMemRegionManager() const = 0;
 
 
   std::string getString() const;
   std::string getString() const;
-  
+
   const MemSpaceRegion *getMemorySpace() const;
   const MemSpaceRegion *getMemorySpace() const;
-  
+
   const MemRegion *getBaseRegion() const;
   const MemRegion *getBaseRegion() const;
-    
+
   bool hasStackStorage() const;
   bool hasStackStorage() const;
-  
+
   bool hasParametersStorage() const;
   bool hasParametersStorage() const;
-  
+
   bool hasGlobalsStorage() const;
   bool hasGlobalsStorage() const;
-  
+
   bool hasGlobalsOrParametersStorage() const;
   bool hasGlobalsOrParametersStorage() const;
-  
+
   bool hasHeapStorage() const;
   bool hasHeapStorage() const;
-  
+
   bool hasHeapOrStackStorage() const;
   bool hasHeapOrStackStorage() const;
 
 
   virtual void dumpToStream(llvm::raw_ostream& os) const;
   virtual void dumpToStream(llvm::raw_ostream& os) const;
 
 
   void dump() const;
   void dump() const;
-  
-  Kind getKind() const { return kind; }  
-  
+
+  Kind getKind() const { return kind; }
+
   template<typename RegionTy> const RegionTy* getAs() const;
   template<typename RegionTy> const RegionTy* getAs() const;
-  
+
   virtual bool isBoundable() const { return false; }
   virtual bool isBoundable() const { return false; }
 
 
   static bool classof(const MemRegion*) { return true; }
   static bool classof(const MemRegion*) { return true; }
 };
 };
-  
+
 /// MemSpaceRegion - A memory region that represents and "memory space";
 /// MemSpaceRegion - A memory region that represents and "memory space";
 ///  for example, the set of global variables, the stack frame, etc.
 ///  for example, the set of global variables, the stack frame, etc.
 class MemSpaceRegion : public MemRegion {
 class MemSpaceRegion : public MemRegion {
@@ -112,7 +112,7 @@ protected:
 
 
   MemSpaceRegion(MemRegionManager *mgr) : MemRegion(MemSpaceRegionKind),
   MemSpaceRegion(MemRegionManager *mgr) : MemRegion(MemSpaceRegionKind),
                                           Mgr(mgr) {}
                                           Mgr(mgr) {}
-  
+
   MemRegionManager* getMemRegionManager() const {
   MemRegionManager* getMemRegionManager() const {
     return Mgr;
     return Mgr;
   }
   }
@@ -131,28 +131,28 @@ public:
 ///  are subclasses of SubRegion.
 ///  are subclasses of SubRegion.
 class SubRegion : public MemRegion {
 class SubRegion : public MemRegion {
 protected:
 protected:
-  const MemRegion* superRegion;  
+  const MemRegion* superRegion;
   SubRegion(const MemRegion* sReg, Kind k) : MemRegion(k), superRegion(sReg) {}
   SubRegion(const MemRegion* sReg, Kind k) : MemRegion(k), superRegion(sReg) {}
 public:
 public:
   const MemRegion* getSuperRegion() const {
   const MemRegion* getSuperRegion() const {
     return superRegion;
     return superRegion;
   }
   }
-  
+
   MemRegionManager* getMemRegionManager() const;
   MemRegionManager* getMemRegionManager() const;
-  
+
   bool isSubRegionOf(const MemRegion* R) const;
   bool isSubRegionOf(const MemRegion* R) const;
-  
+
   static bool classof(const MemRegion* R) {
   static bool classof(const MemRegion* R) {
     return R->getKind() > MemSpaceRegionKind;
     return R->getKind() > MemSpaceRegionKind;
   }
   }
 };
 };
- 
+
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // Auxillary data classes for use with MemRegions.
 // Auxillary data classes for use with MemRegions.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
 class ElementRegion;
 class ElementRegion;
-  
+
 class RegionRawOffset : public std::pair<const MemRegion*, int64_t> {
 class RegionRawOffset : public std::pair<const MemRegion*, int64_t> {
 private:
 private:
   friend class ElementRegion;
   friend class ElementRegion;
@@ -160,7 +160,7 @@ private:
   RegionRawOffset(const MemRegion* reg, int64_t offset = 0)
   RegionRawOffset(const MemRegion* reg, int64_t offset = 0)
     : std::pair<const MemRegion*, int64_t>(reg, offset) {}
     : std::pair<const MemRegion*, int64_t>(reg, offset) {}
 
 
-public: 
+public:
   // FIXME: Eventually support symbolic offsets.
   // FIXME: Eventually support symbolic offsets.
   int64_t getByteOffset() const { return second; }
   int64_t getByteOffset() const { return second; }
   const MemRegion *getRegion() const { return first; }
   const MemRegion *getRegion() const { return first; }
@@ -171,7 +171,7 @@ public:
 
 
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // MemRegion subclasses.
 // MemRegion subclasses.
-//===----------------------------------------------------------------------===//  
+//===----------------------------------------------------------------------===//
 
 
 /// AllocaRegion - A region that represents an untyped blob of bytes created
 /// AllocaRegion - A region that represents an untyped blob of bytes created
 ///  by a call to 'alloca'.
 ///  by a call to 'alloca'.
@@ -184,9 +184,9 @@ protected:
 
 
   AllocaRegion(const Expr* ex, unsigned cnt, const MemRegion *superRegion)
   AllocaRegion(const Expr* ex, unsigned cnt, const MemRegion *superRegion)
     : SubRegion(superRegion, AllocaRegionKind), Cnt(cnt), Ex(ex) {}
     : SubRegion(superRegion, AllocaRegionKind), Cnt(cnt), Ex(ex) {}
-  
+
 public:
 public:
-  
+
   const Expr* getExpr() const { return Ex; }
   const Expr* getExpr() const { return Ex; }
 
 
   bool isBoundable() const { return true; }
   bool isBoundable() const { return true; }
@@ -195,32 +195,32 @@ public:
 
 
   static void ProfileRegion(llvm::FoldingSetNodeID& ID, const Expr* Ex,
   static void ProfileRegion(llvm::FoldingSetNodeID& ID, const Expr* Ex,
                             unsigned Cnt, const MemRegion *superRegion);
                             unsigned Cnt, const MemRegion *superRegion);
-  
+
   void dumpToStream(llvm::raw_ostream& os) const;
   void dumpToStream(llvm::raw_ostream& os) const;
-  
+
   static bool classof(const MemRegion* R) {
   static bool classof(const MemRegion* R) {
     return R->getKind() == AllocaRegionKind;
     return R->getKind() == AllocaRegionKind;
   }
   }
-};    
-  
+};
+
 /// TypedRegion - An abstract class representing regions that are typed.
 /// TypedRegion - An abstract class representing regions that are typed.
 class TypedRegion : public SubRegion {
 class TypedRegion : public SubRegion {
 protected:
 protected:
   TypedRegion(const MemRegion* sReg, Kind k) : SubRegion(sReg, k) {}
   TypedRegion(const MemRegion* sReg, Kind k) : SubRegion(sReg, k) {}
-  
+
 public:
 public:
   virtual QualType getValueType(ASTContext &C) const = 0;
   virtual QualType getValueType(ASTContext &C) const = 0;
-  
+
   virtual QualType getLocationType(ASTContext& C) const {
   virtual QualType getLocationType(ASTContext& C) const {
     // FIXME: We can possibly optimize this later to cache this value.
     // FIXME: We can possibly optimize this later to cache this value.
     return C.getPointerType(getValueType(C));
     return C.getPointerType(getValueType(C));
   }
   }
-  
+
   QualType getDesugaredValueType(ASTContext& C) const {
   QualType getDesugaredValueType(ASTContext& C) const {
     QualType T = getValueType(C);
     QualType T = getValueType(C);
     return T.getTypePtr() ? T->getDesugaredType() : T;
     return T.getTypePtr() ? T->getDesugaredType() : T;
   }
   }
-  
+
   QualType getDesugaredLocationType(ASTContext& C) const {
   QualType getDesugaredLocationType(ASTContext& C) const {
     return getLocationType(C)->getDesugaredType();
     return getLocationType(C)->getDesugaredType();
   }
   }
@@ -260,9 +260,9 @@ public:
   const FunctionDecl *getDecl() const {
   const FunctionDecl *getDecl() const {
     return FD;
     return FD;
   }
   }
-    
+
   bool isBoundable() const { return false; }
   bool isBoundable() const { return false; }
-  
+
   virtual void dumpToStream(llvm::raw_ostream& os) const;
   virtual void dumpToStream(llvm::raw_ostream& os) const;
 
 
   void Profile(llvm::FoldingSetNodeID& ID) const;
   void Profile(llvm::FoldingSetNodeID& ID) const;
@@ -285,9 +285,9 @@ protected:
   const SymbolRef sym;
   const SymbolRef sym;
 
 
 public:
 public:
-  SymbolicRegion(const SymbolRef s, const MemRegion* sreg) 
+  SymbolicRegion(const SymbolRef s, const MemRegion* sreg)
     : SubRegion(sreg, SymbolicRegionKind), sym(s) {}
     : SubRegion(sreg, SymbolicRegionKind), sym(s) {}
-    
+
   SymbolRef getSymbol() const {
   SymbolRef getSymbol() const {
     return sym;
     return sym;
   }
   }
@@ -299,13 +299,13 @@ public:
   static void ProfileRegion(llvm::FoldingSetNodeID& ID,
   static void ProfileRegion(llvm::FoldingSetNodeID& ID,
                             SymbolRef sym,
                             SymbolRef sym,
                             const MemRegion* superRegion);
                             const MemRegion* superRegion);
-  
+
   void dumpToStream(llvm::raw_ostream& os) const;
   void dumpToStream(llvm::raw_ostream& os) const;
-  
+
   static bool classof(const MemRegion* R) {
   static bool classof(const MemRegion* R) {
     return R->getKind() == SymbolicRegionKind;
     return R->getKind() == SymbolicRegionKind;
   }
   }
-};  
+};
 
 
 /// StringRegion - Region associated with a StringLiteral.
 /// StringRegion - Region associated with a StringLiteral.
 class StringRegion : public TypedRegion {
 class StringRegion : public TypedRegion {
@@ -323,7 +323,7 @@ protected:
 public:
 public:
 
 
   const StringLiteral* getStringLiteral() const { return Str; }
   const StringLiteral* getStringLiteral() const { return Str; }
-    
+
   QualType getValueType(ASTContext& C) const {
   QualType getValueType(ASTContext& C) const {
     return Str->getType();
     return Str->getType();
   }
   }
@@ -351,7 +351,7 @@ private:
 
 
   CompoundLiteralRegion(const CompoundLiteralExpr* cl, const MemRegion* sReg)
   CompoundLiteralRegion(const CompoundLiteralExpr* cl, const MemRegion* sReg)
     : TypedRegion(sReg, CompoundLiteralRegionKind), CL(cl) {}
     : TypedRegion(sReg, CompoundLiteralRegionKind), CL(cl) {}
-  
+
   static void ProfileRegion(llvm::FoldingSetNodeID& ID,
   static void ProfileRegion(llvm::FoldingSetNodeID& ID,
                             const CompoundLiteralExpr* CL,
                             const CompoundLiteralExpr* CL,
                             const MemRegion* superRegion);
                             const MemRegion* superRegion);
@@ -363,11 +363,11 @@ public:
   bool isBoundable() const { return !CL->isFileScope(); }
   bool isBoundable() const { return !CL->isFileScope(); }
 
 
   void Profile(llvm::FoldingSetNodeID& ID) const;
   void Profile(llvm::FoldingSetNodeID& ID) const;
-  
+
   void dumpToStream(llvm::raw_ostream& os) const;
   void dumpToStream(llvm::raw_ostream& os) const;
 
 
   const CompoundLiteralExpr* getLiteralExpr() const { return CL; }
   const CompoundLiteralExpr* getLiteralExpr() const { return CL; }
-  
+
   static bool classof(const MemRegion* R) {
   static bool classof(const MemRegion* R) {
     return R->getKind() == CompoundLiteralRegionKind;
     return R->getKind() == CompoundLiteralRegionKind;
   }
   }
@@ -382,23 +382,23 @@ protected:
 
 
   static void ProfileRegion(llvm::FoldingSetNodeID& ID, const Decl* D,
   static void ProfileRegion(llvm::FoldingSetNodeID& ID, const Decl* D,
                       const MemRegion* superRegion, Kind k);
                       const MemRegion* superRegion, Kind k);
-  
+
 public:
 public:
   const Decl* getDecl() const { return D; }
   const Decl* getDecl() const { return D; }
   void Profile(llvm::FoldingSetNodeID& ID) const;
   void Profile(llvm::FoldingSetNodeID& ID) const;
-      
+
   static bool classof(const MemRegion* R) {
   static bool classof(const MemRegion* R) {
     unsigned k = R->getKind();
     unsigned k = R->getKind();
     return k > BEG_DECL_REGIONS && k < END_DECL_REGIONS;
     return k > BEG_DECL_REGIONS && k < END_DECL_REGIONS;
   }
   }
 };
 };
-  
+
 class VarRegion : public DeclRegion {
 class VarRegion : public DeclRegion {
   friend class MemRegionManager;
   friend class MemRegionManager;
 
 
   // Data.
   // Data.
   const LocationContext *LC;
   const LocationContext *LC;
-  
+
   // Constructors and private methods.
   // Constructors and private methods.
   VarRegion(const VarDecl* vd, const LocationContext *lC, const MemRegion* sReg)
   VarRegion(const VarDecl* vd, const LocationContext *lC, const MemRegion* sReg)
     : DeclRegion(vd, sReg, VarRegionKind), LC(lC) {}
     : DeclRegion(vd, sReg, VarRegionKind), LC(lC) {}
@@ -409,24 +409,24 @@ class VarRegion : public DeclRegion {
     DeclRegion::ProfileRegion(ID, VD, superRegion, VarRegionKind);
     DeclRegion::ProfileRegion(ID, VD, superRegion, VarRegionKind);
     ID.AddPointer(LC);
     ID.AddPointer(LC);
   }
   }
-  
+
   void Profile(llvm::FoldingSetNodeID& ID) const;
   void Profile(llvm::FoldingSetNodeID& ID) const;
-  
-public:  
+
+public:
   const VarDecl *getDecl() const { return cast<VarDecl>(D); }
   const VarDecl *getDecl() const { return cast<VarDecl>(D); }
-  
+
   const LocationContext *getLocationContext() const { return LC; }
   const LocationContext *getLocationContext() const { return LC; }
-  
-  QualType getValueType(ASTContext& C) const { 
+
+  QualType getValueType(ASTContext& C) const {
     // FIXME: We can cache this if needed.
     // FIXME: We can cache this if needed.
     return C.getCanonicalType(getDecl()->getType());
     return C.getCanonicalType(getDecl()->getType());
-  }    
-    
+  }
+
   void dumpToStream(llvm::raw_ostream& os) const;
   void dumpToStream(llvm::raw_ostream& os) const;
-  
+
   static bool classof(const MemRegion* R) {
   static bool classof(const MemRegion* R) {
     return R->getKind() == VarRegionKind;
     return R->getKind() == VarRegionKind;
-  }  
+  }
 };
 };
 
 
 class FieldRegion : public DeclRegion {
 class FieldRegion : public DeclRegion {
@@ -436,57 +436,57 @@ class FieldRegion : public DeclRegion {
     : DeclRegion(fd, sReg, FieldRegionKind) {}
     : DeclRegion(fd, sReg, FieldRegionKind) {}
 
 
 public:
 public:
-  
+
   void dumpToStream(llvm::raw_ostream& os) const;
   void dumpToStream(llvm::raw_ostream& os) const;
-  
+
   const FieldDecl* getDecl() const { return cast<FieldDecl>(D); }
   const FieldDecl* getDecl() const { return cast<FieldDecl>(D); }
-    
-  QualType getValueType(ASTContext& C) const { 
+
+  QualType getValueType(ASTContext& C) const {
     // FIXME: We can cache this if needed.
     // FIXME: We can cache this if needed.
     return C.getCanonicalType(getDecl()->getType());
     return C.getCanonicalType(getDecl()->getType());
-  }    
+  }
 
 
   static void ProfileRegion(llvm::FoldingSetNodeID& ID, const FieldDecl* FD,
   static void ProfileRegion(llvm::FoldingSetNodeID& ID, const FieldDecl* FD,
                             const MemRegion* superRegion) {
                             const MemRegion* superRegion) {
     DeclRegion::ProfileRegion(ID, FD, superRegion, FieldRegionKind);
     DeclRegion::ProfileRegion(ID, FD, superRegion, FieldRegionKind);
   }
   }
-    
+
   static bool classof(const MemRegion* R) {
   static bool classof(const MemRegion* R) {
     return R->getKind() == FieldRegionKind;
     return R->getKind() == FieldRegionKind;
   }
   }
 };
 };
-  
+
 class ObjCObjectRegion : public DeclRegion {
 class ObjCObjectRegion : public DeclRegion {
-  
+
   friend class MemRegionManager;
   friend class MemRegionManager;
-  
+
   ObjCObjectRegion(const ObjCInterfaceDecl* ivd, const MemRegion* sReg)
   ObjCObjectRegion(const ObjCInterfaceDecl* ivd, const MemRegion* sReg)
   : DeclRegion(ivd, sReg, ObjCObjectRegionKind) {}
   : DeclRegion(ivd, sReg, ObjCObjectRegionKind) {}
-  
+
   static void ProfileRegion(llvm::FoldingSetNodeID& ID,
   static void ProfileRegion(llvm::FoldingSetNodeID& ID,
                             const ObjCInterfaceDecl* ivd,
                             const ObjCInterfaceDecl* ivd,
                             const MemRegion* superRegion) {
                             const MemRegion* superRegion) {
     DeclRegion::ProfileRegion(ID, ivd, superRegion, ObjCObjectRegionKind);
     DeclRegion::ProfileRegion(ID, ivd, superRegion, ObjCObjectRegionKind);
   }
   }
-  
+
 public:
 public:
   const ObjCInterfaceDecl* getInterface() const {
   const ObjCInterfaceDecl* getInterface() const {
     return cast<ObjCInterfaceDecl>(D);
     return cast<ObjCInterfaceDecl>(D);
   }
   }
-  
+
   QualType getValueType(ASTContext& C) const {
   QualType getValueType(ASTContext& C) const {
     return C.getObjCInterfaceType(getInterface());
     return C.getObjCInterfaceType(getInterface());
   }
   }
-  
+
   static bool classof(const MemRegion* R) {
   static bool classof(const MemRegion* R) {
     return R->getKind() == ObjCObjectRegionKind;
     return R->getKind() == ObjCObjectRegionKind;
   }
   }
-};  
-  
+};
+
 class ObjCIvarRegion : public DeclRegion {
 class ObjCIvarRegion : public DeclRegion {
-  
+
   friend class MemRegionManager;
   friend class MemRegionManager;
-  
+
   ObjCIvarRegion(const ObjCIvarDecl* ivd, const MemRegion* sReg)
   ObjCIvarRegion(const ObjCIvarDecl* ivd, const MemRegion* sReg)
     : DeclRegion(ivd, sReg, ObjCIvarRegionKind) {}
     : DeclRegion(ivd, sReg, ObjCIvarRegionKind) {}
 
 
@@ -494,13 +494,13 @@ class ObjCIvarRegion : public DeclRegion {
                             const MemRegion* superRegion) {
                             const MemRegion* superRegion) {
     DeclRegion::ProfileRegion(ID, ivd, superRegion, ObjCIvarRegionKind);
     DeclRegion::ProfileRegion(ID, ivd, superRegion, ObjCIvarRegionKind);
   }
   }
-  
+
 public:
 public:
   const ObjCIvarDecl* getDecl() const { return cast<ObjCIvarDecl>(D); }
   const ObjCIvarDecl* getDecl() const { return cast<ObjCIvarDecl>(D); }
   QualType getValueType(ASTContext&) const { return getDecl()->getType(); }
   QualType getValueType(ASTContext&) const { return getDecl()->getType(); }
-  
+
   void dumpToStream(llvm::raw_ostream& os) const;
   void dumpToStream(llvm::raw_ostream& os) const;
-  
+
   static bool classof(const MemRegion* R) {
   static bool classof(const MemRegion* R) {
     return R->getKind() == ObjCIvarRegionKind;
     return R->getKind() == ObjCIvarRegionKind;
   }
   }
@@ -519,7 +519,7 @@ class ElementRegion : public TypedRegion {
            cast<nonloc::ConcreteInt>(&Idx)->getValue().isSigned()) &&
            cast<nonloc::ConcreteInt>(&Idx)->getValue().isSigned()) &&
            "The index must be signed");
            "The index must be signed");
   }
   }
-  
+
   static void ProfileRegion(llvm::FoldingSetNodeID& ID, QualType elementType,
   static void ProfileRegion(llvm::FoldingSetNodeID& ID, QualType elementType,
                             SVal Idx, const MemRegion* superRegion);
                             SVal Idx, const MemRegion* superRegion);
 
 
@@ -530,13 +530,13 @@ public:
   QualType getValueType(ASTContext&) const {
   QualType getValueType(ASTContext&) const {
     return ElementType;
     return ElementType;
   }
   }
-  
+
   QualType getElementType() const {
   QualType getElementType() const {
     return ElementType;
     return ElementType;
   }
   }
-  
+
   RegionRawOffset getAsRawOffset() const;
   RegionRawOffset getAsRawOffset() const;
-  
+
   void dumpToStream(llvm::raw_ostream& os) const;
   void dumpToStream(llvm::raw_ostream& os) const;
 
 
   void Profile(llvm::FoldingSetNodeID& ID) const;
   void Profile(llvm::FoldingSetNodeID& ID) const;
@@ -550,7 +550,7 @@ template<typename RegionTy>
 const RegionTy* MemRegion::getAs() const {
 const RegionTy* MemRegion::getAs() const {
   if (const RegionTy* RT = dyn_cast<RegionTy>(this))
   if (const RegionTy* RT = dyn_cast<RegionTy>(this))
     return RT;
     return RT;
-  
+
   return NULL;
   return NULL;
 }
 }
 
 
@@ -562,7 +562,7 @@ class MemRegionManager {
   ASTContext &C;
   ASTContext &C;
   llvm::BumpPtrAllocator& A;
   llvm::BumpPtrAllocator& A;
   llvm::FoldingSet<MemRegion> Regions;
   llvm::FoldingSet<MemRegion> Regions;
-  
+
   MemSpaceRegion *globals;
   MemSpaceRegion *globals;
   MemSpaceRegion *stack;
   MemSpaceRegion *stack;
   MemSpaceRegion *stackArguments;
   MemSpaceRegion *stackArguments;
@@ -574,11 +574,11 @@ public:
   MemRegionManager(ASTContext &c, llvm::BumpPtrAllocator& a)
   MemRegionManager(ASTContext &c, llvm::BumpPtrAllocator& a)
     : C(c), A(a), globals(0), stack(0), stackArguments(0), heap(0),
     : C(c), A(a), globals(0), stack(0), stackArguments(0), heap(0),
       unknown(0), code(0) {}
       unknown(0), code(0) {}
-  
+
   ~MemRegionManager() {}
   ~MemRegionManager() {}
-  
+
   ASTContext &getContext() { return C; }
   ASTContext &getContext() { return C; }
-  
+
   /// getStackRegion - Retrieve the memory region associated with the
   /// getStackRegion - Retrieve the memory region associated with the
   ///  current stack frame.
   ///  current stack frame.
   MemSpaceRegion *getStackRegion();
   MemSpaceRegion *getStackRegion();
@@ -586,11 +586,11 @@ public:
   /// getStackArgumentsRegion - Retrieve the memory region associated with
   /// getStackArgumentsRegion - Retrieve the memory region associated with
   ///  function/method arguments of the current stack frame.
   ///  function/method arguments of the current stack frame.
   MemSpaceRegion *getStackArgumentsRegion();
   MemSpaceRegion *getStackArgumentsRegion();
-  
+
   /// getGlobalsRegion - Retrieve the memory region associated with
   /// getGlobalsRegion - Retrieve the memory region associated with
   ///  all global variables.
   ///  all global variables.
   MemSpaceRegion *getGlobalsRegion();
   MemSpaceRegion *getGlobalsRegion();
-  
+
   /// getHeapRegion - Retrieve the memory region associated with the
   /// getHeapRegion - Retrieve the memory region associated with the
   ///  generic "heap".
   ///  generic "heap".
   MemSpaceRegion *getHeapRegion();
   MemSpaceRegion *getHeapRegion();
@@ -603,12 +603,12 @@ public:
 
 
   /// getAllocaRegion - Retrieve a region associated with a call to alloca().
   /// getAllocaRegion - Retrieve a region associated with a call to alloca().
   AllocaRegion *getAllocaRegion(const Expr* Ex, unsigned Cnt);
   AllocaRegion *getAllocaRegion(const Expr* Ex, unsigned Cnt);
-  
+
   /// getCompoundLiteralRegion - Retrieve the region associated with a
   /// getCompoundLiteralRegion - Retrieve the region associated with a
   ///  given CompoundLiteral.
   ///  given CompoundLiteral.
   CompoundLiteralRegion*
   CompoundLiteralRegion*
-  getCompoundLiteralRegion(const CompoundLiteralExpr* CL);  
-  
+  getCompoundLiteralRegion(const CompoundLiteralExpr* CL);
+
   /// getSymbolicRegion - Retrieve or create a "symbolic" memory region.
   /// getSymbolicRegion - Retrieve or create a "symbolic" memory region.
   SymbolicRegion* getSymbolicRegion(SymbolRef sym);
   SymbolicRegion* getSymbolicRegion(SymbolRef sym);
 
 
@@ -617,13 +617,13 @@ public:
   /// getVarRegion - Retrieve or create the memory region associated with
   /// getVarRegion - Retrieve or create the memory region associated with
   ///  a specified VarDecl and LocationContext.
   ///  a specified VarDecl and LocationContext.
   VarRegion* getVarRegion(const VarDecl *D, const LocationContext *LC);
   VarRegion* getVarRegion(const VarDecl *D, const LocationContext *LC);
-  
+
   /// getElementRegion - Retrieve the memory region associated with the
   /// getElementRegion - Retrieve the memory region associated with the
   ///  associated element type, index, and super region.
   ///  associated element type, index, and super region.
   ElementRegion *getElementRegion(QualType elementType, SVal Idx,
   ElementRegion *getElementRegion(QualType elementType, SVal Idx,
                                   const MemRegion *superRegion,
                                   const MemRegion *superRegion,
                                   ASTContext &Ctx);
                                   ASTContext &Ctx);
-  
+
   ElementRegion *getElementRegionWithSuper(const ElementRegion *ER,
   ElementRegion *getElementRegionWithSuper(const ElementRegion *ER,
                                            const MemRegion *superRegion) {
                                            const MemRegion *superRegion) {
     return getElementRegion(ER->getElementType(), ER->getIndex(),
     return getElementRegion(ER->getElementType(), ER->getIndex(),
@@ -636,44 +636,44 @@ public:
   ///  a structure or class).
   ///  a structure or class).
   FieldRegion *getFieldRegion(const FieldDecl* fd,
   FieldRegion *getFieldRegion(const FieldDecl* fd,
                               const MemRegion* superRegion);
                               const MemRegion* superRegion);
-  
+
   FieldRegion *getFieldRegionWithSuper(const FieldRegion *FR,
   FieldRegion *getFieldRegionWithSuper(const FieldRegion *FR,
                                        const MemRegion *superRegion) {
                                        const MemRegion *superRegion) {
     return getFieldRegion(FR->getDecl(), superRegion);
     return getFieldRegion(FR->getDecl(), superRegion);
   }
   }
-  
+
   /// getObjCObjectRegion - Retrieve or create the memory region associated with
   /// getObjCObjectRegion - Retrieve or create the memory region associated with
   ///  the instance of a specified Objective-C class.
   ///  the instance of a specified Objective-C class.
   ObjCObjectRegion* getObjCObjectRegion(const ObjCInterfaceDecl* ID,
   ObjCObjectRegion* getObjCObjectRegion(const ObjCInterfaceDecl* ID,
                                   const MemRegion* superRegion);
                                   const MemRegion* superRegion);
-  
+
   /// getObjCIvarRegion - Retrieve or create the memory region associated with
   /// getObjCIvarRegion - Retrieve or create the memory region associated with
   ///   a specified Objective-c instance variable.  'superRegion' corresponds
   ///   a specified Objective-c instance variable.  'superRegion' corresponds
   ///   to the containing region (which typically represents the Objective-C
   ///   to the containing region (which typically represents the Objective-C
   ///   object).
   ///   object).
   ObjCIvarRegion *getObjCIvarRegion(const ObjCIvarDecl* ivd,
   ObjCIvarRegion *getObjCIvarRegion(const ObjCIvarDecl* ivd,
                                     const MemRegion* superRegion);
                                     const MemRegion* superRegion);
-  
+
   CodeTextRegion *getCodeTextRegion(const FunctionDecl *FD);
   CodeTextRegion *getCodeTextRegion(const FunctionDecl *FD);
-  
+
   template <typename RegionTy, typename A1>
   template <typename RegionTy, typename A1>
   RegionTy* getRegion(const A1 a1);
   RegionTy* getRegion(const A1 a1);
-  
+
   template <typename RegionTy, typename A1>
   template <typename RegionTy, typename A1>
   RegionTy* getSubRegion(const A1 a1, const MemRegion* superRegion);
   RegionTy* getSubRegion(const A1 a1, const MemRegion* superRegion);
-  
+
   template <typename RegionTy, typename A1, typename A2>
   template <typename RegionTy, typename A1, typename A2>
   RegionTy* getRegion(const A1 a1, const A2 a2);
   RegionTy* getRegion(const A1 a1, const A2 a2);
 
 
-  bool isGlobalsRegion(const MemRegion* R) { 
+  bool isGlobalsRegion(const MemRegion* R) {
     assert(R);
     assert(R);
-    return R == globals; 
+    return R == globals;
   }
   }
-  
+
 private:
 private:
   MemSpaceRegion* LazyAllocate(MemSpaceRegion*& region);
   MemSpaceRegion* LazyAllocate(MemSpaceRegion*& region);
 };
 };
-  
+
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // Out-of-line member definitions.
 // Out-of-line member definitions.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
@@ -681,69 +681,69 @@ private:
 inline ASTContext& MemRegion::getContext() const {
 inline ASTContext& MemRegion::getContext() const {
   return getMemRegionManager()->getContext();
   return getMemRegionManager()->getContext();
 }
 }
-  
+
 template<typename RegionTy> struct MemRegionManagerTrait;
 template<typename RegionTy> struct MemRegionManagerTrait;
-  
+
 template <typename RegionTy, typename A1>
 template <typename RegionTy, typename A1>
 RegionTy* MemRegionManager::getRegion(const A1 a1) {
 RegionTy* MemRegionManager::getRegion(const A1 a1) {
 
 
   const typename MemRegionManagerTrait<RegionTy>::SuperRegionTy *superRegion =
   const typename MemRegionManagerTrait<RegionTy>::SuperRegionTy *superRegion =
     MemRegionManagerTrait<RegionTy>::getSuperRegion(*this, a1);
     MemRegionManagerTrait<RegionTy>::getSuperRegion(*this, a1);
-  
-  llvm::FoldingSetNodeID ID;  
-  RegionTy::ProfileRegion(ID, a1, superRegion);  
+
+  llvm::FoldingSetNodeID ID;
+  RegionTy::ProfileRegion(ID, a1, superRegion);
   void* InsertPos;
   void* InsertPos;
   RegionTy* R = cast_or_null<RegionTy>(Regions.FindNodeOrInsertPos(ID,
   RegionTy* R = cast_or_null<RegionTy>(Regions.FindNodeOrInsertPos(ID,
                                                                    InsertPos));
                                                                    InsertPos));
-  
+
   if (!R) {
   if (!R) {
     R = (RegionTy*) A.Allocate<RegionTy>();
     R = (RegionTy*) A.Allocate<RegionTy>();
     new (R) RegionTy(a1, superRegion);
     new (R) RegionTy(a1, superRegion);
     Regions.InsertNode(R, InsertPos);
     Regions.InsertNode(R, InsertPos);
   }
   }
-  
+
   return R;
   return R;
 }
 }
 
 
 template <typename RegionTy, typename A1>
 template <typename RegionTy, typename A1>
 RegionTy* MemRegionManager::getSubRegion(const A1 a1,
 RegionTy* MemRegionManager::getSubRegion(const A1 a1,
                                          const MemRegion *superRegion) {
                                          const MemRegion *superRegion) {
-  llvm::FoldingSetNodeID ID;  
-  RegionTy::ProfileRegion(ID, a1, superRegion);  
+  llvm::FoldingSetNodeID ID;
+  RegionTy::ProfileRegion(ID, a1, superRegion);
   void* InsertPos;
   void* InsertPos;
   RegionTy* R = cast_or_null<RegionTy>(Regions.FindNodeOrInsertPos(ID,
   RegionTy* R = cast_or_null<RegionTy>(Regions.FindNodeOrInsertPos(ID,
                                                                    InsertPos));
                                                                    InsertPos));
-  
+
   if (!R) {
   if (!R) {
     R = (RegionTy*) A.Allocate<RegionTy>();
     R = (RegionTy*) A.Allocate<RegionTy>();
     new (R) RegionTy(a1, superRegion);
     new (R) RegionTy(a1, superRegion);
     Regions.InsertNode(R, InsertPos);
     Regions.InsertNode(R, InsertPos);
   }
   }
-  
+
   return R;
   return R;
 }
 }
-  
+
 template <typename RegionTy, typename A1, typename A2>
 template <typename RegionTy, typename A1, typename A2>
 RegionTy* MemRegionManager::getRegion(const A1 a1, const A2 a2) {
 RegionTy* MemRegionManager::getRegion(const A1 a1, const A2 a2) {
-  
+
   const typename MemRegionManagerTrait<RegionTy>::SuperRegionTy *superRegion =
   const typename MemRegionManagerTrait<RegionTy>::SuperRegionTy *superRegion =
     MemRegionManagerTrait<RegionTy>::getSuperRegion(*this, a1, a2);
     MemRegionManagerTrait<RegionTy>::getSuperRegion(*this, a1, a2);
-  
-  llvm::FoldingSetNodeID ID;  
-  RegionTy::ProfileRegion(ID, a1, a2, superRegion);  
+
+  llvm::FoldingSetNodeID ID;
+  RegionTy::ProfileRegion(ID, a1, a2, superRegion);
   void* InsertPos;
   void* InsertPos;
   RegionTy* R = cast_or_null<RegionTy>(Regions.FindNodeOrInsertPos(ID,
   RegionTy* R = cast_or_null<RegionTy>(Regions.FindNodeOrInsertPos(ID,
                                                                    InsertPos));
                                                                    InsertPos));
-  
+
   if (!R) {
   if (!R) {
     R = (RegionTy*) A.Allocate<RegionTy>();
     R = (RegionTy*) A.Allocate<RegionTy>();
     new (R) RegionTy(a1, a2, superRegion);
     new (R) RegionTy(a1, a2, superRegion);
     Regions.InsertNode(R, InsertPos);
     Regions.InsertNode(R, InsertPos);
   }
   }
-  
+
   return R;
   return R;
 }
 }
-  
+
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // Traits for constructing regions.
 // Traits for constructing regions.
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
@@ -754,18 +754,18 @@ template <> struct MemRegionManagerTrait<AllocaRegion> {
                                              const Expr *, unsigned) {
                                              const Expr *, unsigned) {
     return MRMgr.getStackRegion();
     return MRMgr.getStackRegion();
   }
   }
-};  
-  
+};
+
 template <> struct MemRegionManagerTrait<CompoundLiteralRegion> {
 template <> struct MemRegionManagerTrait<CompoundLiteralRegion> {
   typedef MemRegion SuperRegionTy;
   typedef MemRegion SuperRegionTy;
   static const SuperRegionTy* getSuperRegion(MemRegionManager& MRMgr,
   static const SuperRegionTy* getSuperRegion(MemRegionManager& MRMgr,
                                              const CompoundLiteralExpr *CL) {
                                              const CompoundLiteralExpr *CL) {
-    
-    return CL->isFileScope() ? MRMgr.getGlobalsRegion() 
+
+    return CL->isFileScope() ? MRMgr.getGlobalsRegion()
                              : MRMgr.getStackRegion();
                              : MRMgr.getStackRegion();
   }
   }
 };
 };
-  
+
 template <> struct MemRegionManagerTrait<StringRegion> {
 template <> struct MemRegionManagerTrait<StringRegion> {
   typedef MemSpaceRegion SuperRegionTy;
   typedef MemSpaceRegion SuperRegionTy;
   static const SuperRegionTy* getSuperRegion(MemRegionManager& MRMgr,
   static const SuperRegionTy* getSuperRegion(MemRegionManager& MRMgr,
@@ -773,24 +773,24 @@ template <> struct MemRegionManagerTrait<StringRegion> {
     return MRMgr.getGlobalsRegion();
     return MRMgr.getGlobalsRegion();
   }
   }
 };
 };
-  
+
 template <> struct MemRegionManagerTrait<VarRegion> {
 template <> struct MemRegionManagerTrait<VarRegion> {
   typedef MemRegion SuperRegionTy;
   typedef MemRegion SuperRegionTy;
   static const SuperRegionTy* getSuperRegion(MemRegionManager &MRMgr,
   static const SuperRegionTy* getSuperRegion(MemRegionManager &MRMgr,
                                              const VarDecl *D,
                                              const VarDecl *D,
                                              const LocationContext *LC) {
                                              const LocationContext *LC) {
-    
+
     // FIXME: Make stack regions have a location context?
     // FIXME: Make stack regions have a location context?
-    
+
     if (D->hasLocalStorage()) {
     if (D->hasLocalStorage()) {
       return isa<ParmVarDecl>(D) || isa<ImplicitParamDecl>(D)
       return isa<ParmVarDecl>(D) || isa<ImplicitParamDecl>(D)
              ? MRMgr.getStackArgumentsRegion() : MRMgr.getStackRegion();
              ? MRMgr.getStackArgumentsRegion() : MRMgr.getStackRegion();
     }
     }
-    
+
     return MRMgr.getGlobalsRegion();
     return MRMgr.getGlobalsRegion();
   }
   }
 };
 };
-  
+
 template <> struct MemRegionManagerTrait<SymbolicRegion> {
 template <> struct MemRegionManagerTrait<SymbolicRegion> {
   typedef MemRegion SuperRegionTy;
   typedef MemRegion SuperRegionTy;
   static const SuperRegionTy* getSuperRegion(MemRegionManager& MRMgr,
   static const SuperRegionTy* getSuperRegion(MemRegionManager& MRMgr,
@@ -810,7 +810,7 @@ template<> struct MemRegionManagerTrait<CodeTextRegion> {
     return MRMgr.getCodeRegion();
     return MRMgr.getCodeRegion();
   }
   }
 };
 };
-  
+
 } // end clang namespace
 } // end clang namespace
 
 
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
@@ -819,7 +819,7 @@ template<> struct MemRegionManagerTrait<CodeTextRegion> {
 
 
 namespace llvm {
 namespace llvm {
 static inline raw_ostream& operator<<(raw_ostream& os,
 static inline raw_ostream& operator<<(raw_ostream& os,
-                                      const clang::MemRegion* R) { 
+                                      const clang::MemRegion* R) {
   R->dumpToStream(os);
   R->dumpToStream(os);
   return os;
   return os;
 }
 }

+ 80 - 80
include/clang/Analysis/PathSensitive/SVals.h

@@ -38,35 +38,35 @@ class TypedRegion;
 class MemRegionManager;
 class MemRegionManager;
 class GRStateManager;
 class GRStateManager;
 class ValueManager;
 class ValueManager;
-  
+
 class SVal {
 class SVal {
 public:
 public:
   enum BaseKind { UndefinedKind, UnknownKind, LocKind, NonLocKind };
   enum BaseKind { UndefinedKind, UnknownKind, LocKind, NonLocKind };
   enum { BaseBits = 2, BaseMask = 0x3 };
   enum { BaseBits = 2, BaseMask = 0x3 };
-  
+
 protected:
 protected:
   void* Data;
   void* Data;
   unsigned Kind;
   unsigned Kind;
-  
+
 protected:
 protected:
   SVal(const void* d, bool isLoc, unsigned ValKind)
   SVal(const void* d, bool isLoc, unsigned ValKind)
   : Data(const_cast<void*>(d)),
   : Data(const_cast<void*>(d)),
     Kind((isLoc ? LocKind : NonLocKind) | (ValKind << BaseBits)) {}
     Kind((isLoc ? LocKind : NonLocKind) | (ValKind << BaseBits)) {}
-  
+
   explicit SVal(BaseKind k, void* D = NULL)
   explicit SVal(BaseKind k, void* D = NULL)
     : Data(D), Kind(k) {}
     : Data(D), Kind(k) {}
-  
+
 public:
 public:
   SVal() : Data(0), Kind(0) {}
   SVal() : Data(0), Kind(0) {}
   ~SVal() {};
   ~SVal() {};
-  
+
   /// BufferTy - A temporary buffer to hold a set of SVals.
   /// BufferTy - A temporary buffer to hold a set of SVals.
   typedef llvm::SmallVector<SVal,5> BufferTy;
   typedef llvm::SmallVector<SVal,5> BufferTy;
-  
+
   inline unsigned getRawKind() const { return Kind; }
   inline unsigned getRawKind() const { return Kind; }
   inline BaseKind getBaseKind() const { return (BaseKind) (Kind & BaseMask); }
   inline BaseKind getBaseKind() const { return (BaseKind) (Kind & BaseMask); }
   inline unsigned getSubKind() const { return (Kind & ~BaseMask) >> BaseBits; }
   inline unsigned getSubKind() const { return (Kind & ~BaseMask) >> BaseBits; }
-  
+
   inline void Profile(llvm::FoldingSetNodeID& ID) const {
   inline void Profile(llvm::FoldingSetNodeID& ID) const {
     ID.AddInteger((unsigned) getRawKind());
     ID.AddInteger((unsigned) getRawKind());
     ID.AddPointer(reinterpret_cast<void*>(Data));
     ID.AddPointer(reinterpret_cast<void*>(Data));
@@ -75,7 +75,7 @@ public:
   inline bool operator==(const SVal& R) const {
   inline bool operator==(const SVal& R) const {
     return getRawKind() == R.getRawKind() && Data == R.Data;
     return getRawKind() == R.getRawKind() && Data == R.Data;
   }
   }
-    
+
   inline bool operator!=(const SVal& R) const {
   inline bool operator!=(const SVal& R) const {
     return !(*this == R);
     return !(*this == R);
   }
   }
@@ -91,25 +91,25 @@ public:
   inline bool isUnknownOrUndef() const {
   inline bool isUnknownOrUndef() const {
     return getRawKind() <= UnknownKind;
     return getRawKind() <= UnknownKind;
   }
   }
-  
+
   inline bool isValid() const {
   inline bool isValid() const {
     return getRawKind() > UnknownKind;
     return getRawKind() > UnknownKind;
   }
   }
-  
+
   bool isZeroConstant() const;
   bool isZeroConstant() const;
 
 
   /// hasConjuredSymbol - If this SVal wraps a conjured symbol, return true;
   /// hasConjuredSymbol - If this SVal wraps a conjured symbol, return true;
   bool hasConjuredSymbol() const;
   bool hasConjuredSymbol() const;
 
 
   /// getAsFunctionDecl - If this SVal is a MemRegionVal and wraps a
   /// getAsFunctionDecl - If this SVal is a MemRegionVal and wraps a
-  /// CodeTextRegion wrapping a FunctionDecl, return that FunctionDecl. 
+  /// CodeTextRegion wrapping a FunctionDecl, return that FunctionDecl.
   /// Otherwise return 0.
   /// Otherwise return 0.
   const FunctionDecl* getAsFunctionDecl() const;
   const FunctionDecl* getAsFunctionDecl() const;
-  
-  /// getAsLocSymbol - If this SVal is a location (subclasses Loc) and 
+
+  /// getAsLocSymbol - If this SVal is a location (subclasses Loc) and
   ///  wraps a symbol, return that SymbolRef.  Otherwise return a SymbolData*
   ///  wraps a symbol, return that SymbolRef.  Otherwise return a SymbolData*
   SymbolRef getAsLocSymbol() const;
   SymbolRef getAsLocSymbol() const;
-  
+
   /// getAsSymbol - If this Sval wraps a symbol return that SymbolRef.
   /// getAsSymbol - If this Sval wraps a symbol return that SymbolRef.
   ///  Otherwise return a SymbolRef where 'isValid()' returns false.
   ///  Otherwise return a SymbolRef where 'isValid()' returns false.
   SymbolRef getAsSymbol() const;
   SymbolRef getAsSymbol() const;
@@ -119,7 +119,7 @@ public:
   const SymExpr *getAsSymbolicExpression() const;
   const SymExpr *getAsSymbolicExpression() const;
 
 
   const MemRegion *getAsRegion() const;
   const MemRegion *getAsRegion() const;
-  
+
   void dumpToStream(llvm::raw_ostream& OS) const;
   void dumpToStream(llvm::raw_ostream& OS) const;
   void dump() const;
   void dump() const;
 
 
@@ -130,14 +130,14 @@ public:
   public:
   public:
     symbol_iterator() {}
     symbol_iterator() {}
     symbol_iterator(const SymExpr* SE);
     symbol_iterator(const SymExpr* SE);
-    
+
     symbol_iterator& operator++();
     symbol_iterator& operator++();
     SymbolRef operator*();
     SymbolRef operator*();
-      
+
     bool operator==(const symbol_iterator& X) const;
     bool operator==(const symbol_iterator& X) const;
     bool operator!=(const symbol_iterator& X) const;
     bool operator!=(const symbol_iterator& X) const;
   };
   };
-  
+
   symbol_iterator symbol_begin() const {
   symbol_iterator symbol_begin() const {
     const SymExpr *SE = getAsSymbolicExpression();
     const SymExpr *SE = getAsSymbolicExpression();
     if (SE)
     if (SE)
@@ -145,9 +145,9 @@ public:
     else
     else
       return symbol_iterator();
       return symbol_iterator();
   }
   }
-  
+
   symbol_iterator symbol_end() const { return symbol_iterator(); }
   symbol_iterator symbol_end() const { return symbol_iterator(); }
-  
+
   // Implement isa<T> support.
   // Implement isa<T> support.
   static inline bool classof(const SVal*) { return true; }
   static inline bool classof(const SVal*) { return true; }
 };
 };
@@ -155,24 +155,24 @@ public:
 class UnknownVal : public SVal {
 class UnknownVal : public SVal {
 public:
 public:
   UnknownVal() : SVal(UnknownKind) {}
   UnknownVal() : SVal(UnknownKind) {}
-  
+
   static inline bool classof(const SVal* V) {
   static inline bool classof(const SVal* V) {
     return V->getBaseKind() == UnknownKind;
     return V->getBaseKind() == UnknownKind;
-  }  
+  }
 };
 };
 
 
 class UndefinedVal : public SVal {
 class UndefinedVal : public SVal {
 public:
 public:
   UndefinedVal() : SVal(UndefinedKind) {}
   UndefinedVal() : SVal(UndefinedKind) {}
   UndefinedVal(void* D) : SVal(UndefinedKind, D) {}
   UndefinedVal(void* D) : SVal(UndefinedKind, D) {}
-  
+
   static inline bool classof(const SVal* V) {
   static inline bool classof(const SVal* V) {
     return V->getBaseKind() == UndefinedKind;
     return V->getBaseKind() == UndefinedKind;
   }
   }
-  
-  void* getData() const { return Data; }  
+
+  void* getData() const { return Data; }
 };
 };
-  
+
 class DefinedSVal : public SVal {
 class DefinedSVal : public SVal {
 protected:
 protected:
   DefinedSVal(const void* d, bool isLoc, unsigned ValKind)
   DefinedSVal(const void* d, bool isLoc, unsigned ValKind)
@@ -181,16 +181,16 @@ public:
   // Implement isa<T> support.
   // Implement isa<T> support.
   static inline bool classof(const SVal *V) {
   static inline bool classof(const SVal *V) {
     return !V->isUnknownOrUndef();
     return !V->isUnknownOrUndef();
-  }    
+  }
 };
 };
 
 
 class NonLoc : public DefinedSVal {
 class NonLoc : public DefinedSVal {
 protected:
 protected:
   NonLoc(unsigned SubKind, const void* d) : DefinedSVal(d, false, SubKind) {}
   NonLoc(unsigned SubKind, const void* d) : DefinedSVal(d, false, SubKind) {}
-  
+
 public:
 public:
   void dumpToStream(llvm::raw_ostream& Out) const;
   void dumpToStream(llvm::raw_ostream& Out) const;
-  
+
   // Implement isa<T> support.
   // Implement isa<T> support.
   static inline bool classof(const SVal* V) {
   static inline bool classof(const SVal* V) {
     return V->getBaseKind() == NonLocKind;
     return V->getBaseKind() == NonLocKind;
@@ -207,45 +207,45 @@ public:
 
 
   Loc(const Loc& X) : DefinedSVal(X.Data, true, X.getSubKind()) {}
   Loc(const Loc& X) : DefinedSVal(X.Data, true, X.getSubKind()) {}
   Loc& operator=(const Loc& X) { memcpy(this, &X, sizeof(Loc)); return *this; }
   Loc& operator=(const Loc& X) { memcpy(this, &X, sizeof(Loc)); return *this; }
-    
+
   // Implement isa<T> support.
   // Implement isa<T> support.
   static inline bool classof(const SVal* V) {
   static inline bool classof(const SVal* V) {
     return V->getBaseKind() == LocKind;
     return V->getBaseKind() == LocKind;
   }
   }
-  
+
   static inline bool IsLocType(QualType T) {
   static inline bool IsLocType(QualType T) {
     return T->isAnyPointerType() || T->isBlockPointerType();
     return T->isAnyPointerType() || T->isBlockPointerType();
   }
   }
 };
 };
-  
+
 //==------------------------------------------------------------------------==//
 //==------------------------------------------------------------------------==//
 //  Subclasses of NonLoc.
 //  Subclasses of NonLoc.
 //==------------------------------------------------------------------------==//
 //==------------------------------------------------------------------------==//
 
 
 namespace nonloc {
 namespace nonloc {
-  
+
 enum Kind { ConcreteIntKind, SymbolValKind, SymExprValKind,
 enum Kind { ConcreteIntKind, SymbolValKind, SymExprValKind,
             LocAsIntegerKind, CompoundValKind, LazyCompoundValKind };
             LocAsIntegerKind, CompoundValKind, LazyCompoundValKind };
 
 
 class SymbolVal : public NonLoc {
 class SymbolVal : public NonLoc {
 public:
 public:
   SymbolVal(SymbolRef sym) : NonLoc(SymbolValKind, sym) {}
   SymbolVal(SymbolRef sym) : NonLoc(SymbolValKind, sym) {}
-  
+
   SymbolRef getSymbol() const {
   SymbolRef getSymbol() const {
     return (const SymbolData*) Data;
     return (const SymbolData*) Data;
   }
   }
-  
+
   static inline bool classof(const SVal* V) {
   static inline bool classof(const SVal* V) {
-    return V->getBaseKind() == NonLocKind && 
+    return V->getBaseKind() == NonLocKind &&
            V->getSubKind() == SymbolValKind;
            V->getSubKind() == SymbolValKind;
   }
   }
-  
+
   static inline bool classof(const NonLoc* V) {
   static inline bool classof(const NonLoc* V) {
     return V->getSubKind() == SymbolValKind;
     return V->getSubKind() == SymbolValKind;
   }
   }
 };
 };
 
 
-class SymExprVal : public NonLoc {    
+class SymExprVal : public NonLoc {
 public:
 public:
   SymExprVal(const SymExpr *SE)
   SymExprVal(const SymExpr *SE)
     : NonLoc(SymExprValKind, reinterpret_cast<const void*>(SE)) {}
     : NonLoc(SymExprValKind, reinterpret_cast<const void*>(SE)) {}
@@ -253,12 +253,12 @@ public:
   const SymExpr *getSymbolicExpression() const {
   const SymExpr *getSymbolicExpression() const {
     return reinterpret_cast<SymExpr*>(Data);
     return reinterpret_cast<SymExpr*>(Data);
   }
   }
-  
+
   static inline bool classof(const SVal* V) {
   static inline bool classof(const SVal* V) {
     return V->getBaseKind() == NonLocKind &&
     return V->getBaseKind() == NonLocKind &&
            V->getSubKind() == SymExprValKind;
            V->getSubKind() == SymExprValKind;
   }
   }
-  
+
   static inline bool classof(const NonLoc* V) {
   static inline bool classof(const NonLoc* V) {
     return V->getSubKind() == SymExprValKind;
     return V->getSubKind() == SymExprValKind;
   }
   }
@@ -267,30 +267,30 @@ public:
 class ConcreteInt : public NonLoc {
 class ConcreteInt : public NonLoc {
 public:
 public:
   ConcreteInt(const llvm::APSInt& V) : NonLoc(ConcreteIntKind, &V) {}
   ConcreteInt(const llvm::APSInt& V) : NonLoc(ConcreteIntKind, &V) {}
-  
+
   const llvm::APSInt& getValue() const {
   const llvm::APSInt& getValue() const {
     return *static_cast<llvm::APSInt*>(Data);
     return *static_cast<llvm::APSInt*>(Data);
   }
   }
-  
+
   // Transfer functions for binary/unary operations on ConcreteInts.
   // Transfer functions for binary/unary operations on ConcreteInts.
   SVal evalBinOp(ValueManager &ValMgr, BinaryOperator::Opcode Op,
   SVal evalBinOp(ValueManager &ValMgr, BinaryOperator::Opcode Op,
                  const ConcreteInt& R) const;
                  const ConcreteInt& R) const;
-  
+
   ConcreteInt evalComplement(ValueManager &ValMgr) const;
   ConcreteInt evalComplement(ValueManager &ValMgr) const;
-  
+
   ConcreteInt evalMinus(ValueManager &ValMgr) const;
   ConcreteInt evalMinus(ValueManager &ValMgr) const;
-  
+
   // Implement isa<T> support.
   // Implement isa<T> support.
   static inline bool classof(const SVal* V) {
   static inline bool classof(const SVal* V) {
     return V->getBaseKind() == NonLocKind &&
     return V->getBaseKind() == NonLocKind &&
            V->getSubKind() == ConcreteIntKind;
            V->getSubKind() == ConcreteIntKind;
   }
   }
-  
+
   static inline bool classof(const NonLoc* V) {
   static inline bool classof(const NonLoc* V) {
     return V->getSubKind() == ConcreteIntKind;
     return V->getSubKind() == ConcreteIntKind;
   }
   }
 };
 };
-  
+
 class LocAsInteger : public NonLoc {
 class LocAsInteger : public NonLoc {
   friend class clang::ValueManager;
   friend class clang::ValueManager;
 
 
@@ -298,28 +298,28 @@ class LocAsInteger : public NonLoc {
     NonLoc(LocAsIntegerKind, &data) {
     NonLoc(LocAsIntegerKind, &data) {
       assert (isa<Loc>(data.first));
       assert (isa<Loc>(data.first));
     }
     }
-  
+
 public:
 public:
-    
+
   Loc getLoc() const {
   Loc getLoc() const {
     return cast<Loc>(((std::pair<SVal, uintptr_t>*) Data)->first);
     return cast<Loc>(((std::pair<SVal, uintptr_t>*) Data)->first);
   }
   }
-  
+
   const Loc& getPersistentLoc() const {
   const Loc& getPersistentLoc() const {
     const SVal& V = ((std::pair<SVal, uintptr_t>*) Data)->first;
     const SVal& V = ((std::pair<SVal, uintptr_t>*) Data)->first;
     return cast<Loc>(V);
     return cast<Loc>(V);
-  }    
-  
+  }
+
   unsigned getNumBits() const {
   unsigned getNumBits() const {
     return ((std::pair<SVal, unsigned>*) Data)->second;
     return ((std::pair<SVal, unsigned>*) Data)->second;
   }
   }
-  
+
   // Implement isa<T> support.
   // Implement isa<T> support.
   static inline bool classof(const SVal* V) {
   static inline bool classof(const SVal* V) {
     return V->getBaseKind() == NonLocKind &&
     return V->getBaseKind() == NonLocKind &&
            V->getSubKind() == LocAsIntegerKind;
            V->getSubKind() == LocAsIntegerKind;
   }
   }
-  
+
   static inline bool classof(const NonLoc* V) {
   static inline bool classof(const NonLoc* V) {
     return V->getSubKind() == LocAsIntegerKind;
     return V->getSubKind() == LocAsIntegerKind;
   }
   }
@@ -334,10 +334,10 @@ public:
   const CompoundValData* getValue() const {
   const CompoundValData* getValue() const {
     return static_cast<CompoundValData*>(Data);
     return static_cast<CompoundValData*>(Data);
   }
   }
-  
+
   typedef llvm::ImmutableList<SVal>::iterator iterator;
   typedef llvm::ImmutableList<SVal>::iterator iterator;
   iterator begin() const;
   iterator begin() const;
-  iterator end() const;  
+  iterator end() const;
 
 
   static bool classof(const SVal* V) {
   static bool classof(const SVal* V) {
     return V->getBaseKind() == NonLocKind && V->getSubKind() == CompoundValKind;
     return V->getBaseKind() == NonLocKind && V->getSubKind() == CompoundValKind;
@@ -347,7 +347,7 @@ public:
     return V->getSubKind() == CompoundValKind;
     return V->getSubKind() == CompoundValKind;
   }
   }
 };
 };
-  
+
 class LazyCompoundVal : public NonLoc {
 class LazyCompoundVal : public NonLoc {
   friend class clang::ValueManager;
   friend class clang::ValueManager;
 
 
@@ -359,16 +359,16 @@ public:
   }
   }
   const GRState *getState() const;
   const GRState *getState() const;
   const TypedRegion *getRegion() const;
   const TypedRegion *getRegion() const;
-  
+
   static bool classof(const SVal *V) {
   static bool classof(const SVal *V) {
-    return V->getBaseKind() == NonLocKind && 
+    return V->getBaseKind() == NonLocKind &&
            V->getSubKind() == LazyCompoundValKind;
            V->getSubKind() == LazyCompoundValKind;
   }
   }
   static bool classof(const NonLoc *V) {
   static bool classof(const NonLoc *V) {
     return V->getSubKind() == LazyCompoundValKind;
     return V->getSubKind() == LazyCompoundValKind;
   }
   }
 };
 };
-  
+
 } // end namespace clang::nonloc
 } // end namespace clang::nonloc
 
 
 //==------------------------------------------------------------------------==//
 //==------------------------------------------------------------------------==//
@@ -376,27 +376,27 @@ public:
 //==------------------------------------------------------------------------==//
 //==------------------------------------------------------------------------==//
 
 
 namespace loc {
 namespace loc {
-  
+
 enum Kind { GotoLabelKind, MemRegionKind, ConcreteIntKind };
 enum Kind { GotoLabelKind, MemRegionKind, ConcreteIntKind };
 
 
 class GotoLabel : public Loc {
 class GotoLabel : public Loc {
 public:
 public:
   GotoLabel(LabelStmt* Label) : Loc(GotoLabelKind, Label) {}
   GotoLabel(LabelStmt* Label) : Loc(GotoLabelKind, Label) {}
-  
+
   LabelStmt* getLabel() const {
   LabelStmt* getLabel() const {
     return static_cast<LabelStmt*>(Data);
     return static_cast<LabelStmt*>(Data);
   }
   }
-  
+
   static inline bool classof(const SVal* V) {
   static inline bool classof(const SVal* V) {
     return V->getBaseKind() == LocKind &&
     return V->getBaseKind() == LocKind &&
            V->getSubKind() == GotoLabelKind;
            V->getSubKind() == GotoLabelKind;
   }
   }
-  
+
   static inline bool classof(const Loc* V) {
   static inline bool classof(const Loc* V) {
     return V->getSubKind() == GotoLabelKind;
     return V->getSubKind() == GotoLabelKind;
-  } 
+  }
 };
 };
-  
+
 
 
 class MemRegionVal : public Loc {
 class MemRegionVal : public Loc {
 public:
 public:
@@ -405,37 +405,37 @@ public:
   const MemRegion* getRegion() const {
   const MemRegion* getRegion() const {
     return static_cast<MemRegion*>(Data);
     return static_cast<MemRegion*>(Data);
   }
   }
-  
+
   const MemRegion* getBaseRegion() const;
   const MemRegion* getBaseRegion() const;
-  
+
   template <typename REGION>
   template <typename REGION>
   const REGION* getRegionAs() const {
   const REGION* getRegionAs() const {
     return llvm::dyn_cast<REGION>(getRegion());
     return llvm::dyn_cast<REGION>(getRegion());
-  }  
-  
+  }
+
   inline bool operator==(const MemRegionVal& R) const {
   inline bool operator==(const MemRegionVal& R) const {
     return getRegion() == R.getRegion();
     return getRegion() == R.getRegion();
   }
   }
-  
+
   inline bool operator!=(const MemRegionVal& R) const {
   inline bool operator!=(const MemRegionVal& R) const {
     return getRegion() != R.getRegion();
     return getRegion() != R.getRegion();
   }
   }
-  
+
   // Implement isa<T> support.
   // Implement isa<T> support.
   static inline bool classof(const SVal* V) {
   static inline bool classof(const SVal* V) {
     return V->getBaseKind() == LocKind &&
     return V->getBaseKind() == LocKind &&
            V->getSubKind() == MemRegionKind;
            V->getSubKind() == MemRegionKind;
   }
   }
-  
+
   static inline bool classof(const Loc* V) {
   static inline bool classof(const Loc* V) {
     return V->getSubKind() == MemRegionKind;
     return V->getSubKind() == MemRegionKind;
-  }    
+  }
 };
 };
 
 
 class ConcreteInt : public Loc {
 class ConcreteInt : public Loc {
 public:
 public:
   ConcreteInt(const llvm::APSInt& V) : Loc(ConcreteIntKind, &V) {}
   ConcreteInt(const llvm::APSInt& V) : Loc(ConcreteIntKind, &V) {}
-  
+
   const llvm::APSInt& getValue() const {
   const llvm::APSInt& getValue() const {
     return *static_cast<llvm::APSInt*>(Data);
     return *static_cast<llvm::APSInt*>(Data);
   }
   }
@@ -443,20 +443,20 @@ public:
   // Transfer functions for binary/unary operations on ConcreteInts.
   // Transfer functions for binary/unary operations on ConcreteInts.
   SVal EvalBinOp(BasicValueFactory& BasicVals, BinaryOperator::Opcode Op,
   SVal EvalBinOp(BasicValueFactory& BasicVals, BinaryOperator::Opcode Op,
                  const ConcreteInt& R) const;
                  const ConcreteInt& R) const;
-      
+
   // Implement isa<T> support.
   // Implement isa<T> support.
   static inline bool classof(const SVal* V) {
   static inline bool classof(const SVal* V) {
     return V->getBaseKind() == LocKind &&
     return V->getBaseKind() == LocKind &&
            V->getSubKind() == ConcreteIntKind;
            V->getSubKind() == ConcreteIntKind;
   }
   }
-  
+
   static inline bool classof(const Loc* V) {
   static inline bool classof(const Loc* V) {
     return V->getSubKind() == ConcreteIntKind;
     return V->getSubKind() == ConcreteIntKind;
   }
   }
 };
 };
-  
+
 } // end clang::loc namespace
 } // end clang::loc namespace
-} // end clang namespace  
+} // end clang namespace
 
 
 namespace llvm {
 namespace llvm {
 static inline llvm::raw_ostream& operator<<(llvm::raw_ostream& os,
 static inline llvm::raw_ostream& operator<<(llvm::raw_ostream& os,

+ 11 - 11
include/clang/Analysis/PathSensitive/SValuator.h

@@ -9,7 +9,7 @@
 //
 //
 //  This file defines SValuator, a class that defines the interface for
 //  This file defines SValuator, a class that defines the interface for
 //  "symbolical evaluators" which construct an SVal from an expression.
 //  "symbolical evaluators" which construct an SVal from an expression.
-//  
+//
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
 #ifndef LLVM_CLANG_ANALYSIS_SVALUATOR
 #ifndef LLVM_CLANG_ANALYSIS_SVALUATOR
@@ -28,14 +28,14 @@ class SValuator {
 protected:
 protected:
   ValueManager &ValMgr;
   ValueManager &ValMgr;
 
 
-  virtual SVal EvalCastNL(NonLoc val, QualType castTy) = 0;  
-  
+  virtual SVal EvalCastNL(NonLoc val, QualType castTy) = 0;
+
   virtual SVal EvalCastL(Loc val, QualType castTy) = 0;
   virtual SVal EvalCastL(Loc val, QualType castTy) = 0;
 
 
 public:
 public:
   SValuator(ValueManager &valMgr) : ValMgr(valMgr) {}
   SValuator(ValueManager &valMgr) : ValMgr(valMgr) {}
   virtual ~SValuator() {}
   virtual ~SValuator() {}
-  
+
   class CastResult : public std::pair<const GRState *, SVal> {
   class CastResult : public std::pair<const GRState *, SVal> {
   public:
   public:
     const GRState *getState() const { return first; }
     const GRState *getState() const { return first; }
@@ -43,12 +43,12 @@ public:
     CastResult(const GRState *s, SVal v)
     CastResult(const GRState *s, SVal v)
       : std::pair<const GRState*, SVal>(s, v) {}
       : std::pair<const GRState*, SVal>(s, v) {}
   };
   };
-  
+
   CastResult EvalCast(SVal val, const GRState *state,
   CastResult EvalCast(SVal val, const GRState *state,
                       QualType castTy, QualType originalType);
                       QualType castTy, QualType originalType);
-  
+
   virtual SVal EvalMinus(NonLoc val) = 0;
   virtual SVal EvalMinus(NonLoc val) = 0;
-  
+
   virtual SVal EvalComplement(NonLoc val) = 0;
   virtual SVal EvalComplement(NonLoc val) = 0;
 
 
   virtual SVal EvalBinOpNN(BinaryOperator::Opcode Op, NonLoc lhs,
   virtual SVal EvalBinOpNN(BinaryOperator::Opcode Op, NonLoc lhs,
@@ -58,13 +58,13 @@ public:
                            QualType resultTy) = 0;
                            QualType resultTy) = 0;
 
 
   virtual SVal EvalBinOpLN(const GRState *state, BinaryOperator::Opcode Op,
   virtual SVal EvalBinOpLN(const GRState *state, BinaryOperator::Opcode Op,
-                           Loc lhs, NonLoc rhs, QualType resultTy) = 0;  
-  
+                           Loc lhs, NonLoc rhs, QualType resultTy) = 0;
+
   SVal EvalBinOp(const GRState *ST, BinaryOperator::Opcode Op,
   SVal EvalBinOp(const GRState *ST, BinaryOperator::Opcode Op,
                  SVal L, SVal R, QualType T);
                  SVal L, SVal R, QualType T);
 };
 };
-  
+
 SValuator* CreateSimpleSValuator(ValueManager &valMgr);
 SValuator* CreateSimpleSValuator(ValueManager &valMgr);
-  
+
 } // end clang namespace
 } // end clang namespace
 #endif
 #endif

+ 26 - 26
include/clang/Analysis/PathSensitive/Store.h

@@ -23,16 +23,16 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/SmallVector.h"
 
 
 namespace clang {
 namespace clang {
-  
+
 typedef const void* Store;
 typedef const void* Store;
 
 
-class GRState;  
+class GRState;
 class GRStateManager;
 class GRStateManager;
 class Stmt;
 class Stmt;
 class Expr;
 class Expr;
 class ObjCIvarDecl;
 class ObjCIvarDecl;
 class SubRegionMap;
 class SubRegionMap;
-  
+
 class StoreManager {
 class StoreManager {
 protected:
 protected:
   ValueManager &ValMgr;
   ValueManager &ValMgr;
@@ -43,13 +43,13 @@ protected:
 
 
   StoreManager(GRStateManager &stateMgr);
   StoreManager(GRStateManager &stateMgr);
 
 
-public:  
+public:
   virtual ~StoreManager() {}
   virtual ~StoreManager() {}
-  
+
   /// Return the value bound to specified location in a given state.
   /// Return the value bound to specified location in a given state.
   /// \param[in] state The analysis state.
   /// \param[in] state The analysis state.
   /// \param[in] loc The symbolic memory location.
   /// \param[in] loc The symbolic memory location.
-  /// \param[in] T An optional type that provides a hint indicating the 
+  /// \param[in] T An optional type that provides a hint indicating the
   ///   expected type of the returned value.  This is used if the value is
   ///   expected type of the returned value.  This is used if the value is
   ///   lazily computed.
   ///   lazily computed.
   /// \return The value bound to the location \c loc.
   /// \return The value bound to the location \c loc.
@@ -60,13 +60,13 @@ public:
   /// \param[in] state The analysis state.
   /// \param[in] state The analysis state.
   /// \param[in] loc The symbolic memory location.
   /// \param[in] loc The symbolic memory location.
   /// \param[in] val The value to bind to location \c loc.
   /// \param[in] val The value to bind to location \c loc.
-  /// \return A pointer to a GRState object that contains the same bindings as 
+  /// \return A pointer to a GRState object that contains the same bindings as
   ///   \c state with the addition of having the value specified by \c val bound
   ///   \c state with the addition of having the value specified by \c val bound
   ///   to the location given for \c loc.
   ///   to the location given for \c loc.
   virtual const GRState *Bind(const GRState *state, Loc loc, SVal val) = 0;
   virtual const GRState *Bind(const GRState *state, Loc loc, SVal val) = 0;
 
 
   virtual Store Remove(Store St, Loc L) = 0;
   virtual Store Remove(Store St, Loc L) = 0;
-  
+
   /// BindCompoundLiteral - Return the store that has the bindings currently
   /// BindCompoundLiteral - Return the store that has the bindings currently
   ///  in 'store' plus the bindings for the CompoundLiteral.  'R' is the region
   ///  in 'store' plus the bindings for the CompoundLiteral.  'R' is the region
   ///  for the compound literal and 'BegInit' and 'EndInit' represent an
   ///  for the compound literal and 'BegInit' and 'EndInit' represent an
@@ -74,15 +74,15 @@ public:
   virtual const GRState *BindCompoundLiteral(const GRState *state,
   virtual const GRState *BindCompoundLiteral(const GRState *state,
                                               const CompoundLiteralExpr* cl,
                                               const CompoundLiteralExpr* cl,
                                               SVal v) = 0;
                                               SVal v) = 0;
-  
+
   /// getInitialStore - Returns the initial "empty" store representing the
   /// getInitialStore - Returns the initial "empty" store representing the
   ///  value bindings upon entry to an analyzed function.
   ///  value bindings upon entry to an analyzed function.
   virtual Store getInitialStore(const LocationContext *InitLoc) = 0;
   virtual Store getInitialStore(const LocationContext *InitLoc) = 0;
-  
+
   /// getRegionManager - Returns the internal RegionManager object that is
   /// getRegionManager - Returns the internal RegionManager object that is
   ///  used to query and manipulate MemRegion objects.
   ///  used to query and manipulate MemRegion objects.
   MemRegionManager& getRegionManager() { return MRMgr; }
   MemRegionManager& getRegionManager() { return MRMgr; }
-  
+
   /// getSubRegionMap - Returns an opaque map object that clients can query
   /// getSubRegionMap - Returns an opaque map object that clients can query
   ///  to get the subregions of a given MemRegion object.  It is the
   ///  to get the subregions of a given MemRegion object.  It is the
   //   caller's responsibility to 'delete' the returned map.
   //   caller's responsibility to 'delete' the returned map.
@@ -96,13 +96,13 @@ public:
 
 
   virtual SVal getLValueCompoundLiteral(const GRState *state,
   virtual SVal getLValueCompoundLiteral(const GRState *state,
                                         const CompoundLiteralExpr* cl) = 0;
                                         const CompoundLiteralExpr* cl) = 0;
-  
+
   virtual SVal getLValueIvar(const GRState *state, const ObjCIvarDecl* decl,
   virtual SVal getLValueIvar(const GRState *state, const ObjCIvarDecl* decl,
                              SVal base) = 0;
                              SVal base) = 0;
-  
+
   virtual SVal getLValueField(const GRState *state, SVal base,
   virtual SVal getLValueField(const GRState *state, SVal base,
                               const FieldDecl* D) = 0;
                               const FieldDecl* D) = 0;
-  
+
   virtual SVal getLValueElement(const GRState *state, QualType elementType,
   virtual SVal getLValueElement(const GRState *state, QualType elementType,
                                 SVal base, SVal offset) = 0;
                                 SVal base, SVal offset) = 0;
 
 
@@ -114,7 +114,7 @@ public:
   /// ArrayToPointer - Used by GRExprEngine::VistCast to handle implicit
   /// ArrayToPointer - Used by GRExprEngine::VistCast to handle implicit
   ///  conversions between arrays and pointers.
   ///  conversions between arrays and pointers.
   virtual SVal ArrayToPointer(Loc Array) = 0;
   virtual SVal ArrayToPointer(Loc Array) = 0;
-  
+
   class CastResult {
   class CastResult {
     const GRState *state;
     const GRState *state;
     const MemRegion *region;
     const MemRegion *region;
@@ -123,19 +123,19 @@ public:
     const MemRegion* getRegion() const { return region; }
     const MemRegion* getRegion() const { return region; }
     CastResult(const GRState *s, const MemRegion* r = 0) : state(s), region(r){}
     CastResult(const GRState *s, const MemRegion* r = 0) : state(s), region(r){}
   };
   };
-  
+
   /// CastRegion - Used by GRExprEngine::VisitCast to handle casts from
   /// CastRegion - Used by GRExprEngine::VisitCast to handle casts from
   ///  a MemRegion* to a specific location type.  'R' is the region being
   ///  a MemRegion* to a specific location type.  'R' is the region being
   ///  casted and 'CastToTy' the result type of the cast.
   ///  casted and 'CastToTy' the result type of the cast.
   CastResult CastRegion(const GRState *state, const MemRegion *region,
   CastResult CastRegion(const GRState *state, const MemRegion *region,
-                        QualType CastToTy);  
+                        QualType CastToTy);
 
 
   /// EvalBinOp - Perform pointer arithmetic.
   /// EvalBinOp - Perform pointer arithmetic.
   virtual SVal EvalBinOp(const GRState *state, BinaryOperator::Opcode Op,
   virtual SVal EvalBinOp(const GRState *state, BinaryOperator::Opcode Op,
                          Loc lhs, NonLoc rhs, QualType resultTy) {
                          Loc lhs, NonLoc rhs, QualType resultTy) {
     return UnknownVal();
     return UnknownVal();
   }
   }
-  
+
   virtual void RemoveDeadBindings(GRState &state, Stmt* Loc,
   virtual void RemoveDeadBindings(GRState &state, Stmt* Loc,
                                   SymbolReaper& SymReaper,
                                   SymbolReaper& SymReaper,
                       llvm::SmallVectorImpl<const MemRegion*>& RegionRoots) = 0;
                       llvm::SmallVectorImpl<const MemRegion*>& RegionRoots) = 0;
@@ -166,14 +166,14 @@ public:
 
 
   virtual void print(Store store, llvm::raw_ostream& Out,
   virtual void print(Store store, llvm::raw_ostream& Out,
                      const char* nl, const char *sep) = 0;
                      const char* nl, const char *sep) = 0;
-      
+
   class BindingsHandler {
   class BindingsHandler {
-  public:    
+  public:
     virtual ~BindingsHandler();
     virtual ~BindingsHandler();
     virtual bool HandleBinding(StoreManager& SMgr, Store store,
     virtual bool HandleBinding(StoreManager& SMgr, Store store,
                                const MemRegion *region, SVal val) = 0;
                                const MemRegion *region, SVal val) = 0;
   };
   };
-  
+
   /// iterBindings - Iterate over the bindings in the Store.
   /// iterBindings - Iterate over the bindings in the Store.
   virtual void iterBindings(Store store, BindingsHandler& f) = 0;
   virtual void iterBindings(Store store, BindingsHandler& f) = 0;
 
 
@@ -181,12 +181,12 @@ protected:
   CastResult MakeElementRegion(const GRState *state, const MemRegion *region,
   CastResult MakeElementRegion(const GRState *state, const MemRegion *region,
                                QualType pointeeTy, QualType castToTy,
                                QualType pointeeTy, QualType castToTy,
                                uint64_t index = 0);
                                uint64_t index = 0);
-  
+
   /// CastRetrievedVal - Used by subclasses of StoreManager to implement
   /// CastRetrievedVal - Used by subclasses of StoreManager to implement
   ///  implicit casts that arise from loads from regions that are reinterpreted
   ///  implicit casts that arise from loads from regions that are reinterpreted
   ///  as another region.
   ///  as another region.
   SValuator::CastResult CastRetrievedVal(SVal val, const GRState *state,
   SValuator::CastResult CastRetrievedVal(SVal val, const GRState *state,
-                                         const TypedRegion *R, QualType castTy);    
+                                         const TypedRegion *R, QualType castTy);
 };
 };
 
 
 // FIXME: Do we still need this?
 // FIXME: Do we still need this?
@@ -195,14 +195,14 @@ protected:
 class SubRegionMap {
 class SubRegionMap {
 public:
 public:
   virtual ~SubRegionMap() {}
   virtual ~SubRegionMap() {}
-  
+
   class Visitor {
   class Visitor {
   public:
   public:
     virtual ~Visitor() {};
     virtual ~Visitor() {};
     virtual bool Visit(const MemRegion* Parent, const MemRegion* SubRegion) = 0;
     virtual bool Visit(const MemRegion* Parent, const MemRegion* SubRegion) = 0;
   };
   };
-  
-  virtual bool iterSubRegions(const MemRegion *region, Visitor& V) const = 0;  
+
+  virtual bool iterSubRegions(const MemRegion *region, Visitor& V) const = 0;
 };
 };
 
 
 // FIXME: Do we need to pass GRStateManager anymore?
 // FIXME: Do we need to pass GRStateManager anymore?

+ 69 - 69
include/clang/Analysis/PathSensitive/SymbolManager.h

@@ -27,7 +27,7 @@ namespace llvm {
   class raw_ostream;
   class raw_ostream;
 }
 }
 
 
-namespace clang {  
+namespace clang {
   class MemRegion;
   class MemRegion;
   class TypedRegion;
   class TypedRegion;
   class ASTContext;
   class ASTContext;
@@ -35,7 +35,7 @@ namespace clang {
 }
 }
 
 
 namespace clang {
 namespace clang {
-  
+
 class SymExpr : public llvm::FoldingSetNode {
 class SymExpr : public llvm::FoldingSetNode {
 public:
 public:
   enum Kind { BEGIN_SYMBOLS,
   enum Kind { BEGIN_SYMBOLS,
@@ -46,47 +46,47 @@ private:
   Kind K;
   Kind K;
 
 
 protected:
 protected:
-  SymExpr(Kind k) : K(k) {}  
-  
+  SymExpr(Kind k) : K(k) {}
+
 public:
 public:
   virtual ~SymExpr() {}
   virtual ~SymExpr() {}
-  
-  Kind getKind() const { return K; }  
-    
+
+  Kind getKind() const { return K; }
+
   void dump() const;
   void dump() const;
-  
+
   virtual void dumpToStream(llvm::raw_ostream &os) const = 0;
   virtual void dumpToStream(llvm::raw_ostream &os) const = 0;
-  
-  virtual QualType getType(ASTContext&) const = 0;  
+
+  virtual QualType getType(ASTContext&) const = 0;
   virtual void Profile(llvm::FoldingSetNodeID& profile) = 0;
   virtual void Profile(llvm::FoldingSetNodeID& profile) = 0;
-  
+
   // Implement isa<T> support.
   // Implement isa<T> support.
   static inline bool classof(const SymExpr*) { return true; }
   static inline bool classof(const SymExpr*) { return true; }
 };
 };
-  
+
 typedef unsigned SymbolID;
 typedef unsigned SymbolID;
-  
+
 class SymbolData : public SymExpr {
 class SymbolData : public SymExpr {
 private:
 private:
   const SymbolID Sym;
   const SymbolID Sym;
-  
+
 protected:
 protected:
-  SymbolData(Kind k, SymbolID sym) : SymExpr(k), Sym(sym) {}  
+  SymbolData(Kind k, SymbolID sym) : SymExpr(k), Sym(sym) {}
 
 
 public:
 public:
   virtual ~SymbolData() {}
   virtual ~SymbolData() {}
-  
+
   SymbolID getSymbolID() const { return Sym; }
   SymbolID getSymbolID() const { return Sym; }
 
 
   // Implement isa<T> support.
   // Implement isa<T> support.
-  static inline bool classof(const SymExpr* SE) { 
+  static inline bool classof(const SymExpr* SE) {
     Kind k = SE->getKind();
     Kind k = SE->getKind();
     return k > BEGIN_SYMBOLS && k < END_SYMBOLS;
     return k > BEGIN_SYMBOLS && k < END_SYMBOLS;
   }
   }
 };
 };
 
 
 typedef const SymbolData* SymbolRef;
 typedef const SymbolData* SymbolRef;
-  
+
 class SymbolRegionValue : public SymbolData {
 class SymbolRegionValue : public SymbolData {
   const MemRegion *R;
   const MemRegion *R;
   // We may cast the region to another type, so the expected type of the symbol
   // We may cast the region to another type, so the expected type of the symbol
@@ -96,7 +96,7 @@ class SymbolRegionValue : public SymbolData {
 public:
 public:
   SymbolRegionValue(SymbolID sym, const MemRegion *r, QualType t = QualType())
   SymbolRegionValue(SymbolID sym, const MemRegion *r, QualType t = QualType())
     : SymbolData(RegionValueKind, sym), R(r), T(t) {}
     : SymbolData(RegionValueKind, sym), R(r), T(t) {}
-  
+
   const MemRegion* getRegion() const { return R; }
   const MemRegion* getRegion() const { return R; }
 
 
   static void Profile(llvm::FoldingSetNodeID& profile, const MemRegion* R,
   static void Profile(llvm::FoldingSetNodeID& profile, const MemRegion* R,
@@ -105,13 +105,13 @@ public:
     profile.AddPointer(R);
     profile.AddPointer(R);
     T.Profile(profile);
     T.Profile(profile);
   }
   }
-  
+
   virtual void Profile(llvm::FoldingSetNodeID& profile) {
   virtual void Profile(llvm::FoldingSetNodeID& profile) {
     Profile(profile, R, T);
     Profile(profile, R, T);
   }
   }
-  
+
   void dumpToStream(llvm::raw_ostream &os) const;
   void dumpToStream(llvm::raw_ostream &os) const;
-  
+
   QualType getType(ASTContext&) const;
   QualType getType(ASTContext&) const;
 
 
   // Implement isa<T> support.
   // Implement isa<T> support.
@@ -131,17 +131,17 @@ public:
                  const void* symbolTag)
                  const void* symbolTag)
     : SymbolData(ConjuredKind, sym), S(s), T(t), Count(count),
     : SymbolData(ConjuredKind, sym), S(s), T(t), Count(count),
       SymbolTag(symbolTag) {}
       SymbolTag(symbolTag) {}
-  
+
   const Stmt* getStmt() const { return S; }
   const Stmt* getStmt() const { return S; }
   unsigned getCount() const { return Count; }
   unsigned getCount() const { return Count; }
   const void* getTag() const { return SymbolTag; }
   const void* getTag() const { return SymbolTag; }
-  
+
   QualType getType(ASTContext&) const;
   QualType getType(ASTContext&) const;
-  
+
   void dumpToStream(llvm::raw_ostream &os) const;
   void dumpToStream(llvm::raw_ostream &os) const;
-  
+
   static void Profile(llvm::FoldingSetNodeID& profile, const Stmt* S,
   static void Profile(llvm::FoldingSetNodeID& profile, const Stmt* S,
-                      QualType T, unsigned Count, const void* SymbolTag) {    
+                      QualType T, unsigned Count, const void* SymbolTag) {
     profile.AddInteger((unsigned) ConjuredKind);
     profile.AddInteger((unsigned) ConjuredKind);
     profile.AddPointer(S);
     profile.AddPointer(S);
     profile.Add(T);
     profile.Add(T);
@@ -156,39 +156,39 @@ public:
   // Implement isa<T> support.
   // Implement isa<T> support.
   static inline bool classof(const SymExpr* SE) {
   static inline bool classof(const SymExpr* SE) {
     return SE->getKind() == ConjuredKind;
     return SE->getKind() == ConjuredKind;
-  }  
+  }
 };
 };
-  
+
 class SymbolDerived : public SymbolData {
 class SymbolDerived : public SymbolData {
   SymbolRef parentSymbol;
   SymbolRef parentSymbol;
   const TypedRegion *R;
   const TypedRegion *R;
-  
+
 public:
 public:
   SymbolDerived(SymbolID sym, SymbolRef parent, const TypedRegion *r)
   SymbolDerived(SymbolID sym, SymbolRef parent, const TypedRegion *r)
     : SymbolData(DerivedKind, sym), parentSymbol(parent), R(r) {}
     : SymbolData(DerivedKind, sym), parentSymbol(parent), R(r) {}
 
 
   SymbolRef getParentSymbol() const { return parentSymbol; }
   SymbolRef getParentSymbol() const { return parentSymbol; }
   const TypedRegion *getRegion() const { return R; }
   const TypedRegion *getRegion() const { return R; }
-  
+
   QualType getType(ASTContext&) const;
   QualType getType(ASTContext&) const;
-  
+
   void dumpToStream(llvm::raw_ostream &os) const;
   void dumpToStream(llvm::raw_ostream &os) const;
-  
+
   static void Profile(llvm::FoldingSetNodeID& profile, SymbolRef parent,
   static void Profile(llvm::FoldingSetNodeID& profile, SymbolRef parent,
                       const TypedRegion *r) {
                       const TypedRegion *r) {
     profile.AddInteger((unsigned) DerivedKind);
     profile.AddInteger((unsigned) DerivedKind);
     profile.AddPointer(r);
     profile.AddPointer(r);
     profile.AddPointer(parent);
     profile.AddPointer(parent);
   }
   }
- 
+
   virtual void Profile(llvm::FoldingSetNodeID& profile) {
   virtual void Profile(llvm::FoldingSetNodeID& profile) {
     Profile(profile, parentSymbol, R);
     Profile(profile, parentSymbol, R);
   }
   }
-  
+
   // Implement isa<T> support.
   // Implement isa<T> support.
   static inline bool classof(const SymExpr* SE) {
   static inline bool classof(const SymExpr* SE) {
     return SE->getKind() == DerivedKind;
     return SE->getKind() == DerivedKind;
-  }  
+  }
 };
 };
 
 
 // SymIntExpr - Represents symbolic expression like 'x' + 3.
 // SymIntExpr - Represents symbolic expression like 'x' + 3.
@@ -205,16 +205,16 @@ public:
 
 
   // FIXME: We probably need to make this out-of-line to avoid redundant
   // FIXME: We probably need to make this out-of-line to avoid redundant
   // generation of virtual functions.
   // generation of virtual functions.
-  QualType getType(ASTContext& C) const { return T; }  
-  
+  QualType getType(ASTContext& C) const { return T; }
+
   BinaryOperator::Opcode getOpcode() const { return Op; }
   BinaryOperator::Opcode getOpcode() const { return Op; }
-    
-  void dumpToStream(llvm::raw_ostream &os) const;  
-  
+
+  void dumpToStream(llvm::raw_ostream &os) const;
+
   const SymExpr *getLHS() const { return LHS; }
   const SymExpr *getLHS() const { return LHS; }
   const llvm::APSInt &getRHS() const { return RHS; }
   const llvm::APSInt &getRHS() const { return RHS; }
 
 
-  static void Profile(llvm::FoldingSetNodeID& ID, const SymExpr *lhs, 
+  static void Profile(llvm::FoldingSetNodeID& ID, const SymExpr *lhs,
                       BinaryOperator::Opcode op, const llvm::APSInt& rhs,
                       BinaryOperator::Opcode op, const llvm::APSInt& rhs,
                       QualType t) {
                       QualType t) {
     ID.AddInteger((unsigned) SymIntKind);
     ID.AddInteger((unsigned) SymIntKind);
@@ -227,11 +227,11 @@ public:
   void Profile(llvm::FoldingSetNodeID& ID) {
   void Profile(llvm::FoldingSetNodeID& ID) {
     Profile(ID, LHS, Op, RHS, T);
     Profile(ID, LHS, Op, RHS, T);
   }
   }
-  
+
   // Implement isa<T> support.
   // Implement isa<T> support.
   static inline bool classof(const SymExpr* SE) {
   static inline bool classof(const SymExpr* SE) {
     return SE->getKind() == SymIntKind;
     return SE->getKind() == SymIntKind;
-  }  
+  }
 };
 };
 
 
 // SymSymExpr - Represents symbolic expression like 'x' + 'y'.
 // SymSymExpr - Represents symbolic expression like 'x' + 'y'.
@@ -248,13 +248,13 @@ public:
 
 
   const SymExpr *getLHS() const { return LHS; }
   const SymExpr *getLHS() const { return LHS; }
   const SymExpr *getRHS() const { return RHS; }
   const SymExpr *getRHS() const { return RHS; }
-  
+
   // FIXME: We probably need to make this out-of-line to avoid redundant
   // FIXME: We probably need to make this out-of-line to avoid redundant
   // generation of virtual functions.
   // generation of virtual functions.
   QualType getType(ASTContext& C) const { return T; }
   QualType getType(ASTContext& C) const { return T; }
-  
+
   void dumpToStream(llvm::raw_ostream &os) const;
   void dumpToStream(llvm::raw_ostream &os) const;
-  
+
   static void Profile(llvm::FoldingSetNodeID& ID, const SymExpr *lhs,
   static void Profile(llvm::FoldingSetNodeID& ID, const SymExpr *lhs,
                     BinaryOperator::Opcode op, const SymExpr *rhs, QualType t) {
                     BinaryOperator::Opcode op, const SymExpr *rhs, QualType t) {
     ID.AddInteger((unsigned) SymSymKind);
     ID.AddInteger((unsigned) SymSymKind);
@@ -267,48 +267,48 @@ public:
   void Profile(llvm::FoldingSetNodeID& ID) {
   void Profile(llvm::FoldingSetNodeID& ID) {
     Profile(ID, LHS, Op, RHS, T);
     Profile(ID, LHS, Op, RHS, T);
   }
   }
-  
+
   // Implement isa<T> support.
   // Implement isa<T> support.
   static inline bool classof(const SymExpr* SE) {
   static inline bool classof(const SymExpr* SE) {
     return SE->getKind() == SymSymKind;
     return SE->getKind() == SymSymKind;
-  }  
+  }
 };
 };
 
 
 class SymbolManager {
 class SymbolManager {
   typedef llvm::FoldingSet<SymExpr> DataSetTy;
   typedef llvm::FoldingSet<SymExpr> DataSetTy;
-  DataSetTy DataSet;  
+  DataSetTy DataSet;
   unsigned SymbolCounter;
   unsigned SymbolCounter;
   llvm::BumpPtrAllocator& BPAlloc;
   llvm::BumpPtrAllocator& BPAlloc;
   BasicValueFactory &BV;
   BasicValueFactory &BV;
   ASTContext& Ctx;
   ASTContext& Ctx;
-  
+
 public:
 public:
-  SymbolManager(ASTContext& ctx, BasicValueFactory &bv, 
+  SymbolManager(ASTContext& ctx, BasicValueFactory &bv,
                 llvm::BumpPtrAllocator& bpalloc)
                 llvm::BumpPtrAllocator& bpalloc)
     : SymbolCounter(0), BPAlloc(bpalloc), BV(bv), Ctx(ctx) {}
     : SymbolCounter(0), BPAlloc(bpalloc), BV(bv), Ctx(ctx) {}
-  
+
   ~SymbolManager();
   ~SymbolManager();
-  
+
   static bool canSymbolicate(QualType T);
   static bool canSymbolicate(QualType T);
 
 
   /// Make a unique symbol for MemRegion R according to its kind.
   /// Make a unique symbol for MemRegion R according to its kind.
-  const SymbolRegionValue* getRegionValueSymbol(const MemRegion* R, 
+  const SymbolRegionValue* getRegionValueSymbol(const MemRegion* R,
 						QualType T = QualType());
 						QualType T = QualType());
   const SymbolConjured* getConjuredSymbol(const Stmt* E, QualType T,
   const SymbolConjured* getConjuredSymbol(const Stmt* E, QualType T,
                                           unsigned VisitCount,
                                           unsigned VisitCount,
                                           const void* SymbolTag = 0);
                                           const void* SymbolTag = 0);
 
 
   const SymbolConjured* getConjuredSymbol(const Expr* E, unsigned VisitCount,
   const SymbolConjured* getConjuredSymbol(const Expr* E, unsigned VisitCount,
-                                          const void* SymbolTag = 0) {    
+                                          const void* SymbolTag = 0) {
     return getConjuredSymbol(E, E->getType(), VisitCount, SymbolTag);
     return getConjuredSymbol(E, E->getType(), VisitCount, SymbolTag);
   }
   }
-  
+
   const SymbolDerived *getDerivedSymbol(SymbolRef parentSymbol,
   const SymbolDerived *getDerivedSymbol(SymbolRef parentSymbol,
                                         const TypedRegion *R);
                                         const TypedRegion *R);
 
 
   const SymIntExpr *getSymIntExpr(const SymExpr *lhs, BinaryOperator::Opcode op,
   const SymIntExpr *getSymIntExpr(const SymExpr *lhs, BinaryOperator::Opcode op,
                                   const llvm::APSInt& rhs, QualType t);
                                   const llvm::APSInt& rhs, QualType t);
-  
+
   const SymIntExpr *getSymIntExpr(const SymExpr &lhs, BinaryOperator::Opcode op,
   const SymIntExpr *getSymIntExpr(const SymExpr &lhs, BinaryOperator::Opcode op,
                                   const llvm::APSInt& rhs, QualType t) {
                                   const llvm::APSInt& rhs, QualType t) {
     return getSymIntExpr(&lhs, op, rhs, t);
     return getSymIntExpr(&lhs, op, rhs, t);
@@ -316,27 +316,27 @@ public:
 
 
   const SymSymExpr *getSymSymExpr(const SymExpr *lhs, BinaryOperator::Opcode op,
   const SymSymExpr *getSymSymExpr(const SymExpr *lhs, BinaryOperator::Opcode op,
                                   const SymExpr *rhs, QualType t);
                                   const SymExpr *rhs, QualType t);
-  
+
   QualType getType(const SymExpr *SE) const {
   QualType getType(const SymExpr *SE) const {
     return SE->getType(Ctx);
     return SE->getType(Ctx);
   }
   }
-  
+
   ASTContext &getContext() { return Ctx; }
   ASTContext &getContext() { return Ctx; }
   BasicValueFactory &getBasicVals() { return BV; }
   BasicValueFactory &getBasicVals() { return BV; }
 };
 };
-  
+
 class SymbolReaper {
 class SymbolReaper {
   typedef llvm::DenseSet<SymbolRef> SetTy;
   typedef llvm::DenseSet<SymbolRef> SetTy;
-  
+
   SetTy TheLiving;
   SetTy TheLiving;
   SetTy TheDead;
   SetTy TheDead;
   LiveVariables& Liveness;
   LiveVariables& Liveness;
   SymbolManager& SymMgr;
   SymbolManager& SymMgr;
-  
+
 public:
 public:
   SymbolReaper(LiveVariables& liveness, SymbolManager& symmgr)
   SymbolReaper(LiveVariables& liveness, SymbolManager& symmgr)
     : Liveness(liveness), SymMgr(symmgr) {}
     : Liveness(liveness), SymMgr(symmgr) {}
-  
+
   ~SymbolReaper() {}
   ~SymbolReaper() {}
 
 
   bool isLive(SymbolRef sym);
   bool isLive(SymbolRef sym);
@@ -348,19 +348,19 @@ public:
   bool isLive(const Stmt* Loc, const VarDecl* VD) const {
   bool isLive(const Stmt* Loc, const VarDecl* VD) const {
     return Liveness.isLive(Loc, VD);
     return Liveness.isLive(Loc, VD);
   }
   }
-  
+
   void markLive(SymbolRef sym);
   void markLive(SymbolRef sym);
   bool maybeDead(SymbolRef sym);
   bool maybeDead(SymbolRef sym);
-  
+
   typedef SetTy::const_iterator dead_iterator;
   typedef SetTy::const_iterator dead_iterator;
   dead_iterator dead_begin() const { return TheDead.begin(); }
   dead_iterator dead_begin() const { return TheDead.begin(); }
   dead_iterator dead_end() const { return TheDead.end(); }
   dead_iterator dead_end() const { return TheDead.end(); }
-  
+
   bool hasDeadSymbols() const {
   bool hasDeadSymbols() const {
     return !TheDead.empty();
     return !TheDead.empty();
   }
   }
 };
 };
-  
+
 class SymbolVisitor {
 class SymbolVisitor {
 public:
 public:
   // VisitSymbol - A visitor method invoked by
   // VisitSymbol - A visitor method invoked by
@@ -369,7 +369,7 @@ public:
   virtual bool VisitSymbol(SymbolRef sym) = 0;
   virtual bool VisitSymbol(SymbolRef sym) = 0;
   virtual ~SymbolVisitor();
   virtual ~SymbolVisitor();
 };
 };
-  
+
 } // end clang namespace
 } // end clang namespace
 
 
 namespace llvm {
 namespace llvm {

+ 29 - 30
include/clang/Analysis/PathSensitive/ValueManager.h

@@ -25,15 +25,15 @@
 
 
 namespace llvm { class BumpPtrAllocator; }
 namespace llvm { class BumpPtrAllocator; }
 
 
-namespace clang {  
+namespace clang {
 
 
 class GRStateManager;
 class GRStateManager;
-  
+
 class ValueManager {
 class ValueManager {
 
 
-  ASTContext &Context;  
+  ASTContext &Context;
   BasicValueFactory BasicVals;
   BasicValueFactory BasicVals;
-  
+
   /// SymMgr - Object that manages the symbol information.
   /// SymMgr - Object that manages the symbol information.
   SymbolManager SymMgr;
   SymbolManager SymMgr;
 
 
@@ -41,12 +41,12 @@ class ValueManager {
   llvm::OwningPtr<SValuator> SVator;
   llvm::OwningPtr<SValuator> SVator;
 
 
   MemRegionManager MemMgr;
   MemRegionManager MemMgr;
-  
+
   GRStateManager &StateMgr;
   GRStateManager &StateMgr;
-  
+
   const QualType ArrayIndexTy;
   const QualType ArrayIndexTy;
   const unsigned ArrayIndexWidth;
   const unsigned ArrayIndexWidth;
-  
+
 public:
 public:
   ValueManager(llvm::BumpPtrAllocator &alloc, ASTContext &context,
   ValueManager(llvm::BumpPtrAllocator &alloc, ASTContext &context,
                GRStateManager &stateMgr)
                GRStateManager &stateMgr)
@@ -54,40 +54,39 @@ public:
                  SymMgr(context, BasicVals, alloc),
                  SymMgr(context, BasicVals, alloc),
                  MemMgr(context, alloc), StateMgr(stateMgr),
                  MemMgr(context, alloc), StateMgr(stateMgr),
                  ArrayIndexTy(context.IntTy),
                  ArrayIndexTy(context.IntTy),
-                 ArrayIndexWidth(context.getTypeSize(ArrayIndexTy))  
-  {
+                 ArrayIndexWidth(context.getTypeSize(ArrayIndexTy)) {
     // FIXME: Generalize later.
     // FIXME: Generalize later.
     SVator.reset(clang::CreateSimpleSValuator(*this));
     SVator.reset(clang::CreateSimpleSValuator(*this));
   }
   }
 
 
   // Accessors to submanagers.
   // Accessors to submanagers.
-  
+
   ASTContext &getContext() { return Context; }
   ASTContext &getContext() { return Context; }
   const ASTContext &getContext() const { return Context; }
   const ASTContext &getContext() const { return Context; }
-  
+
   GRStateManager &getStateManager() { return StateMgr; }
   GRStateManager &getStateManager() { return StateMgr; }
-  
+
   BasicValueFactory &getBasicValueFactory() { return BasicVals; }
   BasicValueFactory &getBasicValueFactory() { return BasicVals; }
   const BasicValueFactory &getBasicValueFactory() const { return BasicVals; }
   const BasicValueFactory &getBasicValueFactory() const { return BasicVals; }
-  
+
   SymbolManager &getSymbolManager() { return SymMgr; }
   SymbolManager &getSymbolManager() { return SymMgr; }
   const SymbolManager &getSymbolManager() const { return SymMgr; }
   const SymbolManager &getSymbolManager() const { return SymMgr; }
-                 
+
   SValuator &getSValuator() { return *SVator.get(); }
   SValuator &getSValuator() { return *SVator.get(); }
 
 
   MemRegionManager &getRegionManager() { return MemMgr; }
   MemRegionManager &getRegionManager() { return MemMgr; }
   const MemRegionManager &getRegionManager() const { return MemMgr; }
   const MemRegionManager &getRegionManager() const { return MemMgr; }
-  
+
   // Forwarding methods to SymbolManager.
   // Forwarding methods to SymbolManager.
-  
+
   const SymbolConjured* getConjuredSymbol(const Stmt* E, QualType T,
   const SymbolConjured* getConjuredSymbol(const Stmt* E, QualType T,
                                           unsigned VisitCount,
                                           unsigned VisitCount,
                                           const void* SymbolTag = 0) {
                                           const void* SymbolTag = 0) {
     return SymMgr.getConjuredSymbol(E, T, VisitCount, SymbolTag);
     return SymMgr.getConjuredSymbol(E, T, VisitCount, SymbolTag);
   }
   }
-  
+
   const SymbolConjured* getConjuredSymbol(const Expr* E, unsigned VisitCount,
   const SymbolConjured* getConjuredSymbol(const Expr* E, unsigned VisitCount,
-                                          const void* SymbolTag = 0) {    
+                                          const void* SymbolTag = 0) {
     return SymMgr.getConjuredSymbol(E, VisitCount, SymbolTag);
     return SymMgr.getConjuredSymbol(E, VisitCount, SymbolTag);
   }
   }
 
 
@@ -96,24 +95,24 @@ public:
 
 
   /// getRegionValueSymbolVal - make a unique symbol for value of R.
   /// getRegionValueSymbolVal - make a unique symbol for value of R.
   SVal getRegionValueSymbolVal(const MemRegion *R, QualType T = QualType());
   SVal getRegionValueSymbolVal(const MemRegion *R, QualType T = QualType());
-  
+
   SVal getRegionValueSymbolValOrUnknown(const MemRegion *R, QualType T) {
   SVal getRegionValueSymbolValOrUnknown(const MemRegion *R, QualType T) {
-    return SymMgr.canSymbolicate(T) ? getRegionValueSymbolVal(R, T) 
-                                    : UnknownVal();    
+    return SymMgr.canSymbolicate(T) ? getRegionValueSymbolVal(R, T)
+                                    : UnknownVal();
   }
   }
-  
-  SVal getConjuredSymbolVal(const Expr *E, unsigned Count);  
+
+  SVal getConjuredSymbolVal(const Expr *E, unsigned Count);
   SVal getConjuredSymbolVal(const Expr* E, QualType T, unsigned Count);
   SVal getConjuredSymbolVal(const Expr* E, QualType T, unsigned Count);
 
 
   SVal getDerivedRegionValueSymbolVal(SymbolRef parentSymbol,
   SVal getDerivedRegionValueSymbolVal(SymbolRef parentSymbol,
                                       const TypedRegion *R);
                                       const TypedRegion *R);
-  
+
   SVal getFunctionPointer(const FunctionDecl* FD);
   SVal getFunctionPointer(const FunctionDecl* FD);
 
 
   NonLoc makeCompoundVal(QualType T, llvm::ImmutableList<SVal> Vals) {
   NonLoc makeCompoundVal(QualType T, llvm::ImmutableList<SVal> Vals) {
     return nonloc::CompoundVal(BasicVals.getCompoundValData(T, Vals));
     return nonloc::CompoundVal(BasicVals.getCompoundValData(T, Vals));
   }
   }
-  
+
   NonLoc makeLazyCompoundVal(const GRState *state, const TypedRegion *R) {
   NonLoc makeLazyCompoundVal(const GRState *state, const TypedRegion *R) {
     return nonloc::LazyCompoundVal(BasicVals.getLazyCompoundValData(state, R));
     return nonloc::LazyCompoundVal(BasicVals.getLazyCompoundValData(state, R));
   }
   }
@@ -121,11 +120,11 @@ public:
   NonLoc makeZeroArrayIndex() {
   NonLoc makeZeroArrayIndex() {
     return nonloc::ConcreteInt(BasicVals.getValue(0, ArrayIndexTy));
     return nonloc::ConcreteInt(BasicVals.getValue(0, ArrayIndexTy));
   }
   }
-  
+
   NonLoc makeArrayIndex(uint64_t idx) {
   NonLoc makeArrayIndex(uint64_t idx) {
     return nonloc::ConcreteInt(BasicVals.getValue(idx, ArrayIndexTy));
     return nonloc::ConcreteInt(BasicVals.getValue(idx, ArrayIndexTy));
   }
   }
-  
+
   SVal convertToArrayIndex(SVal V);
   SVal convertToArrayIndex(SVal V);
 
 
   nonloc::ConcreteInt makeIntVal(const IntegerLiteral* I) {
   nonloc::ConcreteInt makeIntVal(const IntegerLiteral* I) {
@@ -136,7 +135,7 @@ public:
   nonloc::ConcreteInt makeIntVal(const llvm::APSInt& V) {
   nonloc::ConcreteInt makeIntVal(const llvm::APSInt& V) {
     return nonloc::ConcreteInt(BasicVals.getValue(V));
     return nonloc::ConcreteInt(BasicVals.getValue(V));
   }
   }
-  
+
   loc::ConcreteInt makeIntLocVal(const llvm::APSInt &v) {
   loc::ConcreteInt makeIntLocVal(const llvm::APSInt &v) {
     return loc::ConcreteInt(BasicVals.getValue(v));
     return loc::ConcreteInt(BasicVals.getValue(v));
   }
   }
@@ -170,10 +169,10 @@ public:
 
 
   NonLoc makeNonLoc(const SymExpr *lhs, BinaryOperator::Opcode op,
   NonLoc makeNonLoc(const SymExpr *lhs, BinaryOperator::Opcode op,
                     const llvm::APSInt& rhs, QualType T);
                     const llvm::APSInt& rhs, QualType T);
-  
+
   NonLoc makeNonLoc(const SymExpr *lhs, BinaryOperator::Opcode op,
   NonLoc makeNonLoc(const SymExpr *lhs, BinaryOperator::Opcode op,
                     const SymExpr *rhs, QualType T);
                     const SymExpr *rhs, QualType T);
-  
+
   NonLoc makeTruthVal(bool b, QualType T) {
   NonLoc makeTruthVal(bool b, QualType T) {
     return nonloc::ConcreteInt(BasicVals.getTruthValue(b, T));
     return nonloc::ConcreteInt(BasicVals.getTruthValue(b, T));
   }
   }

+ 55 - 55
include/clang/Analysis/ProgramPoint.h

@@ -26,7 +26,7 @@
 namespace clang {
 namespace clang {
 
 
 class LocationContext;
 class LocationContext;
-    
+
 class ProgramPoint {
 class ProgramPoint {
 public:
 public:
   enum Kind { BlockEdgeKind,
   enum Kind { BlockEdgeKind,
@@ -55,12 +55,12 @@ private:
   // context insensitive analysis.
   // context insensitive analysis.
   const LocationContext *L;
   const LocationContext *L;
   const void *Tag;
   const void *Tag;
-  
+
 protected:
 protected:
-  ProgramPoint(const void* P, Kind k, const LocationContext *l, 
+  ProgramPoint(const void* P, Kind k, const LocationContext *l,
                const void *tag = 0)
                const void *tag = 0)
     : Data(P, NULL), K(k), L(l), Tag(tag) {}
     : Data(P, NULL), K(k), L(l), Tag(tag) {}
-    
+
   ProgramPoint(const void* P1, const void* P2, Kind k, const LocationContext *l,
   ProgramPoint(const void* P1, const void* P2, Kind k, const LocationContext *l,
                const void *tag = 0)
                const void *tag = 0)
     : Data(P1, P2), K(k), L(l), Tag(tag) {}
     : Data(P1, P2), K(k), L(l), Tag(tag) {}
@@ -69,8 +69,8 @@ protected:
   const void* getData1() const { return Data.first; }
   const void* getData1() const { return Data.first; }
   const void* getData2() const { return Data.second; }
   const void* getData2() const { return Data.second; }
   const void *getTag() const { return Tag; }
   const void *getTag() const { return Tag; }
-    
-public:    
+
+public:
   Kind getKind() const { return K; }
   Kind getKind() const { return K; }
 
 
   const LocationContext *getLocationContext() const { return L; }
   const LocationContext *getLocationContext() const { return L; }
@@ -81,7 +81,7 @@ public:
     Profile(ID);
     Profile(ID);
     return ID.ComputeHash();
     return ID.ComputeHash();
   }
   }
-  
+
   static bool classof(const ProgramPoint*) { return true; }
   static bool classof(const ProgramPoint*) { return true; }
 
 
   bool operator==(const ProgramPoint & RHS) const {
   bool operator==(const ProgramPoint & RHS) const {
@@ -91,7 +91,7 @@ public:
   bool operator!=(const ProgramPoint& RHS) const {
   bool operator!=(const ProgramPoint& RHS) const {
     return K != RHS.K || Data != RHS.Data || L != RHS.L || Tag != RHS.Tag;
     return K != RHS.K || Data != RHS.Data || L != RHS.L || Tag != RHS.Tag;
   }
   }
-    
+
   void Profile(llvm::FoldingSetNodeID& ID) const {
   void Profile(llvm::FoldingSetNodeID& ID) const {
     ID.AddInteger((unsigned) K);
     ID.AddInteger((unsigned) K);
     ID.AddPointer(Data.first);
     ID.AddPointer(Data.first);
@@ -100,17 +100,17 @@ public:
     ID.AddPointer(Tag);
     ID.AddPointer(Tag);
   }
   }
 };
 };
-               
+
 class BlockEntrance : public ProgramPoint {
 class BlockEntrance : public ProgramPoint {
 public:
 public:
-  BlockEntrance(const CFGBlock* B, const LocationContext *L, 
+  BlockEntrance(const CFGBlock* B, const LocationContext *L,
                 const void *tag = 0)
                 const void *tag = 0)
     : ProgramPoint(B, BlockEntranceKind, L, tag) {}
     : ProgramPoint(B, BlockEntranceKind, L, tag) {}
-    
+
   CFGBlock* getBlock() const {
   CFGBlock* getBlock() const {
     return const_cast<CFGBlock*>(reinterpret_cast<const CFGBlock*>(getData1()));
     return const_cast<CFGBlock*>(reinterpret_cast<const CFGBlock*>(getData1()));
   }
   }
-  
+
   Stmt* getFirstStmt() const {
   Stmt* getFirstStmt() const {
     const CFGBlock* B = getBlock();
     const CFGBlock* B = getBlock();
     return B->empty() ? NULL : B->front();
     return B->empty() ? NULL : B->front();
@@ -123,9 +123,9 @@ public:
 
 
 class BlockExit : public ProgramPoint {
 class BlockExit : public ProgramPoint {
 public:
 public:
-  BlockExit(const CFGBlock* B, const LocationContext *L) 
+  BlockExit(const CFGBlock* B, const LocationContext *L)
     : ProgramPoint(B, BlockExitKind, L) {}
     : ProgramPoint(B, BlockExitKind, L) {}
-  
+
   CFGBlock* getBlock() const {
   CFGBlock* getBlock() const {
     return const_cast<CFGBlock*>(reinterpret_cast<const CFGBlock*>(getData1()));
     return const_cast<CFGBlock*>(reinterpret_cast<const CFGBlock*>(getData1()));
   }
   }
@@ -134,41 +134,41 @@ public:
     const CFGBlock* B = getBlock();
     const CFGBlock* B = getBlock();
     return B->empty() ? NULL : B->back();
     return B->empty() ? NULL : B->back();
   }
   }
-  
+
   Stmt* getTerminator() const {
   Stmt* getTerminator() const {
     return getBlock()->getTerminator();
     return getBlock()->getTerminator();
   }
   }
-    
+
   static bool classof(const ProgramPoint* Location) {
   static bool classof(const ProgramPoint* Location) {
     return Location->getKind() == BlockExitKind;
     return Location->getKind() == BlockExitKind;
   }
   }
 };
 };
-  
+
 class StmtPoint : public ProgramPoint {
 class StmtPoint : public ProgramPoint {
 public:
 public:
-  StmtPoint(const Stmt *S, const void *p2, Kind k, const LocationContext *L, 
+  StmtPoint(const Stmt *S, const void *p2, Kind k, const LocationContext *L,
             const void *tag)
             const void *tag)
     : ProgramPoint(S, p2, k, L, tag) {}
     : ProgramPoint(S, p2, k, L, tag) {}
-  
+
   const Stmt *getStmt() const { return (const Stmt*) getData1(); }
   const Stmt *getStmt() const { return (const Stmt*) getData1(); }
-  
+
   template <typename T>
   template <typename T>
   const T* getStmtAs() const { return llvm::dyn_cast<T>(getStmt()); }
   const T* getStmtAs() const { return llvm::dyn_cast<T>(getStmt()); }
-  
+
   static bool classof(const ProgramPoint* Location) {
   static bool classof(const ProgramPoint* Location) {
     unsigned k = Location->getKind();
     unsigned k = Location->getKind();
     return k >= PreStmtKind && k <= MaxPostStmtKind;
     return k >= PreStmtKind && k <= MaxPostStmtKind;
   }
   }
-};  
+};
+
 
 
-  
 class PreStmt : public StmtPoint {
 class PreStmt : public StmtPoint {
 public:
 public:
-  PreStmt(const Stmt *S, const LocationContext *L, const void *tag, 
+  PreStmt(const Stmt *S, const LocationContext *L, const void *tag,
           const Stmt *SubStmt = 0)
           const Stmt *SubStmt = 0)
     : StmtPoint(S, SubStmt, PreStmtKind, L, tag) {}
     : StmtPoint(S, SubStmt, PreStmtKind, L, tag) {}
 
 
-  const Stmt *getSubStmt() const { return (const Stmt*) getData2(); }  
+  const Stmt *getSubStmt() const { return (const Stmt*) getData2(); }
 
 
   static bool classof(const ProgramPoint* Location) {
   static bool classof(const ProgramPoint* Location) {
     return Location->getKind() == PreStmtKind;
     return Location->getKind() == PreStmtKind;
@@ -183,7 +183,7 @@ protected:
   PostStmt(const Stmt* S, const void* data, Kind k, const LocationContext *L,
   PostStmt(const Stmt* S, const void* data, Kind k, const LocationContext *L,
            const void *tag =0)
            const void *tag =0)
     : StmtPoint(S, data, k, L, tag) {}
     : StmtPoint(S, data, k, L, tag) {}
-  
+
 public:
 public:
   explicit PostStmt(const Stmt* S, const LocationContext *L,const void *tag = 0)
   explicit PostStmt(const Stmt* S, const LocationContext *L,const void *tag = 0)
     : StmtPoint(S, NULL, PostStmtKind, L, tag) {}
     : StmtPoint(S, NULL, PostStmtKind, L, tag) {}
@@ -196,15 +196,15 @@ public:
 
 
 class PostLocationChecksSucceed : public PostStmt {
 class PostLocationChecksSucceed : public PostStmt {
 public:
 public:
-  PostLocationChecksSucceed(const Stmt* S, const LocationContext *L, 
+  PostLocationChecksSucceed(const Stmt* S, const LocationContext *L,
                             const void *tag = 0)
                             const void *tag = 0)
     : PostStmt(S, PostLocationChecksSucceedKind, L, tag) {}
     : PostStmt(S, PostLocationChecksSucceedKind, L, tag) {}
-  
+
   static bool classof(const ProgramPoint* Location) {
   static bool classof(const ProgramPoint* Location) {
     return Location->getKind() == PostLocationChecksSucceedKind;
     return Location->getKind() == PostLocationChecksSucceedKind;
   }
   }
 };
 };
-  
+
 class PostStmtCustom : public PostStmt {
 class PostStmtCustom : public PostStmt {
 public:
 public:
   PostStmtCustom(const Stmt* S,
   PostStmtCustom(const Stmt* S,
@@ -216,22 +216,22 @@ public:
     return
     return
       *reinterpret_cast<const std::pair<const void*, const void*>*>(getData2());
       *reinterpret_cast<const std::pair<const void*, const void*>*>(getData2());
   }
   }
-  
+
   const void* getTag() const { return getTaggedPair().first; }
   const void* getTag() const { return getTaggedPair().first; }
-  
+
   const void* getTaggedData() const { return getTaggedPair().second; }
   const void* getTaggedData() const { return getTaggedPair().second; }
-    
+
   static bool classof(const ProgramPoint* Location) {
   static bool classof(const ProgramPoint* Location) {
     return Location->getKind() == PostStmtCustomKind;
     return Location->getKind() == PostStmtCustomKind;
   }
   }
 };
 };
-  
+
 class PostOutOfBoundsCheckFailed : public PostStmt {
 class PostOutOfBoundsCheckFailed : public PostStmt {
 public:
 public:
-  PostOutOfBoundsCheckFailed(const Stmt* S, const LocationContext *L, 
+  PostOutOfBoundsCheckFailed(const Stmt* S, const LocationContext *L,
                              const void *tag = 0)
                              const void *tag = 0)
     : PostStmt(S, PostOutOfBoundsCheckFailedKind, L, tag) {}
     : PostStmt(S, PostOutOfBoundsCheckFailedKind, L, tag) {}
-  
+
   static bool classof(const ProgramPoint* Location) {
   static bool classof(const ProgramPoint* Location) {
     return Location->getKind() == PostOutOfBoundsCheckFailedKind;
     return Location->getKind() == PostOutOfBoundsCheckFailedKind;
   }
   }
@@ -242,38 +242,38 @@ public:
   PostUndefLocationCheckFailed(const Stmt* S, const LocationContext *L,
   PostUndefLocationCheckFailed(const Stmt* S, const LocationContext *L,
                                const void *tag = 0)
                                const void *tag = 0)
     : PostStmt(S, PostUndefLocationCheckFailedKind, L, tag) {}
     : PostStmt(S, PostUndefLocationCheckFailedKind, L, tag) {}
-  
+
   static bool classof(const ProgramPoint* Location) {
   static bool classof(const ProgramPoint* Location) {
     return Location->getKind() == PostUndefLocationCheckFailedKind;
     return Location->getKind() == PostUndefLocationCheckFailedKind;
   }
   }
 };
 };
-  
+
 class PostNullCheckFailed : public PostStmt {
 class PostNullCheckFailed : public PostStmt {
 public:
 public:
   PostNullCheckFailed(const Stmt* S, const LocationContext *L,
   PostNullCheckFailed(const Stmt* S, const LocationContext *L,
                       const void *tag = 0)
                       const void *tag = 0)
     : PostStmt(S, PostNullCheckFailedKind, L, tag) {}
     : PostStmt(S, PostNullCheckFailedKind, L, tag) {}
-  
+
   static bool classof(const ProgramPoint* Location) {
   static bool classof(const ProgramPoint* Location) {
     return Location->getKind() == PostNullCheckFailedKind;
     return Location->getKind() == PostNullCheckFailedKind;
   }
   }
 };
 };
-  
+
 class PostLoad : public PostStmt {
 class PostLoad : public PostStmt {
 public:
 public:
   PostLoad(const Stmt* S, const LocationContext *L, const void *tag = 0)
   PostLoad(const Stmt* S, const LocationContext *L, const void *tag = 0)
     : PostStmt(S, PostLoadKind, L, tag) {}
     : PostStmt(S, PostLoadKind, L, tag) {}
-  
+
   static bool classof(const ProgramPoint* Location) {
   static bool classof(const ProgramPoint* Location) {
     return Location->getKind() == PostLoadKind;
     return Location->getKind() == PostLoadKind;
   }
   }
 };
 };
-  
+
 class PostStore : public PostStmt {
 class PostStore : public PostStmt {
 public:
 public:
   PostStore(const Stmt* S, const LocationContext *L, const void *tag = 0)
   PostStore(const Stmt* S, const LocationContext *L, const void *tag = 0)
     : PostStmt(S, PostStoreKind, L, tag) {}
     : PostStmt(S, PostStoreKind, L, tag) {}
-  
+
   static bool classof(const ProgramPoint* Location) {
   static bool classof(const ProgramPoint* Location) {
     return Location->getKind() == PostStoreKind;
     return Location->getKind() == PostStoreKind;
   }
   }
@@ -283,52 +283,52 @@ class PostLValue : public PostStmt {
 public:
 public:
   PostLValue(const Stmt* S, const LocationContext *L, const void *tag = 0)
   PostLValue(const Stmt* S, const LocationContext *L, const void *tag = 0)
     : PostStmt(S, PostLValueKind, L, tag) {}
     : PostStmt(S, PostLValueKind, L, tag) {}
-  
+
   static bool classof(const ProgramPoint* Location) {
   static bool classof(const ProgramPoint* Location) {
     return Location->getKind() == PostLValueKind;
     return Location->getKind() == PostLValueKind;
   }
   }
-};  
-  
+};
+
 class PostPurgeDeadSymbols : public PostStmt {
 class PostPurgeDeadSymbols : public PostStmt {
 public:
 public:
-  PostPurgeDeadSymbols(const Stmt* S, const LocationContext *L, 
+  PostPurgeDeadSymbols(const Stmt* S, const LocationContext *L,
                        const void *tag = 0)
                        const void *tag = 0)
     : PostStmt(S, PostPurgeDeadSymbolsKind, L, tag) {}
     : PostStmt(S, PostPurgeDeadSymbolsKind, L, tag) {}
-  
+
   static bool classof(const ProgramPoint* Location) {
   static bool classof(const ProgramPoint* Location) {
     return Location->getKind() == PostPurgeDeadSymbolsKind;
     return Location->getKind() == PostPurgeDeadSymbolsKind;
   }
   }
 };
 };
-  
+
 class BlockEdge : public ProgramPoint {
 class BlockEdge : public ProgramPoint {
 public:
 public:
   BlockEdge(const CFGBlock* B1, const CFGBlock* B2, const LocationContext *L)
   BlockEdge(const CFGBlock* B1, const CFGBlock* B2, const LocationContext *L)
     : ProgramPoint(B1, B2, BlockEdgeKind, L) {}
     : ProgramPoint(B1, B2, BlockEdgeKind, L) {}
-    
+
   CFGBlock* getSrc() const {
   CFGBlock* getSrc() const {
     return const_cast<CFGBlock*>(static_cast<const CFGBlock*>(getData1()));
     return const_cast<CFGBlock*>(static_cast<const CFGBlock*>(getData1()));
   }
   }
-    
+
   CFGBlock* getDst() const {
   CFGBlock* getDst() const {
     return const_cast<CFGBlock*>(static_cast<const CFGBlock*>(getData2()));
     return const_cast<CFGBlock*>(static_cast<const CFGBlock*>(getData2()));
   }
   }
-  
+
   static bool classof(const ProgramPoint* Location) {
   static bool classof(const ProgramPoint* Location) {
     return Location->getKind() == BlockEdgeKind;
     return Location->getKind() == BlockEdgeKind;
   }
   }
 };
 };
 
 
-  
+
 } // end namespace clang
 } // end namespace clang
 
 
 
 
-namespace llvm { // Traits specialization for DenseMap 
-  
+namespace llvm { // Traits specialization for DenseMap
+
 template <> struct DenseMapInfo<clang::ProgramPoint> {
 template <> struct DenseMapInfo<clang::ProgramPoint> {
 
 
 static inline clang::ProgramPoint getEmptyKey() {
 static inline clang::ProgramPoint getEmptyKey() {
   uintptr_t x =
   uintptr_t x =
-   reinterpret_cast<uintptr_t>(DenseMapInfo<void*>::getEmptyKey()) & ~0x7;    
+   reinterpret_cast<uintptr_t>(DenseMapInfo<void*>::getEmptyKey()) & ~0x7;
   return clang::BlockEntrance(reinterpret_cast<clang::CFGBlock*>(x), 0);
   return clang::BlockEntrance(reinterpret_cast<clang::CFGBlock*>(x), 0);
 }
 }
 
 

+ 63 - 63
include/clang/Analysis/Support/BlkExprDeclBitVector.h

@@ -23,18 +23,18 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/DenseMap.h"
 
 
 namespace clang {
 namespace clang {
-  
+
   class Stmt;
   class Stmt;
   class ASTContext;
   class ASTContext;
 
 
 struct DeclBitVector_Types {
 struct DeclBitVector_Types {
-  
+
   class Idx {
   class Idx {
     unsigned I;
     unsigned I;
   public:
   public:
     explicit Idx(unsigned i) : I(i) {}
     explicit Idx(unsigned i) : I(i) {}
     Idx() : I(~0U) {}
     Idx() : I(~0U) {}
-    
+
     bool isValid() const {
     bool isValid() const {
       return I != ~0U;
       return I != ~0U;
     }
     }
@@ -42,35 +42,35 @@ struct DeclBitVector_Types {
       assert (isValid());
       assert (isValid());
       return I;
       return I;
     }
     }
-  };    
-    
+  };
+
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   // AnalysisDataTy - Whole-function meta data.
   // AnalysisDataTy - Whole-function meta data.
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
-  
+
   class AnalysisDataTy {
   class AnalysisDataTy {
   public:
   public:
     typedef llvm::DenseMap<const NamedDecl*, unsigned > DMapTy;
     typedef llvm::DenseMap<const NamedDecl*, unsigned > DMapTy;
     typedef DMapTy::const_iterator decl_iterator;
     typedef DMapTy::const_iterator decl_iterator;
-    
+
   protected:
   protected:
-    DMapTy DMap;    
+    DMapTy DMap;
     unsigned NDecls;
     unsigned NDecls;
-    
+
   public:
   public:
-    
+
     AnalysisDataTy() : NDecls(0) {}
     AnalysisDataTy() : NDecls(0) {}
     virtual ~AnalysisDataTy() {}
     virtual ~AnalysisDataTy() {}
-    
+
     bool isTracked(const NamedDecl* SD) { return DMap.find(SD) != DMap.end(); }
     bool isTracked(const NamedDecl* SD) { return DMap.find(SD) != DMap.end(); }
-    
+
     Idx getIdx(const NamedDecl* SD) const {
     Idx getIdx(const NamedDecl* SD) const {
       DMapTy::const_iterator I = DMap.find(SD);
       DMapTy::const_iterator I = DMap.find(SD);
       return I == DMap.end() ? Idx() : Idx(I->second);
       return I == DMap.end() ? Idx() : Idx(I->second);
     }
     }
 
 
     unsigned getNumDecls() const { return NDecls; }
     unsigned getNumDecls() const { return NDecls; }
-    
+
     void Register(const NamedDecl* SD) {
     void Register(const NamedDecl* SD) {
       if (!isTracked(SD)) DMap[SD] = NDecls++;
       if (!isTracked(SD)) DMap[SD] = NDecls++;
     }
     }
@@ -78,44 +78,44 @@ struct DeclBitVector_Types {
     decl_iterator begin_decl() const { return DMap.begin(); }
     decl_iterator begin_decl() const { return DMap.begin(); }
     decl_iterator end_decl() const { return DMap.end(); }
     decl_iterator end_decl() const { return DMap.end(); }
   };
   };
-  
+
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   // ValTy - Dataflow value.
   // ValTy - Dataflow value.
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
-  
+
   class ValTy {
   class ValTy {
     llvm::BitVector DeclBV;
     llvm::BitVector DeclBV;
   public:
   public:
-    
+
     void resetDeclValues(AnalysisDataTy& AD) {
     void resetDeclValues(AnalysisDataTy& AD) {
-      DeclBV.resize(AD.getNumDecls()); 
+      DeclBV.resize(AD.getNumDecls());
       DeclBV.reset();
       DeclBV.reset();
     }
     }
 
 
     void setDeclValues(AnalysisDataTy& AD) {
     void setDeclValues(AnalysisDataTy& AD) {
-      DeclBV.resize(AD.getNumDecls()); 
+      DeclBV.resize(AD.getNumDecls());
       DeclBV.set();
       DeclBV.set();
     }
     }
-    
+
     void resetValues(AnalysisDataTy& AD) {
     void resetValues(AnalysisDataTy& AD) {
       resetDeclValues(AD);
       resetDeclValues(AD);
-    }    
-    
-    bool operator==(const ValTy& RHS) const { 
+    }
+
+    bool operator==(const ValTy& RHS) const {
       assert (sizesEqual(RHS));
       assert (sizesEqual(RHS));
       return DeclBV == RHS.DeclBV;
       return DeclBV == RHS.DeclBV;
     }
     }
-    
+
     void copyValues(const ValTy& RHS) { DeclBV = RHS.DeclBV; }
     void copyValues(const ValTy& RHS) { DeclBV = RHS.DeclBV; }
-    
+
     llvm::BitVector::reference getBit(unsigned i) {
     llvm::BitVector::reference getBit(unsigned i) {
       return DeclBV[i];
       return DeclBV[i];
     }
     }
-    
+
     bool getBit(unsigned i) const {
     bool getBit(unsigned i) const {
       return DeclBV[i];
       return DeclBV[i];
     }
     }
-    
+
     llvm::BitVector::reference
     llvm::BitVector::reference
     operator()(const NamedDecl* ND, const AnalysisDataTy& AD) {
     operator()(const NamedDecl* ND, const AnalysisDataTy& AD) {
       return getBit(AD.getIdx(ND));
       return getBit(AD.getIdx(ND));
@@ -124,48 +124,48 @@ struct DeclBitVector_Types {
     bool operator()(const NamedDecl* ND, const AnalysisDataTy& AD) const {
     bool operator()(const NamedDecl* ND, const AnalysisDataTy& AD) const {
       return getBit(AD.getIdx(ND));
       return getBit(AD.getIdx(ND));
     }
     }
-    
-    llvm::BitVector::reference getDeclBit(unsigned i) { return DeclBV[i]; }    
+
+    llvm::BitVector::reference getDeclBit(unsigned i) { return DeclBV[i]; }
     const llvm::BitVector::reference getDeclBit(unsigned i) const {
     const llvm::BitVector::reference getDeclBit(unsigned i) const {
       return const_cast<llvm::BitVector&>(DeclBV)[i];
       return const_cast<llvm::BitVector&>(DeclBV)[i];
     }
     }
-        
+
     ValTy& operator|=(const ValTy& RHS) {
     ValTy& operator|=(const ValTy& RHS) {
       assert (sizesEqual(RHS));
       assert (sizesEqual(RHS));
       DeclBV |= RHS.DeclBV;
       DeclBV |= RHS.DeclBV;
       return *this;
       return *this;
     }
     }
-    
+
     ValTy& operator&=(const ValTy& RHS) {
     ValTy& operator&=(const ValTy& RHS) {
       assert (sizesEqual(RHS));
       assert (sizesEqual(RHS));
       DeclBV &= RHS.DeclBV;
       DeclBV &= RHS.DeclBV;
       return *this;
       return *this;
     }
     }
-    
+
     ValTy& OrDeclBits(const ValTy& RHS) {
     ValTy& OrDeclBits(const ValTy& RHS) {
       return operator|=(RHS);
       return operator|=(RHS);
     }
     }
-    
+
     ValTy& AndDeclBits(const ValTy& RHS) {
     ValTy& AndDeclBits(const ValTy& RHS) {
       return operator&=(RHS);
       return operator&=(RHS);
     }
     }
-        
+
     bool sizesEqual(const ValTy& RHS) const {
     bool sizesEqual(const ValTy& RHS) const {
       return DeclBV.size() == RHS.DeclBV.size();
       return DeclBV.size() == RHS.DeclBV.size();
     }
     }
   };
   };
-  
+
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   // Some useful merge operations.
   // Some useful merge operations.
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
-    
+
   struct Union { void operator()(ValTy& Dst, ValTy& Src) { Dst |= Src; } };
   struct Union { void operator()(ValTy& Dst, ValTy& Src) { Dst |= Src; } };
   struct Intersect { void operator()(ValTy& Dst, ValTy& Src) { Dst &= Src; } };
   struct Intersect { void operator()(ValTy& Dst, ValTy& Src) { Dst &= Src; } };
 };
 };
 
 
 
 
 struct StmtDeclBitVector_Types {
 struct StmtDeclBitVector_Types {
-  
+
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   // AnalysisDataTy - Whole-function meta data.
   // AnalysisDataTy - Whole-function meta data.
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
@@ -179,13 +179,13 @@ struct StmtDeclBitVector_Types {
 
 
     void setContext(ASTContext& c) { ctx = &c; }
     void setContext(ASTContext& c) { ctx = &c; }
     ASTContext& getContext() {
     ASTContext& getContext() {
-      assert(ctx && "ASTContext should not be NULL."); 
+      assert(ctx && "ASTContext should not be NULL.");
       return *ctx;
       return *ctx;
     }
     }
 
 
     void setCFG(CFG& c) { cfg = &c; }
     void setCFG(CFG& c) { cfg = &c; }
     CFG& getCFG() { assert(cfg && "CFG should not be NULL."); return *cfg; }
     CFG& getCFG() { assert(cfg && "CFG should not be NULL."); return *cfg; }
-    
+
     bool isTracked(const Stmt* S) { return cfg->isBlkExpr(S); }
     bool isTracked(const Stmt* S) { return cfg->isBlkExpr(S); }
     using DeclBitVector_Types::AnalysisDataTy::isTracked;
     using DeclBitVector_Types::AnalysisDataTy::isTracked;
 
 
@@ -195,7 +195,7 @@ struct StmtDeclBitVector_Types {
       return I;
       return I;
     }
     }
     using DeclBitVector_Types::AnalysisDataTy::getIdx;
     using DeclBitVector_Types::AnalysisDataTy::getIdx;
-    
+
     unsigned getNumBlkExprs() const { return cfg->getNumBlkExprs(); }
     unsigned getNumBlkExprs() const { return cfg->getNumBlkExprs(); }
   };
   };
 
 
@@ -206,101 +206,101 @@ struct StmtDeclBitVector_Types {
   class ValTy : public DeclBitVector_Types::ValTy {
   class ValTy : public DeclBitVector_Types::ValTy {
     llvm::BitVector BlkExprBV;
     llvm::BitVector BlkExprBV;
     typedef DeclBitVector_Types::ValTy ParentTy;
     typedef DeclBitVector_Types::ValTy ParentTy;
-    
+
     static inline ParentTy& ParentRef(ValTy& X) {
     static inline ParentTy& ParentRef(ValTy& X) {
       return static_cast<ParentTy&>(X);
       return static_cast<ParentTy&>(X);
     }
     }
-    
+
     static inline const ParentTy& ParentRef(const ValTy& X) {
     static inline const ParentTy& ParentRef(const ValTy& X) {
       return static_cast<const ParentTy&>(X);
       return static_cast<const ParentTy&>(X);
     }
     }
-    
+
   public:
   public:
 
 
     void resetBlkExprValues(AnalysisDataTy& AD) {
     void resetBlkExprValues(AnalysisDataTy& AD) {
       BlkExprBV.resize(AD.getNumBlkExprs());
       BlkExprBV.resize(AD.getNumBlkExprs());
       BlkExprBV.reset();
       BlkExprBV.reset();
     }
     }
-    
+
     void setBlkExprValues(AnalysisDataTy& AD) {
     void setBlkExprValues(AnalysisDataTy& AD) {
       BlkExprBV.resize(AD.getNumBlkExprs());
       BlkExprBV.resize(AD.getNumBlkExprs());
       BlkExprBV.set();
       BlkExprBV.set();
     }
     }
-    
+
     void resetValues(AnalysisDataTy& AD) {
     void resetValues(AnalysisDataTy& AD) {
       resetDeclValues(AD);
       resetDeclValues(AD);
       resetBlkExprValues(AD);
       resetBlkExprValues(AD);
     }
     }
-    
+
     void setValues(AnalysisDataTy& AD) {
     void setValues(AnalysisDataTy& AD) {
       setDeclValues(AD);
       setDeclValues(AD);
       setBlkExprValues(AD);
       setBlkExprValues(AD);
     }
     }
-    
-    bool operator==(const ValTy& RHS) const { 
-      return ParentRef(*this) == ParentRef(RHS) 
+
+    bool operator==(const ValTy& RHS) const {
+      return ParentRef(*this) == ParentRef(RHS)
           && BlkExprBV == RHS.BlkExprBV;
           && BlkExprBV == RHS.BlkExprBV;
     }
     }
-    
+
     void copyValues(const ValTy& RHS) {
     void copyValues(const ValTy& RHS) {
       ParentRef(*this).copyValues(ParentRef(RHS));
       ParentRef(*this).copyValues(ParentRef(RHS));
       BlkExprBV = RHS.BlkExprBV;
       BlkExprBV = RHS.BlkExprBV;
     }
     }
-        
+
     llvm::BitVector::reference
     llvm::BitVector::reference
     operator()(const Stmt* S, const AnalysisDataTy& AD) {
     operator()(const Stmt* S, const AnalysisDataTy& AD) {
-      return BlkExprBV[AD.getIdx(S)];      
-    }    
+      return BlkExprBV[AD.getIdx(S)];
+    }
     const llvm::BitVector::reference
     const llvm::BitVector::reference
     operator()(const Stmt* S, const AnalysisDataTy& AD) const {
     operator()(const Stmt* S, const AnalysisDataTy& AD) const {
       return const_cast<ValTy&>(*this)(S,AD);
       return const_cast<ValTy&>(*this)(S,AD);
     }
     }
-    
+
     using DeclBitVector_Types::ValTy::operator();
     using DeclBitVector_Types::ValTy::operator();
 
 
-    
-    llvm::BitVector::reference getStmtBit(unsigned i) { return BlkExprBV[i]; }    
+
+    llvm::BitVector::reference getStmtBit(unsigned i) { return BlkExprBV[i]; }
     const llvm::BitVector::reference getStmtBit(unsigned i) const {
     const llvm::BitVector::reference getStmtBit(unsigned i) const {
       return const_cast<llvm::BitVector&>(BlkExprBV)[i];
       return const_cast<llvm::BitVector&>(BlkExprBV)[i];
     }
     }
-    
+
     ValTy& OrBlkExprBits(const ValTy& RHS) {
     ValTy& OrBlkExprBits(const ValTy& RHS) {
       BlkExprBV |= RHS.BlkExprBV;
       BlkExprBV |= RHS.BlkExprBV;
       return *this;
       return *this;
     }
     }
-    
+
     ValTy& AndBlkExprBits(const ValTy& RHS) {
     ValTy& AndBlkExprBits(const ValTy& RHS) {
       BlkExprBV &= RHS.BlkExprBV;
       BlkExprBV &= RHS.BlkExprBV;
       return *this;
       return *this;
     }
     }
-    
+
     ValTy& operator|=(const ValTy& RHS) {
     ValTy& operator|=(const ValTy& RHS) {
       assert (sizesEqual(RHS));
       assert (sizesEqual(RHS));
       ParentRef(*this) |= ParentRef(RHS);
       ParentRef(*this) |= ParentRef(RHS);
       BlkExprBV |= RHS.BlkExprBV;
       BlkExprBV |= RHS.BlkExprBV;
       return *this;
       return *this;
     }
     }
-    
+
     ValTy& operator&=(const ValTy& RHS) {
     ValTy& operator&=(const ValTy& RHS) {
       assert (sizesEqual(RHS));
       assert (sizesEqual(RHS));
       ParentRef(*this) &= ParentRef(RHS);
       ParentRef(*this) &= ParentRef(RHS);
       BlkExprBV &= RHS.BlkExprBV;
       BlkExprBV &= RHS.BlkExprBV;
       return *this;
       return *this;
     }
     }
-    
+
     bool sizesEqual(const ValTy& RHS) const {
     bool sizesEqual(const ValTy& RHS) const {
       return ParentRef(*this).sizesEqual(ParentRef(RHS))
       return ParentRef(*this).sizesEqual(ParentRef(RHS))
           && BlkExprBV.size() == RHS.BlkExprBV.size();
           && BlkExprBV.size() == RHS.BlkExprBV.size();
     }
     }
   };
   };
-  
+
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   // Some useful merge operations.
   // Some useful merge operations.
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
-  
+
   struct Union { void operator()(ValTy& Dst, ValTy& Src) { Dst |= Src; } };
   struct Union { void operator()(ValTy& Dst, ValTy& Src) { Dst |= Src; } };
   struct Intersect { void operator()(ValTy& Dst, ValTy& Src) { Dst &= Src; } };
   struct Intersect { void operator()(ValTy& Dst, ValTy& Src) { Dst &= Src; } };
-  
+
 };
 };
 } // end namespace clang
 } // end namespace clang
 
 

+ 6 - 6
include/clang/Analysis/Support/Optional.h

@@ -17,7 +17,7 @@
 #define LLVM_CLANG_ANALYSIS_OPTIONAL
 #define LLVM_CLANG_ANALYSIS_OPTIONAL
 
 
 namespace clang {
 namespace clang {
-  
+
 template<typename T>
 template<typename T>
 class Optional {
 class Optional {
   const T x;
   const T x;
@@ -25,15 +25,15 @@ class Optional {
 public:
 public:
   explicit Optional() : hasVal(false) {}
   explicit Optional() : hasVal(false) {}
   Optional(const T &y) : x(y), hasVal(true) {}
   Optional(const T &y) : x(y), hasVal(true) {}
-  
+
   static inline Optional create(const T* y) {
   static inline Optional create(const T* y) {
     return y ? Optional(*y) : Optional();
     return y ? Optional(*y) : Optional();
   }
   }
-  
+
   const T* getPointer() const { assert(hasVal); return &x; }
   const T* getPointer() const { assert(hasVal); return &x; }
-  
+
   operator bool() const { return hasVal; }
   operator bool() const { return hasVal; }
-  const T* operator->() const { return getPointer(); } 
+  const T* operator->() const { return getPointer(); }
   const T& operator*() const { assert(hasVal); return x; }
   const T& operator*() const { assert(hasVal); return x; }
 };
 };
 } //end clang namespace
 } //end clang namespace
@@ -46,7 +46,7 @@ struct simplify_type<const ::clang::Optional<T> > {
     return Val.getPointer();
     return Val.getPointer();
   }
   }
 };
 };
-  
+
 template <typename T>
 template <typename T>
 struct simplify_type< ::clang::Optional<T> >
 struct simplify_type< ::clang::Optional<T> >
   : public simplify_type<const ::clang::Optional<T> > {};
   : public simplify_type<const ::clang::Optional<T> > {};

+ 3 - 3
include/clang/Analysis/Support/SaveAndRestore.h

@@ -16,7 +16,7 @@
 #define LLVM_CLANG_ANALYSIS_SAVERESTORE
 #define LLVM_CLANG_ANALYSIS_SAVERESTORE
 
 
 namespace clang {
 namespace clang {
-  
+
 // SaveAndRestore - A utility class that uses RAII to save and restore
 // SaveAndRestore - A utility class that uses RAII to save and restore
 //  the value of a variable.
 //  the value of a variable.
 template<typename T>
 template<typename T>
@@ -24,7 +24,7 @@ struct SaveAndRestore {
   SaveAndRestore(T& x) : X(x), old_value(x) {}
   SaveAndRestore(T& x) : X(x), old_value(x) {}
   ~SaveAndRestore() { X = old_value; }
   ~SaveAndRestore() { X = old_value; }
   T get() { return old_value; }
   T get() { return old_value; }
-private:  
+private:
   T& X;
   T& X;
   T old_value;
   T old_value;
 };
 };
@@ -39,6 +39,6 @@ private:
   bool& X;
   bool& X;
   const bool old_value;
   const bool old_value;
 };
 };
-  
+
 }
 }
 #endif
 #endif

+ 7 - 7
include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h

@@ -30,28 +30,28 @@ break;
 #define DEFAULT_DISPATCH_VARDECL(CLASS) void Visit##CLASS(CLASS* D)\
 #define DEFAULT_DISPATCH_VARDECL(CLASS) void Visit##CLASS(CLASS* D)\
   { static_cast<ImplClass*>(this)->VisitVarDecl(D); }
   { static_cast<ImplClass*>(this)->VisitVarDecl(D); }
 
 
-  
+
 namespace clang {
 namespace clang {
 template <typename ImplClass>
 template <typename ImplClass>
 class CFGRecStmtDeclVisitor : public CFGRecStmtVisitor<ImplClass> {
 class CFGRecStmtDeclVisitor : public CFGRecStmtVisitor<ImplClass> {
-public:  
+public:
 
 
   void VisitDeclRefExpr(DeclRefExpr* DR) {
   void VisitDeclRefExpr(DeclRefExpr* DR) {
-    static_cast<ImplClass*>(this)->VisitDecl(DR->getDecl()); 
+    static_cast<ImplClass*>(this)->VisitDecl(DR->getDecl());
   }
   }
-  
+
   void VisitDeclStmt(DeclStmt* DS) {
   void VisitDeclStmt(DeclStmt* DS) {
     for (DeclStmt::decl_iterator DI = DS->decl_begin(), DE = DS->decl_end();
     for (DeclStmt::decl_iterator DI = DS->decl_begin(), DE = DS->decl_end();
         DI != DE; ++DI) {
         DI != DE; ++DI) {
       Decl* D = *DI;
       Decl* D = *DI;
-      static_cast<ImplClass*>(this)->VisitDecl(D); 
+      static_cast<ImplClass*>(this)->VisitDecl(D);
       // Visit the initializer.
       // Visit the initializer.
       if (VarDecl* VD = dyn_cast<VarDecl>(D))
       if (VarDecl* VD = dyn_cast<VarDecl>(D))
         if (Expr* I = VD->getInit())
         if (Expr* I = VD->getInit())
           static_cast<ImplClass*>(this)->Visit(I);
           static_cast<ImplClass*>(this)->Visit(I);
     }
     }
   }
   }
-    
+
   void VisitDecl(Decl* D) {
   void VisitDecl(Decl* D) {
     switch (D->getKind()) {
     switch (D->getKind()) {
         DISPATCH_CASE(Function,FunctionDecl)
         DISPATCH_CASE(Function,FunctionDecl)
@@ -67,7 +67,7 @@ public:
         assert(false && "Subtype of ScopedDecl not handled.");
         assert(false && "Subtype of ScopedDecl not handled.");
     }
     }
   }
   }
-  
+
   DEFAULT_DISPATCH(VarDecl)
   DEFAULT_DISPATCH(VarDecl)
   DEFAULT_DISPATCH(FunctionDecl)
   DEFAULT_DISPATCH(FunctionDecl)
   DEFAULT_DISPATCH_VARDECL(OriginalParmVarDecl)
   DEFAULT_DISPATCH_VARDECL(OriginalParmVarDecl)

+ 2 - 2
include/clang/Analysis/Visitors/CFGRecStmtVisitor.h

@@ -20,12 +20,12 @@
 namespace clang {
 namespace clang {
 template <typename ImplClass>
 template <typename ImplClass>
 class CFGRecStmtVisitor : public CFGStmtVisitor<ImplClass,void> {
 class CFGRecStmtVisitor : public CFGStmtVisitor<ImplClass,void> {
-public:  
+public:
 
 
   void VisitStmt(Stmt* S) {
   void VisitStmt(Stmt* S) {
     static_cast< ImplClass* >(this)->VisitChildren(S);
     static_cast< ImplClass* >(this)->VisitChildren(S);
   }
   }
-      
+
   // Defining operator() allows the visitor to be used as a C++ style functor.
   // Defining operator() allows the visitor to be used as a C++ style functor.
   void operator()(Stmt* S) { static_cast<ImplClass*>(this)->BlockStmt_Visit(S);}
   void operator()(Stmt* S) { static_cast<ImplClass*>(this)->BlockStmt_Visit(S);}
 };
 };

+ 30 - 30
include/clang/Analysis/Visitors/CFGStmtVisitor.h

@@ -7,7 +7,7 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 //
 //
-//  This file defines the CFGStmtVisitor interface, which extends 
+//  This file defines the CFGStmtVisitor interface, which extends
 //  StmtVisitor.  This interface is useful for visiting statements in a CFG
 //  StmtVisitor.  This interface is useful for visiting statements in a CFG
 //  where some statements have implicit control-flow and thus should
 //  where some statements have implicit control-flow and thus should
 //  be treated specially.
 //  be treated specially.
@@ -24,7 +24,7 @@ namespace clang {
 
 
 #define DISPATCH_CASE(CLASS) \
 #define DISPATCH_CASE(CLASS) \
 case Stmt::CLASS ## Class: return \
 case Stmt::CLASS ## Class: return \
-static_cast<ImplClass*>(this)->BlockStmt_Visit ## CLASS(static_cast<CLASS*>(S));  
+static_cast<ImplClass*>(this)->BlockStmt_Visit ## CLASS(static_cast<CLASS*>(S));
 
 
 #define DEFAULT_BLOCKSTMT_VISIT(CLASS) RetTy BlockStmt_Visit ## CLASS(CLASS *S)\
 #define DEFAULT_BLOCKSTMT_VISIT(CLASS) RetTy BlockStmt_Visit ## CLASS(CLASS *S)\
 { return\
 { return\
@@ -36,40 +36,40 @@ class CFGStmtVisitor : public StmtVisitor<ImplClass,RetTy> {
   Stmt* CurrentBlkStmt;
   Stmt* CurrentBlkStmt;
 
 
   struct NullifyStmt {
   struct NullifyStmt {
-    Stmt*& S;  
-    
+    Stmt*& S;
+
     NullifyStmt(Stmt*& s) : S(s) {}
     NullifyStmt(Stmt*& s) : S(s) {}
     ~NullifyStmt() { S = NULL; }
     ~NullifyStmt() { S = NULL; }
   };
   };
-  
+
 public:
 public:
-  CFGStmtVisitor() : CurrentBlkStmt(NULL) {}  
-  
+  CFGStmtVisitor() : CurrentBlkStmt(NULL) {}
+
   Stmt* getCurrentBlkStmt() const { return CurrentBlkStmt; }
   Stmt* getCurrentBlkStmt() const { return CurrentBlkStmt; }
-  
+
   RetTy Visit(Stmt* S) {
   RetTy Visit(Stmt* S) {
-    if (S == CurrentBlkStmt || 
+    if (S == CurrentBlkStmt ||
         !static_cast<ImplClass*>(this)->getCFG().isBlkExpr(S))
         !static_cast<ImplClass*>(this)->getCFG().isBlkExpr(S))
       return StmtVisitor<ImplClass,RetTy>::Visit(S);
       return StmtVisitor<ImplClass,RetTy>::Visit(S);
     else
     else
       return RetTy();
       return RetTy();
   }
   }
-  
+
   /// BlockVisit_XXX - Visitor methods for visiting the "root" statements in
   /// BlockVisit_XXX - Visitor methods for visiting the "root" statements in
-  /// CFGBlocks.  Root statements are the statements that appear explicitly in 
+  /// CFGBlocks.  Root statements are the statements that appear explicitly in
   /// the list of statements in a CFGBlock.  For substatements, or when there
   /// the list of statements in a CFGBlock.  For substatements, or when there
   /// is no implementation provided for a BlockStmt_XXX method, we default
   /// is no implementation provided for a BlockStmt_XXX method, we default
   /// to using StmtVisitor's Visit method.
   /// to using StmtVisitor's Visit method.
   RetTy BlockStmt_Visit(Stmt* S) {
   RetTy BlockStmt_Visit(Stmt* S) {
     CurrentBlkStmt = S;
     CurrentBlkStmt = S;
     NullifyStmt cleanup(CurrentBlkStmt);
     NullifyStmt cleanup(CurrentBlkStmt);
-    
+
     switch (S->getStmtClass()) {
     switch (S->getStmtClass()) {
 
 
       DISPATCH_CASE(StmtExpr)
       DISPATCH_CASE(StmtExpr)
       DISPATCH_CASE(ConditionalOperator)
       DISPATCH_CASE(ConditionalOperator)
       DISPATCH_CASE(ObjCForCollectionStmt)
       DISPATCH_CASE(ObjCForCollectionStmt)
-        
+
       case Stmt::BinaryOperatorClass: {
       case Stmt::BinaryOperatorClass: {
         BinaryOperator* B = cast<BinaryOperator>(S);
         BinaryOperator* B = cast<BinaryOperator>(S);
         if (B->isLogicalOp())
         if (B->isLogicalOp())
@@ -78,40 +78,40 @@ public:
           return static_cast<ImplClass*>(this)->BlockStmt_VisitComma(B);
           return static_cast<ImplClass*>(this)->BlockStmt_VisitComma(B);
         // Fall through.
         // Fall through.
       }
       }
-      
+
       default:
       default:
         if (isa<Expr>(S))
         if (isa<Expr>(S))
-          return 
+          return
             static_cast<ImplClass*>(this)->BlockStmt_VisitExpr(cast<Expr>(S));
             static_cast<ImplClass*>(this)->BlockStmt_VisitExpr(cast<Expr>(S));
         else
         else
-          return static_cast<ImplClass*>(this)->BlockStmt_VisitStmt(S);                             
+          return static_cast<ImplClass*>(this)->BlockStmt_VisitStmt(S);
     }
     }
   }
   }
 
 
   DEFAULT_BLOCKSTMT_VISIT(StmtExpr)
   DEFAULT_BLOCKSTMT_VISIT(StmtExpr)
   DEFAULT_BLOCKSTMT_VISIT(ConditionalOperator)
   DEFAULT_BLOCKSTMT_VISIT(ConditionalOperator)
-  
+
   RetTy BlockStmt_VisitObjCForCollectionStmt(ObjCForCollectionStmt* S) {
   RetTy BlockStmt_VisitObjCForCollectionStmt(ObjCForCollectionStmt* S) {
     return static_cast<ImplClass*>(this)->BlockStmt_VisitStmt(S);
     return static_cast<ImplClass*>(this)->BlockStmt_VisitStmt(S);
   }
   }
-  
+
   RetTy BlockStmt_VisitImplicitControlFlowExpr(Expr* E) {
   RetTy BlockStmt_VisitImplicitControlFlowExpr(Expr* E) {
     return static_cast<ImplClass*>(this)->BlockStmt_VisitExpr(E);
     return static_cast<ImplClass*>(this)->BlockStmt_VisitExpr(E);
   }
   }
-  
+
   RetTy BlockStmt_VisitExpr(Expr* E) {
   RetTy BlockStmt_VisitExpr(Expr* E) {
     return static_cast<ImplClass*>(this)->BlockStmt_VisitStmt(E);
     return static_cast<ImplClass*>(this)->BlockStmt_VisitStmt(E);
   }
   }
-  
+
   RetTy BlockStmt_VisitStmt(Stmt* S) {
   RetTy BlockStmt_VisitStmt(Stmt* S) {
     return static_cast<ImplClass*>(this)->Visit(S);
     return static_cast<ImplClass*>(this)->Visit(S);
   }
   }
 
 
   RetTy BlockStmt_VisitLogicalOp(BinaryOperator* B) {
   RetTy BlockStmt_VisitLogicalOp(BinaryOperator* B) {
-    return 
+    return
      static_cast<ImplClass*>(this)->BlockStmt_VisitImplicitControlFlowExpr(B);
      static_cast<ImplClass*>(this)->BlockStmt_VisitImplicitControlFlowExpr(B);
   }
   }
-  
+
   RetTy BlockStmt_VisitComma(BinaryOperator* B) {
   RetTy BlockStmt_VisitComma(BinaryOperator* B) {
     return
     return
      static_cast<ImplClass*>(this)->BlockStmt_VisitImplicitControlFlowExpr(B);
      static_cast<ImplClass*>(this)->BlockStmt_VisitImplicitControlFlowExpr(B);
@@ -120,21 +120,21 @@ public:
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   // Utility methods.  Not called by default (but subclasses may use them).
   // Utility methods.  Not called by default (but subclasses may use them).
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
-    
+
   /// VisitChildren: Call "Visit" on each child of S.
   /// VisitChildren: Call "Visit" on each child of S.
   void VisitChildren(Stmt* S) {
   void VisitChildren(Stmt* S) {
-    
+
     switch (S->getStmtClass()) {
     switch (S->getStmtClass()) {
       default:
       default:
         break;
         break;
-        
+
       case Stmt::StmtExprClass: {
       case Stmt::StmtExprClass: {
         CompoundStmt* CS = cast<StmtExpr>(S)->getSubStmt();
         CompoundStmt* CS = cast<StmtExpr>(S)->getSubStmt();
         if (CS->body_empty()) return;
         if (CS->body_empty()) return;
         static_cast<ImplClass*>(this)->Visit(CS->body_back());
         static_cast<ImplClass*>(this)->Visit(CS->body_back());
         return;
         return;
       }
       }
-        
+
       case Stmt::BinaryOperatorClass: {
       case Stmt::BinaryOperatorClass: {
         BinaryOperator* B = cast<BinaryOperator>(S);
         BinaryOperator* B = cast<BinaryOperator>(S);
         if (B->getOpcode() != BinaryOperator::Comma) break;
         if (B->getOpcode() != BinaryOperator::Comma) break;
@@ -142,12 +142,12 @@ public:
         return;
         return;
       }
       }
     }
     }
-        
+
     for (Stmt::child_iterator I=S->child_begin(), E=S->child_end(); I != E;++I)
     for (Stmt::child_iterator I=S->child_begin(), E=S->child_end(); I != E;++I)
-      if (*I) static_cast<ImplClass*>(this)->Visit(*I);    
+      if (*I) static_cast<ImplClass*>(this)->Visit(*I);
   }
   }
-};  
-      
+};
+
 #undef DEFAULT_BLOCKSTMT_VISIT
 #undef DEFAULT_BLOCKSTMT_VISIT
 #undef DISPATCH_CASE
 #undef DISPATCH_CASE
 
 

+ 10 - 10
include/clang/Analysis/Visitors/CFGVarDeclVisitor.h

@@ -24,37 +24,37 @@ namespace clang {
 template <typename ImplClass>
 template <typename ImplClass>
 class CFGVarDeclVisitor : public CFGStmtVisitor<ImplClass> {
 class CFGVarDeclVisitor : public CFGStmtVisitor<ImplClass> {
   const CFG& cfg;
   const CFG& cfg;
-public:  
+public:
   CFGVarDeclVisitor(const CFG& c) : cfg(c) {}
   CFGVarDeclVisitor(const CFG& c) : cfg(c) {}
-  
+
   void VisitStmt(Stmt* S) {
   void VisitStmt(Stmt* S) {
     static_cast<ImplClass*>(this)->VisitChildren(S);
     static_cast<ImplClass*>(this)->VisitChildren(S);
   }
   }
-  
+
   void VisitDeclRefExpr(DeclRefExpr* DR) {
   void VisitDeclRefExpr(DeclRefExpr* DR) {
     static_cast<ImplClass*>(this)->VisitDeclChain(DR->getDecl());
     static_cast<ImplClass*>(this)->VisitDeclChain(DR->getDecl());
   }
   }
-  
+
   void VisitDeclStmt(DeclStmt* DS) {
   void VisitDeclStmt(DeclStmt* DS) {
     static_cast<ImplClass*>(this)->VisitDeclChain(DS->getDecl());
     static_cast<ImplClass*>(this)->VisitDeclChain(DS->getDecl());
   }
   }
-  
-  void VisitDeclChain(ScopedDecl* D) {  
+
+  void VisitDeclChain(ScopedDecl* D) {
     for (; D != NULL ; D = D->getNextDeclarator())
     for (; D != NULL ; D = D->getNextDeclarator())
       static_cast<ImplClass*>(this)->VisitScopedDecl(D);
       static_cast<ImplClass*>(this)->VisitScopedDecl(D);
   }
   }
-  
+
   void VisitScopedDecl(ScopedDecl* D) {
   void VisitScopedDecl(ScopedDecl* D) {
     if (VarDecl* V = dyn_cast<VarDecl>(D))
     if (VarDecl* V = dyn_cast<VarDecl>(D))
       static_cast<ImplClass*>(this)->VisitVarDecl(V);
       static_cast<ImplClass*>(this)->VisitVarDecl(V);
   }
   }
-  
+
   void VisitVarDecl(VarDecl* D) {}
   void VisitVarDecl(VarDecl* D) {}
-  
+
   void VisitAllDecls() {
   void VisitAllDecls() {
     for (CFG::const_iterator BI = cfg.begin(), BE = cfg.end(); BI != BE; ++BI)
     for (CFG::const_iterator BI = cfg.begin(), BE = cfg.end(); BI != BE; ++BI)
       for (CFGBlock::const_iterator SI=BI->begin(),SE = BI->end();SI != SE;++SI)
       for (CFGBlock::const_iterator SI=BI->begin(),SE = BI->end();SI != SE;++SI)
-        static_cast<ImplClass*>(this)->BlockStmt_Visit(const_cast<Stmt*>(*SI));    
+        static_cast<ImplClass*>(this)->BlockStmt_Visit(const_cast<Stmt*>(*SI));
   }
   }
 };
 };
 
 

+ 8 - 8
include/clang/Basic/Builtins.h

@@ -67,40 +67,40 @@ public:
   /// \brief Popular the vector with the names of all of the builtins.
   /// \brief Popular the vector with the names of all of the builtins.
   void GetBuiltinNames(llvm::SmallVectorImpl<const char *> &Names,
   void GetBuiltinNames(llvm::SmallVectorImpl<const char *> &Names,
                        bool NoBuiltins);
                        bool NoBuiltins);
-  
+
   /// Builtin::GetName - Return the identifier name for the specified builtin,
   /// Builtin::GetName - Return the identifier name for the specified builtin,
   /// e.g. "__builtin_abs".
   /// e.g. "__builtin_abs".
   const char *GetName(unsigned ID) const {
   const char *GetName(unsigned ID) const {
     return GetRecord(ID).Name;
     return GetRecord(ID).Name;
   }
   }
-  
+
   /// GetTypeString - Get the type descriptor string for the specified builtin.
   /// GetTypeString - Get the type descriptor string for the specified builtin.
   const char *GetTypeString(unsigned ID) const {
   const char *GetTypeString(unsigned ID) const {
     return GetRecord(ID).Type;
     return GetRecord(ID).Type;
   }
   }
-  
+
   /// isConst - Return true if this function has no side effects and doesn't
   /// isConst - Return true if this function has no side effects and doesn't
   /// read memory.
   /// read memory.
   bool isConst(unsigned ID) const {
   bool isConst(unsigned ID) const {
     return strchr(GetRecord(ID).Attributes, 'c') != 0;
     return strchr(GetRecord(ID).Attributes, 'c') != 0;
   }
   }
-  
+
   /// isNoThrow - Return true if we know this builtin never throws an exception.
   /// isNoThrow - Return true if we know this builtin never throws an exception.
   bool isNoThrow(unsigned ID) const {
   bool isNoThrow(unsigned ID) const {
     return strchr(GetRecord(ID).Attributes, 'n') != 0;
     return strchr(GetRecord(ID).Attributes, 'n') != 0;
   }
   }
-  
+
   /// isNoReturn - Return true if we know this builtin never returns.
   /// isNoReturn - Return true if we know this builtin never returns.
   bool isNoReturn(unsigned ID) const {
   bool isNoReturn(unsigned ID) const {
     return strchr(GetRecord(ID).Attributes, 'r') != 0;
     return strchr(GetRecord(ID).Attributes, 'r') != 0;
   }
   }
-  
+
   /// isLibFunction - Return true if this is a builtin for a libc/libm function,
   /// isLibFunction - Return true if this is a builtin for a libc/libm function,
   /// with a "__builtin_" prefix (e.g. __builtin_abs).
   /// with a "__builtin_" prefix (e.g. __builtin_abs).
   bool isLibFunction(unsigned ID) const {
   bool isLibFunction(unsigned ID) const {
     return strchr(GetRecord(ID).Attributes, 'F') != 0;
     return strchr(GetRecord(ID).Attributes, 'F') != 0;
   }
   }
-  
+
   /// \brief Determines whether this builtin is a predefined libc/libm
   /// \brief Determines whether this builtin is a predefined libc/libm
   /// function, such as "malloc", where we know the signature a
   /// function, such as "malloc", where we know the signature a
   /// priori.
   /// priori.
@@ -124,7 +124,7 @@ public:
   bool hasVAListUse(unsigned ID) const {
   bool hasVAListUse(unsigned ID) const {
     return strpbrk(GetRecord(ID).Type, "Aa") != 0;
     return strpbrk(GetRecord(ID).Type, "Aa") != 0;
   }
   }
-  
+
   /// isConstWithoutErrno - Return true if this function has no side
   /// isConstWithoutErrno - Return true if this function has no side
   /// effects and doesn't read memory, except for possibly errno. Such
   /// effects and doesn't read memory, except for possibly errno. Such
   /// functions can be const when the MathErrno lang option is
   /// functions can be const when the MathErrno lang option is

+ 12 - 12
include/clang/Basic/ConvertUTF.h

@@ -8,9 +8,9 @@
  *==------------------------------------------------------------------------==*/
  *==------------------------------------------------------------------------==*/
 /*
 /*
  * Copyright 2001-2004 Unicode, Inc.
  * Copyright 2001-2004 Unicode, Inc.
- * 
+ *
  * Disclaimer
  * Disclaimer
- * 
+ *
  * This source code is provided as is by Unicode, Inc. No claims are
  * This source code is provided as is by Unicode, Inc. No claims are
  * made as to fitness for any particular purpose. No warranties of any
  * made as to fitness for any particular purpose. No warranties of any
  * kind are expressed or implied. The recipient agrees to determine
  * kind are expressed or implied. The recipient agrees to determine
@@ -18,9 +18,9 @@
  * purchased on magnetic or optical media from Unicode, Inc., the
  * purchased on magnetic or optical media from Unicode, Inc., the
  * sole remedy for any claim will be exchange of defective media
  * sole remedy for any claim will be exchange of defective media
  * within 90 days of receipt.
  * within 90 days of receipt.
- * 
+ *
  * Limitations on Rights to Redistribute This Code
  * Limitations on Rights to Redistribute This Code
- * 
+ *
  * Unicode, Inc. hereby grants the right to freely use the information
  * Unicode, Inc. hereby grants the right to freely use the information
  * supplied in this file in the creation of products supporting the
  * supplied in this file in the creation of products supporting the
  * Unicode Standard, and to make copies of this file in any form
  * Unicode Standard, and to make copies of this file in any form
@@ -41,7 +41,7 @@
 
 
     Each routine converts the text between *sourceStart and sourceEnd,
     Each routine converts the text between *sourceStart and sourceEnd,
     putting the result into the buffer between *targetStart and
     putting the result into the buffer between *targetStart and
-    targetEnd. Note: the end pointers are *after* the last item: e.g. 
+    targetEnd. Note: the end pointers are *after* the last item: e.g.
     *(sourceEnd - 1) is the last item.
     *(sourceEnd - 1) is the last item.
 
 
     The return result indicates whether the conversion was successful,
     The return result indicates whether the conversion was successful,
@@ -79,7 +79,7 @@
         sequence is malformed.  When "sourceIllegal" is returned, the source
         sequence is malformed.  When "sourceIllegal" is returned, the source
         value will point to the illegal value that caused the problem. E.g.,
         value will point to the illegal value that caused the problem. E.g.,
         in UTF-8 when a sequence is malformed, it points to the start of the
         in UTF-8 when a sequence is malformed, it points to the start of the
-        malformed sequence.  
+        malformed sequence.
 
 
     Author: Mark E. Davis, 1994.
     Author: Mark E. Davis, 1994.
     Rev History: Rick McGowan, fixes & updates May 2001.
     Rev History: Rick McGowan, fixes & updates May 2001.
@@ -125,28 +125,28 @@ extern "C" {
 #endif
 #endif
 
 
 ConversionResult ConvertUTF8toUTF16 (
 ConversionResult ConvertUTF8toUTF16 (
-  const UTF8** sourceStart, const UTF8* sourceEnd, 
+  const UTF8** sourceStart, const UTF8* sourceEnd,
   UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
   UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
 
 
 #ifdef CLANG_NEEDS_THESE_ONE_DAY
 #ifdef CLANG_NEEDS_THESE_ONE_DAY
 ConversionResult ConvertUTF16toUTF8 (
 ConversionResult ConvertUTF16toUTF8 (
-  const UTF16** sourceStart, const UTF16* sourceEnd, 
+  const UTF16** sourceStart, const UTF16* sourceEnd,
   UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
   UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
 
 
 ConversionResult ConvertUTF8toUTF32 (
 ConversionResult ConvertUTF8toUTF32 (
-  const UTF8** sourceStart, const UTF8* sourceEnd, 
+  const UTF8** sourceStart, const UTF8* sourceEnd,
   UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
   UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
 
 
 ConversionResult ConvertUTF32toUTF8 (
 ConversionResult ConvertUTF32toUTF8 (
-  const UTF32** sourceStart, const UTF32* sourceEnd, 
+  const UTF32** sourceStart, const UTF32* sourceEnd,
   UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
   UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
 
 
 ConversionResult ConvertUTF16toUTF32 (
 ConversionResult ConvertUTF16toUTF32 (
-  const UTF16** sourceStart, const UTF16* sourceEnd, 
+  const UTF16** sourceStart, const UTF16* sourceEnd,
   UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
   UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
 
 
 ConversionResult ConvertUTF32toUTF16 (
 ConversionResult ConvertUTF32toUTF16 (
-  const UTF32** sourceStart, const UTF32* sourceEnd, 
+  const UTF32** sourceStart, const UTF32* sourceEnd,
   UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
   UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
 #endif
 #endif
 
 

+ 67 - 67
include/clang/Basic/Diagnostic.h

@@ -30,7 +30,7 @@ namespace clang {
   class LangOptions;
   class LangOptions;
   class PartialDiagnostic;
   class PartialDiagnostic;
   class SourceRange;
   class SourceRange;
-  
+
   // Import the diagnostic enums themselves.
   // Import the diagnostic enums themselves.
   namespace diag {
   namespace diag {
     // Start position for diagnostics.
     // Start position for diagnostics.
@@ -46,7 +46,7 @@ namespace clang {
     };
     };
 
 
     class CustomDiagInfo;
     class CustomDiagInfo;
-    
+
     /// diag::kind - All of the diagnostics that can be emitted by the frontend.
     /// diag::kind - All of the diagnostics that can be emitted by the frontend.
     typedef unsigned kind;
     typedef unsigned kind;
 
 
@@ -57,7 +57,7 @@ namespace clang {
       NUM_BUILTIN_COMMON_DIAGNOSTICS
       NUM_BUILTIN_COMMON_DIAGNOSTICS
 #undef DIAG
 #undef DIAG
     };
     };
-      
+
     /// Enum values that allow the client to map NOTEs, WARNINGs, and EXTENSIONs
     /// Enum values that allow the client to map NOTEs, WARNINGs, and EXTENSIONs
     /// to either MAP_IGNORE (nothing), MAP_WARNING (emit a warning), MAP_ERROR
     /// to either MAP_IGNORE (nothing), MAP_WARNING (emit a warning), MAP_ERROR
     /// (emit as an error).  It allows clients to map errors to
     /// (emit as an error).  It allows clients to map errors to
@@ -69,13 +69,13 @@ namespace clang {
       MAP_WARNING = 2,     //< Map this diagnostic to a warning.
       MAP_WARNING = 2,     //< Map this diagnostic to a warning.
       MAP_ERROR   = 3,     //< Map this diagnostic to an error.
       MAP_ERROR   = 3,     //< Map this diagnostic to an error.
       MAP_FATAL   = 4,     //< Map this diagnostic to a fatal error.
       MAP_FATAL   = 4,     //< Map this diagnostic to a fatal error.
-      
+
       /// Map this diagnostic to "warning", but make it immune to -Werror.  This
       /// Map this diagnostic to "warning", but make it immune to -Werror.  This
       /// happens when you specify -Wno-error=foo.
       /// happens when you specify -Wno-error=foo.
       MAP_WARNING_NO_WERROR = 5
       MAP_WARNING_NO_WERROR = 5
     };
     };
   }
   }
-  
+
 /// \brief Annotates a diagnostic with some code that should be
 /// \brief Annotates a diagnostic with some code that should be
 /// inserted, removed, or replaced to fix the problem.
 /// inserted, removed, or replaced to fix the problem.
 ///
 ///
@@ -104,7 +104,7 @@ public:
 
 
   /// \brief Create a code modification hint that inserts the given
   /// \brief Create a code modification hint that inserts the given
   /// code string at a specific location.
   /// code string at a specific location.
-  static CodeModificationHint CreateInsertion(SourceLocation InsertionLoc, 
+  static CodeModificationHint CreateInsertion(SourceLocation InsertionLoc,
                                               const std::string &Code) {
                                               const std::string &Code) {
     CodeModificationHint Hint;
     CodeModificationHint Hint;
     Hint.InsertionLoc = InsertionLoc;
     Hint.InsertionLoc = InsertionLoc;
@@ -122,7 +122,7 @@ public:
 
 
   /// \brief Create a code modification hint that replaces the given
   /// \brief Create a code modification hint that replaces the given
   /// source range with the given code string.
   /// source range with the given code string.
-  static CodeModificationHint CreateReplacement(SourceRange RemoveRange, 
+  static CodeModificationHint CreateReplacement(SourceRange RemoveRange,
                                                 const std::string &Code) {
                                                 const std::string &Code) {
     CodeModificationHint Hint;
     CodeModificationHint Hint;
     Hint.RemoveRange = RemoveRange;
     Hint.RemoveRange = RemoveRange;
@@ -142,13 +142,13 @@ public:
   enum Level {
   enum Level {
     Ignored, Note, Warning, Error, Fatal
     Ignored, Note, Warning, Error, Fatal
   };
   };
-  
+
   /// ExtensionHandling - How do we handle otherwise-unmapped extension?  This
   /// ExtensionHandling - How do we handle otherwise-unmapped extension?  This
   /// is controlled by -pedantic and -pedantic-errors.
   /// is controlled by -pedantic and -pedantic-errors.
   enum ExtensionHandling {
   enum ExtensionHandling {
     Ext_Ignore, Ext_Warn, Ext_Error
     Ext_Ignore, Ext_Warn, Ext_Error
   };
   };
-  
+
   enum ArgumentKind {
   enum ArgumentKind {
     ak_std_string,      // std::string
     ak_std_string,      // std::string
     ak_c_string,        // const char *
     ak_c_string,        // const char *
@@ -161,10 +161,10 @@ public:
     ak_nestednamespec   // NestedNameSpecifier *
     ak_nestednamespec   // NestedNameSpecifier *
   };
   };
 
 
-private: 
+private:
   unsigned char AllExtensionsSilenced; // Used by __extension__
   unsigned char AllExtensionsSilenced; // Used by __extension__
   bool IgnoreAllWarnings;        // Ignore all warnings: -w
   bool IgnoreAllWarnings;        // Ignore all warnings: -w
-  bool WarningsAsErrors;         // Treat warnings like errors: 
+  bool WarningsAsErrors;         // Treat warnings like errors:
   bool SuppressSystemWarnings;   // Suppress warnings in system headers.
   bool SuppressSystemWarnings;   // Suppress warnings in system headers.
   ExtensionHandling ExtBehavior; // Map extensions onto warnings or errors?
   ExtensionHandling ExtBehavior; // Map extensions onto warnings or errors?
   DiagnosticClient *Client;
   DiagnosticClient *Client;
@@ -183,7 +183,7 @@ private:
   /// fatal error is emitted, and is sticky.
   /// fatal error is emitted, and is sticky.
   bool ErrorOccurred;
   bool ErrorOccurred;
   bool FatalErrorOccurred;
   bool FatalErrorOccurred;
-  
+
   /// LastDiagLevel - This is the level of the last diagnostic emitted.  This is
   /// LastDiagLevel - This is the level of the last diagnostic emitted.  This is
   /// used to emit continuation diagnostics with the same level as the
   /// used to emit continuation diagnostics with the same level as the
   /// diagnostic that they follow.
   /// diagnostic that they follow.
@@ -209,16 +209,16 @@ private:
 public:
 public:
   explicit Diagnostic(DiagnosticClient *client = 0);
   explicit Diagnostic(DiagnosticClient *client = 0);
   ~Diagnostic();
   ~Diagnostic();
-  
+
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   //  Diagnostic characterization methods, used by a client to customize how
   //  Diagnostic characterization methods, used by a client to customize how
   //
   //
-  
+
   DiagnosticClient *getClient() { return Client; };
   DiagnosticClient *getClient() { return Client; };
   const DiagnosticClient *getClient() const { return Client; };
   const DiagnosticClient *getClient() const { return Client; };
-    
 
 
-  /// pushMappings - Copies the current DiagMappings and pushes the new copy 
+
+  /// pushMappings - Copies the current DiagMappings and pushes the new copy
   /// onto the top of the stack.
   /// onto the top of the stack.
   void pushMappings();
   void pushMappings();
 
 
@@ -234,12 +234,12 @@ public:
   /// ignored.  If this and WarningsAsErrors are both set, then this one wins.
   /// ignored.  If this and WarningsAsErrors are both set, then this one wins.
   void setIgnoreAllWarnings(bool Val) { IgnoreAllWarnings = Val; }
   void setIgnoreAllWarnings(bool Val) { IgnoreAllWarnings = Val; }
   bool getIgnoreAllWarnings() const { return IgnoreAllWarnings; }
   bool getIgnoreAllWarnings() const { return IgnoreAllWarnings; }
-  
+
   /// setWarningsAsErrors - When set to true, any warnings reported are issued
   /// setWarningsAsErrors - When set to true, any warnings reported are issued
   /// as errors.
   /// as errors.
   void setWarningsAsErrors(bool Val) { WarningsAsErrors = Val; }
   void setWarningsAsErrors(bool Val) { WarningsAsErrors = Val; }
   bool getWarningsAsErrors() const { return WarningsAsErrors; }
   bool getWarningsAsErrors() const { return WarningsAsErrors; }
-  
+
   /// setSuppressSystemWarnings - When set to true mask warnings that
   /// setSuppressSystemWarnings - When set to true mask warnings that
   /// come from system headers.
   /// come from system headers.
   void setSuppressSystemWarnings(bool Val) { SuppressSystemWarnings = Val; }
   void setSuppressSystemWarnings(bool Val) { SuppressSystemWarnings = Val; }
@@ -251,14 +251,14 @@ public:
   void setExtensionHandlingBehavior(ExtensionHandling H) {
   void setExtensionHandlingBehavior(ExtensionHandling H) {
     ExtBehavior = H;
     ExtBehavior = H;
   }
   }
-  
+
   /// AllExtensionsSilenced - This is a counter bumped when an __extension__
   /// AllExtensionsSilenced - This is a counter bumped when an __extension__
   /// block is encountered.  When non-zero, all extension diagnostics are
   /// block is encountered.  When non-zero, all extension diagnostics are
   /// entirely silenced, no matter how they are mapped.
   /// entirely silenced, no matter how they are mapped.
   void IncrementAllExtensionsSilenced() { ++AllExtensionsSilenced; }
   void IncrementAllExtensionsSilenced() { ++AllExtensionsSilenced; }
   void DecrementAllExtensionsSilenced() { --AllExtensionsSilenced; }
   void DecrementAllExtensionsSilenced() { --AllExtensionsSilenced; }
   bool hasAllExtensionsSilenced() { return AllExtensionsSilenced != 0; }
   bool hasAllExtensionsSilenced() { return AllExtensionsSilenced != 0; }
-  
+
   /// setDiagnosticMapping - This allows the client to specify that certain
   /// setDiagnosticMapping - This allows the client to specify that certain
   /// warnings are ignored.  Notes can never be mapped, errors can only be
   /// warnings are ignored.  Notes can never be mapped, errors can only be
   /// mapped to fatal, and WARNINGs and EXTENSIONs can be mapped arbitrarily.
   /// mapped to fatal, and WARNINGs and EXTENSIONs can be mapped arbitrarily.
@@ -269,7 +269,7 @@ public:
            "Cannot map errors!");
            "Cannot map errors!");
     setDiagnosticMappingInternal(Diag, Map, true);
     setDiagnosticMappingInternal(Diag, Map, true);
   }
   }
-  
+
   /// setDiagnosticGroupMapping - Change an entire diagnostic group (e.g.
   /// setDiagnosticGroupMapping - Change an entire diagnostic group (e.g.
   /// "unknown-pragmas" to have the specified mapping.  This returns true and
   /// "unknown-pragmas" to have the specified mapping.  This returns true and
   /// ignores the request if "Group" was unknown, false otherwise.
   /// ignores the request if "Group" was unknown, false otherwise.
@@ -280,13 +280,13 @@ public:
 
 
   unsigned getNumErrors() const { return NumErrors; }
   unsigned getNumErrors() const { return NumErrors; }
   unsigned getNumDiagnostics() const { return NumDiagnostics; }
   unsigned getNumDiagnostics() const { return NumDiagnostics; }
-  
+
   /// getCustomDiagID - Return an ID for a diagnostic with the specified message
   /// getCustomDiagID - Return an ID for a diagnostic with the specified message
   /// and level.  If this is the first request for this diagnosic, it is
   /// and level.  If this is the first request for this diagnosic, it is
   /// registered and created, otherwise the existing ID is returned.
   /// registered and created, otherwise the existing ID is returned.
   unsigned getCustomDiagID(Level L, const char *Message);
   unsigned getCustomDiagID(Level L, const char *Message);
-  
-  
+
+
   /// ConvertArgToString - This method converts a diagnostic argument (as an
   /// ConvertArgToString - This method converts a diagnostic argument (as an
   /// intptr_t) into the string that represents it.
   /// intptr_t) into the string that represents it.
   void ConvertArgToString(ArgumentKind Kind, intptr_t Val,
   void ConvertArgToString(ArgumentKind Kind, intptr_t Val,
@@ -296,12 +296,12 @@ public:
     ArgToStringFn(Kind, Val, Modifier, ModLen, Argument, ArgLen, Output,
     ArgToStringFn(Kind, Val, Modifier, ModLen, Argument, ArgLen, Output,
                   ArgToStringCookie);
                   ArgToStringCookie);
   }
   }
-  
+
   void SetArgToStringFn(ArgToStringFnTy Fn, void *Cookie) {
   void SetArgToStringFn(ArgToStringFnTy Fn, void *Cookie) {
     ArgToStringFn = Fn;
     ArgToStringFn = Fn;
     ArgToStringCookie = Cookie;
     ArgToStringCookie = Cookie;
   }
   }
-  
+
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   // Diagnostic classification and reporting interfaces.
   // Diagnostic classification and reporting interfaces.
   //
   //
@@ -309,7 +309,7 @@ public:
   /// getDescription - Given a diagnostic ID, return a description of the
   /// getDescription - Given a diagnostic ID, return a description of the
   /// issue.
   /// issue.
   const char *getDescription(unsigned DiagID) const;
   const char *getDescription(unsigned DiagID) const;
-  
+
   /// isNoteWarningOrExtension - Return true if the unmapped diagnostic
   /// isNoteWarningOrExtension - Return true if the unmapped diagnostic
   /// level of the specified diagnostic ID is a Warning or Extension.
   /// level of the specified diagnostic ID is a Warning or Extension.
   /// This only works on builtin diagnostics, not custom ones, and is not legal to
   /// This only works on builtin diagnostics, not custom ones, and is not legal to
@@ -319,12 +319,12 @@ public:
   /// \brief Determine whether the given built-in diagnostic ID is a
   /// \brief Determine whether the given built-in diagnostic ID is a
   /// Note.
   /// Note.
   static bool isBuiltinNote(unsigned DiagID);
   static bool isBuiltinNote(unsigned DiagID);
-  
+
   /// isBuiltinExtensionDiag - Determine whether the given built-in diagnostic
   /// isBuiltinExtensionDiag - Determine whether the given built-in diagnostic
   /// ID is for an extension of some sort.
   /// ID is for an extension of some sort.
   ///
   ///
   static bool isBuiltinExtensionDiag(unsigned DiagID);
   static bool isBuiltinExtensionDiag(unsigned DiagID);
-  
+
   /// getWarningOptionForDiag - Return the lowest-level warning option that
   /// getWarningOptionForDiag - Return the lowest-level warning option that
   /// enables the specified diagnostic.  If there is no -Wfoo flag that controls
   /// enables the specified diagnostic.  If there is no -Wfoo flag that controls
   /// the diagnostic, this returns null.
   /// the diagnostic, this returns null.
@@ -343,8 +343,8 @@ public:
   /// getDiagnosticLevel - Based on the way the client configured the Diagnostic
   /// getDiagnosticLevel - Based on the way the client configured the Diagnostic
   /// object, classify the specified diagnostic ID into a Level, consumable by
   /// object, classify the specified diagnostic ID into a Level, consumable by
   /// the DiagnosticClient.
   /// the DiagnosticClient.
-  Level getDiagnosticLevel(unsigned DiagID) const;  
-  
+  Level getDiagnosticLevel(unsigned DiagID) const;
+
   /// Report - Issue the message to the client.  @c DiagID is a member of the
   /// Report - Issue the message to the client.  @c DiagID is a member of the
   /// @c diag::kind enum.  This actually returns aninstance of DiagnosticBuilder
   /// @c diag::kind enum.  This actually returns aninstance of DiagnosticBuilder
   /// which emits the diagnostics (through @c ProcessDiag) when it is destroyed.
   /// which emits the diagnostics (through @c ProcessDiag) when it is destroyed.
@@ -354,7 +354,7 @@ public:
 
 
   /// \brief Clear out the current diagnostic.
   /// \brief Clear out the current diagnostic.
   void Clear() { CurDiagID = ~0U; }
   void Clear() { CurDiagID = ~0U; }
-  
+
 private:
 private:
   /// getDiagnosticMappingInfo - Return the mapping info currently set for the
   /// getDiagnosticMappingInfo - Return the mapping info currently set for the
   /// specified builtin diagnostic.  This returns the high bit encoding, or zero
   /// specified builtin diagnostic.  This returns the high bit encoding, or zero
@@ -363,7 +363,7 @@ private:
     const DiagMappings &currentMappings = DiagMappingsStack.back();
     const DiagMappings &currentMappings = DiagMappingsStack.back();
     return (diag::Mapping)((currentMappings[Diag/2] >> (Diag & 1)*4) & 15);
     return (diag::Mapping)((currentMappings[Diag/2] >> (Diag & 1)*4) & 15);
   }
   }
-  
+
   void setDiagnosticMappingInternal(unsigned DiagId, unsigned Map,
   void setDiagnosticMappingInternal(unsigned DiagId, unsigned Map,
                                     bool isUser) const {
                                     bool isUser) const {
     if (isUser) Map |= 8;  // Set the high bit for user mappings.
     if (isUser) Map |= 8;  // Set the high bit for user mappings.
@@ -372,7 +372,7 @@ private:
     Slot &= ~(15 << Shift);
     Slot &= ~(15 << Shift);
     Slot |= Map << Shift;
     Slot |= Map << Shift;
   }
   }
-  
+
   /// getDiagnosticLevel - This is an internal implementation helper used when
   /// getDiagnosticLevel - This is an internal implementation helper used when
   /// DiagClass is already known.
   /// DiagClass is already known.
   Level getDiagnosticLevel(unsigned DiagID, unsigned DiagClass) const;
   Level getDiagnosticLevel(unsigned DiagID, unsigned DiagClass) const;
@@ -389,7 +389,7 @@ private:
   /// CurDiagLoc - This is the location of the current diagnostic that is in
   /// CurDiagLoc - This is the location of the current diagnostic that is in
   /// flight.
   /// flight.
   FullSourceLoc CurDiagLoc;
   FullSourceLoc CurDiagLoc;
-  
+
   /// CurDiagID - This is the ID of the current diagnostic that is in flight.
   /// CurDiagID - This is the ID of the current diagnostic that is in flight.
   /// This is set to ~0U when there is no diagnostic in flight.
   /// This is set to ~0U when there is no diagnostic in flight.
   unsigned CurDiagID;
   unsigned CurDiagID;
@@ -400,7 +400,7 @@ private:
     /// than that almost certainly has to be simplified anyway.
     /// than that almost certainly has to be simplified anyway.
     MaxArguments = 10
     MaxArguments = 10
   };
   };
-  
+
   /// NumDiagArgs - This contains the number of entries in Arguments.
   /// NumDiagArgs - This contains the number of entries in Arguments.
   signed char NumDiagArgs;
   signed char NumDiagArgs;
   /// NumRanges - This is the number of ranges in the DiagRanges array.
   /// NumRanges - This is the number of ranges in the DiagRanges array.
@@ -413,7 +413,7 @@ private:
   /// values, with one for each argument.  This specifies whether the argument
   /// values, with one for each argument.  This specifies whether the argument
   /// is in DiagArgumentsStr or in DiagArguments.
   /// is in DiagArgumentsStr or in DiagArguments.
   unsigned char DiagArgumentsKind[MaxArguments];
   unsigned char DiagArgumentsKind[MaxArguments];
-  
+
   /// DiagArgumentsStr - This holds the values of each string argument for the
   /// DiagArgumentsStr - This holds the values of each string argument for the
   /// current diagnostic.  This value is only used when the corresponding
   /// current diagnostic.  This value is only used when the corresponding
   /// ArgumentKind is ak_std_string.
   /// ArgumentKind is ak_std_string.
@@ -424,11 +424,11 @@ private:
   /// mangled into an intptr_t and the intepretation depends on exactly what
   /// mangled into an intptr_t and the intepretation depends on exactly what
   /// sort of argument kind it is.
   /// sort of argument kind it is.
   intptr_t DiagArgumentsVal[MaxArguments];
   intptr_t DiagArgumentsVal[MaxArguments];
-  
+
   /// DiagRanges - The list of ranges added to this diagnostic.  It currently
   /// DiagRanges - The list of ranges added to this diagnostic.  It currently
   /// only support 10 ranges, could easily be extended if needed.
   /// only support 10 ranges, could easily be extended if needed.
   const SourceRange *DiagRanges[10];
   const SourceRange *DiagRanges[10];
-  
+
   enum { MaxCodeModificationHints = 3 };
   enum { MaxCodeModificationHints = 3 };
 
 
   /// CodeModificationHints - If valid, provides a hint with some code
   /// CodeModificationHints - If valid, provides a hint with some code
@@ -461,14 +461,14 @@ private:
 class DiagnosticBuilder {
 class DiagnosticBuilder {
   mutable Diagnostic *DiagObj;
   mutable Diagnostic *DiagObj;
   mutable unsigned NumArgs, NumRanges, NumCodeModificationHints;
   mutable unsigned NumArgs, NumRanges, NumCodeModificationHints;
-  
+
   void operator=(const DiagnosticBuilder&); // DO NOT IMPLEMENT
   void operator=(const DiagnosticBuilder&); // DO NOT IMPLEMENT
   friend class Diagnostic;
   friend class Diagnostic;
   explicit DiagnosticBuilder(Diagnostic *diagObj)
   explicit DiagnosticBuilder(Diagnostic *diagObj)
-    : DiagObj(diagObj), NumArgs(0), NumRanges(0), 
+    : DiagObj(diagObj), NumArgs(0), NumRanges(0),
       NumCodeModificationHints(0) {}
       NumCodeModificationHints(0) {}
 
 
-public:  
+public:
   /// Copy constructor.  When copied, this "takes" the diagnostic info from the
   /// Copy constructor.  When copied, this "takes" the diagnostic info from the
   /// input and neuters it.
   /// input and neuters it.
   DiagnosticBuilder(const DiagnosticBuilder &D) {
   DiagnosticBuilder(const DiagnosticBuilder &D) {
@@ -485,7 +485,7 @@ public:
 
 
   /// \brief Create an empty DiagnosticBuilder object that represents
   /// \brief Create an empty DiagnosticBuilder object that represents
   /// no actual diagnostic.
   /// no actual diagnostic.
-  explicit DiagnosticBuilder(SuppressKind) 
+  explicit DiagnosticBuilder(SuppressKind)
     : DiagObj(0), NumArgs(0), NumRanges(0), NumCodeModificationHints(0) { }
     : DiagObj(0), NumArgs(0), NumRanges(0), NumCodeModificationHints(0) { }
 
 
   /// \brief Force the diagnostic builder to emit the diagnostic now.
   /// \brief Force the diagnostic builder to emit the diagnostic now.
@@ -522,7 +522,7 @@ public:
   /// Destructor - The dtor emits the diagnostic if it hasn't already
   /// Destructor - The dtor emits the diagnostic if it hasn't already
   /// been emitted.
   /// been emitted.
   ~DiagnosticBuilder() { Emit(); }
   ~DiagnosticBuilder() { Emit(); }
-  
+
   /// Operator bool: conversion of DiagnosticBuilder to bool always returns
   /// Operator bool: conversion of DiagnosticBuilder to bool always returns
   /// true.  This allows is to be used in boolean error contexts like:
   /// true.  This allows is to be used in boolean error contexts like:
   /// return Diag(...);
   /// return Diag(...);
@@ -536,7 +536,7 @@ public:
       DiagObj->DiagArgumentsStr[NumArgs++] = S;
       DiagObj->DiagArgumentsStr[NumArgs++] = S;
     }
     }
   }
   }
-  
+
   void AddTaggedVal(intptr_t V, Diagnostic::ArgumentKind Kind) const {
   void AddTaggedVal(intptr_t V, Diagnostic::ArgumentKind Kind) const {
     assert(NumArgs < Diagnostic::MaxArguments &&
     assert(NumArgs < Diagnostic::MaxArguments &&
            "Too many arguments to diagnostic!");
            "Too many arguments to diagnostic!");
@@ -545,14 +545,14 @@ public:
       DiagObj->DiagArgumentsVal[NumArgs++] = V;
       DiagObj->DiagArgumentsVal[NumArgs++] = V;
     }
     }
   }
   }
-  
+
   void AddSourceRange(const SourceRange &R) const {
   void AddSourceRange(const SourceRange &R) const {
-    assert(NumRanges < 
+    assert(NumRanges <
            sizeof(DiagObj->DiagRanges)/sizeof(DiagObj->DiagRanges[0]) &&
            sizeof(DiagObj->DiagRanges)/sizeof(DiagObj->DiagRanges[0]) &&
            "Too many arguments to diagnostic!");
            "Too many arguments to diagnostic!");
     if (DiagObj)
     if (DiagObj)
       DiagObj->DiagRanges[NumRanges++] = &R;
       DiagObj->DiagRanges[NumRanges++] = &R;
-  }    
+  }
 
 
   void AddCodeModificationHint(const CodeModificationHint &Hint) const {
   void AddCodeModificationHint(const CodeModificationHint &Hint) const {
     assert(NumCodeModificationHints < Diagnostic::MaxCodeModificationHints &&
     assert(NumCodeModificationHints < Diagnostic::MaxCodeModificationHints &&
@@ -597,7 +597,7 @@ inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB,
                   Diagnostic::ak_identifierinfo);
                   Diagnostic::ak_identifierinfo);
   return DB;
   return DB;
 }
 }
-  
+
 inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB,
 inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB,
                                            const SourceRange &R) {
                                            const SourceRange &R) {
   DB.AddSourceRange(R);
   DB.AddSourceRange(R);
@@ -623,7 +623,7 @@ inline DiagnosticBuilder Diagnostic::Report(FullSourceLoc Loc, unsigned DiagID){
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 // DiagnosticInfo
 // DiagnosticInfo
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
-  
+
 /// DiagnosticInfo - This is a little helper class (which is basically a smart
 /// DiagnosticInfo - This is a little helper class (which is basically a smart
 /// pointer that forward info from Diagnostic) that allows clients to enquire
 /// pointer that forward info from Diagnostic) that allows clients to enquire
 /// about the currently in-flight diagnostic.
 /// about the currently in-flight diagnostic.
@@ -631,74 +631,74 @@ class DiagnosticInfo {
   const Diagnostic *DiagObj;
   const Diagnostic *DiagObj;
 public:
 public:
   explicit DiagnosticInfo(const Diagnostic *DO) : DiagObj(DO) {}
   explicit DiagnosticInfo(const Diagnostic *DO) : DiagObj(DO) {}
-  
+
   const Diagnostic *getDiags() const { return DiagObj; }
   const Diagnostic *getDiags() const { return DiagObj; }
   unsigned getID() const { return DiagObj->CurDiagID; }
   unsigned getID() const { return DiagObj->CurDiagID; }
   const FullSourceLoc &getLocation() const { return DiagObj->CurDiagLoc; }
   const FullSourceLoc &getLocation() const { return DiagObj->CurDiagLoc; }
-  
+
   unsigned getNumArgs() const { return DiagObj->NumDiagArgs; }
   unsigned getNumArgs() const { return DiagObj->NumDiagArgs; }
-  
+
   /// getArgKind - Return the kind of the specified index.  Based on the kind
   /// getArgKind - Return the kind of the specified index.  Based on the kind
   /// of argument, the accessors below can be used to get the value.
   /// of argument, the accessors below can be used to get the value.
   Diagnostic::ArgumentKind getArgKind(unsigned Idx) const {
   Diagnostic::ArgumentKind getArgKind(unsigned Idx) const {
     assert(Idx < getNumArgs() && "Argument index out of range!");
     assert(Idx < getNumArgs() && "Argument index out of range!");
     return (Diagnostic::ArgumentKind)DiagObj->DiagArgumentsKind[Idx];
     return (Diagnostic::ArgumentKind)DiagObj->DiagArgumentsKind[Idx];
   }
   }
-  
+
   /// getArgStdStr - Return the provided argument string specified by Idx.
   /// getArgStdStr - Return the provided argument string specified by Idx.
   const std::string &getArgStdStr(unsigned Idx) const {
   const std::string &getArgStdStr(unsigned Idx) const {
     assert(getArgKind(Idx) == Diagnostic::ak_std_string &&
     assert(getArgKind(Idx) == Diagnostic::ak_std_string &&
            "invalid argument accessor!");
            "invalid argument accessor!");
     return DiagObj->DiagArgumentsStr[Idx];
     return DiagObj->DiagArgumentsStr[Idx];
   }
   }
-  
+
   /// getArgCStr - Return the specified C string argument.
   /// getArgCStr - Return the specified C string argument.
   const char *getArgCStr(unsigned Idx) const {
   const char *getArgCStr(unsigned Idx) const {
     assert(getArgKind(Idx) == Diagnostic::ak_c_string &&
     assert(getArgKind(Idx) == Diagnostic::ak_c_string &&
            "invalid argument accessor!");
            "invalid argument accessor!");
     return reinterpret_cast<const char*>(DiagObj->DiagArgumentsVal[Idx]);
     return reinterpret_cast<const char*>(DiagObj->DiagArgumentsVal[Idx]);
   }
   }
-  
+
   /// getArgSInt - Return the specified signed integer argument.
   /// getArgSInt - Return the specified signed integer argument.
   int getArgSInt(unsigned Idx) const {
   int getArgSInt(unsigned Idx) const {
     assert(getArgKind(Idx) == Diagnostic::ak_sint &&
     assert(getArgKind(Idx) == Diagnostic::ak_sint &&
            "invalid argument accessor!");
            "invalid argument accessor!");
     return (int)DiagObj->DiagArgumentsVal[Idx];
     return (int)DiagObj->DiagArgumentsVal[Idx];
   }
   }
-  
+
   /// getArgUInt - Return the specified unsigned integer argument.
   /// getArgUInt - Return the specified unsigned integer argument.
   unsigned getArgUInt(unsigned Idx) const {
   unsigned getArgUInt(unsigned Idx) const {
     assert(getArgKind(Idx) == Diagnostic::ak_uint &&
     assert(getArgKind(Idx) == Diagnostic::ak_uint &&
            "invalid argument accessor!");
            "invalid argument accessor!");
     return (unsigned)DiagObj->DiagArgumentsVal[Idx];
     return (unsigned)DiagObj->DiagArgumentsVal[Idx];
   }
   }
-  
+
   /// getArgIdentifier - Return the specified IdentifierInfo argument.
   /// getArgIdentifier - Return the specified IdentifierInfo argument.
   const IdentifierInfo *getArgIdentifier(unsigned Idx) const {
   const IdentifierInfo *getArgIdentifier(unsigned Idx) const {
     assert(getArgKind(Idx) == Diagnostic::ak_identifierinfo &&
     assert(getArgKind(Idx) == Diagnostic::ak_identifierinfo &&
            "invalid argument accessor!");
            "invalid argument accessor!");
     return reinterpret_cast<IdentifierInfo*>(DiagObj->DiagArgumentsVal[Idx]);
     return reinterpret_cast<IdentifierInfo*>(DiagObj->DiagArgumentsVal[Idx]);
   }
   }
-  
+
   /// getRawArg - Return the specified non-string argument in an opaque form.
   /// getRawArg - Return the specified non-string argument in an opaque form.
   intptr_t getRawArg(unsigned Idx) const {
   intptr_t getRawArg(unsigned Idx) const {
     assert(getArgKind(Idx) != Diagnostic::ak_std_string &&
     assert(getArgKind(Idx) != Diagnostic::ak_std_string &&
            "invalid argument accessor!");
            "invalid argument accessor!");
     return DiagObj->DiagArgumentsVal[Idx];
     return DiagObj->DiagArgumentsVal[Idx];
   }
   }
-  
-  
+
+
   /// getNumRanges - Return the number of source ranges associated with this
   /// getNumRanges - Return the number of source ranges associated with this
   /// diagnostic.
   /// diagnostic.
   unsigned getNumRanges() const {
   unsigned getNumRanges() const {
     return DiagObj->NumDiagRanges;
     return DiagObj->NumDiagRanges;
   }
   }
-  
+
   const SourceRange &getRange(unsigned Idx) const {
   const SourceRange &getRange(unsigned Idx) const {
     assert(Idx < DiagObj->NumDiagRanges && "Invalid diagnostic range index!");
     assert(Idx < DiagObj->NumDiagRanges && "Invalid diagnostic range index!");
     return *DiagObj->DiagRanges[Idx];
     return *DiagObj->DiagRanges[Idx];
   }
   }
-  
+
   unsigned getNumCodeModificationHints() const {
   unsigned getNumCodeModificationHints() const {
     return DiagObj->NumCodeModificationHints;
     return DiagObj->NumCodeModificationHints;
   }
   }
@@ -708,7 +708,7 @@ public:
   }
   }
 
 
   const CodeModificationHint *getCodeModificationHints() const {
   const CodeModificationHint *getCodeModificationHints() const {
-    return DiagObj->NumCodeModificationHints? 
+    return DiagObj->NumCodeModificationHints?
              &DiagObj->CodeModificationHints[0] : 0;
              &DiagObj->CodeModificationHints[0] : 0;
   }
   }
 
 
@@ -717,20 +717,20 @@ public:
   /// array.
   /// array.
   void FormatDiagnostic(llvm::SmallVectorImpl<char> &OutStr) const;
   void FormatDiagnostic(llvm::SmallVectorImpl<char> &OutStr) const;
 };
 };
-  
+
 /// DiagnosticClient - This is an abstract interface implemented by clients of
 /// DiagnosticClient - This is an abstract interface implemented by clients of
 /// the front-end, which formats and prints fully processed diagnostics.
 /// the front-end, which formats and prints fully processed diagnostics.
 class DiagnosticClient {
 class DiagnosticClient {
 public:
 public:
   virtual ~DiagnosticClient();
   virtual ~DiagnosticClient();
-  
+
   /// setLangOptions - This is set by clients of diagnostics when they know the
   /// setLangOptions - This is set by clients of diagnostics when they know the
   /// language parameters of the diagnostics that may be sent through.  Note
   /// language parameters of the diagnostics that may be sent through.  Note
   /// that this can change over time if a DiagClient has multiple languages sent
   /// that this can change over time if a DiagClient has multiple languages sent
   /// through it.  It may also be set to null (e.g. when processing command line
   /// through it.  It may also be set to null (e.g. when processing command line
   /// options).
   /// options).
   virtual void setLangOptions(const LangOptions *LO) {}
   virtual void setLangOptions(const LangOptions *LO) {}
-  
+
   /// IncludeInDiagnosticCounts - This method (whose default implementation
   /// IncludeInDiagnosticCounts - This method (whose default implementation
   ///  returns true) indicates whether the diagnostics handled by this
   ///  returns true) indicates whether the diagnostics handled by this
   ///  DiagnosticClient should be included in the number of diagnostics
   ///  DiagnosticClient should be included in the number of diagnostics

+ 17 - 17
include/clang/Basic/FileManager.h

@@ -25,7 +25,7 @@
 
 
 namespace clang {
 namespace clang {
 class FileManager;
 class FileManager;
-  
+
 /// DirectoryEntry - Cached information about one directory on the disk.
 /// DirectoryEntry - Cached information about one directory on the disk.
 ///
 ///
 class DirectoryEntry {
 class DirectoryEntry {
@@ -33,7 +33,7 @@ class DirectoryEntry {
   friend class FileManager;
   friend class FileManager;
 public:
 public:
   DirectoryEntry() : Name(0) {}
   DirectoryEntry() : Name(0) {}
-  const char *getName() const { return Name; } 
+  const char *getName() const { return Name; }
 };
 };
 
 
 /// FileEntry - Cached information about one file on the disk.
 /// FileEntry - Cached information about one file on the disk.
@@ -53,7 +53,7 @@ public:
     : Name(0), Device(device), Inode(inode), FileMode(m) {}
     : Name(0), Device(device), Inode(inode), FileMode(m) {}
   // Add a default constructor for use with llvm::StringMap
   // Add a default constructor for use with llvm::StringMap
   FileEntry() : Name(0), Device(0), Inode(0), FileMode(0) {}
   FileEntry() : Name(0), Device(0), Inode(0), FileMode(0) {}
-  
+
   const char *getName() const { return Name; }
   const char *getName() const { return Name; }
   off_t getSize() const { return Size; }
   off_t getSize() const { return Size; }
   unsigned getUID() const { return UID; }
   unsigned getUID() const { return UID; }
@@ -61,11 +61,11 @@ public:
   dev_t getDevice() const { return Device; }
   dev_t getDevice() const { return Device; }
   time_t getModificationTime() const { return ModTime; }
   time_t getModificationTime() const { return ModTime; }
   mode_t getFileMode() const { return FileMode; }
   mode_t getFileMode() const { return FileMode; }
-  
+
   /// getDir - Return the directory the file lives in.
   /// getDir - Return the directory the file lives in.
   ///
   ///
   const DirectoryEntry *getDir() const { return Dir; }
   const DirectoryEntry *getDir() const { return Dir; }
-  
+
   bool operator<(const FileEntry& RHS) const {
   bool operator<(const FileEntry& RHS) const {
     return Device < RHS.Device || (Device == RHS.Device && Inode < RHS.Inode);
     return Device < RHS.Device || (Device == RHS.Device && Inode < RHS.Inode);
   }
   }
@@ -85,19 +85,19 @@ public:
 /// execution of the front end.
 /// execution of the front end.
 class MemorizeStatCalls : public StatSysCallCache {
 class MemorizeStatCalls : public StatSysCallCache {
 public:
 public:
-  /// \brief The result of a stat() call. 
+  /// \brief The result of a stat() call.
   ///
   ///
   /// The first member is the result of calling stat(). If stat()
   /// The first member is the result of calling stat(). If stat()
   /// found something, the second member is a copy of the stat
   /// found something, the second member is a copy of the stat
   /// structure.
   /// structure.
   typedef std::pair<int, struct stat> StatResult;
   typedef std::pair<int, struct stat> StatResult;
 
 
-  /// \brief The set of stat() calls that have been 
+  /// \brief The set of stat() calls that have been
   llvm::StringMap<StatResult, llvm::BumpPtrAllocator> StatCalls;
   llvm::StringMap<StatResult, llvm::BumpPtrAllocator> StatCalls;
 
 
   typedef llvm::StringMap<StatResult, llvm::BumpPtrAllocator>::const_iterator
   typedef llvm::StringMap<StatResult, llvm::BumpPtrAllocator>::const_iterator
     iterator;
     iterator;
-  
+
   iterator begin() const { return StatCalls.begin(); }
   iterator begin() const { return StatCalls.begin(); }
   iterator end() const { return StatCalls.end(); }
   iterator end() const { return StatCalls.end(); }
 
 
@@ -124,22 +124,22 @@ class FileManager {
   ///
   ///
   llvm::StringMap<DirectoryEntry*, llvm::BumpPtrAllocator> DirEntries;
   llvm::StringMap<DirectoryEntry*, llvm::BumpPtrAllocator> DirEntries;
   llvm::StringMap<FileEntry*, llvm::BumpPtrAllocator> FileEntries;
   llvm::StringMap<FileEntry*, llvm::BumpPtrAllocator> FileEntries;
-  
+
   /// NextFileUID - Each FileEntry we create is assigned a unique ID #.
   /// NextFileUID - Each FileEntry we create is assigned a unique ID #.
   ///
   ///
   unsigned NextFileUID;
   unsigned NextFileUID;
-  
+
   // Statistics.
   // Statistics.
   unsigned NumDirLookups, NumFileLookups;
   unsigned NumDirLookups, NumFileLookups;
   unsigned NumDirCacheMisses, NumFileCacheMisses;
   unsigned NumDirCacheMisses, NumFileCacheMisses;
-  
+
   // Caching.
   // Caching.
   llvm::OwningPtr<StatSysCallCache> StatCache;
   llvm::OwningPtr<StatSysCallCache> StatCache;
 
 
   int stat_cached(const char* path, struct stat* buf) {
   int stat_cached(const char* path, struct stat* buf) {
     return StatCache.get() ? StatCache->stat(path, buf) : stat(path, buf);
     return StatCache.get() ? StatCache->stat(path, buf) : stat(path, buf);
   }
   }
-  
+
 public:
 public:
   FileManager();
   FileManager();
   ~FileManager();
   ~FileManager();
@@ -150,24 +150,24 @@ public:
   void setStatCache(StatSysCallCache *statCache) {
   void setStatCache(StatSysCallCache *statCache) {
     StatCache.reset(statCache);
     StatCache.reset(statCache);
   }
   }
-  
+
   /// getDirectory - Lookup, cache, and verify the specified directory.  This
   /// getDirectory - Lookup, cache, and verify the specified directory.  This
   /// returns null if the directory doesn't exist.
   /// returns null if the directory doesn't exist.
-  /// 
+  ///
   const DirectoryEntry *getDirectory(const llvm::StringRef &Filename) {
   const DirectoryEntry *getDirectory(const llvm::StringRef &Filename) {
     return getDirectory(Filename.begin(), Filename.end());
     return getDirectory(Filename.begin(), Filename.end());
   }
   }
   const DirectoryEntry *getDirectory(const char *FileStart,const char *FileEnd);
   const DirectoryEntry *getDirectory(const char *FileStart,const char *FileEnd);
-  
+
   /// getFile - Lookup, cache, and verify the specified file.  This returns null
   /// getFile - Lookup, cache, and verify the specified file.  This returns null
   /// if the file doesn't exist.
   /// if the file doesn't exist.
-  /// 
+  ///
   const FileEntry *getFile(const llvm::StringRef &Filename) {
   const FileEntry *getFile(const llvm::StringRef &Filename) {
     return getFile(Filename.begin(), Filename.end());
     return getFile(Filename.begin(), Filename.end());
   }
   }
   const FileEntry *getFile(const char *FilenameStart,
   const FileEntry *getFile(const char *FilenameStart,
                            const char *FilenameEnd);
                            const char *FilenameEnd);
-  
+
   void PrintStats() const;
   void PrintStats() const;
 };
 };
 
 

+ 59 - 59
include/clang/Basic/IdentifierTable.h

@@ -21,8 +21,8 @@
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/OwningPtr.h"
 #include "llvm/ADT/OwningPtr.h"
 #include "llvm/Support/PointerLikeTypeTraits.h"
 #include "llvm/Support/PointerLikeTypeTraits.h"
-#include <string> 
-#include <cassert> 
+#include <string>
+#include <cassert>
 
 
 namespace llvm {
 namespace llvm {
   template <typename T> struct DenseMapInfo;
   template <typename T> struct DenseMapInfo;
@@ -38,21 +38,21 @@ namespace clang {
 
 
   /// IdentifierLocPair - A simple pair of identifier info and location.
   /// IdentifierLocPair - A simple pair of identifier info and location.
   typedef std::pair<IdentifierInfo*, SourceLocation> IdentifierLocPair;
   typedef std::pair<IdentifierInfo*, SourceLocation> IdentifierLocPair;
-  
-  
+
+
 /// IdentifierInfo - One of these records is kept for each identifier that
 /// IdentifierInfo - One of these records is kept for each identifier that
 /// is lexed.  This contains information about whether the token was #define'd,
 /// is lexed.  This contains information about whether the token was #define'd,
 /// is a language keyword, or if it is a front-end token of some sort (e.g. a
 /// is a language keyword, or if it is a front-end token of some sort (e.g. a
 /// variable or function name).  The preprocessor keeps this information in a
 /// variable or function name).  The preprocessor keeps this information in a
-/// set, and all tok::identifier tokens have a pointer to one of these.  
+/// set, and all tok::identifier tokens have a pointer to one of these.
 class IdentifierInfo {
 class IdentifierInfo {
   // Note: DON'T make TokenID a 'tok::TokenKind'; MSVC will treat it as a
   // Note: DON'T make TokenID a 'tok::TokenKind'; MSVC will treat it as a
   //       signed char and TokenKinds > 127 won't be handled correctly.
   //       signed char and TokenKinds > 127 won't be handled correctly.
-  unsigned TokenID            : 8; // Front-end token ID or tok::identifier. 
+  unsigned TokenID            : 8; // Front-end token ID or tok::identifier.
   // Objective-C keyword ('protocol' in '@protocol') or builtin (__builtin_inf).
   // Objective-C keyword ('protocol' in '@protocol') or builtin (__builtin_inf).
   // First NUM_OBJC_KEYWORDS values are for Objective-C, the remaining values
   // First NUM_OBJC_KEYWORDS values are for Objective-C, the remaining values
   // are for builtins.
   // are for builtins.
-  unsigned ObjCOrBuiltinID    :10; 
+  unsigned ObjCOrBuiltinID    :10;
   bool HasMacro               : 1; // True if there is a #define for this.
   bool HasMacro               : 1; // True if there is a #define for this.
   bool IsExtension            : 1; // True if identifier is a lang extension.
   bool IsExtension            : 1; // True if identifier is a lang extension.
   bool IsPoisoned             : 1; // True if identifier is poisoned.
   bool IsPoisoned             : 1; // True if identifier is poisoned.
@@ -61,50 +61,50 @@ class IdentifierInfo {
   // 9 bits left in 32-bit word.
   // 9 bits left in 32-bit word.
   void *FETokenInfo;               // Managed by the language front-end.
   void *FETokenInfo;               // Managed by the language front-end.
   llvm::StringMapEntry<IdentifierInfo*> *Entry;
   llvm::StringMapEntry<IdentifierInfo*> *Entry;
-  
+
   IdentifierInfo(const IdentifierInfo&);  // NONCOPYABLE.
   IdentifierInfo(const IdentifierInfo&);  // NONCOPYABLE.
   void operator=(const IdentifierInfo&);  // NONASSIGNABLE.
   void operator=(const IdentifierInfo&);  // NONASSIGNABLE.
 
 
-  friend class IdentifierTable;  
+  friend class IdentifierTable;
 
 
 public:
 public:
   IdentifierInfo();
   IdentifierInfo();
 
 
-  
+
   /// isStr - Return true if this is the identifier for the specified string.
   /// isStr - Return true if this is the identifier for the specified string.
   /// This is intended to be used for string literals only: II->isStr("foo").
   /// This is intended to be used for string literals only: II->isStr("foo").
   template <std::size_t StrLen>
   template <std::size_t StrLen>
   bool isStr(const char (&Str)[StrLen]) const {
   bool isStr(const char (&Str)[StrLen]) const {
     return getLength() == StrLen-1 && !memcmp(getName(), Str, StrLen-1);
     return getLength() == StrLen-1 && !memcmp(getName(), Str, StrLen-1);
   }
   }
-  
-  /// getName - Return the actual string for this identifier.  The returned 
+
+  /// getName - Return the actual string for this identifier.  The returned
   /// string is properly null terminated.
   /// string is properly null terminated.
   ///
   ///
-  const char *getName() const {    
+  const char *getName() const {
     if (Entry) return Entry->getKeyData();
     if (Entry) return Entry->getKeyData();
     // FIXME: This is gross. It would be best not to embed specific details
     // FIXME: This is gross. It would be best not to embed specific details
     // of the PTH file format here.
     // of the PTH file format here.
-    // The 'this' pointer really points to a 
+    // The 'this' pointer really points to a
     // std::pair<IdentifierInfo, const char*>, where internal pointer
     // std::pair<IdentifierInfo, const char*>, where internal pointer
     // points to the external string data.
     // points to the external string data.
     return ((std::pair<IdentifierInfo, const char*>*) this)->second;
     return ((std::pair<IdentifierInfo, const char*>*) this)->second;
   }
   }
-  
+
   /// getLength - Efficiently return the length of this identifier info.
   /// getLength - Efficiently return the length of this identifier info.
   ///
   ///
   unsigned getLength() const {
   unsigned getLength() const {
     if (Entry) return Entry->getKeyLength();
     if (Entry) return Entry->getKeyLength();
     // FIXME: This is gross. It would be best not to embed specific details
     // FIXME: This is gross. It would be best not to embed specific details
     // of the PTH file format here.
     // of the PTH file format here.
-    // The 'this' pointer really points to a 
+    // The 'this' pointer really points to a
     // std::pair<IdentifierInfo, const char*>, where internal pointer
     // std::pair<IdentifierInfo, const char*>, where internal pointer
     // points to the external string data.
     // points to the external string data.
     const char* p = ((std::pair<IdentifierInfo, const char*>*) this)->second-2;
     const char* p = ((std::pair<IdentifierInfo, const char*>*) this)->second-2;
     return (((unsigned) p[0])
     return (((unsigned) p[0])
         | (((unsigned) p[1]) << 8)) - 1;
         | (((unsigned) p[1]) << 8)) - 1;
   }
   }
-  
+
   /// hasMacroDefinition - Return true if this identifier is #defined to some
   /// hasMacroDefinition - Return true if this identifier is #defined to some
   /// other value.
   /// other value.
   bool hasMacroDefinition() const {
   bool hasMacroDefinition() const {
@@ -112,29 +112,29 @@ public:
   }
   }
   void setHasMacroDefinition(bool Val) {
   void setHasMacroDefinition(bool Val) {
     if (HasMacro == Val) return;
     if (HasMacro == Val) return;
-    
+
     HasMacro = Val;
     HasMacro = Val;
     if (Val)
     if (Val)
       NeedsHandleIdentifier = 1;
       NeedsHandleIdentifier = 1;
     else
     else
       RecomputeNeedsHandleIdentifier();
       RecomputeNeedsHandleIdentifier();
   }
   }
-  
+
   /// get/setTokenID - If this is a source-language token (e.g. 'for'), this API
   /// get/setTokenID - If this is a source-language token (e.g. 'for'), this API
   /// can be used to cause the lexer to map identifiers to source-language
   /// can be used to cause the lexer to map identifiers to source-language
   /// tokens.
   /// tokens.
   tok::TokenKind getTokenID() const { return (tok::TokenKind)TokenID; }
   tok::TokenKind getTokenID() const { return (tok::TokenKind)TokenID; }
   void setTokenID(tok::TokenKind ID) { TokenID = ID; }
   void setTokenID(tok::TokenKind ID) { TokenID = ID; }
-  
+
   /// getPPKeywordID - Return the preprocessor keyword ID for this identifier.
   /// getPPKeywordID - Return the preprocessor keyword ID for this identifier.
   /// For example, "define" will return tok::pp_define.
   /// For example, "define" will return tok::pp_define.
   tok::PPKeywordKind getPPKeywordID() const;
   tok::PPKeywordKind getPPKeywordID() const;
-  
+
   /// getObjCKeywordID - Return the Objective-C keyword ID for the this
   /// getObjCKeywordID - Return the Objective-C keyword ID for the this
   /// identifier.  For example, 'class' will return tok::objc_class if ObjC is
   /// identifier.  For example, 'class' will return tok::objc_class if ObjC is
   /// enabled.
   /// enabled.
   tok::ObjCKeywordKind getObjCKeywordID() const {
   tok::ObjCKeywordKind getObjCKeywordID() const {
-    if (ObjCOrBuiltinID < tok::NUM_OBJC_KEYWORDS) 
+    if (ObjCOrBuiltinID < tok::NUM_OBJC_KEYWORDS)
       return tok::ObjCKeywordKind(ObjCOrBuiltinID);
       return tok::ObjCKeywordKind(ObjCOrBuiltinID);
     else
     else
       return tok::objc_not_keyword;
       return tok::objc_not_keyword;
@@ -144,15 +144,15 @@ public:
   /// getBuiltinID - Return a value indicating whether this is a builtin
   /// getBuiltinID - Return a value indicating whether this is a builtin
   /// function.  0 is not-built-in.  1 is builtin-for-some-nonprimary-target.
   /// function.  0 is not-built-in.  1 is builtin-for-some-nonprimary-target.
   /// 2+ are specific builtin functions.
   /// 2+ are specific builtin functions.
-  unsigned getBuiltinID() const { 
+  unsigned getBuiltinID() const {
     if (ObjCOrBuiltinID >= tok::NUM_OBJC_KEYWORDS)
     if (ObjCOrBuiltinID >= tok::NUM_OBJC_KEYWORDS)
-      return ObjCOrBuiltinID - tok::NUM_OBJC_KEYWORDS; 
+      return ObjCOrBuiltinID - tok::NUM_OBJC_KEYWORDS;
     else
     else
       return 0;
       return 0;
   }
   }
   void setBuiltinID(unsigned ID) {
   void setBuiltinID(unsigned ID) {
     ObjCOrBuiltinID = ID + tok::NUM_OBJC_KEYWORDS;
     ObjCOrBuiltinID = ID + tok::NUM_OBJC_KEYWORDS;
-    assert(ObjCOrBuiltinID - unsigned(tok::NUM_OBJC_KEYWORDS) == ID 
+    assert(ObjCOrBuiltinID - unsigned(tok::NUM_OBJC_KEYWORDS) == ID
            && "ID too large for field!");
            && "ID too large for field!");
   }
   }
 
 
@@ -170,7 +170,7 @@ public:
     else
     else
       RecomputeNeedsHandleIdentifier();
       RecomputeNeedsHandleIdentifier();
   }
   }
-  
+
   /// setIsPoisoned - Mark this identifier as poisoned.  After poisoning, the
   /// setIsPoisoned - Mark this identifier as poisoned.  After poisoning, the
   /// Preprocessor will emit an error every time this token is used.
   /// Preprocessor will emit an error every time this token is used.
   void setIsPoisoned(bool Value = true) {
   void setIsPoisoned(bool Value = true) {
@@ -180,10 +180,10 @@ public:
     else
     else
       RecomputeNeedsHandleIdentifier();
       RecomputeNeedsHandleIdentifier();
   }
   }
-  
+
   /// isPoisoned - Return true if this token has been poisoned.
   /// isPoisoned - Return true if this token has been poisoned.
   bool isPoisoned() const { return IsPoisoned; }
   bool isPoisoned() const { return IsPoisoned; }
-  
+
   /// isCPlusPlusOperatorKeyword/setIsCPlusPlusOperatorKeyword controls whether
   /// isCPlusPlusOperatorKeyword/setIsCPlusPlusOperatorKeyword controls whether
   /// this identifier is a C++ alternate representation of an operator.
   /// this identifier is a C++ alternate representation of an operator.
   void setIsCPlusPlusOperatorKeyword(bool Val = true) {
   void setIsCPlusPlusOperatorKeyword(bool Val = true) {
@@ -205,7 +205,7 @@ public:
   /// must be called on a token of this identifier.  If this returns false, we
   /// must be called on a token of this identifier.  If this returns false, we
   /// know that HandleIdentifier will not affect the token.
   /// know that HandleIdentifier will not affect the token.
   bool isHandleIdentifierCase() const { return NeedsHandleIdentifier; }
   bool isHandleIdentifierCase() const { return NeedsHandleIdentifier; }
-  
+
 private:
 private:
   /// RecomputeNeedsHandleIdentifier - The Preprocessor::HandleIdentifier does
   /// RecomputeNeedsHandleIdentifier - The Preprocessor::HandleIdentifier does
   /// several special (but rare) things to identifiers of various sorts.  For
   /// several special (but rare) things to identifiers of various sorts.  For
@@ -227,13 +227,13 @@ private:
 class IdentifierInfoLookup {
 class IdentifierInfoLookup {
 public:
 public:
   virtual ~IdentifierInfoLookup();
   virtual ~IdentifierInfoLookup();
-  
+
   /// get - Return the identifier token info for the specified named identifier.
   /// get - Return the identifier token info for the specified named identifier.
   ///  Unlike the version in IdentifierTable, this returns a pointer instead
   ///  Unlike the version in IdentifierTable, this returns a pointer instead
   ///  of a reference.  If the pointer is NULL then the IdentifierInfo cannot
   ///  of a reference.  If the pointer is NULL then the IdentifierInfo cannot
   ///  be found.
   ///  be found.
   virtual IdentifierInfo* get(const char *NameStart, const char *NameEnd) = 0;
   virtual IdentifierInfo* get(const char *NameStart, const char *NameEnd) = 0;
-};  
+};
 
 
 /// \brief An abstract class used to resolve numerical identifier
 /// \brief An abstract class used to resolve numerical identifier
 /// references (meaningful only to some external source) into
 /// references (meaningful only to some external source) into
@@ -257,7 +257,7 @@ class IdentifierTable {
   // BumpPtrAllocator!
   // BumpPtrAllocator!
   typedef llvm::StringMap<IdentifierInfo*, llvm::BumpPtrAllocator> HashTableTy;
   typedef llvm::StringMap<IdentifierInfo*, llvm::BumpPtrAllocator> HashTableTy;
   HashTableTy HashTable;
   HashTableTy HashTable;
-  
+
   IdentifierInfoLookup* ExternalLookup;
   IdentifierInfoLookup* ExternalLookup;
 
 
 public:
 public:
@@ -265,7 +265,7 @@ public:
   /// info about the language keywords for the language specified by LangOpts.
   /// info about the language keywords for the language specified by LangOpts.
   IdentifierTable(const LangOptions &LangOpts,
   IdentifierTable(const LangOptions &LangOpts,
                   IdentifierInfoLookup* externalLookup = 0);
                   IdentifierInfoLookup* externalLookup = 0);
-  
+
   /// \brief Set the external identifier lookup mechanism.
   /// \brief Set the external identifier lookup mechanism.
   void setExternalIdentifierLookup(IdentifierInfoLookup *IILookup) {
   void setExternalIdentifierLookup(IdentifierInfoLookup *IILookup) {
     ExternalLookup = IILookup;
     ExternalLookup = IILookup;
@@ -274,16 +274,16 @@ public:
   llvm::BumpPtrAllocator& getAllocator() {
   llvm::BumpPtrAllocator& getAllocator() {
     return HashTable.getAllocator();
     return HashTable.getAllocator();
   }
   }
-  
+
   /// get - Return the identifier token info for the specified named identifier.
   /// get - Return the identifier token info for the specified named identifier.
   ///
   ///
   IdentifierInfo &get(const char *NameStart, const char *NameEnd) {
   IdentifierInfo &get(const char *NameStart, const char *NameEnd) {
     llvm::StringMapEntry<IdentifierInfo*> &Entry =
     llvm::StringMapEntry<IdentifierInfo*> &Entry =
       HashTable.GetOrCreateValue(NameStart, NameEnd);
       HashTable.GetOrCreateValue(NameStart, NameEnd);
-    
+
     IdentifierInfo *II = Entry.getValue();
     IdentifierInfo *II = Entry.getValue();
     if (II) return *II;
     if (II) return *II;
-    
+
     // No entry; if we have an external lookup, look there first.
     // No entry; if we have an external lookup, look there first.
     if (ExternalLookup) {
     if (ExternalLookup) {
       II = ExternalLookup->get(NameStart, NameEnd);
       II = ExternalLookup->get(NameStart, NameEnd);
@@ -305,7 +305,7 @@ public:
 
 
     return *II;
     return *II;
   }
   }
-  
+
   /// \brief Creates a new IdentifierInfo from the given string.
   /// \brief Creates a new IdentifierInfo from the given string.
   ///
   ///
   /// This is a lower-level version of get() that requires that this
   /// This is a lower-level version of get() that requires that this
@@ -314,14 +314,14 @@ public:
   /// identifier sources can use this routine to build IdentifierInfo
   /// identifier sources can use this routine to build IdentifierInfo
   /// nodes and then introduce additional information about those
   /// nodes and then introduce additional information about those
   /// identifiers.
   /// identifiers.
-  IdentifierInfo &CreateIdentifierInfo(const char *NameStart, 
+  IdentifierInfo &CreateIdentifierInfo(const char *NameStart,
                                        const char *NameEnd) {
                                        const char *NameEnd) {
     llvm::StringMapEntry<IdentifierInfo*> &Entry =
     llvm::StringMapEntry<IdentifierInfo*> &Entry =
       HashTable.GetOrCreateValue(NameStart, NameEnd);
       HashTable.GetOrCreateValue(NameStart, NameEnd);
-    
+
     IdentifierInfo *II = Entry.getValue();
     IdentifierInfo *II = Entry.getValue();
     assert(!II && "IdentifierInfo already exists");
     assert(!II && "IdentifierInfo already exists");
-    
+
     // Lookups failed, make a new IdentifierInfo.
     // Lookups failed, make a new IdentifierInfo.
     void *Mem = getAllocator().Allocate<IdentifierInfo>();
     void *Mem = getAllocator().Allocate<IdentifierInfo>();
     II = new (Mem) IdentifierInfo();
     II = new (Mem) IdentifierInfo();
@@ -345,26 +345,26 @@ public:
 
 
   typedef HashTableTy::const_iterator iterator;
   typedef HashTableTy::const_iterator iterator;
   typedef HashTableTy::const_iterator const_iterator;
   typedef HashTableTy::const_iterator const_iterator;
-  
+
   iterator begin() const { return HashTable.begin(); }
   iterator begin() const { return HashTable.begin(); }
   iterator end() const   { return HashTable.end(); }
   iterator end() const   { return HashTable.end(); }
   unsigned size() const { return HashTable.size(); }
   unsigned size() const { return HashTable.size(); }
-  
+
   /// PrintStats - Print some statistics to stderr that indicate how well the
   /// PrintStats - Print some statistics to stderr that indicate how well the
   /// hashing is doing.
   /// hashing is doing.
   void PrintStats() const;
   void PrintStats() const;
-  
+
   void AddKeywords(const LangOptions &LangOpts);
   void AddKeywords(const LangOptions &LangOpts);
 };
 };
 
 
 /// Selector - This smart pointer class efficiently represents Objective-C
 /// Selector - This smart pointer class efficiently represents Objective-C
 /// method names. This class will either point to an IdentifierInfo or a
 /// method names. This class will either point to an IdentifierInfo or a
 /// MultiKeywordSelector (which is private). This enables us to optimize
 /// MultiKeywordSelector (which is private). This enables us to optimize
-/// selectors that take no arguments and selectors that take 1 argument, which 
+/// selectors that take no arguments and selectors that take 1 argument, which
 /// accounts for 78% of all selectors in Cocoa.h.
 /// accounts for 78% of all selectors in Cocoa.h.
 class Selector {
 class Selector {
   friend class DiagnosticInfo;
   friend class DiagnosticInfo;
-  
+
   enum IdentifierInfoFlag {
   enum IdentifierInfoFlag {
     // MultiKeywordSelector = 0.
     // MultiKeywordSelector = 0.
     ZeroArg  = 0x1,
     ZeroArg  = 0x1,
@@ -372,7 +372,7 @@ class Selector {
     ArgFlags = ZeroArg|OneArg
     ArgFlags = ZeroArg|OneArg
   };
   };
   uintptr_t InfoPtr; // a pointer to the MultiKeywordSelector or IdentifierInfo.
   uintptr_t InfoPtr; // a pointer to the MultiKeywordSelector or IdentifierInfo.
-  
+
   Selector(IdentifierInfo *II, unsigned nArgs) {
   Selector(IdentifierInfo *II, unsigned nArgs) {
     InfoPtr = reinterpret_cast<uintptr_t>(II);
     InfoPtr = reinterpret_cast<uintptr_t>(II);
     assert((InfoPtr & ArgFlags) == 0 &&"Insufficiently aligned IdentifierInfo");
     assert((InfoPtr & ArgFlags) == 0 &&"Insufficiently aligned IdentifierInfo");
@@ -383,7 +383,7 @@ class Selector {
     InfoPtr = reinterpret_cast<uintptr_t>(SI);
     InfoPtr = reinterpret_cast<uintptr_t>(SI);
     assert((InfoPtr & ArgFlags) == 0 &&"Insufficiently aligned IdentifierInfo");
     assert((InfoPtr & ArgFlags) == 0 &&"Insufficiently aligned IdentifierInfo");
   }
   }
-  
+
   IdentifierInfo *getAsIdentifierInfo() const {
   IdentifierInfo *getAsIdentifierInfo() const {
     if (getIdentifierInfoFlag())
     if (getIdentifierInfoFlag())
       return reinterpret_cast<IdentifierInfo *>(InfoPtr & ~ArgFlags);
       return reinterpret_cast<IdentifierInfo *>(InfoPtr & ~ArgFlags);
@@ -417,19 +417,19 @@ public:
   bool isNull() const { return InfoPtr == 0; }
   bool isNull() const { return InfoPtr == 0; }
 
 
   // Predicates to identify the selector type.
   // Predicates to identify the selector type.
-  bool isKeywordSelector() const { 
-    return getIdentifierInfoFlag() != ZeroArg; 
+  bool isKeywordSelector() const {
+    return getIdentifierInfoFlag() != ZeroArg;
   }
   }
-  bool isUnarySelector() const { 
+  bool isUnarySelector() const {
     return getIdentifierInfoFlag() == ZeroArg;
     return getIdentifierInfoFlag() == ZeroArg;
   }
   }
   unsigned getNumArgs() const;
   unsigned getNumArgs() const;
   IdentifierInfo *getIdentifierInfoForSlot(unsigned argIndex) const;
   IdentifierInfo *getIdentifierInfoForSlot(unsigned argIndex) const;
-  
+
   /// getAsString - Derive the full selector name (e.g. "foo:bar:") and return
   /// getAsString - Derive the full selector name (e.g. "foo:bar:") and return
   /// it as an std::string.
   /// it as an std::string.
   std::string getAsString() const;
   std::string getAsString() const;
-  
+
   static Selector getEmptyMarker() {
   static Selector getEmptyMarker() {
     return Selector(uintptr_t(-1));
     return Selector(uintptr_t(-1));
   }
   }
@@ -452,7 +452,7 @@ public:
   /// whether this is a no argument selector "foo", a single argument selector
   /// whether this is a no argument selector "foo", a single argument selector
   /// "foo:" or multi-argument "foo:bar:".
   /// "foo:" or multi-argument "foo:bar:".
   Selector getSelector(unsigned NumArgs, IdentifierInfo **IIV);
   Selector getSelector(unsigned NumArgs, IdentifierInfo **IIV);
-  
+
   Selector getUnarySelector(IdentifierInfo *ID) {
   Selector getUnarySelector(IdentifierInfo *ID) {
     return Selector(ID, 1);
     return Selector(ID, 1);
   }
   }
@@ -519,15 +519,15 @@ struct DenseMapInfo<clang::Selector> {
     return clang::Selector::getEmptyMarker();
     return clang::Selector::getEmptyMarker();
   }
   }
   static inline clang::Selector getTombstoneKey() {
   static inline clang::Selector getTombstoneKey() {
-    return clang::Selector::getTombstoneMarker(); 
+    return clang::Selector::getTombstoneMarker();
   }
   }
-  
+
   static unsigned getHashValue(clang::Selector S);
   static unsigned getHashValue(clang::Selector S);
-  
+
   static bool isEqual(clang::Selector LHS, clang::Selector RHS) {
   static bool isEqual(clang::Selector LHS, clang::Selector RHS) {
     return LHS == RHS;
     return LHS == RHS;
   }
   }
-  
+
   static bool isPod() { return true; }
   static bool isPod() { return true; }
 };
 };
 
 
@@ -537,7 +537,7 @@ template<>
 class PointerLikeTypeTraits<clang::IdentifierInfo*> {
 class PointerLikeTypeTraits<clang::IdentifierInfo*> {
 public:
 public:
   static inline void *getAsVoidPointer(clang::IdentifierInfo* P) {
   static inline void *getAsVoidPointer(clang::IdentifierInfo* P) {
-    return P; 
+    return P;
   }
   }
   static inline clang::IdentifierInfo *getFromVoidPointer(void *P) {
   static inline clang::IdentifierInfo *getFromVoidPointer(void *P) {
     return static_cast<clang::IdentifierInfo*>(P);
     return static_cast<clang::IdentifierInfo*>(P);
@@ -549,7 +549,7 @@ template<>
 class PointerLikeTypeTraits<const clang::IdentifierInfo*> {
 class PointerLikeTypeTraits<const clang::IdentifierInfo*> {
 public:
 public:
   static inline const void *getAsVoidPointer(const clang::IdentifierInfo* P) {
   static inline const void *getAsVoidPointer(const clang::IdentifierInfo* P) {
-    return P; 
+    return P;
   }
   }
   static inline const clang::IdentifierInfo *getFromVoidPointer(const void *P) {
   static inline const clang::IdentifierInfo *getFromVoidPointer(const void *P) {
     return static_cast<const clang::IdentifierInfo*>(P);
     return static_cast<const clang::IdentifierInfo*>(P);

+ 15 - 15
include/clang/Basic/LangOptions.h

@@ -34,13 +34,13 @@ public:
   unsigned CPlusPlus         : 1;  // C++ Support
   unsigned CPlusPlus         : 1;  // C++ Support
   unsigned CPlusPlus0x       : 1;  // C++0x Support
   unsigned CPlusPlus0x       : 1;  // C++0x Support
   unsigned CXXOperatorNames  : 1;  // Treat C++ operator names as keywords.
   unsigned CXXOperatorNames  : 1;  // Treat C++ operator names as keywords.
-    
+
   unsigned ObjC1             : 1;  // Objective-C 1 support enabled.
   unsigned ObjC1             : 1;  // Objective-C 1 support enabled.
   unsigned ObjC2             : 1;  // Objective-C 2 support enabled.
   unsigned ObjC2             : 1;  // Objective-C 2 support enabled.
   unsigned ObjCSenderDispatch: 1;  // Objective-C 2 three-dimensional dispatch
   unsigned ObjCSenderDispatch: 1;  // Objective-C 2 three-dimensional dispatch
                                    // enabled.
                                    // enabled.
   unsigned ObjCNonFragileABI : 1;  // Objective-C modern abi enabled
   unsigned ObjCNonFragileABI : 1;  // Objective-C modern abi enabled
-    
+
   unsigned PascalStrings     : 1;  // Allow Pascal strings
   unsigned PascalStrings     : 1;  // Allow Pascal strings
   unsigned WritableStrings   : 1;  // Allow writable strings
   unsigned WritableStrings   : 1;  // Allow writable strings
   unsigned LaxVectorConversions : 1;
   unsigned LaxVectorConversions : 1;
@@ -69,7 +69,7 @@ public:
                                   // may be ripped out at any time.
                                   // may be ripped out at any time.
 
 
   unsigned Optimize          : 1; // Whether __OPTIMIZE__ should be defined.
   unsigned Optimize          : 1; // Whether __OPTIMIZE__ should be defined.
-  unsigned OptimizeSize      : 1; // Whether __OPTIMIZE_SIZE__ should be 
+  unsigned OptimizeSize      : 1; // Whether __OPTIMIZE_SIZE__ should be
                                   // defined.
                                   // defined.
   unsigned Static            : 1; // Should __STATIC__ be defined (as
   unsigned Static            : 1; // Should __STATIC__ be defined (as
                                   // opposed to __DYNAMIC__).
                                   // opposed to __DYNAMIC__).
@@ -82,7 +82,7 @@ public:
   unsigned ObjCGCBitmapPrint : 1; // Enable printing of gc's bitmap layout
   unsigned ObjCGCBitmapPrint : 1; // Enable printing of gc's bitmap layout
                                   // for __weak/__strong ivars.
                                   // for __weak/__strong ivars.
 
 
-  unsigned AccessControl     : 1; // Whether C++ access control should 
+  unsigned AccessControl     : 1; // Whether C++ access control should
                                   // be enabled.
                                   // be enabled.
   unsigned CharIsSigned      : 1; // Whether char is a signed or unsigned type
   unsigned CharIsSigned      : 1; // Whether char is a signed or unsigned type
 
 
@@ -106,19 +106,19 @@ private:
   /// the original input file, for example with -save-temps.
   /// the original input file, for example with -save-temps.
   const char *MainFileName;
   const char *MainFileName;
 
 
-public:  
+public:
   unsigned InstantiationDepth;    // Maximum template instantiation depth.
   unsigned InstantiationDepth;    // Maximum template instantiation depth.
 
 
   const char *ObjCConstantStringClass;
   const char *ObjCConstantStringClass;
 
 
   enum GCMode { NonGC, GCOnly, HybridGC };
   enum GCMode { NonGC, GCOnly, HybridGC };
   enum StackProtectorMode { SSPOff, SSPOn, SSPReq };
   enum StackProtectorMode { SSPOff, SSPOn, SSPReq };
-  enum VisibilityMode { 
-    Default, 
-    Protected, 
+  enum VisibilityMode {
+    Default,
+    Protected,
     Hidden
     Hidden
   };
   };
-  
+
   LangOptions() {
   LangOptions() {
     Trigraphs = BCPLComment = Bool = DollarIdents = AsmPreprocessor = 0;
     Trigraphs = BCPLComment = Bool = DollarIdents = AsmPreprocessor = 0;
     GNUMode = ImplicitInt = Digraphs = 0;
     GNUMode = ImplicitInt = Digraphs = 0;
@@ -134,7 +134,7 @@ public:
     AltiVec = OpenCL = StackProtector = 0;
     AltiVec = OpenCL = StackProtector = 0;
 
 
     SymbolVisibility = (unsigned) Default;
     SymbolVisibility = (unsigned) Default;
-    
+
     // FIXME: The default should be 1.
     // FIXME: The default should be 1.
     ThreadsafeStatics = 0;
     ThreadsafeStatics = 0;
     POSIXThreads = 0;
     POSIXThreads = 0;
@@ -145,13 +145,13 @@ public:
     // FIXME: The default should be 1.
     // FIXME: The default should be 1.
     AccessControl = 0;
     AccessControl = 0;
     ElideConstructors = 1;
     ElideConstructors = 1;
-    
+
     OverflowChecking = 0;
     OverflowChecking = 0;
     ObjCGCBitmapPrint = 0;
     ObjCGCBitmapPrint = 0;
     ObjCSenderDispatch = 0;
     ObjCSenderDispatch = 0;
 
 
     InstantiationDepth = 99;
     InstantiationDepth = 99;
-    
+
     Optimize = 0;
     Optimize = 0;
     OptimizeSize = 0;
     OptimizeSize = 0;
 
 
@@ -165,7 +165,7 @@ public:
 
 
     MainFileName = 0;
     MainFileName = 0;
   }
   }
-  
+
   GCMode getGCMode() const { return (GCMode) GC; }
   GCMode getGCMode() const { return (GCMode) GC; }
   void setGCMode(GCMode m) { GC = (unsigned) m; }
   void setGCMode(GCMode m) { GC = (unsigned) m; }
 
 
@@ -179,8 +179,8 @@ public:
   const char *getMainFileName() const { return MainFileName; }
   const char *getMainFileName() const { return MainFileName; }
   void setMainFileName(const char *Name) { MainFileName = Name; }
   void setMainFileName(const char *Name) { MainFileName = Name; }
 
 
-  VisibilityMode getVisibilityMode() const { 
-    return (VisibilityMode) SymbolVisibility; 
+  VisibilityMode getVisibilityMode() const {
+    return (VisibilityMode) SymbolVisibility;
   }
   }
   void setVisibilityMode(VisibilityMode v) { SymbolVisibility = (unsigned) v; }
   void setVisibilityMode(VisibilityMode v) { SymbolVisibility = (unsigned) v; }
 };
 };

+ 44 - 44
include/clang/Basic/OnDiskHashTable.h

@@ -29,7 +29,7 @@ namespace clang {
 // This is basically copy-and-paste from StringMap.  This likely won't
 // This is basically copy-and-paste from StringMap.  This likely won't
 // stay here, which is why I didn't both to expose this function from
 // stay here, which is why I didn't both to expose this function from
 // String Map.
 // String Map.
-inline unsigned BernsteinHash(const char* x) {  
+inline unsigned BernsteinHash(const char* x) {
   unsigned int R = 0;
   unsigned int R = 0;
   for ( ; *x != '\0' ; ++x) R = R * 33 + *x;
   for ( ; *x != '\0' ; ++x) R = R * 33 + *x;
   return R + (R >> 5);
   return R + (R >> 5);
@@ -131,29 +131,29 @@ class OnDiskChainedHashTableGenerator {
   unsigned NumBuckets;
   unsigned NumBuckets;
   unsigned NumEntries;
   unsigned NumEntries;
   llvm::BumpPtrAllocator BA;
   llvm::BumpPtrAllocator BA;
-  
+
   class Item {
   class Item {
   public:
   public:
     typename Info::key_type key;
     typename Info::key_type key;
     typename Info::data_type data;
     typename Info::data_type data;
     Item *next;
     Item *next;
     const uint32_t hash;
     const uint32_t hash;
-    
+
     Item(typename Info::key_type_ref k, typename Info::data_type_ref d)
     Item(typename Info::key_type_ref k, typename Info::data_type_ref d)
     : key(k), data(d), next(0), hash(Info::ComputeHash(k)) {}
     : key(k), data(d), next(0), hash(Info::ComputeHash(k)) {}
   };
   };
-  
-  class Bucket { 
+
+  class Bucket {
   public:
   public:
     io::Offset off;
     io::Offset off;
     Item*  head;
     Item*  head;
     unsigned length;
     unsigned length;
-    
+
     Bucket() {}
     Bucket() {}
   };
   };
-  
+
   Bucket* Buckets;
   Bucket* Buckets;
-  
+
 private:
 private:
   void insert(Bucket* b, size_t size, Item* E) {
   void insert(Bucket* b, size_t size, Item* E) {
     unsigned idx = E->hash & (size - 1);
     unsigned idx = E->hash & (size - 1);
@@ -162,7 +162,7 @@ private:
     ++B.length;
     ++B.length;
     B.head = E;
     B.head = E;
   }
   }
-  
+
   void resize(size_t newsize) {
   void resize(size_t newsize) {
     Bucket* newBuckets = (Bucket*) std::calloc(newsize, sizeof(Bucket));
     Bucket* newBuckets = (Bucket*) std::calloc(newsize, sizeof(Bucket));
     // Populate newBuckets with the old entries.
     // Populate newBuckets with the old entries.
@@ -173,14 +173,14 @@ private:
         insert(newBuckets, newsize, E);
         insert(newBuckets, newsize, E);
         E = N;
         E = N;
       }
       }
-    
+
     free(Buckets);
     free(Buckets);
     NumBuckets = newsize;
     NumBuckets = newsize;
     Buckets = newBuckets;
     Buckets = newBuckets;
-  }  
-  
+  }
+
 public:
 public:
-  
+
   void insert(typename Info::key_type_ref key,
   void insert(typename Info::key_type_ref key,
               typename Info::data_type_ref data) {
               typename Info::data_type_ref data) {
 
 
@@ -188,7 +188,7 @@ public:
     if (4*NumEntries >= 3*NumBuckets) resize(NumBuckets*2);
     if (4*NumEntries >= 3*NumBuckets) resize(NumBuckets*2);
     insert(Buckets, NumBuckets, new (BA.Allocate<Item>()) Item(key, data));
     insert(Buckets, NumBuckets, new (BA.Allocate<Item>()) Item(key, data));
   }
   }
-  
+
   io::Offset Emit(llvm::raw_ostream &out) {
   io::Offset Emit(llvm::raw_ostream &out) {
     Info InfoObj;
     Info InfoObj;
     return Emit(out, InfoObj);
     return Emit(out, InfoObj);
@@ -201,42 +201,42 @@ public:
     for (unsigned i = 0; i < NumBuckets; ++i) {
     for (unsigned i = 0; i < NumBuckets; ++i) {
       Bucket& B = Buckets[i];
       Bucket& B = Buckets[i];
       if (!B.head) continue;
       if (!B.head) continue;
-      
+
       // Store the offset for the data of this bucket.
       // Store the offset for the data of this bucket.
       B.off = out.tell();
       B.off = out.tell();
       assert(B.off && "Cannot write a bucket at offset 0. Please add padding.");
       assert(B.off && "Cannot write a bucket at offset 0. Please add padding.");
 
 
       // Write out the number of items in the bucket.
       // Write out the number of items in the bucket.
       Emit16(out, B.length);
       Emit16(out, B.length);
-      
+
       // Write out the entries in the bucket.
       // Write out the entries in the bucket.
       for (Item *I = B.head; I ; I = I->next) {
       for (Item *I = B.head; I ; I = I->next) {
         Emit32(out, I->hash);
         Emit32(out, I->hash);
-        const std::pair<unsigned, unsigned>& Len = 
+        const std::pair<unsigned, unsigned>& Len =
           InfoObj.EmitKeyDataLength(out, I->key, I->data);
           InfoObj.EmitKeyDataLength(out, I->key, I->data);
         InfoObj.EmitKey(out, I->key, Len.first);
         InfoObj.EmitKey(out, I->key, Len.first);
         InfoObj.EmitData(out, I->key, I->data, Len.second);
         InfoObj.EmitData(out, I->key, I->data, Len.second);
       }
       }
     }
     }
-    
+
     // Emit the hashtable itself.
     // Emit the hashtable itself.
     Pad(out, 4);
     Pad(out, 4);
     io::Offset TableOff = out.tell();
     io::Offset TableOff = out.tell();
     Emit32(out, NumBuckets);
     Emit32(out, NumBuckets);
     Emit32(out, NumEntries);
     Emit32(out, NumEntries);
     for (unsigned i = 0; i < NumBuckets; ++i) Emit32(out, Buckets[i].off);
     for (unsigned i = 0; i < NumBuckets; ++i) Emit32(out, Buckets[i].off);
-    
+
     return TableOff;
     return TableOff;
   }
   }
-  
+
   OnDiskChainedHashTableGenerator() {
   OnDiskChainedHashTableGenerator() {
     NumEntries = 0;
     NumEntries = 0;
-    NumBuckets = 64;    
+    NumBuckets = 64;
     // Note that we do not need to run the constructors of the individual
     // Note that we do not need to run the constructors of the individual
     // Bucket objects since 'calloc' returns bytes that are all 0.
     // Bucket objects since 'calloc' returns bytes that are all 0.
     Buckets = (Bucket*) std::calloc(NumBuckets, sizeof(Bucket));
     Buckets = (Bucket*) std::calloc(NumBuckets, sizeof(Bucket));
   }
   }
-  
+
   ~OnDiskChainedHashTableGenerator() {
   ~OnDiskChainedHashTableGenerator() {
     std::free(Buckets);
     std::free(Buckets);
   }
   }
@@ -254,7 +254,7 @@ public:
   typedef typename Info::internal_key_type internal_key_type;
   typedef typename Info::internal_key_type internal_key_type;
   typedef typename Info::external_key_type external_key_type;
   typedef typename Info::external_key_type external_key_type;
   typedef typename Info::data_type         data_type;
   typedef typename Info::data_type         data_type;
-  
+
   OnDiskChainedHashTable(unsigned numBuckets, unsigned numEntries,
   OnDiskChainedHashTable(unsigned numBuckets, unsigned numEntries,
                          const unsigned char* buckets,
                          const unsigned char* buckets,
                          const unsigned char* base,
                          const unsigned char* base,
@@ -271,7 +271,7 @@ public:
   const unsigned char* getBuckets() const { return Buckets; }
   const unsigned char* getBuckets() const { return Buckets; }
 
 
   bool isEmpty() const { return NumEntries == 0; }
   bool isEmpty() const { return NumEntries == 0; }
-  
+
   class iterator {
   class iterator {
     internal_key_type key;
     internal_key_type key;
     const unsigned char* const data;
     const unsigned char* const data;
@@ -282,12 +282,12 @@ public:
     iterator(const internal_key_type k, const unsigned char* d, unsigned l,
     iterator(const internal_key_type k, const unsigned char* d, unsigned l,
              Info *InfoObj)
              Info *InfoObj)
       : key(k), data(d), len(l), InfoObj(InfoObj) {}
       : key(k), data(d), len(l), InfoObj(InfoObj) {}
-    
-    data_type operator*() const { return InfoObj->ReadData(key, data, len); }    
-    bool operator==(const iterator& X) const { return X.data == data; }    
+
+    data_type operator*() const { return InfoObj->ReadData(key, data, len); }
+    bool operator==(const iterator& X) const { return X.data == data; }
     bool operator!=(const iterator& X) const { return X.data != data; }
     bool operator!=(const iterator& X) const { return X.data != data; }
-  };    
-  
+  };
+
   iterator find(const external_key_type& eKey, Info *InfoPtr = 0) {
   iterator find(const external_key_type& eKey, Info *InfoPtr = 0) {
     if (!InfoPtr)
     if (!InfoPtr)
       InfoPtr = &InfoObj;
       InfoPtr = &InfoObj;
@@ -295,25 +295,25 @@ public:
     using namespace io;
     using namespace io;
     const internal_key_type& iKey = Info::GetInternalKey(eKey);
     const internal_key_type& iKey = Info::GetInternalKey(eKey);
     unsigned key_hash = Info::ComputeHash(iKey);
     unsigned key_hash = Info::ComputeHash(iKey);
-    
+
     // Each bucket is just a 32-bit offset into the hash table file.
     // Each bucket is just a 32-bit offset into the hash table file.
     unsigned idx = key_hash & (NumBuckets - 1);
     unsigned idx = key_hash & (NumBuckets - 1);
     const unsigned char* Bucket = Buckets + sizeof(uint32_t)*idx;
     const unsigned char* Bucket = Buckets + sizeof(uint32_t)*idx;
-    
+
     unsigned offset = ReadLE32(Bucket);
     unsigned offset = ReadLE32(Bucket);
     if (offset == 0) return iterator(); // Empty bucket.
     if (offset == 0) return iterator(); // Empty bucket.
     const unsigned char* Items = Base + offset;
     const unsigned char* Items = Base + offset;
-    
+
     // 'Items' starts with a 16-bit unsigned integer representing the
     // 'Items' starts with a 16-bit unsigned integer representing the
     // number of items in this bucket.
     // number of items in this bucket.
     unsigned len = ReadUnalignedLE16(Items);
     unsigned len = ReadUnalignedLE16(Items);
-    
+
     for (unsigned i = 0; i < len; ++i) {
     for (unsigned i = 0; i < len; ++i) {
       // Read the hash.
       // Read the hash.
       uint32_t item_hash = ReadUnalignedLE32(Items);
       uint32_t item_hash = ReadUnalignedLE32(Items);
-      
+
       // Determine the length of the key and the data.
       // Determine the length of the key and the data.
-      const std::pair<unsigned, unsigned>& L = Info::ReadKeyDataLength(Items);      
+      const std::pair<unsigned, unsigned>& L = Info::ReadKeyDataLength(Items);
       unsigned item_len = L.first + L.second;
       unsigned item_len = L.first + L.second;
 
 
       // Compare the hashes.  If they are not the same, skip the entry entirely.
       // Compare the hashes.  If they are not the same, skip the entry entirely.
@@ -321,7 +321,7 @@ public:
         Items += item_len;
         Items += item_len;
         continue;
         continue;
       }
       }
-      
+
       // Read the key.
       // Read the key.
       const internal_key_type& X =
       const internal_key_type& X =
         InfoPtr->ReadKey((const unsigned char* const) Items, L.first);
         InfoPtr->ReadKey((const unsigned char* const) Items, L.first);
@@ -331,17 +331,17 @@ public:
         Items += item_len;
         Items += item_len;
         continue;
         continue;
       }
       }
-      
+
       // The key matches!
       // The key matches!
       return iterator(X, Items + L.first, L.second, InfoPtr);
       return iterator(X, Items + L.first, L.second, InfoPtr);
     }
     }
-    
+
     return iterator();
     return iterator();
   }
   }
-  
+
   iterator end() const { return iterator(); }
   iterator end() const { return iterator(); }
-  
-  
+
+
   static OnDiskChainedHashTable* Create(const unsigned char* buckets,
   static OnDiskChainedHashTable* Create(const unsigned char* buckets,
                                         const unsigned char* const base,
                                         const unsigned char* const base,
                                         const Info &InfoObj = Info()) {
                                         const Info &InfoObj = Info()) {
@@ -349,14 +349,14 @@ public:
     assert(buckets > base);
     assert(buckets > base);
     assert((reinterpret_cast<uintptr_t>(buckets) & 0x3) == 0 &&
     assert((reinterpret_cast<uintptr_t>(buckets) & 0x3) == 0 &&
            "buckets should be 4-byte aligned.");
            "buckets should be 4-byte aligned.");
-    
+
     unsigned numBuckets = ReadLE32(buckets);
     unsigned numBuckets = ReadLE32(buckets);
     unsigned numEntries = ReadLE32(buckets);
     unsigned numEntries = ReadLE32(buckets);
     return new OnDiskChainedHashTable<Info>(numBuckets, numEntries, buckets,
     return new OnDiskChainedHashTable<Info>(numBuckets, numEntries, buckets,
                                             base, InfoObj);
                                             base, InfoObj);
-  }  
+  }
 };
 };
 
 
 } // end namespace clang
 } // end namespace clang
 
 
-#endif 
+#endif

+ 45 - 45
include/clang/Basic/SourceLocation.h

@@ -24,10 +24,10 @@ namespace llvm {
 }
 }
 
 
 namespace clang {
 namespace clang {
-  
+
 class SourceManager;
 class SourceManager;
 class FileEntry;
 class FileEntry;
-  
+
 /// FileID - This is an opaque identifier used by SourceManager which refers to
 /// FileID - This is an opaque identifier used by SourceManager which refers to
 /// a source file (MemoryBuffer) along with its #include path and #line data.
 /// a source file (MemoryBuffer) along with its #include path and #line data.
 ///
 ///
@@ -36,19 +36,19 @@ class FileID {
   unsigned ID;
   unsigned ID;
 public:
 public:
   FileID() : ID(0) {}
   FileID() : ID(0) {}
-  
+
   bool isInvalid() const { return ID == 0; }
   bool isInvalid() const { return ID == 0; }
-  
+
   bool operator==(const FileID &RHS) const { return ID == RHS.ID; }
   bool operator==(const FileID &RHS) const { return ID == RHS.ID; }
   bool operator<(const FileID &RHS) const { return ID < RHS.ID; }
   bool operator<(const FileID &RHS) const { return ID < RHS.ID; }
   bool operator<=(const FileID &RHS) const { return ID <= RHS.ID; }
   bool operator<=(const FileID &RHS) const { return ID <= RHS.ID; }
   bool operator!=(const FileID &RHS) const { return !(*this == RHS); }
   bool operator!=(const FileID &RHS) const { return !(*this == RHS); }
   bool operator>(const FileID &RHS) const { return RHS < *this; }
   bool operator>(const FileID &RHS) const { return RHS < *this; }
   bool operator>=(const FileID &RHS) const { return RHS <= *this; }
   bool operator>=(const FileID &RHS) const { return RHS <= *this; }
-  
+
   static FileID getSentinel() { return get(~0U); }
   static FileID getSentinel() { return get(~0U); }
   unsigned getHashValue() const { return ID; }
   unsigned getHashValue() const { return ID; }
-  
+
 private:
 private:
   friend class SourceManager;
   friend class SourceManager;
   static FileID get(unsigned V) {
   static FileID get(unsigned V) {
@@ -58,8 +58,8 @@ private:
   }
   }
   unsigned getOpaqueValue() const { return ID; }
   unsigned getOpaqueValue() const { return ID; }
 };
 };
-  
-    
+
+
 /// SourceLocation - This is a carefully crafted 32-bit identifier that encodes
 /// SourceLocation - This is a carefully crafted 32-bit identifier that encodes
 /// a full include stack, line and column number information for a position in
 /// a full include stack, line and column number information for a position in
 /// an input translation unit.
 /// an input translation unit.
@@ -72,17 +72,17 @@ class SourceLocation {
 public:
 public:
 
 
   SourceLocation() : ID(0) {}  // 0 is an invalid FileID.
   SourceLocation() : ID(0) {}  // 0 is an invalid FileID.
-  
+
   bool isFileID() const  { return (ID & MacroIDBit) == 0; }
   bool isFileID() const  { return (ID & MacroIDBit) == 0; }
   bool isMacroID() const { return (ID & MacroIDBit) != 0; }
   bool isMacroID() const { return (ID & MacroIDBit) != 0; }
-  
+
   /// isValid - Return true if this is a valid SourceLocation object.  Invalid
   /// isValid - Return true if this is a valid SourceLocation object.  Invalid
   /// SourceLocations are often used when events have no corresponding location
   /// SourceLocations are often used when events have no corresponding location
   /// in the source (e.g. a diagnostic is required for a command line option).
   /// in the source (e.g. a diagnostic is required for a command line option).
   ///
   ///
   bool isValid() const { return ID != 0; }
   bool isValid() const { return ID != 0; }
   bool isInvalid() const { return ID == 0; }
   bool isInvalid() const { return ID == 0; }
-  
+
 private:
 private:
   /// getOffset - Return the index for SourceManager's SLocEntryTable table,
   /// getOffset - Return the index for SourceManager's SLocEntryTable table,
   /// note that this is not an index *into* it though.
   /// note that this is not an index *into* it though.
@@ -96,7 +96,7 @@ private:
     L.ID = ID;
     L.ID = ID;
     return L;
     return L;
   }
   }
-  
+
   static SourceLocation getMacroLoc(unsigned ID) {
   static SourceLocation getMacroLoc(unsigned ID) {
     assert((ID & MacroIDBit) == 0 && "Ran out of source locations!");
     assert((ID & MacroIDBit) == 0 && "Ran out of source locations!");
     SourceLocation L;
     SourceLocation L;
@@ -104,7 +104,7 @@ private:
     return L;
     return L;
   }
   }
 public:
 public:
-  
+
   /// getFileLocWithOffset - Return a source location with the specified offset
   /// getFileLocWithOffset - Return a source location with the specified offset
   /// from this file SourceLocation.
   /// from this file SourceLocation.
   SourceLocation getFileLocWithOffset(int Offset) const {
   SourceLocation getFileLocWithOffset(int Offset) const {
@@ -113,14 +113,14 @@ public:
     L.ID = ID+Offset;
     L.ID = ID+Offset;
     return L;
     return L;
   }
   }
-  
+
   /// getRawEncoding - When a SourceLocation itself cannot be used, this returns
   /// getRawEncoding - When a SourceLocation itself cannot be used, this returns
   /// an (opaque) 32-bit integer encoding for it.  This should only be passed
   /// an (opaque) 32-bit integer encoding for it.  This should only be passed
   /// to SourceLocation::getFromRawEncoding, it should not be inspected
   /// to SourceLocation::getFromRawEncoding, it should not be inspected
   /// directly.
   /// directly.
   unsigned getRawEncoding() const { return ID; }
   unsigned getRawEncoding() const { return ID; }
-  
-  
+
+
   /// getFromRawEncoding - Turn a raw encoding of a SourceLocation object into
   /// getFromRawEncoding - Turn a raw encoding of a SourceLocation object into
   /// a real SourceLocation.
   /// a real SourceLocation.
   static SourceLocation getFromRawEncoding(unsigned Encoding) {
   static SourceLocation getFromRawEncoding(unsigned Encoding) {
@@ -128,7 +128,7 @@ public:
     X.ID = Encoding;
     X.ID = Encoding;
     return X;
     return X;
   }
   }
-  
+
   void print(llvm::raw_ostream &OS, const SourceManager &SM) const;
   void print(llvm::raw_ostream &OS, const SourceManager &SM) const;
   void dump(const SourceManager &SM) const;
   void dump(const SourceManager &SM) const;
 };
 };
@@ -140,7 +140,7 @@ inline bool operator==(const SourceLocation &LHS, const SourceLocation &RHS) {
 inline bool operator!=(const SourceLocation &LHS, const SourceLocation &RHS) {
 inline bool operator!=(const SourceLocation &LHS, const SourceLocation &RHS) {
   return !(LHS == RHS);
   return !(LHS == RHS);
 }
 }
-  
+
 inline bool operator<(const SourceLocation &LHS, const SourceLocation &RHS) {
 inline bool operator<(const SourceLocation &LHS, const SourceLocation &RHS) {
   return LHS.getRawEncoding() < RHS.getRawEncoding();
   return LHS.getRawEncoding() < RHS.getRawEncoding();
 }
 }
@@ -153,24 +153,24 @@ public:
   SourceRange(): B(SourceLocation()), E(SourceLocation()) {}
   SourceRange(): B(SourceLocation()), E(SourceLocation()) {}
   SourceRange(SourceLocation loc) : B(loc), E(loc) {}
   SourceRange(SourceLocation loc) : B(loc), E(loc) {}
   SourceRange(SourceLocation begin, SourceLocation end) : B(begin), E(end) {}
   SourceRange(SourceLocation begin, SourceLocation end) : B(begin), E(end) {}
-    
+
   SourceLocation getBegin() const { return B; }
   SourceLocation getBegin() const { return B; }
   SourceLocation getEnd() const { return E; }
   SourceLocation getEnd() const { return E; }
-  
+
   void setBegin(SourceLocation b) { B = b; }
   void setBegin(SourceLocation b) { B = b; }
   void setEnd(SourceLocation e) { E = e; }
   void setEnd(SourceLocation e) { E = e; }
-  
+
   bool isValid() const { return B.isValid() && E.isValid(); }
   bool isValid() const { return B.isValid() && E.isValid(); }
-  
+
   bool operator==(const SourceRange &X) const {
   bool operator==(const SourceRange &X) const {
     return B == X.B && E == X.E;
     return B == X.B && E == X.E;
   }
   }
-  
+
   bool operator!=(const SourceRange &X) const {
   bool operator!=(const SourceRange &X) const {
     return B != X.B || E != X.E;
     return B != X.B || E != X.E;
   }
   }
 };
 };
-  
+
 /// FullSourceLoc - A SourceLocation and its associated SourceManager.  Useful
 /// FullSourceLoc - A SourceLocation and its associated SourceManager.  Useful
 /// for argument passing to functions that expect both objects.
 /// for argument passing to functions that expect both objects.
 class FullSourceLoc : public SourceLocation {
 class FullSourceLoc : public SourceLocation {
@@ -179,21 +179,21 @@ public:
   /// Creates a FullSourceLoc where isValid() returns false.
   /// Creates a FullSourceLoc where isValid() returns false.
   explicit FullSourceLoc() : SrcMgr((SourceManager*) 0) {}
   explicit FullSourceLoc() : SrcMgr((SourceManager*) 0) {}
 
 
-  explicit FullSourceLoc(SourceLocation Loc, SourceManager &SM) 
+  explicit FullSourceLoc(SourceLocation Loc, SourceManager &SM)
     : SourceLocation(Loc), SrcMgr(&SM) {}
     : SourceLocation(Loc), SrcMgr(&SM) {}
-    
+
   SourceManager &getManager() {
   SourceManager &getManager() {
     assert(SrcMgr && "SourceManager is NULL.");
     assert(SrcMgr && "SourceManager is NULL.");
     return *SrcMgr;
     return *SrcMgr;
   }
   }
-  
+
   const SourceManager &getManager() const {
   const SourceManager &getManager() const {
     assert(SrcMgr && "SourceManager is NULL.");
     assert(SrcMgr && "SourceManager is NULL.");
     return *SrcMgr;
     return *SrcMgr;
   }
   }
-  
+
   FileID getFileID() const;
   FileID getFileID() const;
-  
+
   FullSourceLoc getInstantiationLoc() const;
   FullSourceLoc getInstantiationLoc() const;
   FullSourceLoc getSpellingLoc() const;
   FullSourceLoc getSpellingLoc() const;
 
 
@@ -204,37 +204,37 @@ public:
   unsigned getSpellingColumnNumber() const;
   unsigned getSpellingColumnNumber() const;
 
 
   const char *getCharacterData() const;
   const char *getCharacterData() const;
-  
+
   const llvm::MemoryBuffer* getBuffer() const;
   const llvm::MemoryBuffer* getBuffer() const;
-  
+
   /// getBufferData - Return a pointer to the start and end of the source buffer
   /// getBufferData - Return a pointer to the start and end of the source buffer
   /// data for the specified FileID.
   /// data for the specified FileID.
   std::pair<const char*, const char*> getBufferData() const;
   std::pair<const char*, const char*> getBufferData() const;
-  
+
   /// getDecomposedLoc - Decompose the specified location into a raw FileID +
   /// getDecomposedLoc - Decompose the specified location into a raw FileID +
   /// Offset pair.  The first element is the FileID, the second is the
   /// Offset pair.  The first element is the FileID, the second is the
   /// offset from the start of the buffer of the location.
   /// offset from the start of the buffer of the location.
   std::pair<FileID, unsigned> getDecomposedLoc() const;
   std::pair<FileID, unsigned> getDecomposedLoc() const;
 
 
   bool isInSystemHeader() const;
   bool isInSystemHeader() const;
-  
+
   /// Prints information about this FullSourceLoc to stderr. Useful for
   /// Prints information about this FullSourceLoc to stderr. Useful for
   ///  debugging.
   ///  debugging.
   void dump() const { SourceLocation::dump(*SrcMgr); }
   void dump() const { SourceLocation::dump(*SrcMgr); }
 
 
-  friend inline bool 
+  friend inline bool
   operator==(const FullSourceLoc &LHS, const FullSourceLoc &RHS) {
   operator==(const FullSourceLoc &LHS, const FullSourceLoc &RHS) {
     return LHS.getRawEncoding() == RHS.getRawEncoding() &&
     return LHS.getRawEncoding() == RHS.getRawEncoding() &&
           LHS.SrcMgr == RHS.SrcMgr;
           LHS.SrcMgr == RHS.SrcMgr;
   }
   }
 
 
-  friend inline bool 
+  friend inline bool
   operator!=(const FullSourceLoc &LHS, const FullSourceLoc &RHS) {
   operator!=(const FullSourceLoc &LHS, const FullSourceLoc &RHS) {
     return !(LHS == RHS);
     return !(LHS == RHS);
   }
   }
 
 
 };
 };
-  
+
 /// PresumedLoc - This class represents an unpacked "presumed" location which
 /// PresumedLoc - This class represents an unpacked "presumed" location which
 /// can be presented to the user.  A 'presumed' location can be modified by
 /// can be presented to the user.  A 'presumed' location can be modified by
 /// #line and GNU line marker directives and is always the instantiation point
 /// #line and GNU line marker directives and is always the instantiation point
@@ -250,13 +250,13 @@ public:
   PresumedLoc(const char *FN, unsigned Ln, unsigned Co, SourceLocation IL)
   PresumedLoc(const char *FN, unsigned Ln, unsigned Co, SourceLocation IL)
     : Filename(FN), Line(Ln), Col(Co), IncludeLoc(IL) {
     : Filename(FN), Line(Ln), Col(Co), IncludeLoc(IL) {
   }
   }
-  
+
   /// isInvalid - Return true if this object is invalid or uninitialized. This
   /// isInvalid - Return true if this object is invalid or uninitialized. This
   /// occurs when created with invalid source locations or when walking off
   /// occurs when created with invalid source locations or when walking off
   /// the top of a #include stack.
   /// the top of a #include stack.
   bool isInvalid() const { return Filename == 0; }
   bool isInvalid() const { return Filename == 0; }
   bool isValid() const { return Filename != 0; }
   bool isValid() const { return Filename != 0; }
-  
+
   /// getFilename - Return the presumed filename of this location.  This can be
   /// getFilename - Return the presumed filename of this location.  This can be
   /// affected by #line etc.
   /// affected by #line etc.
   const char *getFilename() const { return Filename; }
   const char *getFilename() const { return Filename; }
@@ -264,7 +264,7 @@ public:
   /// getLine - Return the presumed line number of this location.  This can be
   /// getLine - Return the presumed line number of this location.  This can be
   /// affected by #line etc.
   /// affected by #line etc.
   unsigned getLine() const { return Line; }
   unsigned getLine() const { return Line; }
-  
+
   /// getColumn - Return the presumed column number of this location.  This can
   /// getColumn - Return the presumed column number of this location.  This can
   /// not be affected by #line, but is packaged here for convenience.
   /// not be affected by #line, but is packaged here for convenience.
   unsigned getColumn() const { return Col; }
   unsigned getColumn() const { return Col; }
@@ -274,7 +274,7 @@ public:
   SourceLocation getIncludeLoc() const { return IncludeLoc; }
   SourceLocation getIncludeLoc() const { return IncludeLoc; }
 };
 };
 
 
-  
+
 }  // end namespace clang
 }  // end namespace clang
 
 
 namespace llvm {
 namespace llvm {
@@ -286,20 +286,20 @@ namespace llvm {
       return clang::FileID();
       return clang::FileID();
     }
     }
     static inline clang::FileID getTombstoneKey() {
     static inline clang::FileID getTombstoneKey() {
-      return clang::FileID::getSentinel(); 
+      return clang::FileID::getSentinel();
     }
     }
-    
+
     static unsigned getHashValue(clang::FileID S) {
     static unsigned getHashValue(clang::FileID S) {
       return S.getHashValue();
       return S.getHashValue();
     }
     }
-    
+
     static bool isEqual(clang::FileID LHS, clang::FileID RHS) {
     static bool isEqual(clang::FileID LHS, clang::FileID RHS) {
       return LHS == RHS;
       return LHS == RHS;
     }
     }
-    
+
     static bool isPod() { return true; }
     static bool isPod() { return true; }
   };
   };
-  
+
 }  // end namespace llvm
 }  // end namespace llvm
 
 
 #endif
 #endif

+ 105 - 105
include/clang/Basic/SourceManager.h

@@ -24,9 +24,9 @@
 namespace llvm {
 namespace llvm {
 class MemoryBuffer;
 class MemoryBuffer;
 }
 }
-  
+
 namespace clang {
 namespace clang {
-  
+
 class SourceManager;
 class SourceManager;
 class FileManager;
 class FileManager;
 class FileEntry;
 class FileEntry;
@@ -46,7 +46,7 @@ namespace SrcMgr {
   enum CharacteristicKind {
   enum CharacteristicKind {
     C_User, C_System, C_ExternCSystem
     C_User, C_System, C_ExternCSystem
   };
   };
-  
+
   /// ContentCache - Once instance of this struct is kept for every file
   /// ContentCache - Once instance of this struct is kept for every file
   /// loaded or used.  This object owns the MemoryBuffer object.
   /// loaded or used.  This object owns the MemoryBuffer object.
   class ContentCache {
   class ContentCache {
@@ -59,12 +59,12 @@ namespace SrcMgr {
     /// the FileEntry object.  It is possible for this to be NULL if
     /// the FileEntry object.  It is possible for this to be NULL if
     /// the ContentCache encapsulates an imaginary text buffer.
     /// the ContentCache encapsulates an imaginary text buffer.
     const FileEntry *Entry;
     const FileEntry *Entry;
-    
+
     /// SourceLineCache - A bump pointer allocated array of offsets for each
     /// SourceLineCache - A bump pointer allocated array of offsets for each
     /// source line.  This is lazily computed.  This is owned by the
     /// source line.  This is lazily computed.  This is owned by the
     /// SourceManager BumpPointerAllocator object.
     /// SourceManager BumpPointerAllocator object.
     unsigned *SourceLineCache;
     unsigned *SourceLineCache;
-    
+
     /// NumLines - The number of lines in this ContentCache.  This is only valid
     /// NumLines - The number of lines in this ContentCache.  This is only valid
     /// if SourceLineCache is non-null.
     /// if SourceLineCache is non-null.
     unsigned NumLines;
     unsigned NumLines;
@@ -76,28 +76,28 @@ namespace SrcMgr {
 
 
     /// getBuffer - Returns the memory buffer for the associated content.
     /// getBuffer - Returns the memory buffer for the associated content.
     const llvm::MemoryBuffer *getBuffer() const;
     const llvm::MemoryBuffer *getBuffer() const;
-    
+
     /// getSize - Returns the size of the content encapsulated by this
     /// getSize - Returns the size of the content encapsulated by this
     ///  ContentCache. This can be the size of the source file or the size of an
     ///  ContentCache. This can be the size of the source file or the size of an
     ///  arbitrary scratch buffer.  If the ContentCache encapsulates a source
     ///  arbitrary scratch buffer.  If the ContentCache encapsulates a source
     ///  file this size is retrieved from the file's FileEntry.
     ///  file this size is retrieved from the file's FileEntry.
     unsigned getSize() const;
     unsigned getSize() const;
-    
+
     /// getSizeBytesMapped - Returns the number of bytes actually mapped for
     /// getSizeBytesMapped - Returns the number of bytes actually mapped for
     ///  this ContentCache.  This can be 0 if the MemBuffer was not actually
     ///  this ContentCache.  This can be 0 if the MemBuffer was not actually
     ///  instantiated.
     ///  instantiated.
     unsigned getSizeBytesMapped() const;
     unsigned getSizeBytesMapped() const;
-    
+
     void setBuffer(const llvm::MemoryBuffer *B) {
     void setBuffer(const llvm::MemoryBuffer *B) {
       assert(!Buffer && "MemoryBuffer already set.");
       assert(!Buffer && "MemoryBuffer already set.");
       Buffer = B;
       Buffer = B;
     }
     }
-        
+
     ContentCache(const FileEntry *Ent = 0)
     ContentCache(const FileEntry *Ent = 0)
       : Buffer(0), Entry(Ent), SourceLineCache(0), NumLines(0) {}
       : Buffer(0), Entry(Ent), SourceLineCache(0), NumLines(0) {}
 
 
     ~ContentCache();
     ~ContentCache();
-    
+
     /// The copy ctor does not allow copies where source object has either
     /// The copy ctor does not allow copies where source object has either
     ///  a non-NULL Buffer or SourceLineCache.  Ownership of allocated memory
     ///  a non-NULL Buffer or SourceLineCache.  Ownership of allocated memory
     ///  is not transfered, so this is a logical error.
     ///  is not transfered, so this is a logical error.
@@ -106,14 +106,14 @@ namespace SrcMgr {
 
 
       assert (RHS.Buffer == 0 && RHS.SourceLineCache == 0
       assert (RHS.Buffer == 0 && RHS.SourceLineCache == 0
               && "Passed ContentCache object cannot own a buffer.");
               && "Passed ContentCache object cannot own a buffer.");
-              
-      NumLines = RHS.NumLines;      
+
+      NumLines = RHS.NumLines;
     }
     }
-    
+
   private:
   private:
     // Disable assignments.
     // Disable assignments.
-    ContentCache &operator=(const ContentCache& RHS);    
-  };  
+    ContentCache &operator=(const ContentCache& RHS);
+  };
 
 
   /// FileInfo - Information about a FileID, basically just the logical file
   /// FileInfo - Information about a FileID, basically just the logical file
   /// that it represents and include stack information.
   /// that it represents and include stack information.
@@ -128,7 +128,7 @@ namespace SrcMgr {
     /// IncludeLoc - The location of the #include that brought in this file.
     /// IncludeLoc - The location of the #include that brought in this file.
     /// This is an invalid SLOC for the main file (top of the #include chain).
     /// This is an invalid SLOC for the main file (top of the #include chain).
     unsigned IncludeLoc;  // Really a SourceLocation
     unsigned IncludeLoc;  // Really a SourceLocation
-    
+
     /// Data - This contains the ContentCache* and the bits indicating the
     /// Data - This contains the ContentCache* and the bits indicating the
     /// characteristic of the file and whether it has #line info, all bitmangled
     /// characteristic of the file and whether it has #line info, all bitmangled
     /// together.
     /// together.
@@ -145,39 +145,39 @@ namespace SrcMgr {
       X.Data |= (unsigned)FileCharacter;
       X.Data |= (unsigned)FileCharacter;
       return X;
       return X;
     }
     }
-    
+
     SourceLocation getIncludeLoc() const {
     SourceLocation getIncludeLoc() const {
       return SourceLocation::getFromRawEncoding(IncludeLoc);
       return SourceLocation::getFromRawEncoding(IncludeLoc);
     }
     }
     const ContentCache* getContentCache() const {
     const ContentCache* getContentCache() const {
       return reinterpret_cast<const ContentCache*>(Data & ~7UL);
       return reinterpret_cast<const ContentCache*>(Data & ~7UL);
     }
     }
-    
+
     /// getCharacteristic - Return whether this is a system header or not.
     /// getCharacteristic - Return whether this is a system header or not.
-    CharacteristicKind getFileCharacteristic() const { 
+    CharacteristicKind getFileCharacteristic() const {
       return (CharacteristicKind)(Data & 3);
       return (CharacteristicKind)(Data & 3);
     }
     }
 
 
     /// hasLineDirectives - Return true if this FileID has #line directives in
     /// hasLineDirectives - Return true if this FileID has #line directives in
     /// it.
     /// it.
     bool hasLineDirectives() const { return (Data & 4) != 0; }
     bool hasLineDirectives() const { return (Data & 4) != 0; }
-    
+
     /// setHasLineDirectives - Set the flag that indicates that this FileID has
     /// setHasLineDirectives - Set the flag that indicates that this FileID has
     /// line table entries associated with it.
     /// line table entries associated with it.
     void setHasLineDirectives() {
     void setHasLineDirectives() {
       Data |= 4;
       Data |= 4;
     }
     }
   };
   };
-  
+
   /// InstantiationInfo - Each InstantiationInfo encodes the Instantiation
   /// InstantiationInfo - Each InstantiationInfo encodes the Instantiation
   /// location - where the token was ultimately instantiated, and the
   /// location - where the token was ultimately instantiated, and the
   /// SpellingLoc - where the actual character data for the token came from.
   /// SpellingLoc - where the actual character data for the token came from.
   class InstantiationInfo {
   class InstantiationInfo {
      // Really these are all SourceLocations.
      // Really these are all SourceLocations.
-    
+
     /// SpellingLoc - Where the spelling for the token can be found.
     /// SpellingLoc - Where the spelling for the token can be found.
     unsigned SpellingLoc;
     unsigned SpellingLoc;
-    
+
     /// InstantiationLocStart/InstantiationLocEnd - In a macro expansion, these
     /// InstantiationLocStart/InstantiationLocEnd - In a macro expansion, these
     /// indicate the start and end of the instantiation.  In object-like macros,
     /// indicate the start and end of the instantiation.  In object-like macros,
     /// these will be the same.  In a function-like macro instantiation, the
     /// these will be the same.  In a function-like macro instantiation, the
@@ -193,12 +193,12 @@ namespace SrcMgr {
     SourceLocation getInstantiationLocEnd() const {
     SourceLocation getInstantiationLocEnd() const {
       return SourceLocation::getFromRawEncoding(InstantiationLocEnd);
       return SourceLocation::getFromRawEncoding(InstantiationLocEnd);
     }
     }
-    
+
     std::pair<SourceLocation,SourceLocation> getInstantiationLocRange() const {
     std::pair<SourceLocation,SourceLocation> getInstantiationLocRange() const {
       return std::make_pair(getInstantiationLocStart(),
       return std::make_pair(getInstantiationLocStart(),
                             getInstantiationLocEnd());
                             getInstantiationLocEnd());
     }
     }
-    
+
     /// get - Return a InstantiationInfo for an expansion.  IL specifies
     /// get - Return a InstantiationInfo for an expansion.  IL specifies
     /// the instantiation location (where the macro is expanded), and SL
     /// the instantiation location (where the macro is expanded), and SL
     /// specifies the spelling location (where the characters from the token
     /// specifies the spelling location (where the characters from the token
@@ -213,7 +213,7 @@ namespace SrcMgr {
       return X;
       return X;
     }
     }
   };
   };
-  
+
   /// SLocEntry - This is a discriminated union of FileInfo and
   /// SLocEntry - This is a discriminated union of FileInfo and
   /// InstantiationInfo.  SourceManager keeps an array of these objects, and
   /// InstantiationInfo.  SourceManager keeps an array of these objects, and
   /// they are uniquely identified by the FileID datatype.
   /// they are uniquely identified by the FileID datatype.
@@ -225,10 +225,10 @@ namespace SrcMgr {
     };
     };
   public:
   public:
     unsigned getOffset() const { return Offset >> 1; }
     unsigned getOffset() const { return Offset >> 1; }
-    
+
     bool isInstantiation() const { return Offset & 1; }
     bool isInstantiation() const { return Offset & 1; }
     bool isFile() const { return !isInstantiation(); }
     bool isFile() const { return !isInstantiation(); }
-    
+
     const FileInfo &getFile() const {
     const FileInfo &getFile() const {
       assert(isFile() && "Not a file SLocEntry!");
       assert(isFile() && "Not a file SLocEntry!");
       return File;
       return File;
@@ -238,7 +238,7 @@ namespace SrcMgr {
       assert(isInstantiation() && "Not an instantiation SLocEntry!");
       assert(isInstantiation() && "Not an instantiation SLocEntry!");
       return Instantiation;
       return Instantiation;
     }
     }
-    
+
     static SLocEntry get(unsigned Offset, const FileInfo &FI) {
     static SLocEntry get(unsigned Offset, const FileInfo &FI) {
       SLocEntry E;
       SLocEntry E;
       E.Offset = Offset << 1;
       E.Offset = Offset << 1;
@@ -277,18 +277,18 @@ public:
 /// location specifies where it was expanded.
 /// location specifies where it was expanded.
 class SourceManager {
 class SourceManager {
   mutable llvm::BumpPtrAllocator ContentCacheAlloc;
   mutable llvm::BumpPtrAllocator ContentCacheAlloc;
-  
+
   /// FileInfos - Memoized information about all of the files tracked by this
   /// FileInfos - Memoized information about all of the files tracked by this
   /// SourceManager.  This set allows us to merge ContentCache entries based
   /// SourceManager.  This set allows us to merge ContentCache entries based
   /// on their FileEntry*.  All ContentCache objects will thus have unique,
   /// on their FileEntry*.  All ContentCache objects will thus have unique,
-  /// non-null, FileEntry pointers.  
+  /// non-null, FileEntry pointers.
   llvm::DenseMap<const FileEntry*, SrcMgr::ContentCache*> FileInfos;
   llvm::DenseMap<const FileEntry*, SrcMgr::ContentCache*> FileInfos;
-  
+
   /// MemBufferInfos - Information about various memory buffers that we have
   /// MemBufferInfos - Information about various memory buffers that we have
   /// read in.  All FileEntry* within the stored ContentCache objects are NULL,
   /// read in.  All FileEntry* within the stored ContentCache objects are NULL,
   /// as they do not refer to a file.
   /// as they do not refer to a file.
   std::vector<SrcMgr::ContentCache*> MemBufferInfos;
   std::vector<SrcMgr::ContentCache*> MemBufferInfos;
-  
+
   /// SLocEntryTable - This is an array of SLocEntry's that we have created.
   /// SLocEntryTable - This is an array of SLocEntry's that we have created.
   /// FileID is an index into this vector.  This array is sorted by the offset.
   /// FileID is an index into this vector.  This array is sorted by the offset.
   std::vector<SrcMgr::SLocEntry> SLocEntryTable;
   std::vector<SrcMgr::SLocEntry> SLocEntryTable;
@@ -308,49 +308,49 @@ class SourceManager {
   /// LastFileIDLookup records the last FileID looked up or created, because it
   /// LastFileIDLookup records the last FileID looked up or created, because it
   /// is very common to look up many tokens from the same file.
   /// is very common to look up many tokens from the same file.
   mutable FileID LastFileIDLookup;
   mutable FileID LastFileIDLookup;
-  
+
   /// LineTable - This holds information for #line directives.  It is referenced
   /// LineTable - This holds information for #line directives.  It is referenced
   /// by indices from SLocEntryTable.
   /// by indices from SLocEntryTable.
   LineTableInfo *LineTable;
   LineTableInfo *LineTable;
-  
+
   /// LastLineNo - These ivars serve as a cache used in the getLineNumber
   /// LastLineNo - These ivars serve as a cache used in the getLineNumber
   /// method which is used to speedup getLineNumber calls to nearby locations.
   /// method which is used to speedup getLineNumber calls to nearby locations.
   mutable FileID LastLineNoFileIDQuery;
   mutable FileID LastLineNoFileIDQuery;
   mutable SrcMgr::ContentCache *LastLineNoContentCache;
   mutable SrcMgr::ContentCache *LastLineNoContentCache;
   mutable unsigned LastLineNoFilePos;
   mutable unsigned LastLineNoFilePos;
   mutable unsigned LastLineNoResult;
   mutable unsigned LastLineNoResult;
-  
+
   /// MainFileID - The file ID for the main source file of the translation unit.
   /// MainFileID - The file ID for the main source file of the translation unit.
   FileID MainFileID;
   FileID MainFileID;
 
 
   // Statistics for -print-stats.
   // Statistics for -print-stats.
   mutable unsigned NumLinearScans, NumBinaryProbes;
   mutable unsigned NumLinearScans, NumBinaryProbes;
-  
+
   // Cache results for the isBeforeInTranslationUnit method.
   // Cache results for the isBeforeInTranslationUnit method.
   mutable FileID LastLFIDForBeforeTUCheck;
   mutable FileID LastLFIDForBeforeTUCheck;
   mutable FileID LastRFIDForBeforeTUCheck;
   mutable FileID LastRFIDForBeforeTUCheck;
   mutable bool   LastResForBeforeTUCheck;
   mutable bool   LastResForBeforeTUCheck;
-  
+
   // SourceManager doesn't support copy construction.
   // SourceManager doesn't support copy construction.
   explicit SourceManager(const SourceManager&);
   explicit SourceManager(const SourceManager&);
-  void operator=(const SourceManager&);  
+  void operator=(const SourceManager&);
 public:
 public:
-  SourceManager() 
-    : ExternalSLocEntries(0), LineTable(0), NumLinearScans(0), 
+  SourceManager()
+    : ExternalSLocEntries(0), LineTable(0), NumLinearScans(0),
       NumBinaryProbes(0) {
       NumBinaryProbes(0) {
     clearIDTables();
     clearIDTables();
   }
   }
   ~SourceManager();
   ~SourceManager();
-  
+
   void clearIDTables();
   void clearIDTables();
-  
+
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   // MainFileID creation and querying methods.
   // MainFileID creation and querying methods.
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
 
 
   /// getMainFileID - Returns the FileID of the main source file.
   /// getMainFileID - Returns the FileID of the main source file.
   FileID getMainFileID() const { return MainFileID; }
   FileID getMainFileID() const { return MainFileID; }
-  
+
   /// createMainFileID - Create the FileID for the main source file.
   /// createMainFileID - Create the FileID for the main source file.
   FileID createMainFileID(const FileEntry *SourceFile,
   FileID createMainFileID(const FileEntry *SourceFile,
                           SourceLocation IncludePos) {
                           SourceLocation IncludePos) {
@@ -358,15 +358,15 @@ public:
     MainFileID = createFileID(SourceFile, IncludePos, SrcMgr::C_User);
     MainFileID = createFileID(SourceFile, IncludePos, SrcMgr::C_User);
     return MainFileID;
     return MainFileID;
   }
   }
-  
+
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   // Methods to create new FileID's and instantiations.
   // Methods to create new FileID's and instantiations.
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
-  
+
   /// createFileID - Create a new FileID that represents the specified file
   /// createFileID - Create a new FileID that represents the specified file
   /// being #included from the specified IncludePosition.  This returns 0 on
   /// being #included from the specified IncludePosition.  This returns 0 on
   /// error and translates NULL into standard input.
   /// error and translates NULL into standard input.
-  /// PreallocateID should be non-zero to specify which a pre-allocated, 
+  /// PreallocateID should be non-zero to specify which a pre-allocated,
   /// lazily computed source location is being filled in by this operation.
   /// lazily computed source location is being filled in by this operation.
   FileID createFileID(const FileEntry *SourceFile, SourceLocation IncludePos,
   FileID createFileID(const FileEntry *SourceFile, SourceLocation IncludePos,
                       SrcMgr::CharacteristicKind FileCharacter,
                       SrcMgr::CharacteristicKind FileCharacter,
@@ -376,7 +376,7 @@ public:
     if (IR == 0) return FileID();    // Error opening file?
     if (IR == 0) return FileID();    // Error opening file?
     return createFileID(IR, IncludePos, FileCharacter, PreallocatedID, Offset);
     return createFileID(IR, IncludePos, FileCharacter, PreallocatedID, Offset);
   }
   }
-  
+
   /// createFileIDForMemBuffer - Create a new FileID that represents the
   /// createFileIDForMemBuffer - Create a new FileID that represents the
   /// specified memory buffer.  This does no caching of the buffer and takes
   /// specified memory buffer.  This does no caching of the buffer and takes
   /// ownership of the MemoryBuffer, so only pass a MemoryBuffer to this once.
   /// ownership of the MemoryBuffer, so only pass a MemoryBuffer to this once.
@@ -386,7 +386,7 @@ public:
     return createFileID(createMemBufferContentCache(Buffer), SourceLocation(),
     return createFileID(createMemBufferContentCache(Buffer), SourceLocation(),
                         SrcMgr::C_User, PreallocatedID, Offset);
                         SrcMgr::C_User, PreallocatedID, Offset);
   }
   }
-  
+
   /// createMainFileIDForMembuffer - Create the FileID for a memory buffer
   /// createMainFileIDForMembuffer - Create the FileID for a memory buffer
   ///  that will represent the FileID for the main source.  One example
   ///  that will represent the FileID for the main source.  One example
   ///  of when this would be used is when the main source is read from STDIN.
   ///  of when this would be used is when the main source is read from STDIN.
@@ -405,31 +405,31 @@ public:
                                         unsigned TokLength,
                                         unsigned TokLength,
                                         unsigned PreallocatedID = 0,
                                         unsigned PreallocatedID = 0,
                                         unsigned Offset = 0);
                                         unsigned Offset = 0);
-  
+
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   // FileID manipulation methods.
   // FileID manipulation methods.
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
-  
+
   /// getBuffer - Return the buffer for the specified FileID.
   /// getBuffer - Return the buffer for the specified FileID.
   ///
   ///
   const llvm::MemoryBuffer *getBuffer(FileID FID) const {
   const llvm::MemoryBuffer *getBuffer(FileID FID) const {
     return getSLocEntry(FID).getFile().getContentCache()->getBuffer();
     return getSLocEntry(FID).getFile().getContentCache()->getBuffer();
   }
   }
-  
+
   /// getFileEntryForID - Returns the FileEntry record for the provided FileID.
   /// getFileEntryForID - Returns the FileEntry record for the provided FileID.
   const FileEntry *getFileEntryForID(FileID FID) const {
   const FileEntry *getFileEntryForID(FileID FID) const {
     return getSLocEntry(FID).getFile().getContentCache()->Entry;
     return getSLocEntry(FID).getFile().getContentCache()->Entry;
   }
   }
-  
+
   /// getBufferData - Return a pointer to the start and end of the source buffer
   /// getBufferData - Return a pointer to the start and end of the source buffer
   /// data for the specified FileID.
   /// data for the specified FileID.
   std::pair<const char*, const char*> getBufferData(FileID FID) const;
   std::pair<const char*, const char*> getBufferData(FileID FID) const;
-  
-  
+
+
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   // SourceLocation manipulation methods.
   // SourceLocation manipulation methods.
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
-  
+
   /// getFileID - Return the FileID for a SourceLocation.  This is a very
   /// getFileID - Return the FileID for a SourceLocation.  This is a very
   /// hot method that is used for all SourceManager queries that start with a
   /// hot method that is used for all SourceManager queries that start with a
   /// SourceLocation object.  It is responsible for finding the entry in
   /// SourceLocation object.  It is responsible for finding the entry in
@@ -437,14 +437,14 @@ public:
   ///
   ///
   FileID getFileID(SourceLocation SpellingLoc) const {
   FileID getFileID(SourceLocation SpellingLoc) const {
     unsigned SLocOffset = SpellingLoc.getOffset();
     unsigned SLocOffset = SpellingLoc.getOffset();
-    
+
     // If our one-entry cache covers this offset, just return it.
     // If our one-entry cache covers this offset, just return it.
     if (isOffsetInFileID(LastFileIDLookup, SLocOffset))
     if (isOffsetInFileID(LastFileIDLookup, SLocOffset))
       return LastFileIDLookup;
       return LastFileIDLookup;
 
 
     return getFileIDSlow(SLocOffset);
     return getFileIDSlow(SLocOffset);
   }
   }
-  
+
   /// getLocForStartOfFile - Return the source location corresponding to the
   /// getLocForStartOfFile - Return the source location corresponding to the
   /// first byte of the specified file.
   /// first byte of the specified file.
   SourceLocation getLocForStartOfFile(FileID FID) const {
   SourceLocation getLocForStartOfFile(FileID FID) const {
@@ -453,7 +453,7 @@ public:
     unsigned FileOffset = getSLocEntry(FID).getOffset();
     unsigned FileOffset = getSLocEntry(FID).getOffset();
     return SourceLocation::getFileLoc(FileOffset);
     return SourceLocation::getFileLoc(FileOffset);
   }
   }
-  
+
   /// getInstantiationLoc - Given a SourceLocation object, return the
   /// getInstantiationLoc - Given a SourceLocation object, return the
   /// instantiation location referenced by the ID.
   /// instantiation location referenced by the ID.
   SourceLocation getInstantiationLoc(SourceLocation Loc) const {
   SourceLocation getInstantiationLoc(SourceLocation Loc) const {
@@ -462,18 +462,18 @@ public:
     if (Loc.isFileID()) return Loc;
     if (Loc.isFileID()) return Loc;
     return getInstantiationLocSlowCase(Loc);
     return getInstantiationLocSlowCase(Loc);
   }
   }
-  
+
   /// getImmediateInstantiationRange - Loc is required to be an instantiation
   /// getImmediateInstantiationRange - Loc is required to be an instantiation
   /// location.  Return the start/end of the instantiation information.
   /// location.  Return the start/end of the instantiation information.
   std::pair<SourceLocation,SourceLocation>
   std::pair<SourceLocation,SourceLocation>
   getImmediateInstantiationRange(SourceLocation Loc) const;
   getImmediateInstantiationRange(SourceLocation Loc) const;
-  
+
   /// getInstantiationRange - Given a SourceLocation object, return the
   /// getInstantiationRange - Given a SourceLocation object, return the
   /// range of tokens covered by the instantiation in the ultimate file.
   /// range of tokens covered by the instantiation in the ultimate file.
   std::pair<SourceLocation,SourceLocation>
   std::pair<SourceLocation,SourceLocation>
   getInstantiationRange(SourceLocation Loc) const;
   getInstantiationRange(SourceLocation Loc) const;
-  
-  
+
+
   /// getSpellingLoc - Given a SourceLocation object, return the spelling
   /// getSpellingLoc - Given a SourceLocation object, return the spelling
   /// location referenced by the ID.  This is the place where the characters
   /// location referenced by the ID.  This is the place where the characters
   /// that make up the lexed token can be found.
   /// that make up the lexed token can be found.
@@ -483,12 +483,12 @@ public:
     if (Loc.isFileID()) return Loc;
     if (Loc.isFileID()) return Loc;
     return getSpellingLocSlowCase(Loc);
     return getSpellingLocSlowCase(Loc);
   }
   }
-  
+
   /// getImmediateSpellingLoc - Given a SourceLocation object, return the
   /// getImmediateSpellingLoc - Given a SourceLocation object, return the
   /// spelling location referenced by the ID.  This is the first level down
   /// spelling location referenced by the ID.  This is the first level down
   /// towards the place where the characters that make up the lexed token can be
   /// towards the place where the characters that make up the lexed token can be
   /// found.  This should not generally be used by clients.
   /// found.  This should not generally be used by clients.
-  SourceLocation getImmediateSpellingLoc(SourceLocation Loc) const;  
+  SourceLocation getImmediateSpellingLoc(SourceLocation Loc) const;
 
 
   /// getDecomposedLoc - Decompose the specified location into a raw FileID +
   /// getDecomposedLoc - Decompose the specified location into a raw FileID +
   /// Offset pair.  The first element is the FileID, the second is the
   /// Offset pair.  The first element is the FileID, the second is the
@@ -497,7 +497,7 @@ public:
     FileID FID = getFileID(Loc);
     FileID FID = getFileID(Loc);
     return std::make_pair(FID, Loc.getOffset()-getSLocEntry(FID).getOffset());
     return std::make_pair(FID, Loc.getOffset()-getSLocEntry(FID).getOffset());
   }
   }
-  
+
   /// getDecomposedInstantiationLoc - Decompose the specified location into a
   /// getDecomposedInstantiationLoc - Decompose the specified location into a
   /// raw FileID + Offset pair.  If the location is an instantiation record,
   /// raw FileID + Offset pair.  If the location is an instantiation record,
   /// walk through it until we find the final location instantiated.
   /// walk through it until we find the final location instantiated.
@@ -505,11 +505,11 @@ public:
   getDecomposedInstantiationLoc(SourceLocation Loc) const {
   getDecomposedInstantiationLoc(SourceLocation Loc) const {
     FileID FID = getFileID(Loc);
     FileID FID = getFileID(Loc);
     const SrcMgr::SLocEntry *E = &getSLocEntry(FID);
     const SrcMgr::SLocEntry *E = &getSLocEntry(FID);
-    
+
     unsigned Offset = Loc.getOffset()-E->getOffset();
     unsigned Offset = Loc.getOffset()-E->getOffset();
     if (Loc.isFileID())
     if (Loc.isFileID())
       return std::make_pair(FID, Offset);
       return std::make_pair(FID, Offset);
-    
+
     return getDecomposedInstantiationLocSlowCase(E, Offset);
     return getDecomposedInstantiationLocSlowCase(E, Offset);
   }
   }
 
 
@@ -520,29 +520,29 @@ public:
   getDecomposedSpellingLoc(SourceLocation Loc) const {
   getDecomposedSpellingLoc(SourceLocation Loc) const {
     FileID FID = getFileID(Loc);
     FileID FID = getFileID(Loc);
     const SrcMgr::SLocEntry *E = &getSLocEntry(FID);
     const SrcMgr::SLocEntry *E = &getSLocEntry(FID);
-    
+
     unsigned Offset = Loc.getOffset()-E->getOffset();
     unsigned Offset = Loc.getOffset()-E->getOffset();
     if (Loc.isFileID())
     if (Loc.isFileID())
       return std::make_pair(FID, Offset);
       return std::make_pair(FID, Offset);
     return getDecomposedSpellingLocSlowCase(E, Offset);
     return getDecomposedSpellingLocSlowCase(E, Offset);
-  }    
-  
+  }
+
   /// getFileOffset - This method returns the offset from the start
   /// getFileOffset - This method returns the offset from the start
   /// of the file that the specified SourceLocation represents. This is not very
   /// of the file that the specified SourceLocation represents. This is not very
   /// meaningful for a macro ID.
   /// meaningful for a macro ID.
   unsigned getFileOffset(SourceLocation SpellingLoc) const {
   unsigned getFileOffset(SourceLocation SpellingLoc) const {
     return getDecomposedLoc(SpellingLoc).second;
     return getDecomposedLoc(SpellingLoc).second;
   }
   }
-  
-  
+
+
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   // Queries about the code at a SourceLocation.
   // Queries about the code at a SourceLocation.
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
-  
+
   /// getCharacterData - Return a pointer to the start of the specified location
   /// getCharacterData - Return a pointer to the start of the specified location
   /// in the appropriate spelling MemoryBuffer.
   /// in the appropriate spelling MemoryBuffer.
   const char *getCharacterData(SourceLocation SL) const;
   const char *getCharacterData(SourceLocation SL) const;
-  
+
   /// getColumnNumber - Return the column # for the specified file position.
   /// getColumnNumber - Return the column # for the specified file position.
   /// This is significantly cheaper to compute than the line number.  This
   /// This is significantly cheaper to compute than the line number.  This
   /// returns zero if the column number isn't known.  This may only be called on
   /// returns zero if the column number isn't known.  This may only be called on
@@ -551,24 +551,24 @@ public:
   unsigned getColumnNumber(FileID FID, unsigned FilePos) const;
   unsigned getColumnNumber(FileID FID, unsigned FilePos) const;
   unsigned getSpellingColumnNumber(SourceLocation Loc) const;
   unsigned getSpellingColumnNumber(SourceLocation Loc) const;
   unsigned getInstantiationColumnNumber(SourceLocation Loc) const;
   unsigned getInstantiationColumnNumber(SourceLocation Loc) const;
-  
-  
+
+
   /// getLineNumber - Given a SourceLocation, return the spelling line number
   /// getLineNumber - Given a SourceLocation, return the spelling line number
   /// for the position indicated.  This requires building and caching a table of
   /// for the position indicated.  This requires building and caching a table of
   /// line offsets for the MemoryBuffer, so this is not cheap: use only when
   /// line offsets for the MemoryBuffer, so this is not cheap: use only when
   /// about to emit a diagnostic.
   /// about to emit a diagnostic.
   unsigned getLineNumber(FileID FID, unsigned FilePos) const;
   unsigned getLineNumber(FileID FID, unsigned FilePos) const;
-  
+
   unsigned getInstantiationLineNumber(SourceLocation Loc) const;
   unsigned getInstantiationLineNumber(SourceLocation Loc) const;
   unsigned getSpellingLineNumber(SourceLocation Loc) const;
   unsigned getSpellingLineNumber(SourceLocation Loc) const;
-  
+
   /// Return the filename or buffer identifier of the buffer the location is in.
   /// Return the filename or buffer identifier of the buffer the location is in.
   /// Note that this name does not respect #line directives.  Use getPresumedLoc
   /// Note that this name does not respect #line directives.  Use getPresumedLoc
   /// for normal clients.
   /// for normal clients.
   const char *getBufferName(SourceLocation Loc) const;
   const char *getBufferName(SourceLocation Loc) const;
-  
+
   /// getFileCharacteristic - return the file characteristic of the specified
   /// getFileCharacteristic - return the file characteristic of the specified
-  /// source location, indicating whether this is a normal file, a system 
+  /// source location, indicating whether this is a normal file, a system
   /// header, or an "implicit extern C" system header.
   /// header, or an "implicit extern C" system header.
   ///
   ///
   /// This state can be modified with flags on GNU linemarker directives like:
   /// This state can be modified with flags on GNU linemarker directives like:
@@ -576,7 +576,7 @@ public:
   /// which changes all source locations in the current file after that to be
   /// which changes all source locations in the current file after that to be
   /// considered to be from a system header.
   /// considered to be from a system header.
   SrcMgr::CharacteristicKind getFileCharacteristic(SourceLocation Loc) const;
   SrcMgr::CharacteristicKind getFileCharacteristic(SourceLocation Loc) const;
-  
+
   /// getPresumedLoc - This method returns the "presumed" location of a
   /// getPresumedLoc - This method returns the "presumed" location of a
   /// SourceLocation specifies.  A "presumed location" can be modified by #line
   /// SourceLocation specifies.  A "presumed location" can be modified by #line
   /// or GNU line marker directives.  This provides a view on the data that a
   /// or GNU line marker directives.  This provides a view on the data that a
@@ -585,44 +585,44 @@ public:
   /// Note that a presumed location is always given as the instantiation point
   /// Note that a presumed location is always given as the instantiation point
   /// of an instantiation location, not at the spelling location.
   /// of an instantiation location, not at the spelling location.
   PresumedLoc getPresumedLoc(SourceLocation Loc) const;
   PresumedLoc getPresumedLoc(SourceLocation Loc) const;
-  
+
   /// isFromSameFile - Returns true if both SourceLocations correspond to
   /// isFromSameFile - Returns true if both SourceLocations correspond to
   ///  the same file.
   ///  the same file.
   bool isFromSameFile(SourceLocation Loc1, SourceLocation Loc2) const {
   bool isFromSameFile(SourceLocation Loc1, SourceLocation Loc2) const {
     return getFileID(Loc1) == getFileID(Loc2);
     return getFileID(Loc1) == getFileID(Loc2);
   }
   }
-  
+
   /// isFromMainFile - Returns true if the file of provided SourceLocation is
   /// isFromMainFile - Returns true if the file of provided SourceLocation is
   ///   the main file.
   ///   the main file.
   bool isFromMainFile(SourceLocation Loc) const {
   bool isFromMainFile(SourceLocation Loc) const {
     return getFileID(Loc) == getMainFileID();
     return getFileID(Loc) == getMainFileID();
-  } 
-  
+  }
+
   /// isInSystemHeader - Returns if a SourceLocation is in a system header.
   /// isInSystemHeader - Returns if a SourceLocation is in a system header.
   bool isInSystemHeader(SourceLocation Loc) const {
   bool isInSystemHeader(SourceLocation Loc) const {
     return getFileCharacteristic(Loc) != SrcMgr::C_User;
     return getFileCharacteristic(Loc) != SrcMgr::C_User;
   }
   }
-  
+
   /// isInExternCSystemHeader - Returns if a SourceLocation is in an "extern C"
   /// isInExternCSystemHeader - Returns if a SourceLocation is in an "extern C"
   /// system header.
   /// system header.
   bool isInExternCSystemHeader(SourceLocation Loc) const {
   bool isInExternCSystemHeader(SourceLocation Loc) const {
     return getFileCharacteristic(Loc) == SrcMgr::C_ExternCSystem;
     return getFileCharacteristic(Loc) == SrcMgr::C_ExternCSystem;
   }
   }
-  
+
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   // Line Table Manipulation Routines
   // Line Table Manipulation Routines
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
-  
+
   /// getLineTableFilenameID - Return the uniqued ID for the specified filename.
   /// getLineTableFilenameID - Return the uniqued ID for the specified filename.
-  /// 
+  ///
   unsigned getLineTableFilenameID(const char *Ptr, unsigned Len);
   unsigned getLineTableFilenameID(const char *Ptr, unsigned Len);
-  
+
   /// AddLineNote - Add a line note to the line table for the FileID and offset
   /// AddLineNote - Add a line note to the line table for the FileID and offset
   /// specified by Loc.  If FilenameID is -1, it is considered to be
   /// specified by Loc.  If FilenameID is -1, it is considered to be
   /// unspecified.
   /// unspecified.
   void AddLineNote(SourceLocation Loc, unsigned LineNo, int FilenameID);
   void AddLineNote(SourceLocation Loc, unsigned LineNo, int FilenameID);
   void AddLineNote(SourceLocation Loc, unsigned LineNo, int FilenameID,
   void AddLineNote(SourceLocation Loc, unsigned LineNo, int FilenameID,
-                   bool IsFileEntry, bool IsFileExit, 
+                   bool IsFileEntry, bool IsFileExit,
                    bool IsSystemHeader, bool IsExternCHeader);
                    bool IsSystemHeader, bool IsExternCHeader);
 
 
   /// \brief Determine if the source manager has a line table.
   /// \brief Determine if the source manager has a line table.
@@ -641,7 +641,7 @@ public:
   /// be based upon the first inclusion.
   /// be based upon the first inclusion.
   SourceLocation getLocation(const FileEntry *SourceFile,
   SourceLocation getLocation(const FileEntry *SourceFile,
                              unsigned Line, unsigned Col) const;
                              unsigned Line, unsigned Col) const;
-  
+
   /// \brief Determines the order of 2 source locations in the translation unit.
   /// \brief Determines the order of 2 source locations in the translation unit.
   ///
   ///
   /// \returns true if LHS source location comes before RHS, false otherwise.
   /// \returns true if LHS source location comes before RHS, false otherwise.
@@ -657,22 +657,22 @@ public:
   ///
   ///
   void PrintStats() const;
   void PrintStats() const;
 
 
-  // Iteration over the source location entry table.  
+  // Iteration over the source location entry table.
   typedef std::vector<SrcMgr::SLocEntry>::const_iterator sloc_entry_iterator;
   typedef std::vector<SrcMgr::SLocEntry>::const_iterator sloc_entry_iterator;
 
 
-  sloc_entry_iterator sloc_entry_begin() const { 
-    return SLocEntryTable.begin(); 
+  sloc_entry_iterator sloc_entry_begin() const {
+    return SLocEntryTable.begin();
   }
   }
 
 
-  sloc_entry_iterator sloc_entry_end() const { 
-    return SLocEntryTable.end(); 
+  sloc_entry_iterator sloc_entry_end() const {
+    return SLocEntryTable.end();
   }
   }
 
 
   unsigned sloc_entry_size() const { return SLocEntryTable.size(); }
   unsigned sloc_entry_size() const { return SLocEntryTable.size(); }
 
 
   const SrcMgr::SLocEntry &getSLocEntry(FileID FID) const {
   const SrcMgr::SLocEntry &getSLocEntry(FileID FID) const {
     assert(FID.ID < SLocEntryTable.size() && "Invalid id");
     assert(FID.ID < SLocEntryTable.size() && "Invalid id");
-    if (ExternalSLocEntries && 
+    if (ExternalSLocEntries &&
         FID.ID < SLocEntryLoaded.size() &&
         FID.ID < SLocEntryLoaded.size() &&
         !SLocEntryLoaded[FID.ID])
         !SLocEntryLoaded[FID.ID])
       ExternalSLocEntries->ReadSLocEntry(FID.ID);
       ExternalSLocEntries->ReadSLocEntry(FID.ID);
@@ -698,14 +698,14 @@ private:
     const SrcMgr::SLocEntry &Entry = getSLocEntry(FID);
     const SrcMgr::SLocEntry &Entry = getSLocEntry(FID);
     // If the entry is after the offset, it can't contain it.
     // If the entry is after the offset, it can't contain it.
     if (SLocOffset < Entry.getOffset()) return false;
     if (SLocOffset < Entry.getOffset()) return false;
-    
+
     // If this is the last entry than it does.  Otherwise, the entry after it
     // If this is the last entry than it does.  Otherwise, the entry after it
     // has to not include it.
     // has to not include it.
     if (FID.ID+1 == SLocEntryTable.size()) return true;
     if (FID.ID+1 == SLocEntryTable.size()) return true;
 
 
     return SLocOffset < getSLocEntry(FileID::get(FID.ID+1)).getOffset();
     return SLocOffset < getSLocEntry(FileID::get(FID.ID+1)).getOffset();
   }
   }
-  
+
   /// createFileID - Create a new fileID for the specified ContentCache and
   /// createFileID - Create a new fileID for the specified ContentCache and
   ///  include position.  This works regardless of whether the ContentCache
   ///  include position.  This works regardless of whether the ContentCache
   ///  corresponds to a file or some other input source.
   ///  corresponds to a file or some other input source.
@@ -714,15 +714,15 @@ private:
                       SrcMgr::CharacteristicKind DirCharacter,
                       SrcMgr::CharacteristicKind DirCharacter,
                       unsigned PreallocatedID = 0,
                       unsigned PreallocatedID = 0,
                       unsigned Offset = 0);
                       unsigned Offset = 0);
-    
+
   const SrcMgr::ContentCache *
   const SrcMgr::ContentCache *
     getOrCreateContentCache(const FileEntry *SourceFile);
     getOrCreateContentCache(const FileEntry *SourceFile);
 
 
   /// createMemBufferContentCache - Create a new ContentCache for the specified
   /// createMemBufferContentCache - Create a new ContentCache for the specified
   ///  memory buffer.
   ///  memory buffer.
-  const SrcMgr::ContentCache* 
+  const SrcMgr::ContentCache*
   createMemBufferContentCache(const llvm::MemoryBuffer *Buf);
   createMemBufferContentCache(const llvm::MemoryBuffer *Buf);
-  
+
   FileID getFileIDSlow(unsigned SLocOffset) const;
   FileID getFileIDSlow(unsigned SLocOffset) const;
 
 
   SourceLocation getInstantiationLocSlowCase(SourceLocation Loc) const;
   SourceLocation getInstantiationLocSlowCase(SourceLocation Loc) const;
@@ -730,7 +730,7 @@ private:
 
 
   std::pair<FileID, unsigned>
   std::pair<FileID, unsigned>
   getDecomposedInstantiationLocSlowCase(const SrcMgr::SLocEntry *E,
   getDecomposedInstantiationLocSlowCase(const SrcMgr::SLocEntry *E,
-                                        unsigned Offset) const;  
+                                        unsigned Offset) const;
   std::pair<FileID, unsigned>
   std::pair<FileID, unsigned>
   getDecomposedSpellingLocSlowCase(const SrcMgr::SLocEntry *E,
   getDecomposedSpellingLocSlowCase(const SrcMgr::SLocEntry *E,
                                    unsigned Offset) const;
                                    unsigned Offset) const;

+ 12 - 12
include/clang/Basic/SourceManagerInternals.h

@@ -28,22 +28,22 @@ namespace clang {
 struct LineEntry {
 struct LineEntry {
   /// FileOffset - The offset in this file that the line entry occurs at.
   /// FileOffset - The offset in this file that the line entry occurs at.
   unsigned FileOffset;
   unsigned FileOffset;
-  
+
   /// LineNo - The presumed line number of this line entry: #line 4.
   /// LineNo - The presumed line number of this line entry: #line 4.
   unsigned LineNo;
   unsigned LineNo;
-  
+
   /// FilenameID - The ID of the filename identified by this line entry:
   /// FilenameID - The ID of the filename identified by this line entry:
   /// #line 4 "foo.c".  This is -1 if not specified.
   /// #line 4 "foo.c".  This is -1 if not specified.
   int FilenameID;
   int FilenameID;
-  
-  /// Flags - Set the 0 if no flags, 1 if a system header, 
+
+  /// Flags - Set the 0 if no flags, 1 if a system header,
   SrcMgr::CharacteristicKind FileKind;
   SrcMgr::CharacteristicKind FileKind;
-  
+
   /// IncludeOffset - This is the offset of the virtual include stack location,
   /// IncludeOffset - This is the offset of the virtual include stack location,
   /// which is manipulated by GNU linemarker directives.  If this is 0 then
   /// which is manipulated by GNU linemarker directives.  If this is 0 then
   /// there is no virtual #includer.
   /// there is no virtual #includer.
   unsigned IncludeOffset;
   unsigned IncludeOffset;
-  
+
   static LineEntry get(unsigned Offs, unsigned Line, int Filename,
   static LineEntry get(unsigned Offs, unsigned Line, int Filename,
                        SrcMgr::CharacteristicKind FileKind,
                        SrcMgr::CharacteristicKind FileKind,
                        unsigned IncludeOffset) {
                        unsigned IncludeOffset) {
@@ -70,7 +70,7 @@ inline bool operator<(const LineEntry &E, unsigned Offset) {
 inline bool operator<(unsigned Offset, const LineEntry &E) {
 inline bool operator<(unsigned Offset, const LineEntry &E) {
   return Offset < E.FileOffset;
   return Offset < E.FileOffset;
 }
 }
-  
+
 /// LineTableInfo - This class is used to hold and unique data used to
 /// LineTableInfo - This class is used to hold and unique data used to
 /// represent #line information.
 /// represent #line information.
 class LineTableInfo {
 class LineTableInfo {
@@ -81,22 +81,22 @@ class LineTableInfo {
   /// to string.
   /// to string.
   llvm::StringMap<unsigned, llvm::BumpPtrAllocator> FilenameIDs;
   llvm::StringMap<unsigned, llvm::BumpPtrAllocator> FilenameIDs;
   std::vector<llvm::StringMapEntry<unsigned>*> FilenamesByID;
   std::vector<llvm::StringMapEntry<unsigned>*> FilenamesByID;
-  
+
   /// LineEntries - This is a map from FileIDs to a list of line entries (sorted
   /// LineEntries - This is a map from FileIDs to a list of line entries (sorted
   /// by the offset they occur in the file.
   /// by the offset they occur in the file.
   std::map<unsigned, std::vector<LineEntry> > LineEntries;
   std::map<unsigned, std::vector<LineEntry> > LineEntries;
 public:
 public:
   LineTableInfo() {
   LineTableInfo() {
   }
   }
-  
+
   void clear() {
   void clear() {
     FilenameIDs.clear();
     FilenameIDs.clear();
     FilenamesByID.clear();
     FilenamesByID.clear();
     LineEntries.clear();
     LineEntries.clear();
   }
   }
-  
+
   ~LineTableInfo() {}
   ~LineTableInfo() {}
-  
+
   unsigned getLineTableFilenameID(const char *Ptr, unsigned Len);
   unsigned getLineTableFilenameID(const char *Ptr, unsigned Len);
   const char *getFilename(unsigned ID) const {
   const char *getFilename(unsigned ID) const {
     assert(ID < FilenamesByID.size() && "Invalid FilenameID");
     assert(ID < FilenamesByID.size() && "Invalid FilenameID");
@@ -110,7 +110,7 @@ public:
                    unsigned LineNo, int FilenameID,
                    unsigned LineNo, int FilenameID,
                    unsigned EntryExit, SrcMgr::CharacteristicKind FileKind);
                    unsigned EntryExit, SrcMgr::CharacteristicKind FileKind);
 
 
-  
+
   /// FindNearestLineEntry - Find the line entry nearest to FID that is before
   /// FindNearestLineEntry - Find the line entry nearest to FID that is before
   /// it.  If there is no line entry before Offset in FID, return null.
   /// it.  If there is no line entry before Offset in FID, return null.
   const LineEntry *FindNearestLineEntry(unsigned FID, unsigned Offset);
   const LineEntry *FindNearestLineEntry(unsigned FID, unsigned Offset);

+ 40 - 40
include/clang/Basic/TargetInfo.h

@@ -34,7 +34,7 @@ class SourceLocation;
 class SourceManager;
 class SourceManager;
 class LangOptions;
 class LangOptions;
 namespace Builtin { struct Info; }
 namespace Builtin { struct Info; }
-  
+
 /// TargetInfo - This class exposes information about the current target.
 /// TargetInfo - This class exposes information about the current target.
 ///
 ///
 class TargetInfo {
 class TargetInfo {
@@ -61,8 +61,8 @@ protected:
 
 
   // TargetInfo Constructor.  Default initializes all fields.
   // TargetInfo Constructor.  Default initializes all fields.
   TargetInfo(const std::string &T);
   TargetInfo(const std::string &T);
-  
-public:  
+
+public:
   /// CreateTargetInfo - Return the target info object for the specified target
   /// CreateTargetInfo - Return the target info object for the specified target
   /// triple.
   /// triple.
   static TargetInfo* CreateTargetInfo(const std::string &Triple);
   static TargetInfo* CreateTargetInfo(const std::string &Triple);
@@ -105,35 +105,35 @@ public:
   uint64_t getPointerAlign(unsigned AddrSpace) const {
   uint64_t getPointerAlign(unsigned AddrSpace) const {
     return AddrSpace == 0 ? PointerAlign : getPointerAlignV(AddrSpace);
     return AddrSpace == 0 ? PointerAlign : getPointerAlignV(AddrSpace);
   }
   }
-  
+
   /// getBoolWidth/Align - Return the size of '_Bool' and C++ 'bool' for this
   /// getBoolWidth/Align - Return the size of '_Bool' and C++ 'bool' for this
   /// target, in bits.
   /// target, in bits.
   unsigned getBoolWidth(bool isWide = false) const { return 8; }  // FIXME
   unsigned getBoolWidth(bool isWide = false) const { return 8; }  // FIXME
   unsigned getBoolAlign(bool isWide = false) const { return 8; }  // FIXME
   unsigned getBoolAlign(bool isWide = false) const { return 8; }  // FIXME
- 
+
   unsigned getCharWidth() const { return 8; } // FIXME
   unsigned getCharWidth() const { return 8; } // FIXME
   unsigned getCharAlign() const { return 8; } // FIXME
   unsigned getCharAlign() const { return 8; } // FIXME
-  
+
   /// getShortWidth/Align - Return the size of 'signed short' and
   /// getShortWidth/Align - Return the size of 'signed short' and
-  /// 'unsigned short' for this target, in bits.  
+  /// 'unsigned short' for this target, in bits.
   unsigned getShortWidth() const { return 16; } // FIXME
   unsigned getShortWidth() const { return 16; } // FIXME
   unsigned getShortAlign() const { return 16; } // FIXME
   unsigned getShortAlign() const { return 16; } // FIXME
-  
+
   /// getIntWidth/Align - Return the size of 'signed int' and 'unsigned int' for
   /// getIntWidth/Align - Return the size of 'signed int' and 'unsigned int' for
   /// this target, in bits.
   /// this target, in bits.
   unsigned getIntWidth() const { return IntWidth; }
   unsigned getIntWidth() const { return IntWidth; }
   unsigned getIntAlign() const { return IntAlign; }
   unsigned getIntAlign() const { return IntAlign; }
-  
+
   /// getLongWidth/Align - Return the size of 'signed long' and 'unsigned long'
   /// getLongWidth/Align - Return the size of 'signed long' and 'unsigned long'
   /// for this target, in bits.
   /// for this target, in bits.
   unsigned getLongWidth() const { return LongWidth; }
   unsigned getLongWidth() const { return LongWidth; }
   unsigned getLongAlign() const { return LongAlign; }
   unsigned getLongAlign() const { return LongAlign; }
-  
+
   /// getLongLongWidth/Align - Return the size of 'signed long long' and
   /// getLongLongWidth/Align - Return the size of 'signed long long' and
   /// 'unsigned long long' for this target, in bits.
   /// 'unsigned long long' for this target, in bits.
   unsigned getLongLongWidth() const { return LongLongWidth; }
   unsigned getLongLongWidth() const { return LongLongWidth; }
   unsigned getLongLongAlign() const { return LongLongAlign; }
   unsigned getLongLongAlign() const { return LongLongAlign; }
-  
+
   /// getWCharWidth/Align - Return the size of 'wchar_t' for this target, in
   /// getWCharWidth/Align - Return the size of 'wchar_t' for this target, in
   /// bits.
   /// bits.
   unsigned getWCharWidth() const { return WCharWidth; }
   unsigned getWCharWidth() const { return WCharWidth; }
@@ -166,13 +166,13 @@ public:
   const llvm::fltSemantics &getLongDoubleFormat() const {
   const llvm::fltSemantics &getLongDoubleFormat() const {
     return *LongDoubleFormat;
     return *LongDoubleFormat;
   }
   }
-  
+
   /// getIntMaxTWidth - Return the size of intmax_t and uintmax_t for this
   /// getIntMaxTWidth - Return the size of intmax_t and uintmax_t for this
-  /// target, in bits.  
+  /// target, in bits.
   unsigned getIntMaxTWidth() const {
   unsigned getIntMaxTWidth() const {
     return IntMaxTWidth;
     return IntMaxTWidth;
   }
   }
-  
+
   /// getUserLabelPrefix - This returns the default value of the
   /// getUserLabelPrefix - This returns the default value of the
   /// __USER_LABEL_PREFIX__ macro, which is the prefix given to user symbols by
   /// __USER_LABEL_PREFIX__ macro, which is the prefix given to user symbols by
   /// default.  On most platforms this is "_", but it is "" on some, and "." on
   /// default.  On most platforms this is "_", but it is "" on some, and "." on
@@ -180,22 +180,22 @@ public:
   const char *getUserLabelPrefix() const {
   const char *getUserLabelPrefix() const {
     return UserLabelPrefix;
     return UserLabelPrefix;
   }
   }
-  
+
   /// getTypeName - Return the user string for the specified integer type enum.
   /// getTypeName - Return the user string for the specified integer type enum.
   /// For example, SignedShort -> "short".
   /// For example, SignedShort -> "short".
   static const char *getTypeName(IntType T);
   static const char *getTypeName(IntType T);
-  
+
   ///===---- Other target property query methods --------------------------===//
   ///===---- Other target property query methods --------------------------===//
-  
+
   /// getTargetDefines - Appends the target-specific #define values for this
   /// getTargetDefines - Appends the target-specific #define values for this
   /// target set to the specified buffer.
   /// target set to the specified buffer.
   virtual void getTargetDefines(const LangOptions &Opts,
   virtual void getTargetDefines(const LangOptions &Opts,
                                 std::vector<char> &DefineBuffer) const = 0;
                                 std::vector<char> &DefineBuffer) const = 0;
-  
+
   /// getTargetBuiltins - Return information about target-specific builtins for
   /// getTargetBuiltins - Return information about target-specific builtins for
   /// the current primary target, and info about which builtins are non-portable
   /// the current primary target, and info about which builtins are non-portable
   /// across the current set of primary and secondary targets.
   /// across the current set of primary and secondary targets.
-  virtual void getTargetBuiltins(const Builtin::Info *&Records, 
+  virtual void getTargetBuiltins(const Builtin::Info *&Records,
                                  unsigned &NumRecords) const = 0;
                                  unsigned &NumRecords) const = 0;
 
 
   /// getVAListDeclaration - Return the declaration to use for
   /// getVAListDeclaration - Return the declaration to use for
@@ -210,7 +210,7 @@ public:
   // getNormalizedGCCRegisterName - Returns the "normalized" GCC register name.
   // getNormalizedGCCRegisterName - Returns the "normalized" GCC register name.
   // For example, on x86 it will return "ax" when "eax" is passed in.
   // For example, on x86 it will return "ax" when "eax" is passed in.
   const char *getNormalizedGCCRegisterName(const char *Name) const;
   const char *getNormalizedGCCRegisterName(const char *Name) const;
-  
+
   struct ConstraintInfo {
   struct ConstraintInfo {
     enum {
     enum {
       CI_None = 0x00,
       CI_None = 0x00,
@@ -221,7 +221,7 @@ public:
     };
     };
     unsigned Flags;
     unsigned Flags;
     int TiedOperand;
     int TiedOperand;
-    
+
     std::string ConstraintStr;  // constraint: "=rm"
     std::string ConstraintStr;  // constraint: "=rm"
     std::string Name;           // Operand name: [foo] with no []'s.
     std::string Name;           // Operand name: [foo] with no []'s.
   public:
   public:
@@ -235,11 +235,11 @@ public:
     bool isReadWrite() const { return (Flags & CI_ReadWrite) != 0; }
     bool isReadWrite() const { return (Flags & CI_ReadWrite) != 0; }
     bool allowsRegister() const { return (Flags & CI_AllowsRegister) != 0; }
     bool allowsRegister() const { return (Flags & CI_AllowsRegister) != 0; }
     bool allowsMemory() const { return (Flags & CI_AllowsMemory) != 0; }
     bool allowsMemory() const { return (Flags & CI_AllowsMemory) != 0; }
-    
+
     /// hasMatchingInput - Return true if this output operand has a matching
     /// hasMatchingInput - Return true if this output operand has a matching
     /// (tied) input operand.
     /// (tied) input operand.
     bool hasMatchingInput() const { return (Flags & CI_HasMatchingInput) != 0; }
     bool hasMatchingInput() const { return (Flags & CI_HasMatchingInput) != 0; }
-    
+
     /// hasTiedOperand() - Return true if this input operand is a matching
     /// hasTiedOperand() - Return true if this input operand is a matching
     /// constraint that ties it to an output operand.  If this returns true,
     /// constraint that ties it to an output operand.  If this returns true,
     /// then getTiedOperand will indicate which output operand this is tied to.
     /// then getTiedOperand will indicate which output operand this is tied to.
@@ -248,12 +248,12 @@ public:
       assert(hasTiedOperand() && "Has no tied operand!");
       assert(hasTiedOperand() && "Has no tied operand!");
       return (unsigned)TiedOperand;
       return (unsigned)TiedOperand;
     }
     }
-    
+
     void setIsReadWrite() { Flags |= CI_ReadWrite; }
     void setIsReadWrite() { Flags |= CI_ReadWrite; }
     void setAllowsMemory() { Flags |= CI_AllowsMemory; }
     void setAllowsMemory() { Flags |= CI_AllowsMemory; }
     void setAllowsRegister() { Flags |= CI_AllowsRegister; }
     void setAllowsRegister() { Flags |= CI_AllowsRegister; }
     void setHasMatchingInput() { Flags |= CI_HasMatchingInput; }
     void setHasMatchingInput() { Flags |= CI_HasMatchingInput; }
-    
+
     /// setTiedOperand - Indicate that this is an input operand that is tied to
     /// setTiedOperand - Indicate that this is an input operand that is tied to
     /// the specified output operand.  Copy over the various constraint
     /// the specified output operand.  Copy over the various constraint
     /// information from the output.
     /// information from the output.
@@ -275,20 +275,20 @@ public:
   bool resolveSymbolicName(const char *&Name,
   bool resolveSymbolicName(const char *&Name,
                            ConstraintInfo *OutputConstraints,
                            ConstraintInfo *OutputConstraints,
                            unsigned NumOutputs, unsigned &Index) const;
                            unsigned NumOutputs, unsigned &Index) const;
-  
+
   virtual std::string convertConstraint(const char Constraint) const {
   virtual std::string convertConstraint(const char Constraint) const {
     return std::string(1, Constraint);
     return std::string(1, Constraint);
   }
   }
-  
+
   // Returns a string of target-specific clobbers, in LLVM format.
   // Returns a string of target-specific clobbers, in LLVM format.
   virtual const char *getClobbers() const = 0;
   virtual const char *getClobbers() const = 0;
-  
+
 
 
   /// getTriple - Return the target triple of the primary target.
   /// getTriple - Return the target triple of the primary target.
   const llvm::Triple &getTriple() const {
   const llvm::Triple &getTriple() const {
     return Triple;
     return Triple;
   }
   }
-  
+
   const char *getTargetDescription() const {
   const char *getTargetDescription() const {
     return DescriptionString;
     return DescriptionString;
   }
   }
@@ -302,30 +302,30 @@ public:
 
 
   /// getUnicodeStringSymbolPrefix - Get the default symbol prefix to
   /// getUnicodeStringSymbolPrefix - Get the default symbol prefix to
   /// use for string literals.
   /// use for string literals.
-  virtual const char *getUnicodeStringSymbolPrefix() const { 
+  virtual const char *getUnicodeStringSymbolPrefix() const {
     return ".str";
     return ".str";
   }
   }
 
 
   /// getUnicodeStringSection - Return the section to use for unicode
   /// getUnicodeStringSection - Return the section to use for unicode
   /// string literals, or 0 if no special section is used.
   /// string literals, or 0 if no special section is used.
-  virtual const char *getUnicodeStringSection() const { 
+  virtual const char *getUnicodeStringSection() const {
     return 0;
     return 0;
   }
   }
 
 
   /// getCFStringSection - Return the section to use for CFString
   /// getCFStringSection - Return the section to use for CFString
   /// literals, or 0 if no special section is used.
   /// literals, or 0 if no special section is used.
-  virtual const char *getCFStringSection() const { 
+  virtual const char *getCFStringSection() const {
     return "__DATA,__cfstring";
     return "__DATA,__cfstring";
   }
   }
 
 
   /// getCFStringDataSection - Return the section to use for the
   /// getCFStringDataSection - Return the section to use for the
   /// constant string data associated with a CFString literal, or 0 if
   /// constant string data associated with a CFString literal, or 0 if
   /// no special section is used.
   /// no special section is used.
-  virtual const char *getCFStringDataSection() const { 
+  virtual const char *getCFStringDataSection() const {
     return "__TEXT,__cstring,cstring_literals";
     return "__TEXT,__cstring,cstring_literals";
   }
   }
-  
-  
+
+
   /// isValidSectionSpecifier - This is an optional hook that targets can
   /// isValidSectionSpecifier - This is an optional hook that targets can
   /// implement to perform semantic checking on attribute((section("foo")))
   /// implement to perform semantic checking on attribute((section("foo")))
   /// specifiers.  In this case, "foo" is passed in to be checked.  If the
   /// specifiers.  In this case, "foo" is passed in to be checked.  If the
@@ -342,13 +342,13 @@ public:
 
 
   /// getDefaultLangOptions - Allow the target to specify default settings for
   /// getDefaultLangOptions - Allow the target to specify default settings for
   /// various language options.  These may be overridden by command line
   /// various language options.  These may be overridden by command line
-  /// options. 
+  /// options.
   virtual void getDefaultLangOptions(LangOptions &Opts) {}
   virtual void getDefaultLangOptions(LangOptions &Opts) {}
 
 
   /// getDefaultFeatures - Get the default set of target features for
   /// getDefaultFeatures - Get the default set of target features for
   /// the \args CPU; this should include all legal feature strings on
   /// the \args CPU; this should include all legal feature strings on
   /// the target.
   /// the target.
-  virtual void getDefaultFeatures(const std::string &CPU, 
+  virtual void getDefaultFeatures(const std::string &CPU,
                                   llvm::StringMap<bool> &Features) const {
                                   llvm::StringMap<bool> &Features) const {
   }
   }
 
 
@@ -387,11 +387,11 @@ protected:
   virtual enum IntType getPtrDiffTypeV(unsigned AddrSpace) const {
   virtual enum IntType getPtrDiffTypeV(unsigned AddrSpace) const {
     return PtrDiffType;
     return PtrDiffType;
   }
   }
-  virtual void getGCCRegNames(const char * const *&Names, 
+  virtual void getGCCRegNames(const char * const *&Names,
                               unsigned &NumNames) const = 0;
                               unsigned &NumNames) const = 0;
-  virtual void getGCCRegAliases(const GCCRegAlias *&Aliases, 
+  virtual void getGCCRegAliases(const GCCRegAlias *&Aliases,
                                 unsigned &NumAliases) const = 0;
                                 unsigned &NumAliases) const = 0;
-  virtual bool validateAsmConstraint(const char *&Name, 
+  virtual bool validateAsmConstraint(const char *&Name,
                                      TargetInfo::ConstraintInfo &info) const= 0;
                                      TargetInfo::ConstraintInfo &info) const= 0;
 };
 };
 
 

+ 1 - 1
include/clang/Basic/TokenKinds.h

@@ -29,7 +29,7 @@ enum TokenKind {
 /// PPKeywordKind - This provides a namespace for preprocessor keywords which
 /// PPKeywordKind - This provides a namespace for preprocessor keywords which
 /// start with a '#' at the beginning of the line.
 /// start with a '#' at the beginning of the line.
 enum PPKeywordKind {
 enum PPKeywordKind {
-#define PPKEYWORD(X) pp_##X, 
+#define PPKEYWORD(X) pp_##X,
 #include "clang/Basic/TokenKinds.def"
 #include "clang/Basic/TokenKinds.def"
   NUM_PP_KEYWORDS
   NUM_PP_KEYWORDS
 };
 };

+ 3 - 3
include/clang/CodeGen/ModuleBuilder.h

@@ -26,13 +26,13 @@ namespace clang {
   class Diagnostic;
   class Diagnostic;
   class LangOptions;
   class LangOptions;
   class CompileOptions;
   class CompileOptions;
-  
+
   class CodeGenerator : public ASTConsumer {
   class CodeGenerator : public ASTConsumer {
   public:
   public:
     virtual llvm::Module* GetModule() = 0;
     virtual llvm::Module* GetModule() = 0;
-    virtual llvm::Module* ReleaseModule() = 0;    
+    virtual llvm::Module* ReleaseModule() = 0;
   };
   };
-  
+
   CodeGenerator *CreateLLVMCodeGen(Diagnostic &Diags,
   CodeGenerator *CreateLLVMCodeGen(Diagnostic &Diags,
                                    const std::string &ModuleName,
                                    const std::string &ModuleName,
                                    const CompileOptions &CO,
                                    const CompileOptions &CO,

+ 19 - 19
include/clang/Driver/Action.h

@@ -26,7 +26,7 @@ namespace clang {
 namespace driver {
 namespace driver {
   class Arg;
   class Arg;
 
 
-/// Action - Represent an abstract compilation step to perform. 
+/// Action - Represent an abstract compilation step to perform.
 ///
 ///
 /// An action represents an edge in the compilation graph; typically
 /// An action represents an edge in the compilation graph; typically
 /// it is a job to transform an input using some tool.
 /// it is a job to transform an input using some tool.
@@ -63,15 +63,15 @@ private:
 
 
   /// The output type of this action.
   /// The output type of this action.
   types::ID Type;
   types::ID Type;
-  
+
   ActionList Inputs;
   ActionList Inputs;
 
 
 protected:
 protected:
   Action(ActionClass _Kind, types::ID _Type) : Kind(_Kind), Type(_Type) {}
   Action(ActionClass _Kind, types::ID _Type) : Kind(_Kind), Type(_Type) {}
-  Action(ActionClass _Kind, Action *Input, types::ID _Type) 
+  Action(ActionClass _Kind, Action *Input, types::ID _Type)
     : Kind(_Kind), Type(_Type), Inputs(&Input, &Input + 1) {}
     : Kind(_Kind), Type(_Type), Inputs(&Input, &Input + 1) {}
-  Action(ActionClass _Kind, const ActionList &_Inputs, types::ID _Type) 
-    : Kind(_Kind), Type(_Type), Inputs(_Inputs) {}  
+  Action(ActionClass _Kind, const ActionList &_Inputs, types::ID _Type)
+    : Kind(_Kind), Type(_Type), Inputs(_Inputs) {}
 public:
 public:
   virtual ~Action();
   virtual ~Action();
 
 
@@ -90,7 +90,7 @@ public:
   const_iterator begin() const { return Inputs.begin(); }
   const_iterator begin() const { return Inputs.begin(); }
   const_iterator end() const { return Inputs.end(); }
   const_iterator end() const { return Inputs.end(); }
 
 
-  static bool classof(const Action *) { return true; }    
+  static bool classof(const Action *) { return true; }
 };
 };
 
 
 class InputAction : public Action {
 class InputAction : public Action {
@@ -100,8 +100,8 @@ public:
 
 
   const Arg &getInputArg() const { return Input; }
   const Arg &getInputArg() const { return Input; }
 
 
-  static bool classof(const Action *A) { 
-    return A->getKind() == InputClass; 
+  static bool classof(const Action *A) {
+    return A->getKind() == InputClass;
   }
   }
   static bool classof(const InputAction *) { return true; }
   static bool classof(const InputAction *) { return true; }
 };
 };
@@ -116,8 +116,8 @@ public:
 
 
   const char *getArchName() const { return ArchName; }
   const char *getArchName() const { return ArchName; }
 
 
-  static bool classof(const Action *A) { 
-    return A->getKind() == BindArchClass; 
+  static bool classof(const Action *A) {
+    return A->getKind() == BindArchClass;
   }
   }
   static bool classof(const BindArchAction *) { return true; }
   static bool classof(const BindArchAction *) { return true; }
 };
 };
@@ -128,9 +128,9 @@ protected:
   JobAction(ActionClass Kind, const ActionList &Inputs, types::ID Type);
   JobAction(ActionClass Kind, const ActionList &Inputs, types::ID Type);
 
 
 public:
 public:
-  static bool classof(const Action *A) { 
+  static bool classof(const Action *A) {
     return (A->getKind() >= JobClassFirst &&
     return (A->getKind() >= JobClassFirst &&
-            A->getKind() <= JobClassLast); 
+            A->getKind() <= JobClassLast);
   }
   }
   static bool classof(const JobAction *) { return true; }
   static bool classof(const JobAction *) { return true; }
 };
 };
@@ -139,7 +139,7 @@ class PreprocessJobAction : public JobAction {
 public:
 public:
   PreprocessJobAction(Action *Input, types::ID OutputType);
   PreprocessJobAction(Action *Input, types::ID OutputType);
 
 
-  static bool classof(const Action *A) { 
+  static bool classof(const Action *A) {
     return A->getKind() == PreprocessJobClass;
     return A->getKind() == PreprocessJobClass;
   }
   }
   static bool classof(const PreprocessJobAction *) { return true; }
   static bool classof(const PreprocessJobAction *) { return true; }
@@ -149,7 +149,7 @@ class PrecompileJobAction : public JobAction {
 public:
 public:
   PrecompileJobAction(Action *Input, types::ID OutputType);
   PrecompileJobAction(Action *Input, types::ID OutputType);
 
 
-  static bool classof(const Action *A) { 
+  static bool classof(const Action *A) {
     return A->getKind() == PrecompileJobClass;
     return A->getKind() == PrecompileJobClass;
   }
   }
   static bool classof(const PrecompileJobAction *) { return true; }
   static bool classof(const PrecompileJobAction *) { return true; }
@@ -159,7 +159,7 @@ class AnalyzeJobAction : public JobAction {
 public:
 public:
   AnalyzeJobAction(Action *Input, types::ID OutputType);
   AnalyzeJobAction(Action *Input, types::ID OutputType);
 
 
-  static bool classof(const Action *A) { 
+  static bool classof(const Action *A) {
     return A->getKind() == AnalyzeJobClass;
     return A->getKind() == AnalyzeJobClass;
   }
   }
   static bool classof(const AnalyzeJobAction *) { return true; }
   static bool classof(const AnalyzeJobAction *) { return true; }
@@ -169,7 +169,7 @@ class CompileJobAction : public JobAction {
 public:
 public:
   CompileJobAction(Action *Input, types::ID OutputType);
   CompileJobAction(Action *Input, types::ID OutputType);
 
 
-  static bool classof(const Action *A) { 
+  static bool classof(const Action *A) {
     return A->getKind() == CompileJobClass;
     return A->getKind() == CompileJobClass;
   }
   }
   static bool classof(const CompileJobAction *) { return true; }
   static bool classof(const CompileJobAction *) { return true; }
@@ -179,7 +179,7 @@ class AssembleJobAction : public JobAction {
 public:
 public:
   AssembleJobAction(Action *Input, types::ID OutputType);
   AssembleJobAction(Action *Input, types::ID OutputType);
 
 
-  static bool classof(const Action *A) { 
+  static bool classof(const Action *A) {
     return A->getKind() == AssembleJobClass;
     return A->getKind() == AssembleJobClass;
   }
   }
   static bool classof(const AssembleJobAction *) { return true; }
   static bool classof(const AssembleJobAction *) { return true; }
@@ -189,7 +189,7 @@ class LinkJobAction : public JobAction {
 public:
 public:
   LinkJobAction(ActionList &Inputs, types::ID Type);
   LinkJobAction(ActionList &Inputs, types::ID Type);
 
 
-  static bool classof(const Action *A) { 
+  static bool classof(const Action *A) {
     return A->getKind() == LinkJobClass;
     return A->getKind() == LinkJobClass;
   }
   }
   static bool classof(const LinkJobAction *) { return true; }
   static bool classof(const LinkJobAction *) { return true; }
@@ -199,7 +199,7 @@ class LipoJobAction : public JobAction {
 public:
 public:
   LipoJobAction(ActionList &Inputs, types::ID Type);
   LipoJobAction(ActionList &Inputs, types::ID Type);
 
 
-  static bool classof(const Action *A) { 
+  static bool classof(const Action *A) {
     return A->getKind() == LipoJobClass;
     return A->getKind() == LipoJobClass;
   }
   }
   static bool classof(const LipoJobAction *) { return true; }
   static bool classof(const LipoJobAction *) { return true; }

+ 23 - 23
include/clang/Driver/Arg.h

@@ -49,7 +49,7 @@ namespace driver {
 
 
     /// The option this argument is an instance of.
     /// The option this argument is an instance of.
     const Option *Opt;
     const Option *Opt;
-    
+
     /// The argument this argument was derived from (during tool chain
     /// The argument this argument was derived from (during tool chain
     /// argument translation), if any.
     /// argument translation), if any.
     const Arg *BaseArg;
     const Arg *BaseArg;
@@ -66,7 +66,7 @@ namespace driver {
   protected:
   protected:
     Arg(ArgClass Kind, const Option *Opt, unsigned Index,
     Arg(ArgClass Kind, const Option *Opt, unsigned Index,
         const Arg *BaseArg = 0);
         const Arg *BaseArg = 0);
-    
+
   public:
   public:
     Arg(const Arg &);
     Arg(const Arg &);
     virtual ~Arg();
     virtual ~Arg();
@@ -74,12 +74,12 @@ namespace driver {
     ArgClass getKind() const { return Kind; }
     ArgClass getKind() const { return Kind; }
     const Option &getOption() const { return *Opt; }
     const Option &getOption() const { return *Opt; }
     unsigned getIndex() const { return Index; }
     unsigned getIndex() const { return Index; }
-    
+
     /// getBaseArg - Return the base argument which generated this
     /// getBaseArg - Return the base argument which generated this
     /// arg; this is either the argument itself or the argument it was
     /// arg; this is either the argument itself or the argument it was
     /// derived from during tool chain specific argument translation.
     /// derived from during tool chain specific argument translation.
-    const Arg &getBaseArg() const { 
-      return BaseArg ? *BaseArg : *this; 
+    const Arg &getBaseArg() const {
+      return BaseArg ? *BaseArg : *this;
     }
     }
     void setBaseArg(const Arg *_BaseArg) {
     void setBaseArg(const Arg *_BaseArg) {
       BaseArg = _BaseArg;
       BaseArg = _BaseArg;
@@ -88,14 +88,14 @@ namespace driver {
     bool isClaimed() const { return getBaseArg().Claimed; }
     bool isClaimed() const { return getBaseArg().Claimed; }
 
 
     /// claim - Set the Arg claimed bit.
     /// claim - Set the Arg claimed bit.
-    
+
     // FIXME: We need to deal with derived arguments and set the bit
     // FIXME: We need to deal with derived arguments and set the bit
     // in the original argument; not the derived one.
     // in the original argument; not the derived one.
     void claim() const { getBaseArg().Claimed = true; }
     void claim() const { getBaseArg().Claimed = true; }
 
 
     virtual unsigned getNumValues() const = 0;
     virtual unsigned getNumValues() const = 0;
     virtual const char *getValue(const ArgList &Args, unsigned N=0) const = 0;
     virtual const char *getValue(const ArgList &Args, unsigned N=0) const = 0;
-    
+
     /// render - Append the argument onto the given array as strings.
     /// render - Append the argument onto the given array as strings.
     virtual void render(const ArgList &Args, ArgStringList &Output) const = 0;
     virtual void render(const ArgList &Args, ArgStringList &Output) const = 0;
 
 
@@ -105,7 +105,7 @@ namespace driver {
     /// (e.g., Xlinker).
     /// (e.g., Xlinker).
     void renderAsInput(const ArgList &Args, ArgStringList &Output) const;
     void renderAsInput(const ArgList &Args, ArgStringList &Output) const;
 
 
-    static bool classof(const Arg *) { return true; }    
+    static bool classof(const Arg *) { return true; }
 
 
     void dump() const;
     void dump() const;
 
 
@@ -124,8 +124,8 @@ namespace driver {
     virtual unsigned getNumValues() const { return 0; }
     virtual unsigned getNumValues() const { return 0; }
     virtual const char *getValue(const ArgList &Args, unsigned N=0) const;
     virtual const char *getValue(const ArgList &Args, unsigned N=0) const;
 
 
-    static bool classof(const Arg *A) { 
-      return A->getKind() == Arg::FlagClass; 
+    static bool classof(const Arg *A) {
+      return A->getKind() == Arg::FlagClass;
     }
     }
     static bool classof(const FlagArg *) { return true; }
     static bool classof(const FlagArg *) { return true; }
   };
   };
@@ -140,8 +140,8 @@ namespace driver {
     virtual unsigned getNumValues() const { return 1; }
     virtual unsigned getNumValues() const { return 1; }
     virtual const char *getValue(const ArgList &Args, unsigned N=0) const;
     virtual const char *getValue(const ArgList &Args, unsigned N=0) const;
 
 
-    static bool classof(const Arg *A) { 
-      return A->getKind() == Arg::PositionalClass; 
+    static bool classof(const Arg *A) {
+      return A->getKind() == Arg::PositionalClass;
     }
     }
     static bool classof(const PositionalArg *) { return true; }
     static bool classof(const PositionalArg *) { return true; }
   };
   };
@@ -157,8 +157,8 @@ namespace driver {
     virtual unsigned getNumValues() const { return 1; }
     virtual unsigned getNumValues() const { return 1; }
     virtual const char *getValue(const ArgList &Args, unsigned N=0) const;
     virtual const char *getValue(const ArgList &Args, unsigned N=0) const;
 
 
-    static bool classof(const Arg *A) { 
-      return A->getKind() == Arg::JoinedClass; 
+    static bool classof(const Arg *A) {
+      return A->getKind() == Arg::JoinedClass;
     }
     }
     static bool classof(const JoinedArg *) { return true; }
     static bool classof(const JoinedArg *) { return true; }
   };
   };
@@ -169,7 +169,7 @@ namespace driver {
     unsigned NumValues;
     unsigned NumValues;
 
 
   public:
   public:
-    SeparateArg(const Option *Opt, unsigned Index, unsigned NumValues, 
+    SeparateArg(const Option *Opt, unsigned Index, unsigned NumValues,
                 const Arg *BaseArg = 0);
                 const Arg *BaseArg = 0);
 
 
     virtual void render(const ArgList &Args, ArgStringList &Output) const;
     virtual void render(const ArgList &Args, ArgStringList &Output) const;
@@ -177,8 +177,8 @@ namespace driver {
     virtual unsigned getNumValues() const { return NumValues; }
     virtual unsigned getNumValues() const { return NumValues; }
     virtual const char *getValue(const ArgList &Args, unsigned N=0) const;
     virtual const char *getValue(const ArgList &Args, unsigned N=0) const;
 
 
-    static bool classof(const Arg *A) { 
-      return A->getKind() == Arg::SeparateClass; 
+    static bool classof(const Arg *A) {
+      return A->getKind() == Arg::SeparateClass;
     }
     }
     static bool classof(const SeparateArg *) { return true; }
     static bool classof(const SeparateArg *) { return true; }
   };
   };
@@ -193,7 +193,7 @@ namespace driver {
     std::vector<std::string> Values;
     std::vector<std::string> Values;
 
 
   public:
   public:
-    CommaJoinedArg(const Option *Opt, unsigned Index, const char *Str, 
+    CommaJoinedArg(const Option *Opt, unsigned Index, const char *Str,
                    const Arg *BaseArg = 0);
                    const Arg *BaseArg = 0);
 
 
     virtual void render(const ArgList &Args, ArgStringList &Output) const;
     virtual void render(const ArgList &Args, ArgStringList &Output) const;
@@ -201,8 +201,8 @@ namespace driver {
     virtual unsigned getNumValues() const { return Values.size(); }
     virtual unsigned getNumValues() const { return Values.size(); }
     virtual const char *getValue(const ArgList &Args, unsigned N=0) const;
     virtual const char *getValue(const ArgList &Args, unsigned N=0) const;
 
 
-    static bool classof(const Arg *A) { 
-      return A->getKind() == Arg::CommaJoinedClass; 
+    static bool classof(const Arg *A) {
+      return A->getKind() == Arg::CommaJoinedClass;
     }
     }
     static bool classof(const CommaJoinedArg *) { return true; }
     static bool classof(const CommaJoinedArg *) { return true; }
   };
   };
@@ -211,7 +211,7 @@ namespace driver {
   /// values.
   /// values.
   class JoinedAndSeparateArg : public Arg {
   class JoinedAndSeparateArg : public Arg {
   public:
   public:
-    JoinedAndSeparateArg(const Option *Opt, unsigned Index, 
+    JoinedAndSeparateArg(const Option *Opt, unsigned Index,
                          const Arg *BaseArg = 0);
                          const Arg *BaseArg = 0);
 
 
     virtual void render(const ArgList &Args, ArgStringList &Output) const;
     virtual void render(const ArgList &Args, ArgStringList &Output) const;
@@ -219,8 +219,8 @@ namespace driver {
     virtual unsigned getNumValues() const { return 2; }
     virtual unsigned getNumValues() const { return 2; }
     virtual const char *getValue(const ArgList &Args, unsigned N=0) const;
     virtual const char *getValue(const ArgList &Args, unsigned N=0) const;
 
 
-    static bool classof(const Arg *A) { 
-      return A->getKind() == Arg::JoinedAndSeparateClass; 
+    static bool classof(const Arg *A) {
+      return A->getKind() == Arg::JoinedAndSeparateClass;
     }
     }
     static bool classof(const JoinedAndSeparateArg *) { return true; }
     static bool classof(const JoinedAndSeparateArg *) { return true; }
   };
   };

+ 13 - 13
include/clang/Driver/ArgList.h

@@ -65,17 +65,17 @@ namespace driver {
 
 
     const_iterator begin() const { return Args.begin(); }
     const_iterator begin() const { return Args.begin(); }
     const_iterator end() const { return Args.end(); }
     const_iterator end() const { return Args.end(); }
-    
+
     const_reverse_iterator rbegin() const { return Args.rbegin(); }
     const_reverse_iterator rbegin() const { return Args.rbegin(); }
     const_reverse_iterator rend() const { return Args.rend(); }
     const_reverse_iterator rend() const { return Args.rend(); }
 
 
     /// hasArg - Does the arg list contain any option matching \arg Id.
     /// hasArg - Does the arg list contain any option matching \arg Id.
     ///
     ///
     /// \arg Claim Whether the argument should be claimed, if it exists.
     /// \arg Claim Whether the argument should be claimed, if it exists.
-    bool hasArg(options::ID Id, bool Claim=true) const { 
+    bool hasArg(options::ID Id, bool Claim=true) const {
       return getLastArg(Id, Claim) != 0;
       return getLastArg(Id, Claim) != 0;
     }
     }
-    bool hasArg(options::ID Id0, options::ID Id1, bool Claim=true) const { 
+    bool hasArg(options::ID Id0, options::ID Id1, bool Claim=true) const {
       return getLastArg(Id0, Id1, Claim) != 0;
       return getLastArg(Id0, Id1, Claim) != 0;
     }
     }
 
 
@@ -105,15 +105,15 @@ namespace driver {
 
 
     /// AddAllArgs - Render all arguments matching the given ids.
     /// AddAllArgs - Render all arguments matching the given ids.
     void AddAllArgs(ArgStringList &Output, options::ID Id0) const;
     void AddAllArgs(ArgStringList &Output, options::ID Id0) const;
-    void AddAllArgs(ArgStringList &Output, options::ID Id0, 
+    void AddAllArgs(ArgStringList &Output, options::ID Id0,
                     options::ID Id1) const;
                     options::ID Id1) const;
-    void AddAllArgs(ArgStringList &Output, options::ID Id0, options::ID Id1, 
+    void AddAllArgs(ArgStringList &Output, options::ID Id0, options::ID Id1,
                     options::ID Id2) const;
                     options::ID Id2) const;
 
 
     /// AddAllArgValues - Render the argument values of all arguments
     /// AddAllArgValues - Render the argument values of all arguments
     /// matching the given ids.
     /// matching the given ids.
     void AddAllArgValues(ArgStringList &Output, options::ID Id0) const;
     void AddAllArgValues(ArgStringList &Output, options::ID Id0) const;
-    void AddAllArgValues(ArgStringList &Output, options::ID Id0, 
+    void AddAllArgValues(ArgStringList &Output, options::ID Id0,
                          options::ID Id1) const;
                          options::ID Id1) const;
 
 
     /// AddAllArgsTranslated - Render all the arguments matching the
     /// AddAllArgsTranslated - Render all the arguments matching the
@@ -123,7 +123,7 @@ namespace driver {
     /// \param Joined - If true, render the argument as joined with
     /// \param Joined - If true, render the argument as joined with
     /// the option specifier.
     /// the option specifier.
     void AddAllArgsTranslated(ArgStringList &Output, options::ID Id0,
     void AddAllArgsTranslated(ArgStringList &Output, options::ID Id0,
-                              const char *Translation, 
+                              const char *Translation,
                               bool Joined = false) const;
                               bool Joined = false) const;
 
 
     /// ClaimAllArgs - Claim all arguments which match the given
     /// ClaimAllArgs - Claim all arguments which match the given
@@ -168,8 +168,8 @@ namespace driver {
     InputArgList(const ArgList &);
     InputArgList(const ArgList &);
     ~InputArgList();
     ~InputArgList();
 
 
-    virtual const char *getArgString(unsigned Index) const { 
-      return ArgStrings[Index]; 
+    virtual const char *getArgString(unsigned Index) const {
+      return ArgStrings[Index];
     }
     }
 
 
     /// getNumInputArgStrings - Return the number of original input
     /// getNumInputArgStrings - Return the number of original input
@@ -212,7 +212,7 @@ namespace driver {
     ~DerivedArgList();
     ~DerivedArgList();
 
 
     virtual const char *getArgString(unsigned Index) const {
     virtual const char *getArgString(unsigned Index) const {
-      return BaseArgs.getArgString(Index); 
+      return BaseArgs.getArgString(Index);
     }
     }
 
 
     /// @name Arg Synthesis
     /// @name Arg Synthesis
@@ -226,17 +226,17 @@ namespace driver {
 
 
     /// MakePositionalArg - Construct a new Positional arg for the
     /// MakePositionalArg - Construct a new Positional arg for the
     /// given option \arg Id, with the provided \arg Value.
     /// given option \arg Id, with the provided \arg Value.
-    Arg *MakePositionalArg(const Arg *BaseArg, const Option *Opt, 
+    Arg *MakePositionalArg(const Arg *BaseArg, const Option *Opt,
                            const char *Value) const;
                            const char *Value) const;
 
 
     /// MakeSeparateArg - Construct a new Positional arg for the
     /// MakeSeparateArg - Construct a new Positional arg for the
     /// given option \arg Id, with the provided \arg Value.
     /// given option \arg Id, with the provided \arg Value.
-    Arg *MakeSeparateArg(const Arg *BaseArg, const Option *Opt, 
+    Arg *MakeSeparateArg(const Arg *BaseArg, const Option *Opt,
                          const char *Value) const;
                          const char *Value) const;
 
 
     /// MakeJoinedArg - Construct a new Positional arg for the
     /// MakeJoinedArg - Construct a new Positional arg for the
     /// given option \arg Id, with the provided \arg Value.
     /// given option \arg Id, with the provided \arg Value.
-    Arg *MakeJoinedArg(const Arg *BaseArg, const Option *Opt, 
+    Arg *MakeJoinedArg(const Arg *BaseArg, const Option *Opt,
                        const char *Value) const;
                        const char *Value) const;
 
 
     /// @}
     /// @}

+ 5 - 5
include/clang/Driver/Compilation.h

@@ -56,7 +56,7 @@ class Compilation {
   ArgStringList ResultFiles;
   ArgStringList ResultFiles;
 
 
 public:
 public:
-  Compilation(const Driver &D, const ToolChain &DefaultToolChain, 
+  Compilation(const Driver &D, const ToolChain &DefaultToolChain,
               InputArgList *Args);
               InputArgList *Args);
   ~Compilation();
   ~Compilation();
 
 
@@ -83,8 +83,8 @@ public:
 
 
   /// addTempFile - Add a file to remove on exit, and returns its
   /// addTempFile - Add a file to remove on exit, and returns its
   /// argument.
   /// argument.
-  const char *addTempFile(const char *Name) { 
-    TempFiles.push_back(Name); 
+  const char *addTempFile(const char *Name) {
+    TempFiles.push_back(Name);
     return Name;
     return Name;
   }
   }
 
 
@@ -99,7 +99,7 @@ public:
   ///
   ///
   /// \param IssueErrors - Report failures as errors.
   /// \param IssueErrors - Report failures as errors.
   /// \return Whether all files were removed successfully.
   /// \return Whether all files were removed successfully.
-  bool CleanupFileList(const ArgStringList &Files, 
+  bool CleanupFileList(const ArgStringList &Files,
                        bool IssueErrors=false) const;
                        bool IssueErrors=false) const;
 
 
   /// PrintJob - Print one job in -### format.
   /// PrintJob - Print one job in -### format.
@@ -108,7 +108,7 @@ public:
   /// \param J - The job to print.
   /// \param J - The job to print.
   /// \param Terminator - A string to print at the end of the line.
   /// \param Terminator - A string to print at the end of the line.
   /// \param Quote - Should separate arguments be quoted.
   /// \param Quote - Should separate arguments be quoted.
-  void PrintJob(llvm::raw_ostream &OS, const Job &J, 
+  void PrintJob(llvm::raw_ostream &OS, const Job &J,
                 const char *Terminator, bool Quote) const;
                 const char *Terminator, bool Quote) const;
 
 
   /// ExecuteCommand - Execute an actual command.
   /// ExecuteCommand - Execute an actual command.

+ 8 - 8
include/clang/Driver/Driver.h

@@ -55,11 +55,11 @@ public:
 public:
 public:
   /// The name the driver was invoked as.
   /// The name the driver was invoked as.
   std::string Name;
   std::string Name;
-  
+
   /// The path the driver executable was in, as invoked from the
   /// The path the driver executable was in, as invoked from the
   /// command line.
   /// command line.
   std::string Dir;
   std::string Dir;
-  
+
   /// Default host triple.
   /// Default host triple.
   std::string DefaultHostTriple;
   std::string DefaultHostTriple;
 
 
@@ -75,7 +75,7 @@ public:
 
 
   /// Whether the driver should follow g++ like behavior.
   /// Whether the driver should follow g++ like behavior.
   bool CCCIsCXX : 1;
   bool CCCIsCXX : 1;
-  
+
   /// Echo commands while executing (in -v style).
   /// Echo commands while executing (in -v style).
   bool CCCEcho : 1;
   bool CCCEcho : 1;
 
 
@@ -107,7 +107,7 @@ private:
 
 
   /// Certain options suppress the 'no input files' warning.
   /// Certain options suppress the 'no input files' warning.
   bool SuppressMissingInputWarning : 1;
   bool SuppressMissingInputWarning : 1;
-  
+
   std::list<std::string> TempFiles;
   std::list<std::string> TempFiles;
   std::list<std::string> ResultFiles;
   std::list<std::string> ResultFiles;
 
 
@@ -243,7 +243,7 @@ public:
   /// \param BaseInput - The original input file that this action was
   /// \param BaseInput - The original input file that this action was
   /// triggered by.
   /// triggered by.
   /// \param AtTopLevel - Whether this is a "top-level" action.
   /// \param AtTopLevel - Whether this is a "top-level" action.
-  const char *GetNamedOutputPath(Compilation &C, 
+  const char *GetNamedOutputPath(Compilation &C,
                                  const JobAction &JA,
                                  const JobAction &JA,
                                  const char *BaseInput,
                                  const char *BaseInput,
                                  bool AtTopLevel) const;
                                  bool AtTopLevel) const;
@@ -253,14 +253,14 @@ public:
   ///
   ///
   /// GCC goes to extra lengths here to be a bit more robust.
   /// GCC goes to extra lengths here to be a bit more robust.
   std::string GetTemporaryPath(const char *Suffix) const;
   std::string GetTemporaryPath(const char *Suffix) const;
-                        
+
   /// GetHostInfo - Construct a new host info object for the given
   /// GetHostInfo - Construct a new host info object for the given
   /// host triple.
   /// host triple.
   const HostInfo *GetHostInfo(const char *HostTriple) const;
   const HostInfo *GetHostInfo(const char *HostTriple) const;
 
 
   /// ShouldUseClangCompilar - Should the clang compiler be used to
   /// ShouldUseClangCompilar - Should the clang compiler be used to
   /// handle this action.
   /// handle this action.
-  bool ShouldUseClangCompiler(const Compilation &C, const JobAction &JA, 
+  bool ShouldUseClangCompiler(const Compilation &C, const JobAction &JA,
                               const llvm::Triple &ArchName) const;
                               const llvm::Triple &ArchName) const;
 
 
   /// @}
   /// @}
@@ -272,7 +272,7 @@ public:
   /// \return True if the entire string was parsed (9.2), or all
   /// \return True if the entire string was parsed (9.2), or all
   /// groups were parsed (10.3.5extrastuff). HadExtra is true if all
   /// groups were parsed (10.3.5extrastuff). HadExtra is true if all
   /// groups were parsed but extra characters remain at the end.
   /// groups were parsed but extra characters remain at the end.
-  static bool GetReleaseVersion(const char *Str, unsigned &Major, 
+  static bool GetReleaseVersion(const char *Str, unsigned &Major,
                                 unsigned &Minor, unsigned &Micro,
                                 unsigned &Minor, unsigned &Micro,
                                 bool &HadExtra);
                                 bool &HadExtra);
 };
 };

+ 1 - 1
include/clang/Driver/DriverDiagnostic.h

@@ -13,7 +13,7 @@
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/Diagnostic.h"
 
 
 namespace clang {
 namespace clang {
-  namespace diag { 
+  namespace diag {
     enum {
     enum {
 #define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,SFINAE) ENUM,
 #define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,SFINAE) ENUM,
 #define DRIVERSTART
 #define DRIVERSTART

+ 9 - 9
include/clang/Driver/HostInfo.h

@@ -22,7 +22,7 @@ namespace driver {
 
 
 /// HostInfo - Config information about a particular host which may interact
 /// HostInfo - Config information about a particular host which may interact
 /// with driver behavior.
 /// with driver behavior.
-/// 
+///
 /// The host information is used for controlling the parts of the driver which
 /// The host information is used for controlling the parts of the driver which
 /// interact with the platform the driver is ostensibly being run from. For
 /// interact with the platform the driver is ostensibly being run from. For
 /// testing purposes, the HostInfo used by the driver may differ from the actual
 /// testing purposes, the HostInfo used by the driver may differ from the actual
@@ -38,7 +38,7 @@ public:
   virtual ~HostInfo();
   virtual ~HostInfo();
 
 
   const Driver &getDriver() const { return TheDriver; }
   const Driver &getDriver() const { return TheDriver; }
-  
+
   const llvm::Triple& getTriple() const { return Triple; }
   const llvm::Triple& getTriple() const { return Triple; }
   std::string getArchName() const { return Triple.getArchName(); }
   std::string getArchName() const { return Triple.getArchName(); }
   std::string getPlatformName() const { return Triple.getVendorName(); }
   std::string getPlatformName() const { return Triple.getVendorName(); }
@@ -64,23 +64,23 @@ public:
 
 
   // FIXME: Pin down exactly what the HostInfo is allowed to use Args
   // FIXME: Pin down exactly what the HostInfo is allowed to use Args
   // for here. Currently this is for -m32 / -m64 defaulting.
   // for here. Currently this is for -m32 / -m64 defaulting.
-  virtual ToolChain *CreateToolChain(const ArgList &Args, 
+  virtual ToolChain *CreateToolChain(const ArgList &Args,
                                      const char *ArchName=0) const = 0;
                                      const char *ArchName=0) const = 0;
 };
 };
 
 
 const HostInfo *createAuroraUXHostInfo(const Driver &D,
 const HostInfo *createAuroraUXHostInfo(const Driver &D,
                                        const llvm::Triple& Triple);
                                        const llvm::Triple& Triple);
-const HostInfo *createDarwinHostInfo(const Driver &D, 
+const HostInfo *createDarwinHostInfo(const Driver &D,
                                      const llvm::Triple& Triple);
                                      const llvm::Triple& Triple);
-const HostInfo *createOpenBSDHostInfo(const Driver &D, 
+const HostInfo *createOpenBSDHostInfo(const Driver &D,
                                       const llvm::Triple& Triple);
                                       const llvm::Triple& Triple);
-const HostInfo *createFreeBSDHostInfo(const Driver &D, 
+const HostInfo *createFreeBSDHostInfo(const Driver &D,
                                       const llvm::Triple& Triple);
                                       const llvm::Triple& Triple);
-const HostInfo *createDragonFlyHostInfo(const Driver &D, 
+const HostInfo *createDragonFlyHostInfo(const Driver &D,
                                         const llvm::Triple& Triple);
                                         const llvm::Triple& Triple);
-const HostInfo *createLinuxHostInfo(const Driver &D, 
+const HostInfo *createLinuxHostInfo(const Driver &D,
                                     const llvm::Triple& Triple);
                                     const llvm::Triple& Triple);
-const HostInfo *createUnknownHostInfo(const Driver &D, 
+const HostInfo *createUnknownHostInfo(const Driver &D,
                                       const llvm::Triple& Triple);
                                       const llvm::Triple& Triple);
 
 
 } // end namespace driver
 } // end namespace driver

+ 11 - 11
include/clang/Driver/Job.h

@@ -46,7 +46,7 @@ public:
   /// either a piped job or a job list.
   /// either a piped job or a job list.
   void addCommand(Command *C);
   void addCommand(Command *C);
 
 
-  static bool classof(const Job *) { return true; }      
+  static bool classof(const Job *) { return true; }
 };
 };
 
 
   /// Command - An executable path/name and argument vector to
   /// Command - An executable path/name and argument vector to
@@ -63,7 +63,7 @@ class Command : public Job {
   ArgStringList Arguments;
   ArgStringList Arguments;
 
 
 public:
 public:
-  Command(const Action &_Source, const char *_Executable, 
+  Command(const Action &_Source, const char *_Executable,
           const ArgStringList &_Arguments);
           const ArgStringList &_Arguments);
 
 
   /// getSource - Return the Action which caused the creation of this job.
   /// getSource - Return the Action which caused the creation of this job.
@@ -73,8 +73,8 @@ public:
 
 
   const ArgStringList &getArguments() const { return Arguments; }
   const ArgStringList &getArguments() const { return Arguments; }
 
 
-  static bool classof(const Job *J) { 
-    return J->getKind() == CommandClass; 
+  static bool classof(const Job *J) {
+    return J->getKind() == CommandClass;
   }
   }
   static bool classof(const Command *) { return true; }
   static bool classof(const Command *) { return true; }
 };
 };
@@ -97,15 +97,15 @@ public:
   void addCommand(Command *C) { Commands.push_back(C); }
   void addCommand(Command *C) { Commands.push_back(C); }
 
 
   const list_type &getCommands() const { return Commands; }
   const list_type &getCommands() const { return Commands; }
-  
+
   size_type size() const { return Commands.size(); }
   size_type size() const { return Commands.size(); }
   iterator begin() { return Commands.begin(); }
   iterator begin() { return Commands.begin(); }
   const_iterator begin() const { return Commands.begin(); }
   const_iterator begin() const { return Commands.begin(); }
   iterator end() { return Commands.end(); }
   iterator end() { return Commands.end(); }
   const_iterator end() const { return Commands.end(); }
   const_iterator end() const { return Commands.end(); }
 
 
-  static bool classof(const Job *J) { 
-    return J->getKind() == PipedJobClass; 
+  static bool classof(const Job *J) {
+    return J->getKind() == PipedJobClass;
   }
   }
   static bool classof(const PipedJob *) { return true; }
   static bool classof(const PipedJob *) { return true; }
 };
 };
@@ -133,13 +133,13 @@ public:
   const_iterator begin() const { return Jobs.begin(); }
   const_iterator begin() const { return Jobs.begin(); }
   iterator end() { return Jobs.end(); }
   iterator end() { return Jobs.end(); }
   const_iterator end() const { return Jobs.end(); }
   const_iterator end() const { return Jobs.end(); }
-  
-  static bool classof(const Job *J) { 
-    return J->getKind() == JobListClass; 
+
+  static bool classof(const Job *J) {
+    return J->getKind() == JobListClass;
   }
   }
   static bool classof(const JobList *) { return true; }
   static bool classof(const JobList *) { return true; }
 };
 };
-    
+
 } // end namespace driver
 } // end namespace driver
 } // end namespace clang
 } // end namespace clang
 
 

+ 44 - 44
include/clang/Driver/Option.h

@@ -24,7 +24,7 @@ namespace driver {
   class Arg;
   class Arg;
   class InputArgList;
   class InputArgList;
   class OptionGroup;
   class OptionGroup;
-  
+
   /// Option - Abstract representation for a single form of driver
   /// Option - Abstract representation for a single form of driver
   /// argument.
   /// argument.
   ///
   ///
@@ -57,10 +57,10 @@ namespace driver {
     options::ID ID;
     options::ID ID;
 
 
     /// The option name.
     /// The option name.
-    const char *Name; 
+    const char *Name;
 
 
     /// Group this option is a member of, if any.
     /// Group this option is a member of, if any.
-    const OptionGroup *Group; 
+    const OptionGroup *Group;
 
 
     /// Option that this is an alias for, if any.
     /// Option that this is an alias for, if any.
     const Option *Alias;
     const Option *Alias;
@@ -70,7 +70,7 @@ namespace driver {
 
 
     /// Treat this option like a linker input?
     /// Treat this option like a linker input?
     bool LinkerInput : 1;
     bool LinkerInput : 1;
-    
+
     /// When rendering as an input, don't render the option.
     /// When rendering as an input, don't render the option.
 
 
     // FIXME: We should ditch the render/renderAsInput distinction.
     // FIXME: We should ditch the render/renderAsInput distinction.
@@ -78,18 +78,18 @@ namespace driver {
 
 
     /// Always render this option as separate form its value.
     /// Always render this option as separate form its value.
     bool ForceSeparateRender : 1;
     bool ForceSeparateRender : 1;
-    
+
     /// Always render this option joined with its value.
     /// Always render this option joined with its value.
-    bool ForceJoinedRender : 1;    
+    bool ForceJoinedRender : 1;
 
 
     /// This option is only consumed by the driver.
     /// This option is only consumed by the driver.
-    bool DriverOption : 1;    
+    bool DriverOption : 1;
 
 
     /// This option should not report argument unused errors.
     /// This option should not report argument unused errors.
-    bool NoArgumentUnused : 1;    
+    bool NoArgumentUnused : 1;
 
 
   protected:
   protected:
-    Option(OptionClass Kind, options::ID ID, const char *Name, 
+    Option(OptionClass Kind, options::ID ID, const char *Name,
            const OptionGroup *Group, const Option *Alias);
            const OptionGroup *Group, const Option *Alias);
   public:
   public:
     virtual ~Option();
     virtual ~Option();
@@ -108,13 +108,13 @@ namespace driver {
 
 
     bool hasNoOptAsInput() const { return NoOptAsInput; }
     bool hasNoOptAsInput() const { return NoOptAsInput; }
     void setNoOptAsInput(bool Value) { NoOptAsInput = Value; }
     void setNoOptAsInput(bool Value) { NoOptAsInput = Value; }
-    
+
     bool hasForceSeparateRender() const { return ForceSeparateRender; }
     bool hasForceSeparateRender() const { return ForceSeparateRender; }
     void setForceSeparateRender(bool Value) { ForceSeparateRender = Value; }
     void setForceSeparateRender(bool Value) { ForceSeparateRender = Value; }
-    
+
     bool hasForceJoinedRender() const { return ForceJoinedRender; }
     bool hasForceJoinedRender() const { return ForceJoinedRender; }
     void setForceJoinedRender(bool Value) { ForceJoinedRender = Value; }
     void setForceJoinedRender(bool Value) { ForceJoinedRender = Value; }
-    
+
     bool isDriverOption() const { return DriverOption; }
     bool isDriverOption() const { return DriverOption; }
     void setDriverOption(bool Value) { DriverOption = Value; }
     void setDriverOption(bool Value) { DriverOption = Value; }
 
 
@@ -125,7 +125,7 @@ namespace driver {
 
 
     /// getUnaliasedOption - Return the final option this option
     /// getUnaliasedOption - Return the final option this option
     /// aliases (itself, if the option has no alias).
     /// aliases (itself, if the option has no alias).
-    const Option *getUnaliasedOption() const { 
+    const Option *getUnaliasedOption() const {
       if (Alias) return Alias->getUnaliasedOption();
       if (Alias) return Alias->getUnaliasedOption();
       return this;
       return this;
     }
     }
@@ -149,12 +149,12 @@ namespace driver {
     /// Index to the position where argument parsing should resume
     /// Index to the position where argument parsing should resume
     /// (even if the argument is missing values).
     /// (even if the argument is missing values).
     virtual Arg *accept(const InputArgList &Args, unsigned &Index) const = 0;
     virtual Arg *accept(const InputArgList &Args, unsigned &Index) const = 0;
-    
+
     void dump() const;
     void dump() const;
 
 
     static bool classof(const Option *) { return true; }
     static bool classof(const Option *) { return true; }
   };
   };
-  
+
   /// OptionGroup - A set of options which are can be handled uniformly
   /// OptionGroup - A set of options which are can be handled uniformly
   /// by the driver.
   /// by the driver.
   class OptionGroup : public Option {
   class OptionGroup : public Option {
@@ -163,14 +163,14 @@ namespace driver {
 
 
     virtual Arg *accept(const InputArgList &Args, unsigned &Index) const;
     virtual Arg *accept(const InputArgList &Args, unsigned &Index) const;
 
 
-    static bool classof(const Option *O) { 
-      return O->getKind() == Option::GroupClass; 
+    static bool classof(const Option *O) {
+      return O->getKind() == Option::GroupClass;
     }
     }
     static bool classof(const OptionGroup *) { return true; }
     static bool classof(const OptionGroup *) { return true; }
   };
   };
-  
+
   // Dummy option classes.
   // Dummy option classes.
-  
+
   /// InputOption - Dummy option class for representing driver inputs.
   /// InputOption - Dummy option class for representing driver inputs.
   class InputOption : public Option {
   class InputOption : public Option {
   public:
   public:
@@ -178,8 +178,8 @@ namespace driver {
 
 
     virtual Arg *accept(const InputArgList &Args, unsigned &Index) const;
     virtual Arg *accept(const InputArgList &Args, unsigned &Index) const;
 
 
-    static bool classof(const Option *O) { 
-      return O->getKind() == Option::InputClass; 
+    static bool classof(const Option *O) {
+      return O->getKind() == Option::InputClass;
     }
     }
     static bool classof(const InputOption *) { return true; }
     static bool classof(const InputOption *) { return true; }
   };
   };
@@ -191,8 +191,8 @@ namespace driver {
 
 
     virtual Arg *accept(const InputArgList &Args, unsigned &Index) const;
     virtual Arg *accept(const InputArgList &Args, unsigned &Index) const;
 
 
-    static bool classof(const Option *O) { 
-      return O->getKind() == Option::UnknownClass; 
+    static bool classof(const Option *O) {
+      return O->getKind() == Option::UnknownClass;
     }
     }
     static bool classof(const UnknownOption *) { return true; }
     static bool classof(const UnknownOption *) { return true; }
   };
   };
@@ -201,52 +201,52 @@ namespace driver {
 
 
   class FlagOption : public Option {
   class FlagOption : public Option {
   public:
   public:
-    FlagOption(options::ID ID, const char *Name, const OptionGroup *Group, 
+    FlagOption(options::ID ID, const char *Name, const OptionGroup *Group,
                const Option *Alias);
                const Option *Alias);
 
 
     virtual Arg *accept(const InputArgList &Args, unsigned &Index) const;
     virtual Arg *accept(const InputArgList &Args, unsigned &Index) const;
 
 
-    static bool classof(const Option *O) { 
-      return O->getKind() == Option::FlagClass; 
+    static bool classof(const Option *O) {
+      return O->getKind() == Option::FlagClass;
     }
     }
     static bool classof(const FlagOption *) { return true; }
     static bool classof(const FlagOption *) { return true; }
   };
   };
 
 
   class JoinedOption : public Option {
   class JoinedOption : public Option {
   public:
   public:
-    JoinedOption(options::ID ID, const char *Name, const OptionGroup *Group, 
+    JoinedOption(options::ID ID, const char *Name, const OptionGroup *Group,
                  const Option *Alias);
                  const Option *Alias);
 
 
     virtual Arg *accept(const InputArgList &Args, unsigned &Index) const;
     virtual Arg *accept(const InputArgList &Args, unsigned &Index) const;
 
 
-    static bool classof(const Option *O) { 
-      return O->getKind() == Option::JoinedClass; 
+    static bool classof(const Option *O) {
+      return O->getKind() == Option::JoinedClass;
     }
     }
     static bool classof(const JoinedOption *) { return true; }
     static bool classof(const JoinedOption *) { return true; }
   };
   };
 
 
   class SeparateOption : public Option {
   class SeparateOption : public Option {
   public:
   public:
-    SeparateOption(options::ID ID, const char *Name, const OptionGroup *Group, 
+    SeparateOption(options::ID ID, const char *Name, const OptionGroup *Group,
                    const Option *Alias);
                    const Option *Alias);
 
 
     virtual Arg *accept(const InputArgList &Args, unsigned &Index) const;
     virtual Arg *accept(const InputArgList &Args, unsigned &Index) const;
 
 
-    static bool classof(const Option *O) { 
-      return O->getKind() == Option::SeparateClass; 
+    static bool classof(const Option *O) {
+      return O->getKind() == Option::SeparateClass;
     }
     }
     static bool classof(const SeparateOption *) { return true; }
     static bool classof(const SeparateOption *) { return true; }
   };
   };
 
 
   class CommaJoinedOption : public Option {
   class CommaJoinedOption : public Option {
   public:
   public:
-    CommaJoinedOption(options::ID ID, const char *Name, 
+    CommaJoinedOption(options::ID ID, const char *Name,
                       const OptionGroup *Group, const Option *Alias);
                       const OptionGroup *Group, const Option *Alias);
 
 
     virtual Arg *accept(const InputArgList &Args, unsigned &Index) const;
     virtual Arg *accept(const InputArgList &Args, unsigned &Index) const;
 
 
-    static bool classof(const Option *O) { 
-      return O->getKind() == Option::CommaJoinedClass; 
+    static bool classof(const Option *O) {
+      return O->getKind() == Option::CommaJoinedClass;
     }
     }
     static bool classof(const CommaJoinedOption *) { return true; }
     static bool classof(const CommaJoinedOption *) { return true; }
   };
   };
@@ -259,15 +259,15 @@ namespace driver {
     unsigned NumArgs;
     unsigned NumArgs;
 
 
   public:
   public:
-    MultiArgOption(options::ID ID, const char *Name, const OptionGroup *Group, 
+    MultiArgOption(options::ID ID, const char *Name, const OptionGroup *Group,
                    const Option *Alias, unsigned NumArgs);
                    const Option *Alias, unsigned NumArgs);
 
 
     unsigned getNumArgs() const { return NumArgs; }
     unsigned getNumArgs() const { return NumArgs; }
 
 
     virtual Arg *accept(const InputArgList &Args, unsigned &Index) const;
     virtual Arg *accept(const InputArgList &Args, unsigned &Index) const;
 
 
-    static bool classof(const Option *O) { 
-      return O->getKind() == Option::MultiArgClass; 
+    static bool classof(const Option *O) {
+      return O->getKind() == Option::MultiArgClass;
     }
     }
     static bool classof(const MultiArgOption *) { return true; }
     static bool classof(const MultiArgOption *) { return true; }
   };
   };
@@ -276,13 +276,13 @@ namespace driver {
   /// prefixes its (non-empty) value, or is follwed by a value.
   /// prefixes its (non-empty) value, or is follwed by a value.
   class JoinedOrSeparateOption : public Option {
   class JoinedOrSeparateOption : public Option {
   public:
   public:
-    JoinedOrSeparateOption(options::ID ID, const char *Name, 
+    JoinedOrSeparateOption(options::ID ID, const char *Name,
                            const OptionGroup *Group, const Option *Alias);
                            const OptionGroup *Group, const Option *Alias);
 
 
     virtual Arg *accept(const InputArgList &Args, unsigned &Index) const;
     virtual Arg *accept(const InputArgList &Args, unsigned &Index) const;
 
 
-    static bool classof(const Option *O) { 
-      return O->getKind() == Option::JoinedOrSeparateClass; 
+    static bool classof(const Option *O) {
+      return O->getKind() == Option::JoinedOrSeparateClass;
     }
     }
     static bool classof(const JoinedOrSeparateOption *) { return true; }
     static bool classof(const JoinedOrSeparateOption *) { return true; }
   };
   };
@@ -291,13 +291,13 @@ namespace driver {
   /// value and is followed by another value.
   /// value and is followed by another value.
   class JoinedAndSeparateOption : public Option {
   class JoinedAndSeparateOption : public Option {
   public:
   public:
-    JoinedAndSeparateOption(options::ID ID, const char *Name, 
+    JoinedAndSeparateOption(options::ID ID, const char *Name,
                             const OptionGroup *Group, const Option *Alias);
                             const OptionGroup *Group, const Option *Alias);
 
 
     virtual Arg *accept(const InputArgList &Args, unsigned &Index) const;
     virtual Arg *accept(const InputArgList &Args, unsigned &Index) const;
 
 
-    static bool classof(const Option *O) { 
-      return O->getKind() == Option::JoinedAndSeparateClass; 
+    static bool classof(const Option *O) {
+      return O->getKind() == Option::JoinedAndSeparateClass;
     }
     }
     static bool classof(const JoinedAndSeparateOption *) { return true; }
     static bool classof(const JoinedAndSeparateOption *) { return true; }
   };
   };

+ 2 - 2
include/clang/Driver/Options.h

@@ -24,7 +24,7 @@ namespace options {
 #undef OPTION
 #undef OPTION
   };
   };
 }
 }
-  
+
   class Arg;
   class Arg;
   class InputArgList;
   class InputArgList;
   class Option;
   class Option;
@@ -36,7 +36,7 @@ namespace options {
   /// few options will be needed at runtime; the OptTable class
   /// few options will be needed at runtime; the OptTable class
   /// maintains enough information to parse command lines without
   /// maintains enough information to parse command lines without
   /// instantiating Options, while letting other parts of the driver
   /// instantiating Options, while letting other parts of the driver
-  /// still use Option instances where convient.  
+  /// still use Option instances where convient.
   class OptTable {
   class OptTable {
     /// The table of options which have been constructed, indexed by
     /// The table of options which have been constructed, indexed by
     /// option::ID - 1.
     /// option::ID - 1.

+ 4 - 4
include/clang/Driver/Tool.h

@@ -22,7 +22,7 @@ namespace driver {
   class Job;
   class Job;
   class JobAction;
   class JobAction;
   class ToolChain;
   class ToolChain;
-  
+
   typedef llvm::SmallVector<InputInfo, 4> InputInfoList;
   typedef llvm::SmallVector<InputInfo, 4> InputInfoList;
 
 
 /// Tool - Information on a specific compilation tool.
 /// Tool - Information on a specific compilation tool.
@@ -57,9 +57,9 @@ public:
   /// linker, then this is the final output name of the linked image.
   /// linker, then this is the final output name of the linked image.
   virtual void ConstructJob(Compilation &C, const JobAction &JA,
   virtual void ConstructJob(Compilation &C, const JobAction &JA,
                             Job &Dest,
                             Job &Dest,
-                            const InputInfo &Output, 
-                            const InputInfoList &Inputs, 
-                            const ArgList &TCArgs, 
+                            const InputInfo &Output,
+                            const InputInfoList &Inputs,
+                            const ArgList &TCArgs,
                             const char *LinkingOutput) const = 0;
                             const char *LinkingOutput) const = 0;
 };
 };
 
 

+ 2 - 2
include/clang/Frontend/ASTConsumers.h

@@ -38,9 +38,9 @@ class LangOptions;
 // implementation is still incomplete.
 // implementation is still incomplete.
 ASTConsumer *CreateASTPrinter(llvm::raw_ostream *OS);
 ASTConsumer *CreateASTPrinter(llvm::raw_ostream *OS);
 
 
-// AST XML-printer: prints out the AST in a XML format 
+// AST XML-printer: prints out the AST in a XML format
 // The output is intended to be in a format such that
 // The output is intended to be in a format such that
-// clang or any other tool could re-parse the output back into the same AST, 
+// clang or any other tool could re-parse the output back into the same AST,
 // but the implementation is still incomplete.
 // but the implementation is still incomplete.
 ASTConsumer *CreateASTPrinterXML(llvm::raw_ostream *OS);
 ASTConsumer *CreateASTPrinterXML(llvm::raw_ostream *OS);
 
 

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff