diff options
54 files changed, 159 insertions, 164 deletions
diff --git a/include/clang/AST/APValue.h b/include/clang/AST/APValue.h index 5c8c99d85d..375af28f0c 100644 --- a/include/clang/AST/APValue.h +++ b/include/clang/AST/APValue.h @@ -14,6 +14,7 @@ #ifndef LLVM_CLANG_AST_APVALUE_H #define LLVM_CLANG_AST_APVALUE_H +#include "clang/Basic/LLVM.h" #include "llvm/ADT/APSInt.h" #include "llvm/ADT/APFloat.h" @@ -104,7 +105,7 @@ public: bool isLValue() const { return Kind == LValue; } bool isVector() const { return Kind == Vector; } - void print(llvm::raw_ostream &OS) const; + void print(raw_ostream &OS) const; void dump() const; APSInt &getInt() { @@ -234,7 +235,7 @@ private: void MakeLValue(); }; -inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const APValue &V) { +inline raw_ostream &operator<<(raw_ostream &OS, const APValue &V) { V.print(OS); return OS; } diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index ba538e96ec..c2b3d9fe6e 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -1145,7 +1145,7 @@ public: const ASTRecordLayout &getASTObjCInterfaceLayout(const ObjCInterfaceDecl *D) const; - void DumpRecordLayout(const RecordDecl *RD, llvm::raw_ostream &OS) const; + void DumpRecordLayout(const RecordDecl *RD, raw_ostream &OS) const; /// getASTObjCImplementationLayout - Get or compute information about /// the layout of the specified Objective-C implementation. This may diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index 4418f77827..938de814e2 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -132,7 +132,7 @@ public: // FIXME: Deprecated, move clients to getName(). std::string getNameAsString() const { return Name.getAsString(); } - void printName(llvm::raw_ostream &os) const { return Name.printName(os); } + void printName(raw_ostream &os) const { return Name.printName(os); } /// getDeclName - Get the actual, stored name of the declaration, /// which may be a special name. @@ -294,7 +294,7 @@ public: static bool classofKind(Kind K) { return K >= firstNamed && K <= lastNamed; } }; -inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, +inline raw_ostream &operator<<(raw_ostream &OS, const NamedDecl *ND) { ND->getDeclName().printName(OS); return OS; diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index d698775e19..8ba94525cc 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -734,15 +734,15 @@ public: static DeclContext *castToDeclContext(const Decl *); static Decl *castFromDeclContext(const DeclContext *); - void print(llvm::raw_ostream &Out, unsigned Indentation = 0) const; - void print(llvm::raw_ostream &Out, const PrintingPolicy &Policy, + void print(raw_ostream &Out, unsigned Indentation = 0) const; + void print(raw_ostream &Out, const PrintingPolicy &Policy, unsigned Indentation = 0) const; static void printGroup(Decl** Begin, unsigned NumDecls, - llvm::raw_ostream &Out, const PrintingPolicy &Policy, + raw_ostream &Out, const PrintingPolicy &Policy, unsigned Indentation = 0); void dump() const; void dumpXML() const; - void dumpXML(llvm::raw_ostream &OS) const; + void dumpXML(raw_ostream &OS) const; private: const Attr *getAttrsImpl() const; @@ -763,7 +763,7 @@ public: SourceManager &sm, const char *Msg) : TheDecl(theDecl), Loc(L), SM(sm), Message(Msg) {} - virtual void print(llvm::raw_ostream &OS) const; + virtual void print(raw_ostream &OS) const; }; class DeclContextLookupResult diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h index a0496aac92..3c3983677d 100644 --- a/include/clang/AST/DeclObjC.h +++ b/include/clang/AST/DeclObjC.h @@ -1228,7 +1228,7 @@ public: static bool classofKind(Kind K) { return K == ObjCCategoryImpl;} }; -llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, +raw_ostream &operator<<(raw_ostream &OS, const ObjCCategoryImplDecl *CID); /// ObjCImplementationDecl - Represents a class definition - this is where @@ -1368,7 +1368,7 @@ public: friend class ASTDeclWriter; }; -llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, +raw_ostream &operator<<(raw_ostream &OS, const ObjCImplementationDecl *ID); /// ObjCCompatibleAliasDecl - Represents alias of a class. This alias is diff --git a/include/clang/AST/DeclarationName.h b/include/clang/AST/DeclarationName.h index bb098313ea..7c670c4741 100644 --- a/include/clang/AST/DeclarationName.h +++ b/include/clang/AST/DeclarationName.h @@ -203,7 +203,7 @@ public: std::string getAsString() const; /// printName - Print the human-readable name to a stream. - void printName(llvm::raw_ostream &OS) const; + void printName(raw_ostream &OS) const; /// getAsIdentifierInfo - Retrieve the IdentifierInfo * stored in /// this declaration name, or NULL if this declaration name isn't a @@ -503,7 +503,7 @@ public: std::string getAsString() const; /// printName - Print the human-readable name to a stream. - void printName(llvm::raw_ostream &OS) const; + void printName(raw_ostream &OS) const; /// getBeginLoc - Retrieve the location of the first token. SourceLocation getBeginLoc() const { return NameLoc; } @@ -533,7 +533,7 @@ inline const PartialDiagnostic &operator<<(const PartialDiagnostic &PD, return PD; } -inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, +inline raw_ostream &operator<<(raw_ostream &OS, DeclarationNameInfo DNInfo) { DNInfo.printName(OS); return OS; diff --git a/include/clang/AST/Mangle.h b/include/clang/AST/Mangle.h index e7a8e32097..d40e101b2b 100644 --- a/include/clang/AST/Mangle.h +++ b/include/clang/AST/Mangle.h @@ -95,46 +95,46 @@ public: /// @{ virtual bool shouldMangleDeclName(const NamedDecl *D) = 0; - virtual void mangleName(const NamedDecl *D, llvm::raw_ostream &)=0; + virtual void mangleName(const NamedDecl *D, raw_ostream &)=0; virtual void mangleThunk(const CXXMethodDecl *MD, const ThunkInfo &Thunk, - llvm::raw_ostream &) = 0; + raw_ostream &) = 0; virtual void mangleCXXDtorThunk(const CXXDestructorDecl *DD, CXXDtorType Type, const ThisAdjustment &ThisAdjustment, - llvm::raw_ostream &) = 0; + raw_ostream &) = 0; virtual void mangleReferenceTemporary(const VarDecl *D, - llvm::raw_ostream &) = 0; + raw_ostream &) = 0; virtual void mangleCXXVTable(const CXXRecordDecl *RD, - llvm::raw_ostream &) = 0; + raw_ostream &) = 0; virtual void mangleCXXVTT(const CXXRecordDecl *RD, - llvm::raw_ostream &) = 0; + raw_ostream &) = 0; virtual void mangleCXXCtorVTable(const CXXRecordDecl *RD, int64_t Offset, const CXXRecordDecl *Type, - llvm::raw_ostream &) = 0; - virtual void mangleCXXRTTI(QualType T, llvm::raw_ostream &) = 0; - virtual void mangleCXXRTTIName(QualType T, llvm::raw_ostream &) = 0; + raw_ostream &) = 0; + virtual void mangleCXXRTTI(QualType T, raw_ostream &) = 0; + virtual void mangleCXXRTTIName(QualType T, raw_ostream &) = 0; virtual void mangleCXXCtor(const CXXConstructorDecl *D, CXXCtorType Type, - llvm::raw_ostream &) = 0; + raw_ostream &) = 0; virtual void mangleCXXDtor(const CXXDestructorDecl *D, CXXDtorType Type, - llvm::raw_ostream &) = 0; + raw_ostream &) = 0; void mangleGlobalBlock(const BlockDecl *BD, - llvm::raw_ostream &Out); + raw_ostream &Out); void mangleCtorBlock(const CXXConstructorDecl *CD, CXXCtorType CT, - const BlockDecl *BD, llvm::raw_ostream &Out); + const BlockDecl *BD, raw_ostream &Out); void mangleDtorBlock(const CXXDestructorDecl *CD, CXXDtorType DT, - const BlockDecl *BD, llvm::raw_ostream &Out); + const BlockDecl *BD, raw_ostream &Out); void mangleBlock(const DeclContext *DC, const BlockDecl *BD, - llvm::raw_ostream &Out); + raw_ostream &Out); // Do the right thing. - void mangleBlock(const BlockDecl *BD, llvm::raw_ostream &Out); + void mangleBlock(const BlockDecl *BD, raw_ostream &Out); void mangleObjCMethodName(const ObjCMethodDecl *MD, - llvm::raw_ostream &); + raw_ostream &); // This is pretty lame. virtual void mangleItaniumGuardVariable(const VarDecl *D, - llvm::raw_ostream &) { + raw_ostream &) { assert(0 && "Target does not support mangling guard variables"); } /// @} diff --git a/include/clang/AST/NestedNameSpecifier.h b/include/clang/AST/NestedNameSpecifier.h index 018041f8ba..ae65d00dd7 100644 --- a/include/clang/AST/NestedNameSpecifier.h +++ b/include/clang/AST/NestedNameSpecifier.h @@ -196,7 +196,7 @@ public: /// \brief Print this nested name specifier to the given output /// stream. - void print(llvm::raw_ostream &OS, const PrintingPolicy &Policy) const; + void print(raw_ostream &OS, const PrintingPolicy &Policy) const; void Profile(llvm::FoldingSetNodeID &ID) const { ID.AddPointer(Prefix.getOpaqueValue()); diff --git a/include/clang/AST/PrettyPrinter.h b/include/clang/AST/PrettyPrinter.h index fc8ac36b3b..a5ffd3764e 100644 --- a/include/clang/AST/PrettyPrinter.h +++ b/include/clang/AST/PrettyPrinter.h @@ -29,7 +29,7 @@ class LangOptions; class PrinterHelper { public: virtual ~PrinterHelper(); - virtual bool handledStmt(Stmt* E, llvm::raw_ostream& OS) = 0; + virtual bool handledStmt(Stmt* E, raw_ostream& OS) = 0; }; /// \brief Describes how types, statements, expressions, and diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h index cca59509d2..08391d7a24 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -269,7 +269,7 @@ public: /// This is useful in a debugger. void dump() const; void dump(SourceManager &SM) const; - void dump(llvm::raw_ostream &OS, SourceManager &SM) const; + void dump(raw_ostream &OS, SourceManager &SM) const; /// dumpAll - This does a dump of the specified AST fragment and all subtrees. void dumpAll() const; @@ -278,12 +278,12 @@ public: /// dumpPretty/printPretty - These two methods do a "pretty print" of the AST /// back to its original source language syntax. void dumpPretty(ASTContext& Context) const; - void printPretty(llvm::raw_ostream &OS, PrinterHelper *Helper, + void printPretty(raw_ostream &OS, PrinterHelper *Helper, const PrintingPolicy &Policy, unsigned Indentation = 0) const { printPretty(OS, *(ASTContext*)0, Helper, Policy, Indentation); } - void printPretty(llvm::raw_ostream &OS, ASTContext &Context, + void printPretty(raw_ostream &OS, ASTContext &Context, PrinterHelper *Helper, const PrintingPolicy &Policy, unsigned Indentation = 0) const; diff --git a/include/clang/AST/TemplateBase.h b/include/clang/AST/TemplateBase.h index 9412ec8152..a9b6cad048 100644 --- a/include/clang/AST/TemplateBase.h +++ b/include/clang/AST/TemplateBase.h @@ -354,7 +354,7 @@ public: TemplateArgument getPackExpansionPattern() const; /// \brief Print this template argument to the given output stream. - void print(const PrintingPolicy &Policy, llvm::raw_ostream &Out) const; + void print(const PrintingPolicy &Policy, raw_ostream &Out) const; /// \brief Used to insert TemplateArguments into FoldingSets. void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) const; diff --git a/include/clang/AST/TemplateName.h b/include/clang/AST/TemplateName.h index a180f587ed..7dc75b1925 100644 --- a/include/clang/AST/TemplateName.h +++ b/include/clang/AST/TemplateName.h @@ -14,14 +14,11 @@ #ifndef LLVM_CLANG_AST_TEMPLATENAME_H #define LLVM_CLANG_AST_TEMPLATENAME_H +#include "clang/Basic/LLVM.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/PointerUnion.h" #include "clang/Basic/OperatorKinds.h" -namespace llvm { - class raw_ostream; -} - namespace clang { class ASTContext; @@ -308,7 +305,7 @@ public: /// \param SuppressNNS if true, don't print the /// nested-name-specifier that precedes the template name (if it has /// one). - void print(llvm::raw_ostream &OS, const PrintingPolicy &Policy, + void print(raw_ostream &OS, const PrintingPolicy &Policy, bool SuppressNNS = false) const; /// \brief Debugging aid that dumps the template name to standard diff --git a/include/clang/Analysis/Analyses/FormatString.h b/include/clang/Analysis/Analyses/FormatString.h index 36d37ad95a..61f4164472 100644 --- a/include/clang/Analysis/Analyses/FormatString.h +++ b/include/clang/Analysis/Analyses/FormatString.h @@ -271,7 +271,7 @@ public: ArgTypeResult getArgType(ASTContext &Ctx) const; - void toString(llvm::raw_ostream &os) const; + void toString(raw_ostream &os) const; bool usesPositionalArg() const { return (bool) UsesPositionalArg; } unsigned getPositionalArgIndex() const { @@ -465,7 +465,7 @@ public: /// was not successful. bool fixType(QualType QT); - void toString(llvm::raw_ostream &os) const; + void toString(raw_ostream &os) const; // Validation methods - to check if any element results in undefined behavior bool hasValidPlusPrefix() const; diff --git a/include/clang/Analysis/CFG.h b/include/clang/Analysis/CFG.h index 83f5b1549e..ec3fa779a6 100644 --- a/include/clang/Analysis/CFG.h +++ b/include/clang/Analysis/CFG.h @@ -478,8 +478,8 @@ public: unsigned getBlockID() const { return BlockID; } void dump(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 print(raw_ostream &OS, const CFG* cfg, const LangOptions &LO) const; + void printTerminator(raw_ostream &OS, const LangOptions &LO) const; void addSuccessor(CFGBlock* Block, BumpVectorContext &C) { if (Block) @@ -652,7 +652,7 @@ public: //===--------------------------------------------------------------------===// void viewCFG(const LangOptions &LO) const; - void print(llvm::raw_ostream& OS, const LangOptions &LO) const; + void print(raw_ostream& OS, const LangOptions &LO) const; void dump(const LangOptions &LO) const; //===--------------------------------------------------------------------===// diff --git a/include/clang/Basic/LLVM.h b/include/clang/Basic/LLVM.h index a4aaa2f890..7df5936964 100644 --- a/include/clang/Basic/LLVM.h +++ b/include/clang/Basic/LLVM.h @@ -22,10 +22,12 @@ namespace llvm { // ADT's. class StringRef; + class Twine; template<typename T, unsigned N> class SmallVector; template<typename T> class SmallVectorImpl; - - // TODO: Twine, raw_ostream, DenseMap, ... + + class raw_ostream; + // TODO: DenseMap, ... } @@ -37,10 +39,13 @@ namespace clang { using llvm::dyn_cast_or_null; using llvm::cast_or_null; + // ADT's. using llvm::StringRef; + using llvm::Twine; using llvm::SmallVector; using llvm::SmallVectorImpl; + using llvm::raw_ostream; } // end namespace clang. #endif diff --git a/include/clang/Basic/MacroBuilder.h b/include/clang/Basic/MacroBuilder.h index 3287b304c9..1d0f1e899c 100644 --- a/include/clang/Basic/MacroBuilder.h +++ b/include/clang/Basic/MacroBuilder.h @@ -20,23 +20,23 @@ namespace clang { class MacroBuilder { - llvm::raw_ostream &Out; + raw_ostream &Out; public: - MacroBuilder(llvm::raw_ostream &Output) : Out(Output) {} + MacroBuilder(raw_ostream &Output) : Out(Output) {} /// Append a #define line for macro of the form "#define Name Value\n". - void defineMacro(const llvm::Twine &Name, const llvm::Twine &Value = "1") { + void defineMacro(const Twine &Name, const Twine &Value = "1") { Out << "#define " << Name << ' ' << Value << '\n'; } /// Append a #undef line for Name. Name should be of the form XXX /// and we emit "#undef XXX". - void undefineMacro(const llvm::Twine &Name) { + void undefineMacro(const Twine &Name) { Out << "#undef " << Name << '\n'; } /// Directly append Str and a newline to the underlying buffer. - void append(const llvm::Twine &Str) { + void append(const Twine &Str) { Out << Str << '\n'; } }; diff --git a/include/clang/Basic/OnDiskHashTable.h b/include/clang/Basic/OnDiskHashTable.h index 267ecbcd6d..3705a8941e 100644 --- a/include/clang/Basic/OnDiskHashTable.h +++ b/include/clang/Basic/OnDiskHashTable.h @@ -28,31 +28,31 @@ namespace io { typedef uint32_t Offset; -inline void Emit8(llvm::raw_ostream& Out, uint32_t V) { +inline void Emit8(raw_ostream& Out, uint32_t V) { Out << (unsigned char)(V); } -inline void Emit16(llvm::raw_ostream& Out, uint32_t V) { +inline void Emit16(raw_ostream& Out, uint32_t V) { Out << (unsigned char)(V); Out << (unsigned char)(V >> 8); assert((V >> 16) == 0); } -inline void Emit24(llvm::raw_ostream& Out, uint32_t V) { +inline void Emit24(raw_ostream& Out, uint32_t V) { Out << (unsigned char)(V); Out << (unsigned char)(V >> 8); Out << (unsigned char)(V >> 16); assert((V >> 24) == 0); } -inline void Emit32(llvm::raw_ostream& Out, uint32_t V) { +inline void Emit32(raw_ostream& Out, uint32_t V) { Out << (unsigned char)(V); Out << (unsigned char)(V >> 8); Out << (unsigned char)(V >> 16); Out << (unsigned char)(V >> 24); } -inline void Emit64(llvm::raw_ostream& Out, uint64_t V) { +inline void Emit64(raw_ostream& Out, uint64_t V) { Out << (unsigned char)(V); Out << (unsigned char)(V >> 8); Out << (unsigned char)(V >> 16); @@ -63,7 +63,7 @@ inline void Emit64(llvm::raw_ostream& Out, uint64_t V) { Out << (unsigned char)(V >> 56); } -inline void Pad(llvm::raw_ostream& Out, unsigned A) { +inline void Pad(raw_ostream& Out, unsigned A) { Offset off = (Offset) Out.tell(); uint32_t n = ((uintptr_t)(off+A-1) & ~(uintptr_t)(A-1)) - off; for (; n ; --n) @@ -182,12 +182,12 @@ public: InfoObj)); } - io::Offset Emit(llvm::raw_ostream &out) { + io::Offset Emit(raw_ostream &out) { Info InfoObj; return Emit(out, InfoObj); } - io::Offset Emit(llvm::raw_ostream &out, Info &InfoObj) { + io::Offset Emit(raw_ostream &out, Info &InfoObj) { using namespace clang::io; // Emit the payload of the table. diff --git a/include/clang/Basic/PrettyStackTrace.h b/include/clang/Basic/PrettyStackTrace.h index 5a5d55192b..06a12644c3 100644 --- a/include/clang/Basic/PrettyStackTrace.h +++ b/include/clang/Basic/PrettyStackTrace.h @@ -30,7 +30,7 @@ namespace clang { public: PrettyStackTraceLoc(SourceManager &sm, SourceLocation L, const char *Msg) : SM(sm), Loc(L), Message(Msg) {} - virtual void print(llvm::raw_ostream &OS) const; + virtual void print(raw_ostream &OS) const; }; } diff --git a/include/clang/Basic/SourceLocation.h b/include/clang/Basic/SourceLocation.h index 5e3fe0c0c9..3a4780c20d 100644 --- a/include/clang/Basic/SourceLocation.h +++ b/include/clang/Basic/SourceLocation.h @@ -164,7 +164,7 @@ public: return getFromRawEncoding((unsigned)(uintptr_t)Encoding); } - void print(llvm::raw_ostream &OS, const SourceManager &SM) const; + void print(raw_ostream &OS, const SourceManager &SM) const; void dump(const SourceManager &SM) const; }; diff --git a/include/clang/Basic/VersionTuple.h b/include/clang/Basic/VersionTuple.h index 91eb68eaad..30ef6641ef 100644 --- a/include/clang/Basic/VersionTuple.h +++ b/include/clang/Basic/VersionTuple.h @@ -14,13 +14,10 @@ #ifndef LLVM_CLANG_BASIC_VERSIONTUPLE_H |