[cfe-commits] r39659 - in /cfe/cfe/trunk: AST/ Basic/ CodeGen/ Driver/ Lex/ Parse/ Sema/ include/clang/AST/ include/clang/Basic/ include/clang/CodeGen/ include/clang/Lex/ include/clang/Parse/ include/clang/Sema/

clattner at cs.uiuc.edu clattner at cs.uiuc.edu
Wed Jul 11 09:46:47 PDT 2007


Author: clattner
Date: Wed Jul 11 11:46:45 2007
New Revision: 39659

URL: http://llvm.org/viewvc/llvm-project?rev=39659&view=rev
Log:
Finally bite the bullet and make the major change: split the clang namespace
out of the llvm namespace.  This makes the clang namespace be a sibling of
llvm instead of being a child.

The good thing about this is that it makes many things unambiguous.  The
bad things is that many things in the llvm namespace (notably data structures
like smallvector) now require an llvm:: qualifier.  IMO, libsystem and libsupport
should be split out of llvm into their own namespace in the future, which will fix
this issue.

Modified:
    cfe/cfe/trunk/AST/ASTContext.cpp
    cfe/cfe/trunk/AST/Attr.cpp
    cfe/cfe/trunk/AST/Builtins.cpp
    cfe/cfe/trunk/AST/Decl.cpp
    cfe/cfe/trunk/AST/Expr.cpp
    cfe/cfe/trunk/AST/Stmt.cpp
    cfe/cfe/trunk/AST/StmtPrinter.cpp
    cfe/cfe/trunk/AST/StmtVisitor.cpp
    cfe/cfe/trunk/AST/Type.cpp
    cfe/cfe/trunk/Basic/Diagnostic.cpp
    cfe/cfe/trunk/Basic/FileManager.cpp
    cfe/cfe/trunk/Basic/SourceManager.cpp
    cfe/cfe/trunk/Basic/TargetInfo.cpp
    cfe/cfe/trunk/Basic/TokenKinds.cpp
    cfe/cfe/trunk/CodeGen/CGDecl.cpp
    cfe/cfe/trunk/CodeGen/CGExpr.cpp
    cfe/cfe/trunk/CodeGen/CGStmt.cpp
    cfe/cfe/trunk/CodeGen/CodeGenFunction.cpp
    cfe/cfe/trunk/CodeGen/CodeGenFunction.h
    cfe/cfe/trunk/CodeGen/CodeGenModule.cpp
    cfe/cfe/trunk/CodeGen/CodeGenModule.h
    cfe/cfe/trunk/CodeGen/ModuleBuilder.cpp
    cfe/cfe/trunk/Driver/LLVMCodegen.cpp
    cfe/cfe/trunk/Driver/PrintParserCallbacks.cpp
    cfe/cfe/trunk/Driver/PrintPreprocessedOutput.cpp
    cfe/cfe/trunk/Driver/Targets.cpp
    cfe/cfe/trunk/Driver/TextDiagnosticPrinter.cpp
    cfe/cfe/trunk/Driver/TextDiagnosticPrinter.h
    cfe/cfe/trunk/Driver/TextDiagnostics.cpp
    cfe/cfe/trunk/Driver/TextDiagnostics.h
    cfe/cfe/trunk/Driver/clang.cpp
    cfe/cfe/trunk/Driver/clang.h
    cfe/cfe/trunk/Lex/HeaderSearch.cpp
    cfe/cfe/trunk/Lex/IdentifierTable.cpp
    cfe/cfe/trunk/Lex/Lexer.cpp
    cfe/cfe/trunk/Lex/LiteralSupport.cpp
    cfe/cfe/trunk/Lex/MacroExpander.cpp
    cfe/cfe/trunk/Lex/MacroInfo.cpp
    cfe/cfe/trunk/Lex/PPExpressions.cpp
    cfe/cfe/trunk/Lex/Pragma.cpp
    cfe/cfe/trunk/Lex/Preprocessor.cpp
    cfe/cfe/trunk/Lex/ScratchBuffer.cpp
    cfe/cfe/trunk/Parse/AttributeList.cpp
    cfe/cfe/trunk/Parse/DeclSpec.cpp
    cfe/cfe/trunk/Parse/MinimalAction.cpp
    cfe/cfe/trunk/Parse/ParseDecl.cpp
    cfe/cfe/trunk/Parse/ParseExpr.cpp
    cfe/cfe/trunk/Parse/ParseExprCXX.cpp
    cfe/cfe/trunk/Parse/ParseInit.cpp
    cfe/cfe/trunk/Parse/ParseObjc.cpp
    cfe/cfe/trunk/Parse/ParseStmt.cpp
    cfe/cfe/trunk/Parse/Parser.cpp
    cfe/cfe/trunk/Sema/ASTStreamer.cpp
    cfe/cfe/trunk/Sema/Sema.cpp
    cfe/cfe/trunk/Sema/Sema.h
    cfe/cfe/trunk/Sema/SemaDecl.cpp
    cfe/cfe/trunk/Sema/SemaExpr.cpp
    cfe/cfe/trunk/Sema/SemaExprCXX.cpp
    cfe/cfe/trunk/Sema/SemaStmt.cpp
    cfe/cfe/trunk/Sema/SemaType.cpp
    cfe/cfe/trunk/include/clang/AST/ASTContext.h
    cfe/cfe/trunk/include/clang/AST/Attr.h
    cfe/cfe/trunk/include/clang/AST/Builtins.h
    cfe/cfe/trunk/include/clang/AST/Decl.h
    cfe/cfe/trunk/include/clang/AST/Expr.h
    cfe/cfe/trunk/include/clang/AST/ExprCXX.h
    cfe/cfe/trunk/include/clang/AST/Stmt.h
    cfe/cfe/trunk/include/clang/AST/StmtVisitor.h
    cfe/cfe/trunk/include/clang/AST/Type.h
    cfe/cfe/trunk/include/clang/Basic/Diagnostic.h
    cfe/cfe/trunk/include/clang/Basic/FileManager.h
    cfe/cfe/trunk/include/clang/Basic/LangOptions.h
    cfe/cfe/trunk/include/clang/Basic/SourceLocation.h
    cfe/cfe/trunk/include/clang/Basic/SourceManager.h
    cfe/cfe/trunk/include/clang/Basic/TargetInfo.h
    cfe/cfe/trunk/include/clang/Basic/TokenKinds.h
    cfe/cfe/trunk/include/clang/CodeGen/ModuleBuilder.h
    cfe/cfe/trunk/include/clang/Lex/DirectoryLookup.h
    cfe/cfe/trunk/include/clang/Lex/HeaderSearch.h
    cfe/cfe/trunk/include/clang/Lex/IdentifierTable.h
    cfe/cfe/trunk/include/clang/Lex/Lexer.h
    cfe/cfe/trunk/include/clang/Lex/LexerToken.h
    cfe/cfe/trunk/include/clang/Lex/LiteralSupport.h
    cfe/cfe/trunk/include/clang/Lex/MacroExpander.h
    cfe/cfe/trunk/include/clang/Lex/MacroInfo.h
    cfe/cfe/trunk/include/clang/Lex/MultipleIncludeOpt.h
    cfe/cfe/trunk/include/clang/Lex/PPCallbacks.h
    cfe/cfe/trunk/include/clang/Lex/Pragma.h
    cfe/cfe/trunk/include/clang/Lex/Preprocessor.h
    cfe/cfe/trunk/include/clang/Lex/ScratchBuffer.h
    cfe/cfe/trunk/include/clang/Parse/Action.h
    cfe/cfe/trunk/include/clang/Parse/AttributeList.h
    cfe/cfe/trunk/include/clang/Parse/DeclSpec.h
    cfe/cfe/trunk/include/clang/Parse/Parser.h
    cfe/cfe/trunk/include/clang/Parse/Scope.h
    cfe/cfe/trunk/include/clang/Sema/ASTStreamer.h

Modified: cfe/cfe/trunk/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/ASTContext.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/ASTContext.cpp (original)
+++ cfe/cfe/trunk/AST/ASTContext.cpp Wed Jul 11 11:46:45 2007
@@ -16,8 +16,6 @@
 #include "clang/Lex/Preprocessor.h"
 #include "clang/Basic/TargetInfo.h"
 #include "llvm/ADT/SmallVector.h"
-
-using namespace llvm;
 using namespace clang;
 
 enum FloatingRank {
@@ -144,7 +142,7 @@
 QualType ASTContext::getPointerType(QualType T) {
   // Unique pointers, to guarantee there is only one pointer of a particular
   // structure.
-  FoldingSetNodeID ID;
+  llvm::FoldingSetNodeID ID;
   PointerType::Profile(ID, T);
   
   void *InsertPos = 0;
@@ -172,7 +170,7 @@
 QualType ASTContext::getReferenceType(QualType T) {
   // Unique pointers, to guarantee there is only one pointer of a particular
   // structure.
-  FoldingSetNodeID ID;
+  llvm::FoldingSetNodeID ID;
   ReferenceType::Profile(ID, T);
 
   void *InsertPos = 0;
@@ -202,7 +200,7 @@
                                   unsigned EltTypeQuals, Expr *NumElts) {
   // Unique array types, to guarantee there is only one array of a particular
   // structure.
-  FoldingSetNodeID ID;
+  llvm::FoldingSetNodeID ID;
   ArrayType::Profile(ID, ASM, EltTypeQuals, EltTy, NumElts);
       
   void *InsertPos = 0;
@@ -232,7 +230,7 @@
 QualType ASTContext::getFunctionTypeNoProto(QualType ResultTy) {
   // Unique functions, to guarantee there is only one function of a particular
   // structure.
-  FoldingSetNodeID ID;
+  llvm::FoldingSetNodeID ID;
   FunctionTypeNoProto::Profile(ID, ResultTy);
   
   void *InsertPos = 0;
@@ -262,7 +260,7 @@
                                      unsigned NumArgs, bool isVariadic) {
   // Unique functions, to guarantee there is only one function of a particular
   // structure.
-  FoldingSetNodeID ID;
+  llvm::FoldingSetNodeID ID;
   FunctionTypeProto::Profile(ID, ResultTy, ArgArray, NumArgs, isVariadic);
 
   void *InsertPos = 0;
@@ -279,7 +277,7 @@
   // If this type isn't canonical, get the canonical version of it.
   QualType Canonical;
   if (!isCanonical) {
-    SmallVector<QualType, 16> CanonicalArgs;
+    llvm::SmallVector<QualType, 16> CanonicalArgs;
     CanonicalArgs.reserve(NumArgs);
     for (unsigned i = 0; i != NumArgs; ++i)
       CanonicalArgs.push_back(ArgArray[i].getCanonicalType());

Modified: cfe/cfe/trunk/AST/Attr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/Attr.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/Attr.cpp (original)
+++ cfe/cfe/trunk/AST/Attr.cpp Wed Jul 11 11:46:45 2007
@@ -14,6 +14,5 @@
 #include "clang/AST/Attr.h"
 #include "clang/AST/Expr.h"
 #include "clang/Lex/IdentifierTable.h"
-using namespace llvm;
 using namespace clang;
 

Modified: cfe/cfe/trunk/AST/Builtins.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/Builtins.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/Builtins.cpp (original)
+++ cfe/cfe/trunk/AST/Builtins.cpp Wed Jul 11 11:46:45 2007
@@ -15,7 +15,6 @@
 #include "clang/AST/ASTContext.h"
 #include "clang/Lex/IdentifierTable.h"
 #include "clang/Basic/TargetInfo.h"
-using namespace llvm;
 using namespace clang;
 
 static const Builtin::Info BuiltinInfo[] = {
@@ -112,7 +111,7 @@
 QualType Builtin::Context::GetBuiltinType(unsigned id, ASTContext &Context)const{
   const char *TypeStr = GetRecord(id).Type;
   
-  SmallVector<QualType, 8> ArgTypes;
+  llvm::SmallVector<QualType, 8> ArgTypes;
   
   QualType ResType = DecodeTypeFromStr(TypeStr, Context);
   while (TypeStr[0] && TypeStr[0] != '.')

Modified: cfe/cfe/trunk/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/Decl.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/Decl.cpp (original)
+++ cfe/cfe/trunk/AST/Decl.cpp Wed Jul 11 11:46:45 2007
@@ -13,7 +13,6 @@
 
 #include "clang/AST/Decl.h"
 #include "clang/Lex/IdentifierTable.h"
-using namespace llvm;
 using namespace clang;
 
 // temporary statistics gathering

Modified: cfe/cfe/trunk/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/Expr.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/Expr.cpp (original)
+++ cfe/cfe/trunk/AST/Expr.cpp Wed Jul 11 11:46:45 2007
@@ -14,7 +14,6 @@
 #include "clang/AST/Expr.h"
 #include "clang/AST/StmtVisitor.h"
 #include "clang/Lex/IdentifierTable.h"
-using namespace llvm;
 using namespace clang;
 
 //===----------------------------------------------------------------------===//
@@ -209,7 +208,7 @@
 ///
 /// FIXME: This should ext-warn on overflow during evaluation!  ISO C does not
 /// permit this.
-bool Expr::isIntegerConstantExpr(APSInt &Result, SourceLocation *Loc,
+bool Expr::isIntegerConstantExpr(llvm::APSInt &Result, SourceLocation *Loc,
                                  bool isEvaluated) const {
   switch (getStmtClass()) {
   default:
@@ -299,7 +298,7 @@
     if (!Exp->getLHS()->isIntegerConstantExpr(Result, Loc, isEvaluated))
       return false;
     
-    APSInt RHS(Result);
+    llvm::APSInt RHS(Result);
     
     // The short-circuiting &&/|| operators don't necessarily evaluate their
     // RHS.  Make sure to pass isEvaluated down correctly.
@@ -469,6 +468,6 @@
   
   // If we have an integer constant expression, we need to *evaluate* it and
   // test for the value 0.
-  APSInt Val(32);
+  llvm::APSInt Val(32);
   return isIntegerConstantExpr(Val, 0, true) && Val == 0;
 }

Modified: cfe/cfe/trunk/AST/Stmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/Stmt.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/Stmt.cpp (original)
+++ cfe/cfe/trunk/AST/Stmt.cpp Wed Jul 11 11:46:45 2007
@@ -15,7 +15,6 @@
 #include "clang/AST/ExprCXX.h"
 #include "clang/AST/StmtVisitor.h"
 #include "clang/Lex/IdentifierTable.h"
-using namespace llvm;
 using namespace clang;
 
 // Implement all the AST node visit methods using the StmtNodes.def database.

Modified: cfe/cfe/trunk/AST/StmtPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/StmtPrinter.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/StmtPrinter.cpp (original)
+++ cfe/cfe/trunk/AST/StmtPrinter.cpp Wed Jul 11 11:46:45 2007
@@ -17,7 +17,6 @@
 #include "clang/Lex/IdentifierTable.h"
 #include "llvm/Support/Compiler.h"
 #include <iostream>
-using namespace llvm;
 using namespace clang;
 
 //===----------------------------------------------------------------------===//
@@ -422,6 +421,7 @@
 //===----------------------------------------------------------------------===//
 
 void Stmt::dump() const {
+  // FIXME: eliminate use of <iostream>
   print(std::cerr);
 }
 

Modified: cfe/cfe/trunk/AST/StmtVisitor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/StmtVisitor.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/StmtVisitor.cpp (original)
+++ cfe/cfe/trunk/AST/StmtVisitor.cpp Wed Jul 11 11:46:45 2007
@@ -13,7 +13,6 @@
 
 #include "clang/AST/StmtVisitor.h"
 #include "clang/AST/ExprCXX.h"
-using namespace llvm;
 using namespace clang;
 
 StmtVisitor::~StmtVisitor() {

Modified: cfe/cfe/trunk/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/Type.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/Type.cpp (original)
+++ cfe/cfe/trunk/AST/Type.cpp Wed Jul 11 11:46:45 2007
@@ -17,8 +17,6 @@
 #include "clang/AST/Expr.h"
 #include "clang/Basic/TargetInfo.h"
 #include "llvm/Support/Streams.h"
-
-using namespace llvm;
 using namespace clang;
 
 Type::~Type() {}
@@ -386,7 +384,7 @@
   }
 }
 
-void FunctionTypeProto::Profile(FoldingSetNodeID &ID, QualType Result,
+void FunctionTypeProto::Profile(llvm::FoldingSetNodeID &ID, QualType Result,
                                 QualType* ArgTys,
                                 unsigned NumArgs, bool isVariadic) {
   ID.AddPointer(Result.getAsOpaquePtr());
@@ -395,7 +393,7 @@
   ID.AddInteger(isVariadic);
 }
 
-void FunctionTypeProto::Profile(FoldingSetNodeID &ID) {
+void FunctionTypeProto::Profile(llvm::FoldingSetNodeID &ID) {
   Profile(ID, getResultType(), ArgInfo, NumArgs, isVariadic());
 }
 
@@ -415,9 +413,9 @@
   std::string R = "foo";
   getAsStringInternal(R);
   if (msg)
-    cerr << msg << ": " << R << "\n";
+    fprintf(stderr, "%s: %s\n", msg, R.c_str());
   else
-    cerr << R << "\n";
+    fprintf(stderr, "%s\n", R.c_str());
 }
 
 static void AppendTypeQualList(std::string &S, unsigned TypeQuals) {

Modified: cfe/cfe/trunk/Basic/Diagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Basic/Diagnostic.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Basic/Diagnostic.cpp (original)
+++ cfe/cfe/trunk/Basic/Diagnostic.cpp Wed Jul 11 11:46:45 2007
@@ -14,7 +14,6 @@
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/SourceLocation.h"
 #include <cassert>
-using namespace llvm;
 using namespace clang;
 
 /// Flag values for diagnostics.

Modified: cfe/cfe/trunk/Basic/FileManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Basic/FileManager.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Basic/FileManager.cpp (original)
+++ cfe/cfe/trunk/Basic/FileManager.cpp Wed Jul 11 11:46:45 2007
@@ -20,7 +20,6 @@
 #include "clang/Basic/FileManager.h"
 #include "llvm/ADT/SmallString.h"
 #include <iostream>
-using namespace llvm;
 using namespace clang;
 
 // FIXME: Enhance libsystem to support inode and other fields.
@@ -37,7 +36,7 @@
 const DirectoryEntry *FileManager::getDirectory(const char *NameStart,
                                                 const char *NameEnd) {
   ++NumDirLookups;
-  StringMapEntry<DirectoryEntry *> &NamedDirEnt =
+  llvm::StringMapEntry<DirectoryEntry *> &NamedDirEnt =
     DirEntries.GetOrCreateValue(NameStart, NameEnd);
   
   // See if there is already an entry in the map.
@@ -87,7 +86,7 @@
   ++NumFileLookups;
   
   // See if there is already an entry in the map.
-  StringMapEntry<FileEntry *> &NamedFileEnt =
+  llvm::StringMapEntry<FileEntry *> &NamedFileEnt =
     FileEntries.GetOrCreateValue(NameStart, NameEnd);
 
   // See if there is already an entry in the map.

Modified: cfe/cfe/trunk/Basic/SourceManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Basic/SourceManager.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Basic/SourceManager.cpp (original)
+++ cfe/cfe/trunk/Basic/SourceManager.cpp Wed Jul 11 11:46:45 2007
@@ -17,9 +17,9 @@
 #include "llvm/System/Path.h"
 #include <algorithm>
 #include <iostream>
-using namespace llvm;
 using namespace clang;
 using namespace SrcMgr;
+using llvm::MemoryBuffer;
 
 SourceManager::~SourceManager() {
   for (std::map<const FileEntry *, FileInfo>::iterator I = FileInfos.begin(),

Modified: cfe/cfe/trunk/Basic/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Basic/TargetInfo.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Basic/TargetInfo.cpp (original)
+++ cfe/cfe/trunk/Basic/TargetInfo.cpp Wed Jul 11 11:46:45 2007
@@ -16,7 +16,6 @@
 #include "clang/AST/Builtins.h"
 #include <map>
 #include <set>
-using namespace llvm;
 using namespace clang;
 
 void TargetInfoImpl::ANCHOR() {} // out-of-line virtual method for class.

Modified: cfe/cfe/trunk/Basic/TokenKinds.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Basic/TokenKinds.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Basic/TokenKinds.cpp (original)
+++ cfe/cfe/trunk/Basic/TokenKinds.cpp Wed Jul 11 11:46:45 2007
@@ -13,8 +13,7 @@
 
 #include "clang/Basic/TokenKinds.h"
 #include <cassert>
-using namespace llvm;
-using namespace llvm::clang;
+using namespace clang;
 
 static const char * const TokNames[] = {
 #define TOK(X) #X,

Modified: cfe/cfe/trunk/CodeGen/CGDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/CodeGen/CGDecl.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/CodeGen/CGDecl.cpp (original)
+++ cfe/cfe/trunk/CodeGen/CGDecl.cpp Wed Jul 11 11:46:45 2007
@@ -14,7 +14,6 @@
 #include "CodeGenFunction.h"
 #include "clang/AST/AST.h"
 #include "llvm/Type.h"
-using namespace llvm;
 using namespace clang;
 using namespace CodeGen;
 
@@ -75,7 +74,7 @@
     // A normal fixed sized variable becomes an alloca in the entry block.
     const llvm::Type *LTy = ConvertType(Ty, D.getLocation());
     // TODO: Alignment
-    DeclPtr = new AllocaInst(LTy, 0, D.getName(), AllocaInsertPt);
+    DeclPtr = new llvm::AllocaInst(LTy, 0, D.getName(), AllocaInsertPt);
   } else {
     // TODO: Create a dynamic alloca.
     assert(0 && "FIXME: Local VLAs not implemented yet");
@@ -102,8 +101,8 @@
     const llvm::Type *LTy = ConvertType(Ty, D.getLocation());
     if (LTy->isFirstClassType()) {
       // TODO: Alignment
-      DeclPtr = new AllocaInst(LTy, 0, 
-                               std::string(D.getName())+".addr",AllocaInsertPt);
+      DeclPtr = new llvm::AllocaInst(LTy, 0, std::string(D.getName())+".addr",
+                                     AllocaInsertPt);
       
       // Store the initial value into the alloca.
       Builder.CreateStore(Arg, DeclPtr);

Modified: cfe/cfe/trunk/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/CodeGen/CGExpr.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/CodeGen/CGExpr.cpp (original)
+++ cfe/cfe/trunk/CodeGen/CGExpr.cpp Wed Jul 11 11:46:45 2007
@@ -17,7 +17,6 @@
 #include "llvm/DerivedTypes.h"
 #include "llvm/Function.h"
 #include "llvm/GlobalVariable.h"
-using namespace llvm;
 using namespace clang;
 using namespace CodeGen;
 
@@ -28,7 +27,7 @@
 
 /// EvaluateExprAsBool - Perform the usual unary conversions on the specified
 /// expression and compare the result against zero, returning an Int1Ty value.
-Value *CodeGenFunction::EvaluateExprAsBool(const Expr *E) {
+llvm::Value *CodeGenFunction::EvaluateExprAsBool(const Expr *E) {
   QualType Ty;
   RValue Val = EmitExprWithUsualUnaryConversions(E, Ty);
   return ConvertScalarValueToBool(Val, Ty);
@@ -77,11 +76,11 @@
   if (Val.isScalar() && DstTy->isRealType()) {
     // We know that these are representable as scalars in LLVM, convert to LLVM
     // types since they are easier to reason about.
-    Value *SrcVal = Val.getVal();
+    llvm::Value *SrcVal = Val.getVal();
     const llvm::Type *DestTy = ConvertType(DstTy, Loc);
     if (SrcVal->getType() == DestTy) return Val;
     
-    Value *Result;
+    llvm::Value *Result;
     if (isa<llvm::IntegerType>(SrcVal->getType())) {
       bool InputSigned = ValTy->isSignedIntegerType();
       if (isa<llvm::IntegerType>(DestTy))
@@ -114,9 +113,9 @@
 
 /// ConvertScalarValueToBool - Convert the specified expression value to a
 /// boolean (i1) truth value.  This is equivalent to "Val == 0".
-Value *CodeGenFunction::ConvertScalarValueToBool(RValue Val, QualType Ty) {
+llvm::Value *CodeGenFunction::ConvertScalarValueToBool(RValue Val, QualType Ty){
   Ty = Ty.getCanonicalType();
-  Value *Result;
+  llvm::Value *Result;
   if (const BuiltinType *BT = dyn_cast<BuiltinType>(Ty)) {
     switch (BT->getKind()) {
     default: assert(0 && "Unknown scalar value");
@@ -145,7 +144,7 @@
     case BuiltinType::LongDouble: {
       // Compare against 0.0 for fp scalars.
       Result = Val.getVal();
-      llvm::Value *Zero = Constant::getNullValue(Result->getType());
+      llvm::Value *Zero = llvm::Constant::getNullValue(Result->getType());
       // FIXME: llvm-gcc produces a une comparison: validate this is right.
       Result = Builder.CreateFCmpUNE(Result, Zero, "tobool");
       return Result;
@@ -169,7 +168,7 @@
   // Because of the type rules of C, we often end up computing a logical value,
   // then zero extending it to int, then wanting it as a logical value again.
   // Optimize this common case.
-  if (llvm::ZExtInst *ZI = dyn_cast<ZExtInst>(Result)) {
+  if (llvm::ZExtInst *ZI = dyn_cast<llvm::ZExtInst>(Result)) {
     if (ZI->getOperand(0)->getType() == llvm::Type::Int1Ty) {
       Result = ZI->getOperand(0);
       ZI->eraseFromParent();
@@ -177,7 +176,7 @@
     }
   }
   
-  llvm::Value *Zero = Constant::getNullValue(Result->getType());
+  llvm::Value *Zero = llvm::Constant::getNullValue(Result->getType());
   return Builder.CreateICmpNE(Result, Zero, "tobool");
 }
 
@@ -206,7 +205,7 @@
   default:
     fprintf(stderr, "Unimplemented lvalue expr!\n");
     E->dump();
-    return LValue::getAddr(UndefValue::get(
+    return LValue::getAddr(llvm::UndefValue::get(
                               llvm::PointerType::get(llvm::Type::Int32Ty)));
 
   case Expr::DeclRefExprClass: return EmitDeclRefLValue(cast<DeclRefExpr>(E));
@@ -244,7 +243,7 @@
   assert(Src.isScalar() && "FIXME: Don't support store of aggregate yet");
   
   // TODO: Handle volatility etc.
-  Value *Addr = Dst.getAddress();
+  llvm::Value *Addr = Dst.getAddress();
   const llvm::Type *SrcTy = Src.getVal()->getType();
   const llvm::Type *AddrTy = 
     cast<llvm::PointerType>(Addr->getType())->getElementType();
@@ -259,7 +258,7 @@
 LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) {
   const Decl *D = E->getDecl();
   if (isa<BlockVarDecl>(D) || isa<ParmVarDecl>(D)) {
-    Value *V = LocalDeclMap[D];
+    llvm::Value *V = LocalDeclMap[D];
     assert(V && "BlockVarDecl not entered in LocalDeclMap?");
     return LValue::getAddr(V);
   }
@@ -282,14 +281,15 @@
   unsigned Len = E->getByteLength();
   
   // FIXME: Can cache/reuse these within the module.
-  Constant *C = llvm::ConstantArray::get(std::string(StrData, StrData+Len));
+  llvm::Constant *C=llvm::ConstantArray::get(std::string(StrData, StrData+Len));
   
   // Create a global variable for this.
-  C = new llvm::GlobalVariable(C->getType(), true, GlobalValue::InternalLinkage,
+  C = new llvm::GlobalVariable(C->getType(), true, 
+                               llvm::GlobalValue::InternalLinkage,
                                C, ".str", CurFn->getParent());
-  Constant *Zero = llvm::Constant::getNullValue(llvm::Type::Int32Ty);
-  Constant *Zeros[] = { Zero, Zero };
-  C = ConstantExpr::getGetElementPtr(C, Zeros, 2);
+  llvm::Constant *Zero = llvm::Constant::getNullValue(llvm::Type::Int32Ty);
+  llvm::Constant *Zeros[] = { Zero, Zero };
+  C = llvm::ConstantExpr::getGetElementPtr(C, Zeros, 2);
   return LValue::getAddr(C);
 }
 
@@ -297,9 +297,11 @@
   // The base and index must be pointers or integers, neither of which are
   // aggregates.  Emit them.
   QualType BaseTy;
-  Value *Base =EmitExprWithUsualUnaryConversions(E->getBase(), BaseTy).getVal();
+  llvm::Value *Base =
+    EmitExprWithUsualUnaryConversions(E->getBase(), BaseTy).getVal();
   QualType IdxTy;
-  Value *Idx = EmitExprWithUsualUnaryConversions(E->getIdx(), IdxTy).getVal();
+  llvm::Value *Idx = 
+    EmitExprWithUsualUnaryConversions(E->getIdx(), IdxTy).getVal();
   
   // Usually the base is the pointer type, but sometimes it is the index.
   // Canonicalize to have the pointer as the base.
@@ -311,9 +313,9 @@
   // The pointer is now the base.  Extend or truncate the index type to 32 or
   // 64-bits.
   bool IdxSigned = IdxTy->isSignedIntegerType();
-  unsigned IdxBitwidth = cast<IntegerType>(Idx->getType())->getBitWidth();
+  unsigned IdxBitwidth = cast<llvm::IntegerType>(Idx->getType())->getBitWidth();
   if (IdxBitwidth != LLVMPointerWidth)
-    Idx = Builder.CreateIntCast(Idx, IntegerType::get(LLVMPointerWidth),
+    Idx = Builder.CreateIntCast(Idx, llvm::IntegerType::get(LLVMPointerWidth),
                                 IdxSigned, "idxprom");
 
   // We know that the pointer points to a type of the correct size, unless the
@@ -334,14 +336,14 @@
   default:
     printf("Unimplemented expr!\n");
     E->dump();
-    return RValue::get(UndefValue::get(llvm::Type::Int32Ty));
+    return RValue::get(llvm::UndefValue::get(llvm::Type::Int32Ty));
     
   // l-values.
   case Expr::DeclRefExprClass:
     // DeclRef's of EnumConstantDecl's are simple rvalues.
     if (const EnumConstantDecl *EC = 
           dyn_cast<EnumConstantDecl>(cast<DeclRefExpr>(E)->getDecl()))
-      return RValue::get(ConstantInt::get(EC->getInitVal()));
+      return RValue::get(llvm::ConstantInt::get(EC->getInitVal()));
     
     // FALLTHROUGH
   case Expr::ArraySubscriptExprClass:
@@ -369,7 +371,7 @@
 }
 
 RValue CodeGenFunction::EmitIntegerLiteral(const IntegerLiteral *E) {
-  return RValue::get(ConstantInt::get(E->getValue()));
+  return RValue::get(llvm::ConstantInt::get(E->getValue()));
 }
 
 RValue CodeGenFunction::EmitCastExpr(const CastExpr *E) {
@@ -385,9 +387,10 @@
 
 RValue CodeGenFunction::EmitCallExpr(const CallExpr *E) {
   QualType Ty;
-  Value *Callee =EmitExprWithUsualUnaryConversions(E->getCallee(), Ty).getVal();
+  llvm::Value *Callee =
+    EmitExprWithUsualUnaryConversions(E->getCallee(), Ty).getVal();
   
-  SmallVector<Value*, 16> Args;
+  llvm::SmallVector<llvm::Value*, 16> Args;
   
   // FIXME: Handle struct return.
   for (unsigned i = 0, e = E->getNumArgs(); i != e; ++i) {
@@ -399,7 +402,7 @@
       Args.push_back(ArgVal.getAggregateVal());
   }
   
-  Value *V = Builder.CreateCall(Callee, &Args[0], Args.size());
+  llvm::Value *V = Builder.CreateCall(Callee, &Args[0], Args.size());
   if (V->getType() != llvm::Type::VoidTy)
     V->setName("call");
   
@@ -460,7 +463,7 @@
   default:
     printf("Unimplemented unary expr!\n");
     E->dump();
-    return RValue::get(UndefValue::get(llvm::Type::Int32Ty));
+    return RValue::get(llvm::UndefValue::get(llvm::Type::Int32Ty));
   // FIXME: pre/post inc/dec
   case UnaryOperator::AddrOf: return EmitUnaryAddrOf(E);
   case UnaryOperator::Deref : return EmitLoadOfLValue(E);
@@ -512,7 +515,7 @@
 /// C99 6.5.3.3
 RValue CodeGenFunction::EmitUnaryLNot(const UnaryOperator *E) {
   // Compare operand to zero.
-  Value *BoolVal = EvaluateExprAsBool(E->getSubExpr());
+  llvm::Value *BoolVal = EvaluateExprAsBool(E->getSubExpr());
   
   // Invert value.
   // TODO: Could dynamically modify easy computations here.  For example, if
@@ -630,7 +633,7 @@
   default:
     fprintf(stderr, "Unimplemented expr!\n");
     E->dump();
-    return RValue::get(UndefValue::get(llvm::Type::Int32Ty));
+    return RValue::get(llvm::UndefValue::get(llvm::Type::Int32Ty));
   case BinaryOperator::Mul: return EmitBinaryMul(E);
   case BinaryOperator::Div: return EmitBinaryDiv(E);
   case BinaryOperator::Rem: return EmitBinaryRem(E);
@@ -668,7 +671,7 @@
   EmitUsualArithmeticConversions(E, LHS, RHS);
   
   if (LHS.isScalar()) {
-    Value *RV;
+    llvm::Value *RV;
     if (LHS.getVal()->getType()->isFloatingPoint())
       RV = Builder.CreateFDiv(LHS.getVal(), RHS.getVal(), "div");
     else if (E->getType()->isUnsignedIntegerType())
@@ -685,7 +688,7 @@
   EmitUsualArithmeticConversions(E, LHS, RHS);
   
   if (LHS.isScalar()) {
-    Value *RV;
+    llvm::Value *RV;
     // Rem in C can't be a floating point type: C99 6.5.5p2.
     if (E->getType()->isUnsignedIntegerType())
       RV = Builder.CreateURem(LHS.getVal(), RHS.getVal(), "rem");
@@ -728,8 +731,10 @@
   // conversions are not.  The LHS and RHS need not have the same type.
   
   QualType ResTy;
-  Value *LHS = EmitExprWithUsualUnaryConversions(E->getLHS(), ResTy).getVal();
-  Value *RHS = EmitExprWithUsualUnaryConversions(E->getRHS(), ResTy).getVal();
+  llvm::Value *LHS = 
+    EmitExprWithUsualUnaryConversions(E->getLHS(), ResTy).getVal();
+  llvm::Value *RHS = 
+    EmitExprWithUsualUnaryConversions(E->getRHS(), ResTy).getVal();
 
   // LLVM requires the LHS and RHS to be the same type, promote or truncate the
   // RHS to the same size as the LHS.
@@ -744,8 +749,10 @@
   // conversions are not.  The LHS and RHS need not have the same type.
   
   QualType ResTy;
-  Value *LHS = EmitExprWithUsualUnaryConversions(E->getLHS(), ResTy).getVal();
-  Value *RHS = EmitExprWithUsualUnaryConversions(E->getRHS(), ResTy).getVal();
+  llvm::Value *LHS = 
+    EmitExprWithUsualUnaryConversions(E->getLHS(), ResTy).getVal();
+  llvm::Value *RHS = 
+    EmitExprWithUsualUnaryConversions(E->getRHS(), ResTy).getVal();
   
   // LLVM requires the LHS and RHS to be the same type, promote or truncate the
   // RHS to the same size as the LHS.
@@ -789,16 +796,16 @@
 }
 
 RValue CodeGenFunction::EmitBinaryLAnd(const BinaryOperator *E) {
-  Value *LHSCond = EvaluateExprAsBool(E->getLHS());
+  llvm::Value *LHSCond = EvaluateExprAsBool(E->getLHS());
   
-  BasicBlock *ContBlock = new BasicBlock("land_cont");
-  BasicBlock *RHSBlock = new BasicBlock("land_rhs");
+  llvm::BasicBlock *ContBlock = new llvm::BasicBlock("land_cont");
+  llvm::BasicBlock *RHSBlock = new llvm::BasicBlock("land_rhs");
 
-  BasicBlock *OrigBlock = Builder.GetInsertBlock();
+  llvm::BasicBlock *OrigBlock = Builder.GetInsertBlock();
   Builder.CreateCondBr(LHSCond, RHSBlock, ContBlock);
   
   EmitBlock(RHSBlock);
-  Value *RHSCond = EvaluateExprAsBool(E->getRHS());
+  llvm::Value *RHSCond = EvaluateExprAsBool(E->getRHS());
   
   // Reaquire the RHS block, as there may be subblocks inserted.
   RHSBlock = Builder.GetInsertBlock();
@@ -806,9 +813,9 @@
   
   // Create a PHI node.  If we just evaluted the LHS condition, the result is
   // false.  If we evaluated both, the result is the RHS condition.
-  PHINode *PN = Builder.CreatePHI(llvm::Type::Int1Ty, "land");
+  llvm::PHINode *PN = Builder.CreatePHI(llvm::Type::Int1Ty, "land");
   PN->reserveOperandSpace(2);
-  PN->addIncoming(ConstantInt::getFalse(), OrigBlock);
+  PN->addIncoming(llvm::ConstantInt::getFalse(), OrigBlock);
   PN->addIncoming(RHSCond, RHSBlock);
   
   // ZExt result to int.
@@ -816,16 +823,16 @@
 }
 
 RValue CodeGenFunction::EmitBinaryLOr(const BinaryOperator *E) {
-  Value *LHSCond = EvaluateExprAsBool(E->getLHS());
+  llvm::Value *LHSCond = EvaluateExprAsBool(E->getLHS());
   
-  BasicBlock *ContBlock = new BasicBlock("lor_cont");
-  BasicBlock *RHSBlock = new BasicBlock("lor_rhs");
+  llvm::BasicBlock *ContBlock = new llvm::BasicBlock("lor_cont");
+  llvm::BasicBlock *RHSBlock = new llvm::BasicBlock("lor_rhs");
   
-  BasicBlock *OrigBlock = Builder.GetInsertBlock();
+  llvm::BasicBlock *OrigBlock = Builder.GetInsertBlock();
   Builder.CreateCondBr(LHSCond, ContBlock, RHSBlock);
   
   EmitBlock(RHSBlock);
-  Value *RHSCond = EvaluateExprAsBool(E->getRHS());
+  llvm::Value *RHSCond = EvaluateExprAsBool(E->getRHS());
   
   // Reaquire the RHS block, as there may be subblocks inserted.
   RHSBlock = Builder.GetInsertBlock();
@@ -833,9 +840,9 @@
   
   // Create a PHI node.  If we just evaluted the LHS condition, the result is
   // true.  If we evaluated both, the result is the RHS condition.
-  PHINode *PN = Builder.CreatePHI(llvm::Type::Int1Ty, "lor");
+  llvm::PHINode *PN = Builder.CreatePHI(llvm::Type::Int1Ty, "lor");
   PN->reserveOperandSpace(2);
-  PN->addIncoming(ConstantInt::getTrue(), OrigBlock);
+  PN->addIncoming(llvm::ConstantInt::getTrue(), OrigBlock);
   PN->addIncoming(RHSCond, RHSBlock);
   
   // ZExt result to int.

Modified: cfe/cfe/trunk/CodeGen/CGStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/CodeGen/CGStmt.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/CodeGen/CGStmt.cpp (original)
+++ cfe/cfe/trunk/CodeGen/CGStmt.cpp Wed Jul 11 11:46:45 2007
@@ -16,7 +16,6 @@
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Function.h"
-using namespace llvm;
 using namespace clang;
 using namespace CodeGen;
 
@@ -61,10 +60,10 @@
     EmitStmt(*I);
 }
 
-void CodeGenFunction::EmitBlock(BasicBlock *BB) {
+void CodeGenFunction::EmitBlock(llvm::BasicBlock *BB) {
   // Emit a branch from this block to the next one if this was a real block.  If
   // this was just a fall-through block after a terminator, don't emit it.
-  BasicBlock *LastBB = Builder.GetInsertBlock();
+  llvm::BasicBlock *LastBB = Builder.GetInsertBlock();
   
   if (LastBB->getTerminator()) {
     // If the previous block is already terminated, don't touch it.
@@ -92,7 +91,7 @@
   
   // Emit a block after the branch so that dead code after a goto has some place
   // to go.
-  Builder.SetInsertPoint(new BasicBlock("", CurFn));
+  Builder.SetInsertPoint(new llvm::BasicBlock("", CurFn));
 }
 
 void CodeGenFunction::EmitIfStmt(const IfStmt &S) {
@@ -100,12 +99,12 @@
   // unequal to 0.  The condition must be a scalar type.
   llvm::Value *BoolCondVal = EvaluateExprAsBool(S.getCond());
   
-  BasicBlock *ContBlock = new BasicBlock("ifend");
-  BasicBlock *ThenBlock = new BasicBlock("ifthen");
-  BasicBlock *ElseBlock = ContBlock;
+  llvm::BasicBlock *ContBlock = new llvm::BasicBlock("ifend");
+  llvm::BasicBlock *ThenBlock = new llvm::BasicBlock("ifthen");
+  llvm::BasicBlock *ElseBlock = ContBlock;
   
   if (S.getElse())
-    ElseBlock = new BasicBlock("ifelse");
+    ElseBlock = new llvm::BasicBlock("ifelse");
   
   // Insert the conditional branch.
   Builder.CreateCondBr(BoolCondVal, ThenBlock, ElseBlock);
@@ -131,7 +130,7 @@
   
   // Emit the header for the loop, insert it, which will create an uncond br to
   // it.
-  BasicBlock *LoopHeader = new BasicBlock("whilecond");
+  llvm::BasicBlock *LoopHeader = new llvm::BasicBlock("whilecond");
   EmitBlock(LoopHeader);
   
   // Evaluate the conditional in the while header.  C99 6.8.5.1: The evaluation
@@ -144,8 +143,8 @@
   
   // Create an exit block for when the condition fails, create a block for the
   // body of the loop.
-  BasicBlock *ExitBlock = new BasicBlock("whileexit");
-  BasicBlock *LoopBody  = new BasicBlock("whilebody");
+  llvm::BasicBlock *ExitBlock = new llvm::BasicBlock("whileexit");
+  llvm::BasicBlock *LoopBody  = new llvm::BasicBlock("whilebody");
   
   // As long as the condition is true, go to the loop body.
   Builder.CreateCondBr(BoolCondVal, LoopBody, ExitBlock);
@@ -168,8 +167,8 @@
 
   // Emit the body for the loop, insert it, which will create an uncond br to
   // it.
-  BasicBlock *LoopBody = new BasicBlock("dobody");
-  BasicBlock *AfterDo = new BasicBlock("afterdo");
+  llvm::BasicBlock *LoopBody = new llvm::BasicBlock("dobody");
+  llvm::BasicBlock *AfterDo = new llvm::BasicBlock("afterdo");
   EmitBlock(LoopBody);
   
   // Emit the body of the loop into the block.
@@ -200,8 +199,8 @@
     EmitStmt(S.getInit());
 
   // Start the loop with a block that tests the condition.
-  BasicBlock *CondBlock = new BasicBlock("forcond");
-  BasicBlock *AfterFor = 0;
+  llvm::BasicBlock *CondBlock = new llvm::BasicBlock("forcond");
+  llvm::BasicBlock *AfterFor = 0;
   EmitBlock(CondBlock);
 
   // Evaluate the condition if present.  If not, treat it as a non-zero-constant
@@ -212,8 +211,8 @@
     llvm::Value *BoolCondVal = EvaluateExprAsBool(S.getCond());
     
     // As long as the condition is true, iterate the loop.
-    BasicBlock *ForBody = new BasicBlock("forbody");
-    AfterFor = new BasicBlock("afterfor");
+    llvm::BasicBlock *ForBody = new llvm::BasicBlock("forbody");
+    AfterFor = new llvm::BasicBlock("afterfor");
     Builder.CreateCondBr(BoolCondVal, ForBody, AfterFor);
     EmitBlock(ForBody);    
   } else {
@@ -235,7 +234,7 @@
   if (AfterFor) 
     EmitBlock(AfterFor);
   else
-    EmitBlock(new BasicBlock());
+    EmitBlock(new llvm::BasicBlock());
 }
 
 /// EmitReturnStmt - Note that due to GCC extensions, this can have an operand
@@ -276,7 +275,7 @@
   
   // Emit a block after the branch so that dead code after a return has some
   // place to go.
-  EmitBlock(new BasicBlock());
+  EmitBlock(new llvm::BasicBlock());
 }
 
 void CodeGenFunction::EmitDeclStmt(const DeclStmt &S) {

Modified: cfe/cfe/trunk/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/CodeGen/CodeGenFunction.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/cfe/trunk/CodeGen/CodeGenFunction.cpp Wed Jul 11 11:46:45 2007
@@ -19,7 +19,6 @@
 #include "llvm/DerivedTypes.h"
 #include "llvm/Function.h"
 #include "llvm/Analysis/Verifier.h"
-using namespace llvm;
 using namespace clang;
 using namespace CodeGen;
 
@@ -32,11 +31,11 @@
 
 
 llvm::BasicBlock *CodeGenFunction::getBasicBlockForLabel(const LabelStmt *S) {
-  BasicBlock *&BB = LabelMap[S];
+  llvm::BasicBlock *&BB = LabelMap[S];
   if (BB) return BB;
   
   // Create, but don't insert, the new block.
-  return BB = new BasicBlock(S->getName());
+  return BB = new llvm::BasicBlock(S->getName());
 }
 
 
@@ -55,7 +54,7 @@
     case BuiltinType::Char_U:
     case BuiltinType::SChar:
     case BuiltinType::UChar:
-      return IntegerType::get(Target.getCharWidth(Loc));
+      return llvm::IntegerType::get(Target.getCharWidth(Loc));
 
     case BuiltinType::Bool:
       // FIXME: This is very strange.  We want scalars to be i1, but in memory
@@ -64,19 +63,19 @@
       
     case BuiltinType::Short:
     case BuiltinType::UShort:
-      return IntegerType::get(Target.getShortWidth(Loc));
+      return llvm::IntegerType::get(Target.getShortWidth(Loc));
       
     case BuiltinType::Int:
     case BuiltinType::UInt:
-      return IntegerType::get(Target.getIntWidth(Loc));
+      return llvm::IntegerType::get(Target.getIntWidth(Loc));
 
     case BuiltinType::Long:
     case BuiltinType::ULong:
-      return IntegerType::get(Target.getLongWidth(Loc));
+      return llvm::IntegerType::get(Target.getLongWidth(Loc));
 
     case BuiltinType::LongLong:
     case BuiltinType::ULongLong:
-      return IntegerType::get(Target.getLongLongWidth(Loc));
+      return llvm::IntegerType::get(Target.getLongLongWidth(Loc));
       
     case BuiltinType::Float:      return llvm::Type::FloatTy;
     case BuiltinType::Double:     return llvm::Type::DoubleTy;
@@ -138,7 +137,7 @@
   }
   
   // FIXME: implement.
-  return OpaqueType::get();
+  return llvm::OpaqueType::get();
 }
 
 void CodeGenFunction::DecodeArgumentTypes(const FunctionTypeProto &FTP, 
@@ -163,17 +162,17 @@
   // FIXME: param attributes for sext/zext etc.
   
   CurFuncDecl = FD;
-  CurFn = new Function(Ty, Function::ExternalLinkage,
-                       FD->getName(), &CGM.getModule());
+  CurFn = new llvm::Function(Ty, llvm::Function::ExternalLinkage,
+                             FD->getName(), &CGM.getModule());
   
-  BasicBlock *EntryBB = new BasicBlock("entry", CurFn);
+  llvm::BasicBlock *EntryBB = new llvm::BasicBlock("entry", CurFn);
   
   Builder.SetInsertPoint(EntryBB);
 
   // Create a marker to make it easy to insert allocas into the entryblock
   // later.
-  AllocaInsertPt = Builder.CreateBitCast(UndefValue::get(llvm::Type::Int32Ty),
-                                         llvm::Type::Int32Ty, "allocapt");
+  llvm::Value *Undef = llvm::UndefValue::get(llvm::Type::Int32Ty);
+  AllocaInsertPt = Builder.CreateBitCast(Undef,llvm::Type::Int32Ty, "allocapt");
   
   // Emit allocs for param decls. 
   llvm::Function::arg_iterator AI = CurFn->arg_begin();
@@ -190,9 +189,7 @@
   if (Ty->getReturnType() == llvm::Type::VoidTy)
     Builder.CreateRetVoid();
   else
-    Builder.CreateRet(UndefValue::get(Ty->getReturnType()));
-      
-  
+    Builder.CreateRet(llvm::UndefValue::get(Ty->getReturnType()));
   
   // Verify that the function is well formed.
   assert(!verifyFunction(*CurFn));

Modified: cfe/cfe/trunk/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/CodeGen/CodeGenFunction.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/CodeGen/CodeGenFunction.h (original)
+++ cfe/cfe/trunk/CodeGen/CodeGenFunction.h Wed Jul 11 11:46:45 2007
@@ -20,6 +20,8 @@
 
 namespace llvm {
   class Module;
+}
+
 namespace clang {
   class SourceLocation;
   class TargetInfo;
@@ -62,7 +64,7 @@
 /// LLVM SSA value, or the address of an aggregate value in memory.  These two
 /// possibilities are discriminated by isAggregate/isScalar.
 class RValue {
-  Value *V;
+  llvm::Value *V;
   // TODO: Encode this into the low bit of pointer for more efficient
   // return-by-value.
   bool IsAggregate;
@@ -72,24 +74,24 @@
   bool isScalar() const { return !IsAggregate; }
   
   /// getVal() - Return the Value* of this scalar value.
-  Value *getVal() const {
+  llvm::Value *getVal() const {
     assert(!isAggregate() && "Not a scalar!");
     return V;
   }
 
   /// getAggregateVal() - Return the Value* of the address of the aggregate.
-  Value *getAggregateVal() const {
+  llvm::Value *getAggregateVal() const {
     assert(isAggregate() && "Not an aggregate!");
     return V;
   }
   
-  static RValue get(Value *V) {
+  static RValue get(llvm::Value *V) {
     RValue ER;
     ER.V = V;
     ER.IsAggregate = false;
     return ER;
   }
-  static RValue getAggregate(Value *V) {
+  static RValue getAggregate(llvm::Value *V) {
     RValue ER;
     ER.V = V;
     ER.IsAggregate = true;
@@ -110,7 +112,7 @@
   
   llvm::Value *getAddress() const { assert(!isBitfield()); return V; }
   
-  static LValue getAddr(Value *V) {
+  static LValue getAddr(llvm::Value *V) {
     LValue R;
     R.V = V;
     return R;
@@ -122,7 +124,7 @@
 class CodeGenFunction {
   CodeGenModule &CGM;  // Per-module state.
   TargetInfo &Target;
-  LLVMBuilder Builder;
+  llvm::LLVMBuilder Builder;
   
   const FunctionDecl *CurFuncDecl;
   llvm::Function *CurFn;
@@ -136,10 +138,10 @@
   
   /// LocalDeclMap - This keeps track of the LLVM allocas or globals for local C
   /// decls.
-  DenseMap<const Decl*, llvm::Value*> LocalDeclMap;
+  llvm::DenseMap<const Decl*, llvm::Value*> LocalDeclMap;
 
   /// LabelMap - This keeps track of the LLVM basic block for each C label.
-  DenseMap<const LabelStmt*, llvm::BasicBlock*> LabelMap;
+  llvm::DenseMap<const LabelStmt*, llvm::BasicBlock*> LabelMap;
 public:
   CodeGenFunction(CodeGenModule &cgm);
   
@@ -158,12 +160,12 @@
   llvm::BasicBlock *getBasicBlockForLabel(const LabelStmt *S);
   
   
-  void EmitBlock(BasicBlock *BB);
+  void EmitBlock(llvm::BasicBlock *BB);
 
 
   /// EvaluateExprAsBool - Perform the usual unary conversions on the specified
   /// expression and compare the result against zero, returning an Int1Ty value.
-  Value *EvaluateExprAsBool(const Expr *E);
+  llvm::Value *EvaluateExprAsBool(const Expr *E);
   
   //===--------------------------------------------------------------------===//
   //                                Conversions
@@ -176,7 +178,7 @@
   
   /// ConvertScalarValueToBool - Convert the specified expression value to a
   /// boolean (i1) truth value.  This is equivalent to "Val == 0".
-  Value *ConvertScalarValueToBool(RValue Val, QualType Ty);
+  llvm::Value *ConvertScalarValueToBool(RValue Val, QualType Ty);
   
   //===--------------------------------------------------------------------===//
   //                            Declaration Emission
@@ -290,6 +292,5 @@
 };
 }  // end namespace CodeGen
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/CodeGen/CodeGenModule.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/CodeGen/CodeGenModule.cpp (original)
+++ cfe/cfe/trunk/CodeGen/CodeGenModule.cpp Wed Jul 11 11:46:45 2007
@@ -14,7 +14,6 @@
 #include "CodeGenModule.h"
 #include "CodeGenFunction.h"
 #include "clang/AST/Decl.h"
-using namespace llvm;
 using namespace clang;
 using namespace CodeGen;
 

Modified: cfe/cfe/trunk/CodeGen/CodeGenModule.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/CodeGen/CodeGenModule.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/CodeGen/CodeGenModule.h (original)
+++ cfe/cfe/trunk/CodeGen/CodeGenModule.h Wed Jul 11 11:46:45 2007
@@ -16,6 +16,8 @@
 
 namespace llvm {
   class Module;
+}
+
 namespace clang {
   class ASTContext;
   class FunctionDecl;
@@ -26,12 +28,12 @@
 /// while generating LLVM code.
 class CodeGenModule {
   ASTContext &Context;
-  Module &TheModule;
+  llvm::Module &TheModule;
 public:
-  CodeGenModule(ASTContext &C, Module &M) : Context(C), TheModule(M) {}
+  CodeGenModule(ASTContext &C, llvm::Module &M) : Context(C), TheModule(M) {}
   
   ASTContext &getContext() const { return Context; }
-  Module &getModule() const { return TheModule; }
+  llvm::Module &getModule() const { return TheModule; }
   
   void EmitFunction(FunctionDecl *FD);
   
@@ -39,6 +41,5 @@
 };
 }  // end namespace CodeGen
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/CodeGen/ModuleBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/CodeGen/ModuleBuilder.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/CodeGen/ModuleBuilder.cpp (original)
+++ cfe/cfe/trunk/CodeGen/ModuleBuilder.cpp Wed Jul 11 11:46:45 2007
@@ -13,28 +13,27 @@
 
 #include "clang/CodeGen/ModuleBuilder.h"
 #include "CodeGenModule.h"
-using namespace llvm;
 using namespace clang;
 
 
 /// Init - Create an ModuleBuilder with the specified ASTContext.
-llvm::clang::CodeGen::BuilderTy *
-llvm::clang::CodeGen::Init(ASTContext &Context, Module &M) {
+clang::CodeGen::BuilderTy *
+clang::CodeGen::Init(ASTContext &Context, llvm::Module &M) {
   return new CodeGenModule(Context, M);
 }
 
-void llvm::clang::CodeGen::Terminate(BuilderTy *B) {
+void clang::CodeGen::Terminate(BuilderTy *B) {
   delete static_cast<CodeGenModule*>(B);
 }
 
 /// CodeGenFunction - Convert the AST node for a FunctionDecl into LLVM.
 ///
-void llvm::clang::CodeGen::CodeGenFunction(BuilderTy *B, FunctionDecl *D) {
+void clang::CodeGen::CodeGenFunction(BuilderTy *B, FunctionDecl *D) {
   static_cast<CodeGenModule*>(B)->EmitFunction(D);
 }
 
 /// PrintStats - Emit statistic information to stderr.
 ///
-void llvm::clang::CodeGen::PrintStats(BuilderTy *B) {
+void clang::CodeGen::PrintStats(BuilderTy *B) {
   static_cast<CodeGenModule*>(B)->PrintStats();
 }

Modified: cfe/cfe/trunk/Driver/LLVMCodegen.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/LLVMCodegen.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Driver/LLVMCodegen.cpp (original)
+++ cfe/cfe/trunk/Driver/LLVMCodegen.cpp Wed Jul 11 11:46:45 2007
@@ -19,22 +19,21 @@
 #include "clang/Basic/Diagnostic.h"
 #include "llvm/Module.h"
 #include <iostream>
-using namespace llvm;
 using namespace clang;
 
 //===----------------------------------------------------------------------===//
 // LLVM Emission
 //===----------------------------------------------------------------------===//
 
-void llvm::clang::EmitLLVMFromASTs(Preprocessor &PP, unsigned MainFileID,
-                                   bool PrintStats) {
+void clang::EmitLLVMFromASTs(Preprocessor &PP, unsigned MainFileID,
+                             bool PrintStats) {
   Diagnostic &Diags = PP.getDiagnostics();
   // Create the streamer to read the file.
   ASTContext Context(PP.getTargetInfo(), PP.getIdentifierTable());
   ASTStreamerTy *Streamer = ASTStreamer_Init(PP, Context, MainFileID);
   
   // Create the module to codegen into.
-  Module M("foo");
+  llvm::Module M("foo");
   
   CodeGen::BuilderTy *Builder = CodeGen::Init(Context, M);
   

Modified: cfe/cfe/trunk/Driver/PrintParserCallbacks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/PrintParserCallbacks.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Driver/PrintParserCallbacks.cpp (original)
+++ cfe/cfe/trunk/Driver/PrintParserCallbacks.cpp Wed Jul 11 11:46:45 2007
@@ -17,8 +17,6 @@
 #include "clang/Parse/Action.h"
 #include "clang/Parse/DeclSpec.h"
 #include <iostream>
-
-using namespace llvm;
 using namespace clang;
 
 namespace {
@@ -52,6 +50,6 @@
   };
 }
 
-MinimalAction *llvm::clang::CreatePrintParserActionsAction() {
+MinimalAction *clang::CreatePrintParserActionsAction() {
   return new ParserPrintActions();
 }

Modified: cfe/cfe/trunk/Driver/PrintPreprocessedOutput.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/PrintPreprocessedOutput.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Driver/PrintPreprocessedOutput.cpp (original)
+++ cfe/cfe/trunk/Driver/PrintPreprocessedOutput.cpp Wed Jul 11 11:46:45 2007
@@ -21,7 +21,6 @@
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Config/config.h"
 #include <cstdio>
-using namespace llvm;
 using namespace clang;
 
 //===----------------------------------------------------------------------===//
@@ -98,12 +97,13 @@
 // Preprocessed token printer
 //===----------------------------------------------------------------------===//
 
-static cl::opt<bool>
-DisableLineMarkers("P", cl::desc("Disable linemarker output in -E mode"));
-static cl::opt<bool>
-EnableCommentOutput("C", cl::desc("Enable comment output in -E mode"));
-static cl::opt<bool>
-EnableMacroCommentOutput("CC", cl::desc("Enable comment output in -E mode, "
+static llvm::cl::opt<bool>
+DisableLineMarkers("P", llvm::cl::desc("Disable linemarker output in -E mode"));
+static llvm::cl::opt<bool>
+EnableCommentOutput("C", llvm::cl::desc("Enable comment output in -E mode"));
+static llvm::cl::opt<bool>
+EnableMacroCommentOutput("CC",
+                         llvm::cl::desc("Enable comment output in -E mode, "
                                         "even from macro expansions"));
 
 namespace {
@@ -165,7 +165,7 @@
     
     OutputChar('#');
     OutputChar(' ');
-    std::string Num = utostr_32(LineNo);
+    std::string Num = llvm::utostr_32(LineNo);
     OutputString(&Num[0], Num.size());
     OutputChar(' ');
     OutputString(&CurFilename[0], CurFilename.size());
@@ -213,7 +213,7 @@
   
   OutputChar('#');
   OutputChar(' ');
-  std::string Num = utostr_32(CurLine);
+  std::string Num = llvm::utostr_32(CurLine);
   OutputString(&Num[0], Num.size());
   OutputChar(' ');
   OutputString(&CurFilename[0], CurFilename.size());

Modified: cfe/cfe/trunk/Driver/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/Targets.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Driver/Targets.cpp (original)
+++ cfe/cfe/trunk/Driver/Targets.cpp Wed Jul 11 11:46:45 2007
@@ -17,7 +17,6 @@
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/TargetInfo.h"
 #include "llvm/Support/CommandLine.h"
-using namespace llvm;
 using namespace clang;
 
 /// Note: a hard coded list of targets is clearly silly, these should be
@@ -28,9 +27,9 @@
   target_linux_i386
 };
 
-static cl::list<SupportedTargets>
-Archs("arch", cl::desc("Architectures to compile for"),
-      cl::values(clEnumValN(target_ppc,       "ppc",   "32-bit Darwin PowerPC"),
+static llvm::cl::list<SupportedTargets>
+Archs("arch", llvm::cl::desc("Architectures to compile for"),
+llvm::cl::values(clEnumValN(target_ppc,       "ppc",   "32-bit Darwin PowerPC"),
                  clEnumValN(target_ppc64,     "ppc64", "64-bit Darwin PowerPC"),
                  clEnumValN(target_i386,      "i386",  "32-bit Darwin X86"),
                  clEnumValN(target_x86_64,    "x86_64","64-bit Darwin X86"),

Modified: cfe/cfe/trunk/Driver/TextDiagnosticPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/TextDiagnosticPrinter.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Driver/TextDiagnosticPrinter.cpp (original)
+++ cfe/cfe/trunk/Driver/TextDiagnosticPrinter.cpp Wed Jul 11 11:46:45 2007
@@ -18,19 +18,17 @@
 #include "clang/Lex/Lexer.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/Streams.h"
 #include <iostream>
 #include <string>
-using namespace llvm;
 using namespace clang;
 
-static cl::opt<bool>
+static llvm::cl::opt<bool>
 NoShowColumn("fno-show-column",
-             cl::desc("Do not include column number on diagnostics"));
-static cl::opt<bool>
+             llvm::cl::desc("Do not include column number on diagnostics"));
+static llvm::cl::opt<bool>
 NoCaretDiagnostics("fno-caret-diagnostics",
-                   cl::desc("Do not include source line and caret with"
-                            " diagnostics"));
+                   llvm::cl::desc("Do not include source line and caret with"
+                                  " diagnostics"));
 
 void TextDiagnosticPrinter::
 PrintIncludeStack(SourceLocation Pos) {
@@ -42,9 +40,9 @@
   
   unsigned LineNo = SourceMgr.getLineNumber(Pos);
   
-  const MemoryBuffer *Buffer = SourceMgr.getBuffer(FileID);
-  cerr << "In file included from " << Buffer->getBufferIdentifier()
-       << ":" << LineNo << ":\n";
+  const llvm::MemoryBuffer *Buffer = SourceMgr.getBuffer(FileID);
+  std::cerr << "In file included from " << Buffer->getBufferIdentifier()
+            << ":" << LineNo << ":\n";
 }
 
 /// HighlightRange - Given a SourceRange and a line number, highlight (with ~'s)
@@ -130,7 +128,7 @@
                                              unsigned NumRanges) {
   unsigned LineNo = 0, FilePos = 0, FileID = 0, ColNo = 0;
   unsigned LineStart = 0, LineEnd = 0;
-  const MemoryBuffer *Buffer = 0;
+  const llvm::MemoryBuffer *Buffer = 0;
   
   if (Pos.isValid()) {
     LineNo = SourceMgr.getLineNumber(Pos);
@@ -159,24 +157,24 @@
            Buf[LineEnd] != '\n' && Buf[LineEnd] != '\r')
       ++LineEnd;
   
-    cerr << Buffer->getBufferIdentifier() 
-         << ":" << LineNo << ":";
+    std::cerr << Buffer->getBufferIdentifier() 
+              << ":" << LineNo << ":";
     if (ColNo && !NoShowColumn) 
-      cerr << ColNo << ":";
-    cerr << " ";
+      std::cerr << ColNo << ":";
+    std::cerr << " ";
   }
   
   switch (Level) {
   default: assert(0 && "Unknown diagnostic type!");
-  case Diagnostic::Note:    cerr << "note: "; break;
-  case Diagnostic::Warning: cerr << "warning: "; break;
-  case Diagnostic::Error:   cerr << "error: "; break;
-  case Diagnostic::Fatal:   cerr << "fatal error: "; break;
-  case Diagnostic::Sorry:   cerr << "sorry, unimplemented: ";
+  case Diagnostic::Note:    std::cerr << "note: "; break;
+  case Diagnostic::Warning: std::cerr << "warning: "; break;
+  case Diagnostic::Error:   std::cerr << "error: "; break;
+  case Diagnostic::Fatal:   std::cerr << "fatal error: "; break;
+  case Diagnostic::Sorry:   std::cerr << "sorry, unimplemented: ";
     break;
   }
   
-  cerr << FormatDiagnostic(Level, ID, Strs, NumStrs) << "\n";
+  std::cerr << FormatDiagnostic(Level, ID, Strs, NumStrs) << "\n";
   
   if (!NoCaretDiagnostics && Pos.isValid()) {
     // Get the line of the source file.
@@ -221,7 +219,7 @@
       CaratLine.erase(CaratLine.end()-1);
     
     // Emit what we have computed.
-    cerr << SourceLine << "\n";
-    cerr << CaratLine << "\n";
+    std::cerr << SourceLine << "\n";
+    std::cerr << CaratLine << "\n";
   }
 }

Modified: cfe/cfe/trunk/Driver/TextDiagnosticPrinter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/TextDiagnosticPrinter.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Driver/TextDiagnosticPrinter.h (original)
+++ cfe/cfe/trunk/Driver/TextDiagnosticPrinter.h Wed Jul 11 11:46:45 2007
@@ -18,31 +18,29 @@
 #include "TextDiagnostics.h"
 #include "clang/Basic/SourceLocation.h"
 
-namespace llvm {
-  namespace clang {
-    class SourceManager;
-
-    class TextDiagnosticPrinter : public TextDiagnostics {
-      SourceLocation LastWarningLoc;
-    public:
-      TextDiagnosticPrinter(SourceManager &sourceMgr)
-        : TextDiagnostics(sourceMgr) {}
-
-      void PrintIncludeStack(SourceLocation Pos);
-      void HighlightRange(const SourceRange &R, unsigned LineNo,
-                          std::string &CaratLine,
-                          const std::string &SourceLine);
-      unsigned GetTokenLength(SourceLocation Loc);
-
-      virtual void HandleDiagnostic(Diagnostic::Level DiagLevel,
-                                    SourceLocation Pos,
-                                    diag::kind ID, const std::string *Strs,
-                                    unsigned NumStrs,
-                                    const SourceRange *Ranges, 
-                                    unsigned NumRanges);
-    };
+namespace clang {
+class SourceManager;
 
-  } // end namspace clang
-} // end namespace llvm
+class TextDiagnosticPrinter : public TextDiagnostics {
+  SourceLocation LastWarningLoc;
+public:
+  TextDiagnosticPrinter(SourceManager &sourceMgr)
+    : TextDiagnostics(sourceMgr) {}
+
+  void PrintIncludeStack(SourceLocation Pos);
+  void HighlightRange(const SourceRange &R, unsigned LineNo,
+                      std::string &CaratLine,
+                      const std::string &SourceLine);
+  unsigned GetTokenLength(SourceLocation Loc);
+
+  virtual void HandleDiagnostic(Diagnostic::Level DiagLevel,
+                                SourceLocation Pos,
+                                diag::kind ID, const std::string *Strs,
+                                unsigned NumStrs,
+                                const SourceRange *Ranges, 
+                                unsigned NumRanges);
+};
+
+} // end namspace clang
 
 #endif

Modified: cfe/cfe/trunk/Driver/TextDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/TextDiagnostics.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Driver/TextDiagnostics.cpp (original)
+++ cfe/cfe/trunk/Driver/TextDiagnostics.cpp Wed Jul 11 11:46:45 2007
@@ -15,7 +15,6 @@
 #include "clang/Basic/SourceLocation.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Lex/HeaderSearch.h"
-using namespace llvm;
 using namespace clang;
 
 TextDiagnostics:: ~TextDiagnostics() {}

Modified: cfe/cfe/trunk/Driver/TextDiagnostics.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/TextDiagnostics.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Driver/TextDiagnostics.h (original)
+++ cfe/cfe/trunk/Driver/TextDiagnostics.h Wed Jul 11 11:46:45 2007
@@ -16,40 +16,38 @@
 
 #include "clang/Basic/Diagnostic.h"
 
-namespace llvm {
-  namespace clang {
-    class SourceManager;
-    class HeaderSearch;
-    class Preprocessor;
-
-    class TextDiagnostics : public DiagnosticClient {
-      HeaderSearch *TheHeaderSearch;
-    protected:
-      SourceManager &SourceMgr;
-      Preprocessor *ThePreprocessor;
-
-      std::string FormatDiagnostic(Diagnostic::Level Level,
-                                   diag::kind ID,
-                                   const std::string *Strs,
-                                   unsigned NumStrs);
-    public:
-      TextDiagnostics(SourceManager &sourceMgr) : SourceMgr(sourceMgr) {}
-      virtual ~TextDiagnostics();
-
-      void setHeaderSearch(HeaderSearch &HS) { TheHeaderSearch = &HS; }
-      void setPreprocessor(Preprocessor &P) { ThePreprocessor = &P; }
-
-      virtual bool IgnoreDiagnostic(Diagnostic::Level Level, 
-                                    SourceLocation Pos);
-      virtual void HandleDiagnostic(Diagnostic::Level DiagLevel,
-                                    SourceLocation Pos,
-                                    diag::kind ID, const std::string *Strs,
-                                    unsigned NumStrs,
-                                    const SourceRange *Ranges, 
-                                    unsigned NumRanges) = 0;
-    };
+namespace clang {
+class SourceManager;
+class HeaderSearch;
+class Preprocessor;
+
+class TextDiagnostics : public DiagnosticClient {
+  HeaderSearch *TheHeaderSearch;
+protected:
+  SourceManager &SourceMgr;
+  Preprocessor *ThePreprocessor;
+
+  std::string FormatDiagnostic(Diagnostic::Level Level,
+                               diag::kind ID,
+                               const std::string *Strs,
+                               unsigned NumStrs);
+public:
+  TextDiagnostics(SourceManager &sourceMgr) : SourceMgr(sourceMgr) {}
+  virtual ~TextDiagnostics();
+
+  void setHeaderSearch(HeaderSearch &HS) { TheHeaderSearch = &HS; }
+  void setPreprocessor(Preprocessor &P) { ThePreprocessor = &P; }
+
+  virtual bool IgnoreDiagnostic(Diagnostic::Level Level, 
+                                SourceLocation Pos);
+  virtual void HandleDiagnostic(Diagnostic::Level DiagLevel,
+                                SourceLocation Pos,
+                                diag::kind ID, const std::string *Strs,
+                                unsigned NumStrs,
+                                const SourceRange *Ranges, 
+                                unsigned NumRanges) = 0;
+};
 
-  } // end namspace clang
-} // end namespace llvm
+} // end namspace clang
 
 #endif

Modified: cfe/cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/clang.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Driver/clang.cpp (original)
+++ cfe/cfe/trunk/Driver/clang.cpp Wed Jul 11 11:46:45 2007
@@ -35,17 +35,16 @@
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/System/Signals.h"
 #include <iostream>
-using namespace llvm;
 using namespace clang;
 
 //===----------------------------------------------------------------------===//
 // Global options.
 //===----------------------------------------------------------------------===//
 
-static cl::opt<bool>
-Verbose("v", cl::desc("Enable verbose output"));
-static cl::opt<bool>
-Stats("stats", cl::desc("Print performance metrics and statistics"));
+static llvm::cl::opt<bool>
+Verbose("v", llvm::cl::desc("Enable verbose output"));
+static llvm::cl::opt<bool>
+Stats("stats", llvm::cl::desc("Print performance metrics and statistics"));
 
 enum ProgActions {
   EmitLLVM,                     // Emit a .ll file.
@@ -59,10 +58,10 @@
   DumpTokens                    // Token dump mode.
 };
 
-static cl::opt<ProgActions> 
-ProgAction(cl::desc("Choose output type:"), cl::ZeroOrMore,
-           cl::init(ParseSyntaxOnly),
-           cl::values(
+static llvm::cl::opt<ProgActions> 
+ProgAction(llvm::cl::desc("Choose output type:"), llvm::cl::ZeroOrMore,
+           llvm::cl::init(ParseSyntaxOnly),
+           llvm::cl::values(
              clEnumValN(RunPreprocessorOnly, "Eonly",
                         "Just run preprocessor, no output (for timings)"),
              clEnumValN(PrintPreprocessedInput, "E",
@@ -104,10 +103,10 @@
    assembler  assembler-with-cpp
    ada, f77*, ratfor (!), f95, java, treelang
  */
-static cl::opt<LangKind>
-BaseLang("x", cl::desc("Base language to compile"),
-         cl::init(langkind_unspecified),
-         cl::values(clEnumValN(langkind_c,     "c",            "C"),
+static llvm::cl::opt<LangKind>
+BaseLang("x", llvm::cl::desc("Base language to compile"),
+         llvm::cl::init(langkind_unspecified),
+   llvm::cl::values(clEnumValN(langkind_c,     "c",            "C"),
                     clEnumValN(langkind_cxx,   "c++",          "C++"),
                     clEnumValN(langkind_objc,  "objective-c",  "Objective C"),
                     clEnumValN(langkind_objcxx,"objective-c++","Objective C++"),
@@ -121,12 +120,12 @@
                                "Preprocessed Objective C++"),
                     clEnumValEnd));
 
-static cl::opt<bool>
-LangObjC("ObjC", cl::desc("Set base language to Objective-C"),
-         cl::Hidden);
-static cl::opt<bool>
-LangObjCXX("ObjC++", cl::desc("Set base language to Objective-C++"),
-           cl::Hidden);
+static llvm::cl::opt<bool>
+LangObjC("ObjC", llvm::cl::desc("Set base language to Objective-C"),
+         llvm::cl::Hidden);
+static llvm::cl::opt<bool>
+LangObjCXX("ObjC++", llvm::cl::desc("Set base language to Objective-C++"),
+           llvm::cl::Hidden);
 
 /// InitializeBaseLanguage - Handle the -x foo options or infer a base language
 /// from the input filename.
@@ -208,10 +207,10 @@
   lang_cxx98, lang_gnucxx98
 };
 
-static cl::opt<LangStds>
-LangStd("std", cl::desc("Language standard to compile for"),
-        cl::init(lang_unspecified),
-        cl::values(clEnumValN(lang_c89,      "c89",            "ISO C 1990"),
+static llvm::cl::opt<LangStds>
+LangStd("std", llvm::cl::desc("Language standard to compile for"),
+        llvm::cl::init(lang_unspecified),
+  llvm::cl::values(clEnumValN(lang_c89,      "c89",            "ISO C 1990"),
                    clEnumValN(lang_c89,      "c90",            "ISO C 1990"),
                    clEnumValN(lang_c89,      "iso9899:1990",   "ISO C 1990"),
                    clEnumValN(lang_c94,      "iso9899:199409",
@@ -233,10 +232,10 @@
                               "extensions (default for C++)"),
                    clEnumValEnd));
 
-static cl::opt<bool>
+static llvm::cl::opt<bool>
 NoOperatorNames("fno-operator-names",
-                cl::desc("Do not treat C++ operator name keywords as "
-                         "synonyms for operators"));
+                llvm::cl::desc("Do not treat C++ operator name keywords as "
+                               "synonyms for operators"));
 
 // FIXME: add:
 //   -ansi
@@ -295,20 +294,20 @@
 //===----------------------------------------------------------------------===//
 
 // FIXME: Werror should take a list of things, -Werror=foo,bar
-static cl::opt<bool>
-WarningsAsErrors("Werror", cl::desc("Treat all warnings as errors"));
+static llvm::cl::opt<bool>
+WarningsAsErrors("Werror", llvm::cl::desc("Treat all warnings as errors"));
 
-static cl::opt<bool>
-WarnOnExtensions("pedantic", cl::init(true),
-                 cl::desc("Issue a warning on uses of GCC extensions"));
+static llvm::cl::opt<bool>
+WarnOnExtensions("pedantic", llvm::cl::init(true),
+                 llvm::cl::desc("Issue a warning on uses of GCC extensions"));
 
-static cl::opt<bool>
+static llvm::cl::opt<bool>
 ErrorOnExtensions("pedantic-errors",
-                  cl::desc("Issue an error on uses of GCC extensions"));
+                  llvm::cl::desc("Issue an error on uses of GCC extensions"));
 
-static cl::opt<bool>
+static llvm::cl::opt<bool>
 WarnUnusedMacros("Wunused_macros",
-               cl::desc("Warn for unused macros in the main translation unit"));
+         llvm::cl::desc("Warn for unused macros in the main translation unit"));
 
 
 /// InitializeDiagnostics - Initialize the diagnostic object, based on the
@@ -331,12 +330,12 @@
 //   -A...    - Play with #assertions
 //   -undef   - Undefine all predefined macros
 
-static cl::list<std::string>
-D_macros("D", cl::value_desc("macro"), cl::Prefix,
-       cl::desc("Predefine the specified macro"));
-static cl::list<std::string>
-U_macros("U", cl::value_desc("macro"), cl::Prefix,
-         cl::desc("Undefine the specified macro"));
+static llvm::cl::list<std::string>
+D_macros("D", llvm::cl::value_desc("macro"), llvm::cl::Prefix,
+       llvm::cl::desc("Predefine the specified macro"));
+static llvm::cl::list<std::string>
+U_macros("U", llvm::cl::value_desc("macro"), llvm::cl::Prefix,
+         llvm::cl::desc("Undefine the specified macro"));
 
 // Append a #define line to Buf for Macro.  Macro should be of the form XXX,
 // in which case we emit "#define XXX 1" or "XXX=Y z W" in which case we emit
@@ -442,36 +441,37 @@
 //
 // FIXME: -include,-imacros
 
-static cl::opt<bool>
-nostdinc("nostdinc", cl::desc("Disable standard #include directories"));
+static llvm::cl::opt<bool>
+nostdinc("nostdinc", llvm::cl::desc("Disable standard #include directories"));
 
 // Various command line options.  These four add directories to each chain.
-static cl::list<std::string>
-F_dirs("F", cl::value_desc("directory"), cl::Prefix,
-       cl::desc("Add directory to framework include search path"));
-static cl::list<std::string>
-I_dirs("I", cl::value_desc("directory"), cl::Prefix,
-       cl::desc("Add directory to include search path"));
-static cl::list<std::string>
-idirafter_dirs("idirafter", cl::value_desc("directory"), cl::Prefix,
-               cl::desc("Add directory to AFTER include search path"));
-static cl::list<std::string>
-iquote_dirs("iquote", cl::value_desc("directory"), cl::Prefix,
-               cl::desc("Add directory to QUOTE include search path"));
-static cl::list<std::string>
-isystem_dirs("isystem", cl::value_desc("directory"), cl::Prefix,
-            cl::desc("Add directory to SYSTEM include search path"));
+static llvm::cl::list<std::string>
+F_dirs("F", llvm::cl::value_desc("directory"), llvm::cl::Prefix,
+       llvm::cl::desc("Add directory to framework include search path"));
+static llvm::cl::list<std::string>
+I_dirs("I", llvm::cl::value_desc("directory"), llvm::cl::Prefix,
+       llvm::cl::desc("Add directory to include search path"));
+static llvm::cl::list<std::string>
+idirafter_dirs("idirafter", llvm::cl::value_desc("directory"), llvm::cl::Prefix,
+               llvm::cl::desc("Add directory to AFTER include search path"));
+static llvm::cl::list<std::string>
+iquote_dirs("iquote", llvm::cl::value_desc("directory"), llvm::cl::Prefix,
+               llvm::cl::desc("Add directory to QUOTE include search path"));
+static llvm::cl::list<std::string>
+isystem_dirs("isystem", llvm::cl::value_desc("directory"), llvm::cl::Prefix,
+            llvm::cl::desc("Add directory to SYSTEM include search path"));
 
 // These handle -iprefix/-iwithprefix/-iwithprefixbefore.
-static cl::list<std::string>
-iprefix_vals("iprefix", cl::value_desc("prefix"), cl::Prefix,
-             cl::desc("Set the -iwithprefix/-iwithprefixbefore prefix"));
-static cl::list<std::string>
-iwithprefix_vals("iwithprefix", cl::value_desc("dir"), cl::Prefix,
-          cl::desc("Set directory to SYSTEM include search path with prefix"));
-static cl::list<std::string>
-iwithprefixbefore_vals("iwithprefixbefore", cl::value_desc("dir"), cl::Prefix,
-                 cl::desc("Set directory to include search path with prefix"));
+static llvm::cl::list<std::string>
+iprefix_vals("iprefix", llvm::cl::value_desc("prefix"), llvm::cl::Prefix,
+             llvm::cl::desc("Set the -iwithprefix/-iwithprefixbefore prefix"));
+static llvm::cl::list<std::string>
+iwithprefix_vals("iwithprefix", llvm::cl::value_desc("dir"), llvm::cl::Prefix,
+     llvm::cl::desc("Set directory to SYSTEM include search path with prefix"));
+static llvm::cl::list<std::string>
+iwithprefixbefore_vals("iwithprefixbefore", llvm::cl::value_desc("dir"),
+                       llvm::cl::Prefix,
+            llvm::cl::desc("Set directory to include search path with prefix"));
 
 // Finally, implement the code that groks the options above.
 enum IncludeDirGroup {
@@ -808,7 +808,7 @@
       return 0;
     }
   } else {
-    MemoryBuffer *SB = MemoryBuffer::getSTDIN();
+    llvm::MemoryBuffer *SB = llvm::MemoryBuffer::getSTDIN();
     if (SB) MainFileID = SourceMgr.createFileIDForMemBuffer(SB);
     if (MainFileID == 0) {
       std::cerr << "Error reading standard input!  Empty?\n";
@@ -822,9 +822,9 @@
   // Memory buffer must end with a null byte!
   PrologMacros.push_back(0);
     
-  MemoryBuffer *SB = MemoryBuffer::getMemBuffer(&PrologMacros.front(),
-                                                &PrologMacros.back(),
-                                                "<predefines>");
+  llvm::MemoryBuffer *SB = 
+    llvm::MemoryBuffer::getMemBuffer(&PrologMacros.front(),&PrologMacros.back(),
+                                     "<predefines>");
   assert(SB && "Cannot fail to create predefined source buffer");
   unsigned FileID = SourceMgr.createFileIDForMemBuffer(SB);
   assert(FileID && "Could not create FileID for predefines?");
@@ -905,12 +905,12 @@
   HeaderInfo.ClearFileInfo();
 }
 
-static cl::list<std::string>
-InputFilenames(cl::Positional, cl::desc("<input files>"));
+static llvm::cl::list<std::string>
+InputFilenames(llvm::cl::Positional, llvm::cl::desc("<input files>"));
 
 int main(int argc, char **argv) {
-  cl::ParseCommandLineOptions(argc, argv, " llvm cfe\n");
-  sys::PrintStackTraceOnErrorSignal();
+  llvm::cl::ParseCommandLineOptions(argc, argv, " llvm cfe\n");
+  llvm::sys::PrintStackTraceOnErrorSignal();
   
   // If no input was specified, read from stdin.
   if (InputFilenames.empty())

Modified: cfe/cfe/trunk/Driver/clang.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/clang.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Driver/clang.h (original)
+++ cfe/cfe/trunk/Driver/clang.h Wed Jul 11 11:46:45 2007
@@ -14,7 +14,6 @@
 #ifndef LLVM_CLANG_CLANG_H
 #define LLVM_CLANG_CLANG_H
 
-namespace llvm {
 namespace clang {
 class Preprocessor;
 class LangOptions;
@@ -39,6 +38,5 @@
                       bool PrintStats);
   
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/Lex/HeaderSearch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/HeaderSearch.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Lex/HeaderSearch.cpp (original)
+++ cfe/cfe/trunk/Lex/HeaderSearch.cpp Wed Jul 11 11:46:45 2007
@@ -16,8 +16,6 @@
 #include "clang/Lex/IdentifierTable.h"
 #include "llvm/System/Path.h"
 #include "llvm/ADT/SmallString.h"
-#include "llvm/Support/Streams.h"
-using namespace llvm;
 using namespace clang;
 
 HeaderSearch::HeaderSearch(FileManager &FM) : FileMgr(FM), FrameworkMap(64) {
@@ -30,8 +28,8 @@
 }
 
 void HeaderSearch::PrintStats() {
-  cerr << "\n*** HeaderSearch Stats:\n";
-  cerr << FileInfo.size() << " files tracked.\n";
+  fprintf(stderr, "\n*** HeaderSearch Stats:\n");
+  fprintf(stderr, "%d files tracked.\n", (int)FileInfo.size());
   unsigned NumOnceOnlyFiles = 0, MaxNumIncludes = 0, NumSingleIncludedFiles = 0;
   for (unsigned i = 0, e = FileInfo.size(); i != e; ++i) {
     NumOnceOnlyFiles += FileInfo[i].isImport;
@@ -39,16 +37,16 @@
       MaxNumIncludes = FileInfo[i].NumIncludes;
     NumSingleIncludedFiles += FileInfo[i].NumIncludes == 1;
   }
-  cerr << "  " << NumOnceOnlyFiles << " #import/#pragma once files.\n";
-  cerr << "  " << NumSingleIncludedFiles << " included exactly once.\n";
-  cerr << "  " << MaxNumIncludes << " max times a file is included.\n";
-  
-  cerr << "  " << NumIncluded << " #include/#include_next/#import.\n";
-  cerr << "    " << NumMultiIncludeFileOptzn << " #includes skipped due to"
-       << " the multi-include optimization.\n";
+  fprintf(stderr, "  %d #import/#pragma once files.\n", NumOnceOnlyFiles);
+  fprintf(stderr, "  %d included exactly once.\n", NumSingleIncludedFiles);
+  fprintf(stderr, "  %d max times a file is included.\n", MaxNumIncludes);
+  
+  fprintf(stderr, "  %d #include/#include_next/#import.\n", NumIncluded);
+  fprintf(stderr, "    %d #includes skipped due to"
+          " the multi-include optimization.\n", NumMultiIncludeFileOptzn);
   
-  cerr << NumFrameworkLookups << " framework lookups.\n";
-  cerr << NumSubFrameworkLookups << " subframework lookups.\n";
+  fprintf(stderr, "%d framework lookups.\n", NumFrameworkLookups);
+  fprintf(stderr, "%d subframework lookups.\n", NumSubFrameworkLookups);
 }
 
 //===----------------------------------------------------------------------===//
@@ -62,7 +60,7 @@
   const char *SlashPos = std::find(FilenameStart, FilenameEnd, '/');
   if (SlashPos == FilenameEnd) return 0;
   
-  StringMapEntry<const DirectoryEntry *> &CacheLookup =
+  llvm::StringMapEntry<const DirectoryEntry *> &CacheLookup =
     FrameworkMap.GetOrCreateValue(FilenameStart, SlashPos);
   
   // If it is some other directory, fail.
@@ -70,7 +68,7 @@
     return 0;
 
   // FrameworkName = "/System/Library/Frameworks/"
-  SmallString<1024> FrameworkName;
+  llvm::SmallString<1024> FrameworkName;
   FrameworkName += Dir->getName();
   if (FrameworkName.empty() || FrameworkName.back() != '/')
     FrameworkName.push_back('/');
@@ -85,8 +83,8 @@
     ++NumFrameworkLookups;
     
     // If the framework dir doesn't exist, we fail.
-    if (!sys::Path(std::string(FrameworkName.begin(), 
-                               FrameworkName.end())).exists())
+    if (!llvm::sys::Path(std::string(FrameworkName.begin(), 
+                                     FrameworkName.end())).exists())
       return 0;
     
     // Otherwise, if it does, remember that this is the right direntry for this
@@ -135,7 +133,7 @@
     return FileMgr.getFile(FilenameStart, FilenameEnd);
   }
   
-  SmallString<1024> TmpDir;
+  llvm::SmallString<1024> TmpDir;
   
   // Step #0, unless disabled, check to see if the file is in the #includer's
   // directory.  This search is not done for <> headers.
@@ -214,15 +212,15 @@
   if (FrameworkPos == 0)
     return 0;
   
-  SmallString<1024> FrameworkName(ContextName, 
-                                  FrameworkPos+strlen(".framework/"));
+  llvm::SmallString<1024> FrameworkName(ContextName, 
+                                        FrameworkPos+strlen(".framework/"));
 
   // Append Frameworks/HIToolbox.framework/
   FrameworkName += "Frameworks/";
   FrameworkName.append(FilenameStart, SlashPos);
   FrameworkName += ".framework/";
 
-  StringMapEntry<const DirectoryEntry *> &CacheLookup =
+  llvm::StringMapEntry<const DirectoryEntry *> &CacheLookup =
     FrameworkMap.GetOrCreateValue(FilenameStart, SlashPos);
   
   // Some other location?
@@ -249,7 +247,7 @@
   const FileEntry *FE = 0;
 
   // Check ".../Frameworks/HIToolbox.framework/Headers/HIToolbox.h"
-  SmallString<1024> HeadersFilename(FrameworkName);
+  llvm::SmallString<1024> HeadersFilename(FrameworkName);
   HeadersFilename += "Headers/";
   HeadersFilename.append(SlashPos+1, FilenameEnd);
   if (!(FE = FileMgr.getFile(HeadersFilename.begin(),

Modified: cfe/cfe/trunk/Lex/IdentifierTable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/IdentifierTable.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Lex/IdentifierTable.cpp (original)
+++ cfe/cfe/trunk/Lex/IdentifierTable.cpp Wed Jul 11 11:46:45 2007
@@ -15,8 +15,6 @@
 #include "clang/Lex/IdentifierTable.h"
 #include "clang/Lex/MacroInfo.h"
 #include "clang/Basic/LangOptions.h"
-#include <iostream>
-using namespace llvm;
 using namespace clang;
 
 //===----------------------------------------------------------------------===//
@@ -168,7 +166,7 @@
   unsigned MaxIdentifierLength = 0;
   
   // TODO: Figure out maximum times an identifier had to probe for -stats.
-  for (StringMap<IdentifierInfo, BumpPtrAllocator>::const_iterator
+  for (llvm::StringMap<IdentifierInfo, llvm::BumpPtrAllocator>::const_iterator
        I = HashTable.begin(), E = HashTable.end(); I != E; ++I) {
     unsigned IdLen = I->getKeyLength();
     AverageIdentifierSize += IdLen;
@@ -176,14 +174,14 @@
       MaxIdentifierLength = IdLen;
   }
   
-  std::cerr << "\n*** Identifier Table Stats:\n";
-  std::cerr << "# Identifiers:   " << NumIdentifiers << "\n";
-  std::cerr << "# Empty Buckets: " << NumEmptyBuckets << "\n";
-  std::cerr << "Hash density (#identifiers per bucket): "
-            << NumIdentifiers/(double)NumBuckets << "\n";
-  std::cerr << "Ave identifier length: "
-            << (AverageIdentifierSize/(double)NumIdentifiers) << "\n";
-  std::cerr << "Max identifier length: " << MaxIdentifierLength << "\n";
+  fprintf(stderr, "\n*** Identifier Table Stats:\n");
+  fprintf(stderr, "# Identifiers:   %d\n", NumIdentifiers);
+  fprintf(stderr, "# Empty Buckets: %d\n", NumEmptyBuckets);
+  fprintf(stderr, "Hash density (#identifiers per bucket): %f\n",
+          NumIdentifiers/(double)NumBuckets);
+  fprintf(stderr, "Ave identifier length: %f\n",
+          (AverageIdentifierSize/(double)NumIdentifiers));
+  fprintf(stderr, "Max identifier length: %d\n", MaxIdentifierLength);
   
   // Compute statistics about the memory allocated for identifiers.
   HashTable.getAllocator().PrintStats();

Modified: cfe/cfe/trunk/Lex/Lexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/Lexer.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Lex/Lexer.cpp (original)
+++ cfe/cfe/trunk/Lex/Lexer.cpp Wed Jul 11 11:46:45 2007
@@ -30,12 +30,11 @@
 #include "clang/Basic/SourceLocation.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include <cctype>
-using namespace llvm;
 using namespace clang;
 
 static void InitCharacterInfo();
 
-Lexer::Lexer(const MemoryBuffer *File, unsigned fileid, Preprocessor &pp,
+Lexer::Lexer(const llvm::MemoryBuffer *File, unsigned fileid, Preprocessor &pp,
              const char *BufStart, const char *BufEnd)
   : BufferEnd(BufEnd ? BufEnd : File->getBufferEnd()),
     InputFile(File), CurFileID(fileid), PP(pp), Features(PP.getLangOptions()) {

Modified: cfe/cfe/trunk/Lex/LiteralSupport.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/LiteralSupport.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Lex/LiteralSupport.cpp (original)
+++ cfe/cfe/trunk/Lex/LiteralSupport.cpp Wed Jul 11 11:46:45 2007
@@ -18,7 +18,6 @@
 #include "clang/Basic/Diagnostic.h"
 #include "llvm/ADT/APInt.h"
 #include "llvm/ADT/StringExtras.h"
-using namespace llvm;
 using namespace clang;
 
 /// HexDigitValue - Return the value of the specified hex digit, or -1 if it's
@@ -145,7 +144,7 @@
     if (isgraph(ThisTokBuf[0])) {
       PP.Diag(Loc, diag::ext_unknown_escape, std::string()+(char)ResultChar);
     } else {
-      PP.Diag(Loc, diag::ext_unknown_escape, "x"+utohexstr(ResultChar));
+      PP.Diag(Loc, diag::ext_unknown_escape, "x"+llvm::utohexstr(ResultChar));
     }
     break;
   }
@@ -377,13 +376,13 @@
 /// GetIntegerValue - Convert this numeric literal value to an APInt that
 /// matches Val's input width.  If there is an overflow, set Val to the low bits
 /// of the result and return true.  Otherwise, return false.
-bool NumericLiteralParser::GetIntegerValue(APInt &Val) {
+bool NumericLiteralParser::GetIntegerValue(llvm::APInt &Val) {
   Val = 0;
   s = DigitsBegin;
 
-  APInt RadixVal(Val.getBitWidth(), radix);
-  APInt CharVal(Val.getBitWidth(), 0);
-  APInt OldVal = Val;
+  llvm::APInt RadixVal(Val.getBitWidth(), radix);
+  llvm::APInt CharVal(Val.getBitWidth(), 0);
+  llvm::APInt OldVal = Val;
   
   bool OverflowOccurred = false;
   while (s < SuffixBegin) {
@@ -579,7 +578,7 @@
   ResultBuf.resize(SizeBound);
   
   // Likewise, but for each string piece.
-  SmallString<512> TokenBuf;
+  llvm::SmallString<512> TokenBuf;
   TokenBuf.resize(MaxTokenLength);
   
   // Loop over all the strings, getting their spelling, and expanding them to

Modified: cfe/cfe/trunk/Lex/MacroExpander.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/MacroExpander.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Lex/MacroExpander.cpp (original)
+++ cfe/cfe/trunk/Lex/MacroExpander.cpp Wed Jul 11 11:46:45 2007
@@ -17,7 +17,6 @@
 #include "clang/Basic/SourceManager.h"
 #include "clang/Basic/Diagnostic.h"
 #include "llvm/ADT/SmallVector.h"
-using namespace llvm;
 using namespace clang;
 
 //===----------------------------------------------------------------------===//
@@ -286,7 +285,7 @@
 /// Expand the arguments of a function-like macro so that we can quickly
 /// return preexpanded tokens from MacroTokens.
 void MacroExpander::ExpandFunctionArguments() {
-  SmallVector<LexerToken, 128> ResultToks;
+  llvm::SmallVector<LexerToken, 128> ResultToks;
   
   // Loop through the MacroTokens tokens, expanding them into ResultToks.  Keep
   // track of whether we change anything.  If not, no need to keep them.  If so,
@@ -509,7 +508,7 @@
 /// operator.  Read the ## and RHS, and paste the LHS/RHS together.  If there
 /// are is another ## after it, chomp it iteratively.  Return the result as Tok.
 void MacroExpander::PasteTokens(LexerToken &Tok) {
-  SmallVector<char, 128> Buffer;
+  llvm::SmallVector<char, 128> Buffer;
   do {
     // Consume the ## operator.
     SourceLocation PasteOpLoc = MacroTokens[CurToken].getLocation();

Modified: cfe/cfe/trunk/Lex/MacroInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/MacroInfo.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Lex/MacroInfo.cpp (original)
+++ cfe/cfe/trunk/Lex/MacroInfo.cpp Wed Jul 11 11:46:45 2007
@@ -13,7 +13,6 @@
 
 #include "clang/Lex/MacroInfo.h"
 #include "clang/Lex/Preprocessor.h"
-using namespace llvm;
 using namespace clang;
 
 MacroInfo::MacroInfo(SourceLocation DefLoc) : Location(DefLoc) {

Modified: cfe/cfe/trunk/Lex/PPExpressions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/PPExpressions.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Lex/PPExpressions.cpp (original)
+++ cfe/cfe/trunk/Lex/PPExpressions.cpp Wed Jul 11 11:46:45 2007
@@ -24,10 +24,9 @@
 #include "clang/Basic/Diagnostic.h"
 #include "llvm/ADT/APSInt.h"
 #include "llvm/ADT/SmallString.h"
-using namespace llvm;
 using namespace clang;
 
-static bool EvaluateDirectiveSubExpr(APSInt &LHS, unsigned MinPrec,
+static bool EvaluateDirectiveSubExpr(llvm::APSInt &LHS, unsigned MinPrec,
                                      LexerToken &PeekTok, bool ValueLive,
                                      Preprocessor &PP);
 
@@ -61,7 +60,7 @@
 /// If ValueLive is false, then this value is being evaluated in a context where
 /// the result is not used.  As such, avoid diagnostics that relate to
 /// evaluation.
-static bool EvaluateValue(APSInt &Result, LexerToken &PeekTok,
+static bool EvaluateValue(llvm::APSInt &Result, LexerToken &PeekTok,
                           DefinedTracker &DT, bool ValueLive,
                           Preprocessor &PP) {
   Result = 0;
@@ -153,7 +152,7 @@
     PP.Diag(PeekTok, diag::err_pp_expected_value_in_expr);
     return true;
   case tok::numeric_constant: {
-    SmallString<64> IntegerBuffer;
+    llvm::SmallString<64> IntegerBuffer;
     IntegerBuffer.resize(PeekTok.getLength());
     const char *ThisTokBegin = &IntegerBuffer[0];
     unsigned ActualLength = PP.getSpelling(PeekTok, ThisTokBegin);
@@ -193,7 +192,7 @@
     return false;
   }
   case tok::char_constant: {   // 'x'
-    SmallString<32> CharBuffer;
+    llvm::SmallString<32> CharBuffer;
     CharBuffer.resize(PeekTok.getLength());
     const char *ThisTokBegin = &CharBuffer[0];
     unsigned ActualLength = PP.getSpelling(PeekTok, ThisTokBegin);
@@ -211,7 +210,7 @@
       NumBits = TI.getCharWidth(PeekTok.getLocation());
     
     // Set the width.
-    APSInt Val(NumBits);
+    llvm::APSInt Val(NumBits);
     // Set the value.
     Val = Literal.getValue();
     // Set the signedness.
@@ -360,7 +359,7 @@
 /// If ValueLive is false, then this value is being evaluated in a context where
 /// the result is not used.  As such, avoid diagnostics that relate to
 /// evaluation.
-static bool EvaluateDirectiveSubExpr(APSInt &LHS, unsigned MinPrec,
+static bool EvaluateDirectiveSubExpr(llvm::APSInt &LHS, unsigned MinPrec,
                                      LexerToken &PeekTok, bool ValueLive,
                                      Preprocessor &PP) {
   unsigned PeekPrec = getPrecedence(PeekTok.getKind());
@@ -397,7 +396,7 @@
     LexerToken OpToken = PeekTok;
     PP.LexNonComment(PeekTok);
 
-    APSInt RHS(LHS.getBitWidth());
+    llvm::APSInt RHS(LHS.getBitWidth());
     // Parse the RHS of the operator.
     DefinedTracker DT;
     if (EvaluateValue(RHS, PeekTok, DT, RHSIsLive, PP)) return true;
@@ -427,7 +426,7 @@
     
     // Usual arithmetic conversions (C99 6.3.1.8p1): result is unsigned if
     // either operand is unsigned.  Don't do this for x and y in "x ? y : z".
-    APSInt Res(LHS.getBitWidth());
+    llvm::APSInt Res(LHS.getBitWidth());
     if (Operator != tok::question) {
       Res.setIsUnsigned(LHS.isUnsigned()|RHS.isUnsigned());
       // If this just promoted something from signed to unsigned, and if the
@@ -564,7 +563,7 @@
 
       // Evaluate the value after the :.
       bool AfterColonLive = ValueLive && LHS == 0;
-      APSInt AfterColonVal(LHS.getBitWidth());
+      llvm::APSInt AfterColonVal(LHS.getBitWidth());
       DefinedTracker DT;
       if (EvaluateValue(AfterColonVal, PeekTok, DT, AfterColonLive, PP))
         return true;
@@ -613,7 +612,7 @@
   
   // C99 6.10.1p3 - All expressions are evaluated as intmax_t or uintmax_t.
   unsigned BitWidth = getTargetInfo().getIntMaxTWidth(Tok.getLocation());
-  APSInt ResVal(BitWidth);
+  llvm::APSInt ResVal(BitWidth);
   DefinedTracker DT;
   if (EvaluateValue(ResVal, Tok, DT, true, *this)) {
     // Parse error, skip the rest of the macro line.

Modified: cfe/cfe/trunk/Lex/Pragma.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/Pragma.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Lex/Pragma.cpp (original)
+++ cfe/cfe/trunk/Lex/Pragma.cpp Wed Jul 11 11:46:45 2007
@@ -20,7 +20,6 @@
 #include "clang/Basic/FileManager.h"
 #include "clang/Basic/SourceManager.h"
 #include "llvm/ADT/SmallVector.h"
-using namespace llvm;
 using namespace clang;
 
 // Out-of-line destructor to provide a home for the class.
@@ -256,7 +255,7 @@
     return;
   
   // Reserve a buffer to get the spelling.
-  SmallVector<char, 128> FilenameBuffer;
+  llvm::SmallVector<char, 128> FilenameBuffer;
   FilenameBuffer.resize(FilenameTok.getLength());
   
   const char *FilenameStart = &FilenameBuffer[0], *FilenameEnd;

Modified: cfe/cfe/trunk/Lex/Preprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/Preprocessor.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Lex/Preprocessor.cpp (original)
+++ cfe/cfe/trunk/Lex/Preprocessor.cpp Wed Jul 11 11:46:45 2007
@@ -37,7 +37,6 @@
 #include "clang/Basic/TargetInfo.h"
 #include "llvm/ADT/SmallVector.h"
 #include <iostream>
-using namespace llvm;
 using namespace clang;
 
 //===----------------------------------------------------------------------===//
@@ -343,7 +342,7 @@
   if (MaxIncludeStackDepth < IncludeMacroStack.size())
     MaxIncludeStackDepth = IncludeMacroStack.size();
 
-  const MemoryBuffer *Buffer = SourceMgr.getBuffer(FileID);
+  const llvm::MemoryBuffer *Buffer = SourceMgr.getBuffer(FileID);
   Lexer *TheLexer = new Lexer(Buffer, FileID, *this);
   if (isMainFile) TheLexer->setIsMainFile();
   EnterSourceFileWithLexer(TheLexer, CurDir);
@@ -658,7 +657,7 @@
   // ArgTokens - Build up a list of tokens that make up each argument.  Each
   // argument is separated by an EOF token.  Use a SmallVector so we can avoid
   // heap allocations in the common case.
-  SmallVector<LexerToken, 64> ArgTokens;
+  llvm::SmallVector<LexerToken, 64> ArgTokens;
 
   unsigned NumActuals = 0;
   while (Tok.getKind() == tok::comma) {
@@ -1556,7 +1555,7 @@
     return;
   
   // Reserve a buffer to get the spelling.
-  SmallVector<char, 128> FilenameBuffer;
+  llvm::SmallVector<char, 128> FilenameBuffer;
   FilenameBuffer.resize(FilenameTok.getLength());
   
   const char *FilenameStart = &FilenameBuffer[0], *FilenameEnd;

Modified: cfe/cfe/trunk/Lex/ScratchBuffer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/ScratchBuffer.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Lex/ScratchBuffer.cpp (original)
+++ cfe/cfe/trunk/Lex/ScratchBuffer.cpp Wed Jul 11 11:46:45 2007
@@ -14,7 +14,6 @@
 #include "clang/Lex/ScratchBuffer.h"
 #include "clang/Basic/SourceManager.h"
 #include "llvm/Support/MemoryBuffer.h"
-using namespace llvm;
 using namespace clang;
 
 // ScratchBufSize - The size of each chunk of scratch memory.  Slightly less
@@ -64,8 +63,8 @@
   if (RequestLen < ScratchBufSize)
     RequestLen = ScratchBufSize;
   
-  MemoryBuffer *Buf = 
-    MemoryBuffer::getNewMemBuffer(RequestLen, "<scratch space>");
+  llvm::MemoryBuffer *Buf = 
+    llvm::MemoryBuffer::getNewMemBuffer(RequestLen, "<scratch space>");
   FileID = SourceMgr.createFileIDForMemBuffer(Buf);
   CurBuffer = const_cast<char*>(Buf->getBufferStart());
   BytesUsed = 0;

Modified: cfe/cfe/trunk/Parse/AttributeList.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Parse/AttributeList.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Parse/AttributeList.cpp (original)
+++ cfe/cfe/trunk/Parse/AttributeList.cpp Wed Jul 11 11:46:45 2007
@@ -13,7 +13,6 @@
 
 #include "clang/Parse/AttributeList.h"
 #include "clang/Lex/IdentifierTable.h"
-using namespace llvm;
 using namespace clang;
 
 AttributeList::AttributeList(IdentifierInfo *aName, SourceLocation aLoc,

Modified: cfe/cfe/trunk/Parse/DeclSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Parse/DeclSpec.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Parse/DeclSpec.cpp (original)
+++ cfe/cfe/trunk/Parse/DeclSpec.cpp Wed Jul 11 11:46:45 2007
@@ -14,7 +14,6 @@
 #include "clang/Parse/DeclSpec.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/SourceLocation.h"
-using namespace llvm;
 using namespace clang;
 
 /// getParsedSpecifiers - Return a bitmask of which flavors of specifiers this

Modified: cfe/cfe/trunk/Parse/MinimalAction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Parse/MinimalAction.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Parse/MinimalAction.cpp (original)
+++ cfe/cfe/trunk/Parse/MinimalAction.cpp Wed Jul 11 11:46:45 2007
@@ -14,7 +14,6 @@
 #include "clang/Parse/Parser.h"
 #include "clang/Parse/DeclSpec.h"
 #include "clang/Parse/Scope.h"
-using namespace llvm;
 using namespace clang;
 
 /// TypeNameInfo - A link exists here for each scope that an identifier is

Modified: cfe/cfe/trunk/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Parse/ParseDecl.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Parse/ParseDecl.cpp (original)
+++ cfe/cfe/trunk/Parse/ParseDecl.cpp Wed Jul 11 11:46:45 2007
@@ -14,7 +14,6 @@
 #include "clang/Parse/Parser.h"
 #include "clang/Parse/DeclSpec.h"
 #include "llvm/ADT/SmallSet.h"
-using namespace llvm;
 using namespace clang;
 
 //===----------------------------------------------------------------------===//
@@ -117,7 +116,7 @@
           } else if (Tok.getKind() == tok::comma) {
             ConsumeToken();
             // __attribute__(( format(printf, 1, 2) ))
-            SmallVector<ExprTy*, 8> ArgExprs;
+            llvm::SmallVector<ExprTy*, 8> ArgExprs;
             bool ArgExprsOk = true;
             
             // now parse the non-empty comma separated list of expressions
@@ -149,7 +148,7 @@
                                          0, SourceLocation(), 0, 0, CurrAttr);
           } else { 
             // __attribute__(( aligned(16) ))
-            SmallVector<ExprTy*, 8> ArgExprs;
+            llvm::SmallVector<ExprTy*, 8> ArgExprs;
             bool ArgExprsOk = true;
             
             // now parse the list of expressions
@@ -626,7 +625,7 @@
     Diag(Tok, diag::ext_empty_struct_union_enum, 
          DeclSpec::getSpecifierName((DeclSpec::TST)TagType));
 
-  SmallVector<DeclTy*, 32> FieldDecls;
+  llvm::SmallVector<DeclTy*, 32> FieldDecls;
   
   // While we still have something to read, read the declarations in the struct.
   while (Tok.getKind() != tok::r_brace && 
@@ -768,7 +767,7 @@
   if (Tok.getKind() == tok::r_brace)
     Diag(Tok, diag::ext_empty_struct_union_enum, "enum");
   
-  SmallVector<DeclTy*, 32> EnumConstantDecls;
+  llvm::SmallVector<DeclTy*, 32> EnumConstantDecls;
 
   DeclTy *LastEnumConstDecl = 0;
   
@@ -1162,8 +1161,8 @@
   bool ErrorEmitted = false;
 
   // Build up an array of information about the parsed arguments.
-  SmallVector<DeclaratorChunk::ParamInfo, 16> ParamInfo;
-  SmallSet<const IdentifierInfo*, 16> ParamsSoFar;
+  llvm::SmallVector<DeclaratorChunk::ParamInfo, 16> ParamInfo;
+  llvm::SmallSet<const IdentifierInfo*, 16> ParamsSoFar;
   
   if (Tok.getKind() == tok::r_paren) {
     // int() -> no prototype, no '...'.

Modified: cfe/cfe/trunk/Parse/ParseExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Parse/ParseExpr.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Parse/ParseExpr.cpp (original)
+++ cfe/cfe/trunk/Parse/ParseExpr.cpp Wed Jul 11 11:46:45 2007
@@ -23,7 +23,6 @@
 #include "clang/Basic/Diagnostic.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/SmallString.h"
-using namespace llvm;
 using namespace clang;
 
 /// PrecedenceLevels - These are precedences for the binary/ternary operators in
@@ -620,8 +619,8 @@
     }
       
     case tok::l_paren: {   // p-e: p-e '(' argument-expression-list[opt] ')'
-      SmallVector<ExprTy*, 8> ArgExprs;
-      SmallVector<SourceLocation, 8> CommaLocs;
+      llvm::SmallVector<ExprTy*, 8> ArgExprs;
+      llvm::SmallVector<SourceLocation, 8> CommaLocs;
       bool ArgExprsOk = true;
       
       Loc = ConsumeParen();
@@ -921,7 +920,7 @@
   
   // String concat.  Note that keywords like __func__ and __FUNCTION__ are not
   // considered to be strings for concatenation purposes.
-  SmallVector<LexerToken, 4> StringToks;
+  llvm::SmallVector<LexerToken, 4> StringToks;
   
   do {
     StringToks.push_back(Tok);

Modified: cfe/cfe/trunk/Parse/ParseExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Parse/ParseExprCXX.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Parse/ParseExprCXX.cpp (original)
+++ cfe/cfe/trunk/Parse/ParseExprCXX.cpp Wed Jul 11 11:46:45 2007
@@ -13,7 +13,6 @@
 
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Parse/Parser.h"
-using namespace llvm;
 using namespace clang;
 
 /// ParseCXXCasts - This handles the various ways to cast expressions to another

Modified: cfe/cfe/trunk/Parse/ParseInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Parse/ParseInit.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Parse/ParseInit.cpp (original)
+++ cfe/cfe/trunk/Parse/ParseInit.cpp Wed Jul 11 11:46:45 2007
@@ -13,7 +13,6 @@
 
 #include "clang/Parse/Parser.h"
 #include "clang/Basic/Diagnostic.h"
-using namespace llvm;
 using namespace clang;
 
 

Modified: cfe/cfe/trunk/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Parse/ParseObjc.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Parse/ParseObjc.cpp (original)
+++ cfe/cfe/trunk/Parse/ParseObjc.cpp Wed Jul 11 11:46:45 2007
@@ -14,7 +14,6 @@
 #include "clang/Parse/Parser.h"
 #include "clang/Basic/Diagnostic.h"
 #include "llvm/ADT/SmallVector.h"
-using namespace llvm;
 using namespace clang;
 
 
@@ -55,7 +54,7 @@
 ///  
 void Parser::ParseObjCAtClassDeclaration(SourceLocation atLoc) {
   ConsumeToken(); // the identifier "class"
-  SmallVector<IdentifierInfo *, 8> ClassNames;
+  llvm::SmallVector<IdentifierInfo *, 8> ClassNames;
   
   while (1) {
     if (Tok.getKind() != tok::identifier) {

Modified: cfe/cfe/trunk/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Parse/ParseStmt.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Parse/ParseStmt.cpp (original)
+++ cfe/cfe/trunk/Parse/ParseStmt.cpp Wed Jul 11 11:46:45 2007
@@ -16,7 +16,6 @@
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Parse/DeclSpec.h"
 #include "clang/Parse/Scope.h"
-using namespace llvm;
 using namespace clang;
 
 //===----------------------------------------------------------------------===//
@@ -394,7 +393,7 @@
   // TODO: "__label__ X, Y, Z;" is the GNU "Local Label" extension.  These are
   // only allowed at the start of a compound stmt.
   
-  SmallVector<StmtTy*, 32> Stmts;
+  llvm::SmallVector<StmtTy*, 32> Stmts;
   while (Tok.getKind() != tok::r_brace && Tok.getKind() != tok::eof) {
     StmtResult R = ParseStatementOrDeclaration(false);
     if (!R.isInvalid && R.Val)

Modified: cfe/cfe/trunk/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Parse/Parser.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Parse/Parser.cpp (original)
+++ cfe/cfe/trunk/Parse/Parser.cpp Wed Jul 11 11:46:45 2007
@@ -14,7 +14,6 @@
 #include "clang/Parse/Parser.h"
 #include "clang/Parse/DeclSpec.h"
 #include "clang/Parse/Scope.h"
-using namespace llvm;
 using namespace clang;
 
 Parser::Parser(Preprocessor &pp, Action &actions)
@@ -174,7 +173,8 @@
 //===----------------------------------------------------------------------===//
 
 /// ScopeCache - Cache scopes to avoid malloc traffic.
-static SmallVector<Scope*, 16> ScopeCache;
+/// FIXME: eliminate this static ctor
+static llvm::SmallVector<Scope*, 16> ScopeCache;
 
 /// EnterScope - Start a new scope.
 void Parser::EnterScope(unsigned ScopeFlags) {

Modified: cfe/cfe/trunk/Sema/ASTStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Sema/ASTStreamer.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Sema/ASTStreamer.cpp (original)
+++ cfe/cfe/trunk/Sema/ASTStreamer.cpp Wed Jul 11 11:46:45 2007
@@ -16,7 +16,6 @@
 #include "Sema.h"
 #include "clang/Parse/Action.h"
 #include "clang/Parse/Parser.h"
-using namespace llvm;
 using namespace clang;
 
 namespace {
@@ -87,27 +86,26 @@
 
 /// ASTStreamer_Init - Create an ASTStreamer with the specified preprocessor
 /// and FileID.
-ASTStreamerTy *llvm::clang::ASTStreamer_Init(Preprocessor &pp,
-                                             ASTContext &ctxt,
-                                             unsigned MainFileID) {
+ASTStreamerTy *clang::ASTStreamer_Init(Preprocessor &pp, ASTContext &ctxt,
+                                       unsigned MainFileID) {
   return new ASTStreamer(pp, ctxt, MainFileID);
 }
 
 /// ASTStreamer_ReadTopLevelDecl - Parse and return one top-level declaration. This
 /// returns null at end of file.
-Decl *llvm::clang::ASTStreamer_ReadTopLevelDecl(ASTStreamerTy *Streamer) {
+Decl *clang::ASTStreamer_ReadTopLevelDecl(ASTStreamerTy *Streamer) {
   return static_cast<ASTStreamer*>(Streamer)->ReadTopLevelDecl();
 }
 
 
 /// ASTStreamer_PrintStats - Emit statistic information to stderr.
 ///
-void llvm::clang::ASTStreamer_PrintStats(ASTStreamerTy *Streamer) {
+void clang::ASTStreamer_PrintStats(ASTStreamerTy *Streamer) {
   return static_cast<ASTStreamer*>(Streamer)->PrintStats();
 }
 
 /// ASTStreamer_Terminate - Gracefully shut down the streamer.
 ///
-void llvm::clang::ASTStreamer_Terminate(ASTStreamerTy *Streamer) {
+void clang::ASTStreamer_Terminate(ASTStreamerTy *Streamer) {
   delete static_cast<ASTStreamer*>(Streamer);
 }

Modified: cfe/cfe/trunk/Sema/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Sema/Sema.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Sema/Sema.cpp (original)
+++ cfe/cfe/trunk/Sema/Sema.cpp Wed Jul 11 11:46:45 2007
@@ -16,7 +16,6 @@
 #include "clang/AST/ASTContext.h"
 #include "clang/Lex/Preprocessor.h"
 #include "clang/Basic/Diagnostic.h"
-using namespace llvm;
 using namespace clang;
 
 Sema::Sema(Preprocessor &pp, ASTContext &ctxt, std::vector<Decl*> &prevInGroup)

Modified: cfe/cfe/trunk/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Sema/Sema.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Sema/Sema.h (original)
+++ cfe/cfe/trunk/Sema/Sema.h Wed Jul 11 11:46:45 2007
@@ -20,7 +20,6 @@
 #include <vector>
 #include <string>
 
-namespace llvm {
 namespace clang {
   class ASTContext;
   class Preprocessor;
@@ -57,7 +56,7 @@
   /// LabelMap - This is a mapping from label identifiers to the LabelStmt for
   /// it (which acts like the label decl in some ways).  Forward referenced
   /// labels have a LabelStmt created for them with a null location & SubStmt.
-  DenseMap<IdentifierInfo*, LabelStmt*> LabelMap;
+  llvm::DenseMap<IdentifierInfo*, LabelStmt*> LabelMap;
 public:
   Sema(Preprocessor &pp, ASTContext &ctxt, std::vector<Decl*> &prevInGroup);
   
@@ -347,6 +346,5 @@
 
 
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Sema/SemaDecl.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Sema/SemaDecl.cpp (original)
+++ cfe/cfe/trunk/Sema/SemaDecl.cpp Wed Jul 11 11:46:45 2007
@@ -24,8 +24,6 @@
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/TargetInfo.h"
 #include "llvm/ADT/SmallSet.h"
-
-using namespace llvm;
 using namespace clang;
 
 // C99: 6.7.5p3: Used by ParseDeclarator/ParseField to make sure we have
@@ -43,7 +41,7 @@
 
   // Verify that the size of the array is an integer constant expr.
   SourceLocation Loc;
-  APSInt SizeVal(32);
+  llvm::APSInt SizeVal(32);
   if (!Size->isIntegerConstantExpr(SizeVal, &Loc)) {
     // FIXME: This emits the diagnostic to enforce 6.7.2.1p8, but the message
     // is wrong.  It is also wrong for static variables.
@@ -61,7 +59,7 @@
   // elsewhere or replicated.  'int X[-1];' inside a function should emit an
   // error.
   if (SizeVal.isSigned()) {
-    APSInt Zero(SizeVal.getBitWidth());
+    llvm::APSInt Zero(SizeVal.getBitWidth());
     Zero.setIsUnsigned(false);
     if (SizeVal < Zero) {
       Diag(DeclLoc, diag::err_typecheck_negative_array_size,
@@ -504,7 +502,7 @@
   CurFunctionDecl = FD;
   
   // Create Decl objects for each parameter, adding them to the FunctionDecl.
-  SmallVector<ParmVarDecl*, 16> Params;
+  llvm::SmallVector<ParmVarDecl*, 16> Params;
   
   // Check for C99 6.7.5.3p10 - foo(void) is a non-varargs function that takes
   // no arguments, not a function that takes a single void argument.
@@ -531,8 +529,8 @@
   // Verify and clean out per-function state.
   
   // Check goto/label use.
-  for (DenseMap<IdentifierInfo*, LabelStmt*>::iterator I = LabelMap.begin(),
-       E = LabelMap.end(); I != E; ++I) {
+  for (llvm::DenseMap<IdentifierInfo*, LabelStmt*>::iterator
+       I = LabelMap.begin(), E = LabelMap.end(); I != E; ++I) {
     // Verify that we have no forward references left.  If so, there was a goto
     // or address of a label taken, but no definition of it.  Label fwd
     // definitions are indicated with a null substmt.
@@ -753,8 +751,8 @@
 
   // Verify that all the fields are okay.
   unsigned NumNamedMembers = 0;
-  SmallVector<FieldDecl*, 32> RecFields;
-  SmallSet<const IdentifierInfo*, 32> FieldIDs;
+  llvm::SmallVector<FieldDecl*, 32> RecFields;
+  llvm::SmallSet<const IdentifierInfo*, 32> FieldIDs;
   
   for (unsigned i = 0; i != NumFields; ++i) {
     FieldDecl *FD = cast_or_null<FieldDecl>(static_cast<Decl*>(Fields[i]));
@@ -872,7 +870,7 @@
     }
   }
 
-  APSInt EnumVal(32);
+  llvm::APSInt EnumVal(32);
   QualType EltTy;
   if (Val) {
     // C99 6.7.2.2p2: Make sure we have an integer constant expression.
@@ -975,7 +973,7 @@
     return 0;
   }
   Expr *sizeExpr = static_cast<Expr *>(rawAttr->getArg(0));
-  APSInt vecSize(32);
+  llvm::APSInt vecSize(32);
   if (!sizeExpr->isIntegerConstantExpr(vecSize)) {
     Diag(rawAttr->getAttributeLoc(), diag::err_attribute_vector_size_not_int,
          sizeExpr->getSourceRange());

Modified: cfe/cfe/trunk/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Sema/SemaExpr.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Sema/SemaExpr.cpp (original)
+++ cfe/cfe/trunk/Sema/SemaExpr.cpp Wed Jul 11 11:46:45 2007
@@ -22,7 +22,6 @@
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/TargetInfo.h"
 #include "llvm/ADT/SmallString.h"
-using namespace llvm;
 using namespace clang;
 
 /// ParseStringLiteral - The specified tokens were lexed as pasted string
@@ -39,7 +38,7 @@
   if (Literal.hadError)
     return ExprResult(true);
 
-  SmallVector<SourceLocation, 4> StringTokLocs;
+  llvm::SmallVector<SourceLocation, 4> StringTokLocs;
   for (unsigned i = 0; i != NumStringToks; ++i)
     StringTokLocs.push_back(StringToks[i].getLocation());
   
@@ -97,7 +96,7 @@
 }
 
 Sema::ExprResult Sema::ParseCharacterConstant(const LexerToken &Tok) {
-  SmallString<16> CharBuffer;
+  llvm::SmallString<16> CharBuffer;
   CharBuffer.resize(Tok.getLength());
   const char *ThisTokBegin = &CharBuffer[0];
   unsigned ActualLength = PP.getSpelling(Tok, ThisTokBegin);
@@ -117,10 +116,11 @@
     const char *t = PP.getSourceManager().getCharacterData(Tok.getLocation());
     
     unsigned IntSize = Context.Target.getIntWidth(Tok.getLocation());
-    return ExprResult(new IntegerLiteral(APInt(IntSize, *t-'0'), Context.IntTy, 
+    return ExprResult(new IntegerLiteral(llvm::APInt(IntSize, *t-'0'),
+                                         Context.IntTy, 
                                          Tok.getLocation()));
   }
-  SmallString<512> IntegerBuffer;
+  llvm::SmallString<512> IntegerBuffer;
   IntegerBuffer.resize(Tok.getLength());
   const char *ThisTokBegin = &IntegerBuffer[0];
   
@@ -135,7 +135,7 @@
     QualType t;
 
     // Get the value in the widest-possible width.
-    APInt ResultVal(Context.Target.getIntMaxTWidth(Tok.getLocation()), 0);
+    llvm::APInt ResultVal(Context.Target.getIntMaxTWidth(Tok.getLocation()), 0);
    
     if (Literal.GetIntegerValue(ResultVal)) {
       // If this value didn't fit into uintmax_t, warn and force to ull.

Modified: cfe/cfe/trunk/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Sema/SemaExprCXX.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Sema/SemaExprCXX.cpp (original)
+++ cfe/cfe/trunk/Sema/SemaExprCXX.cpp Wed Jul 11 11:46:45 2007
@@ -13,7 +13,6 @@
 
 #include "Sema.h"
 #include "clang/AST/ExprCXX.h"
-using namespace llvm;
 using namespace clang;
 
 /// ParseCXXCasts - Parse {dynamic,static,reinterpret,const}_cast's.

Modified: cfe/cfe/trunk/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Sema/SemaStmt.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Sema/SemaStmt.cpp (original)
+++ cfe/cfe/trunk/Sema/SemaStmt.cpp Wed Jul 11 11:46:45 2007
@@ -18,7 +18,6 @@
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Lex/IdentifierTable.h"
-using namespace llvm;
 using namespace clang;
 
 Sema::StmtResult Sema::ParseNullStmt(SourceLocation SemiLoc) {

Modified: cfe/cfe/trunk/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Sema/SemaType.cpp?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/Sema/SemaType.cpp (original)
+++ cfe/cfe/trunk/Sema/SemaType.cpp Wed Jul 11 11:46:45 2007
@@ -16,7 +16,6 @@
 #include "clang/AST/Decl.h"
 #include "clang/Parse/DeclSpec.h"
 #include "clang/Lex/IdentifierTable.h"
-using namespace llvm;
 using namespace clang;
 
 /// ConvertDeclSpecToType - Convert the specified declspec to the appropriate
@@ -193,7 +192,7 @@
       } else {
         // Otherwise, we have a function with an argument list that is
         // potentially variadic.
-        SmallVector<QualType, 16> ArgTys;
+        llvm::SmallVector<QualType, 16> ArgTys;
         
         for (unsigned i = 0, e = FTI.NumArgs; i != e; ++i) {
           QualType ArgTy = QualType::getFromOpaquePtr(FTI.ArgInfo[i].TypeInfo);

Modified: cfe/cfe/trunk/include/clang/AST/ASTContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/AST/ASTContext.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/AST/ASTContext.h (original)
+++ cfe/cfe/trunk/include/clang/AST/ASTContext.h Wed Jul 11 11:46:45 2007
@@ -19,7 +19,6 @@
 #include "clang/AST/Expr.h"
 #include <vector>
 
-namespace llvm {
 namespace clang {
   class TargetInfo;
   
@@ -27,11 +26,11 @@
 /// decls) that can be referred to throughout the semantic analysis of a file.
 class ASTContext {
   std::vector<Type*> Types;
-  FoldingSet<PointerType> PointerTypes;
-  FoldingSet<ReferenceType> ReferenceTypes;
-  FoldingSet<ArrayType> ArrayTypes;
-  FoldingSet<FunctionTypeNoProto> FunctionTypeNoProtos;
-  FoldingSet<FunctionTypeProto> FunctionTypeProtos;
+  llvm::FoldingSet<PointerType> PointerTypes;
+  llvm::FoldingSet<ReferenceType> ReferenceTypes;
+  llvm::FoldingSet<ArrayType> ArrayTypes;
+  llvm::FoldingSet<FunctionTypeNoProto> FunctionTypeNoProtos;
+  llvm::FoldingSet<FunctionTypeProto> FunctionTypeProtos;
 public:
   TargetInfo &Target;
   Builtin::Context BuiltinInfo;
@@ -114,6 +113,5 @@
 };
   
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/AST/Attr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/AST/Attr.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/AST/Attr.h (original)
+++ cfe/cfe/trunk/include/clang/AST/Attr.h Wed Jul 11 11:46:45 2007
@@ -17,7 +17,6 @@
 #include "clang/Basic/SourceLocation.h"
 #include "clang/AST/Type.h"
 
-namespace llvm {
 namespace clang {
 class IdentifierInfo;
 class Expr;
@@ -27,6 +26,5 @@
 /// in "clang/Parse/AttributeList.h"
 
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/AST/Builtins.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/AST/Builtins.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/AST/Builtins.h (original)
+++ cfe/cfe/trunk/include/clang/AST/Builtins.h Wed Jul 11 11:46:45 2007
@@ -17,7 +17,6 @@
 
 #include <cstring>
 
-namespace llvm {
 namespace clang {
   class TargetInfo;
   class IdentifierTable;
@@ -70,5 +69,4 @@
 
 }
 } // end namespace clang
-} // end namespace llvm
 #endif

Modified: cfe/cfe/trunk/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/AST/Decl.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/cfe/trunk/include/clang/AST/Decl.h Wed Jul 11 11:46:45 2007
@@ -18,7 +18,6 @@
 #include "clang/AST/Type.h"
 #include "llvm/ADT/APSInt.h"
 
-namespace llvm {
 namespace clang {
 class IdentifierInfo;
 class Expr;
@@ -279,15 +278,15 @@
 /// TagType for the X EnumDecl.
 class EnumConstantDecl : public ValueDecl {
   Expr *Init; // an integer constant expression
-  APSInt Val; // The value.
+  llvm::APSInt Val; // The value.
 public:
   EnumConstantDecl(SourceLocation L, IdentifierInfo *Id, QualType T, Expr *E,
-                   const APSInt &V, Decl *PrevDecl)
+                   const llvm::APSInt &V, Decl *PrevDecl)
     : ValueDecl(EnumConstant, L, Id, T, PrevDecl), Init(E), Val(V) {}
 
   const Expr *getInitExpr() const { return Init; }
   Expr *getInitExpr() { return Init; }
-  const APSInt &getInitVal() const { return Val; }
+  const llvm::APSInt &getInitVal() const { return Val; }
   
   // Implement isa/cast/dyncast/etc.
   static bool classof(const Decl *D) {
@@ -437,6 +436,5 @@
 };
 
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/AST/Expr.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/cfe/trunk/include/clang/AST/Expr.h Wed Jul 11 11:46:45 2007
@@ -19,7 +19,6 @@
 #include "clang/AST/Decl.h"
 #include "llvm/ADT/APSInt.h"
 
-namespace llvm {
 namespace clang {
   class IdentifierInfo;
   class Decl;
@@ -83,10 +82,10 @@
   /// constant expression, and, if so, return its value in Result.  If not a
   /// valid i-c-e, return false and fill in Loc (if specified) with the location
   /// of the invalid expression.
-  bool isIntegerConstantExpr(APSInt &Result, SourceLocation *Loc = 0,
+  bool isIntegerConstantExpr(llvm::APSInt &Result, SourceLocation *Loc = 0,
                              bool isEvaluated = true) const;
   bool isIntegerConstantExpr(SourceLocation *Loc = 0) const {
-    APSInt X(32);
+    llvm::APSInt X(32);
     return isIntegerConstantExpr(X, Loc);
   }
   
@@ -123,16 +122,16 @@
 };
 
 class IntegerLiteral : public Expr {
-  APInt Value;
+  llvm::APInt Value;
   SourceLocation Loc;
 public:
   // type should be IntTy, LongTy, LongLongTy, UnsignedIntTy, UnsignedLongTy, 
   // or UnsignedLongLongTy
-  IntegerLiteral(const APInt &V, QualType type, SourceLocation l)
+  IntegerLiteral(const llvm::APInt &V, QualType type, SourceLocation l)
     : Expr(IntegerLiteralClass, type), Value(V), Loc(l) {
     assert(type->isIntegerType() && "Illegal type in IntegerLiteral");
   }
-  const APInt &getValue() const { return Value; }
+  const llvm::APInt &getValue() const { return Value; }
   virtual SourceRange getSourceRange() const { return SourceRange(Loc); }
 
   virtual void visit(StmtVisitor &Visitor);
@@ -541,6 +540,5 @@
 };
   
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/AST/ExprCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/AST/ExprCXX.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/AST/ExprCXX.h (original)
+++ cfe/cfe/trunk/include/clang/AST/ExprCXX.h Wed Jul 11 11:46:45 2007
@@ -16,7 +16,6 @@
 
 #include "clang/AST/Expr.h"
 
-namespace llvm {
 namespace clang {
 
   //===--------------------------------------------------------------------===//
@@ -60,6 +59,5 @@
   };
 
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/AST/Stmt.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/cfe/trunk/include/clang/AST/Stmt.h Wed Jul 11 11:46:45 2007
@@ -18,7 +18,6 @@
 #include "llvm/ADT/SmallVector.h"
 #include <iosfwd>
 
-namespace llvm {
 namespace clang {
   class Expr;
   class Decl;
@@ -102,16 +101,16 @@
 /// CompoundStmt - This represents a group of statements like { stmt stmt }.
 ///
 class CompoundStmt : public Stmt {
-  SmallVector<Stmt*, 16> Body;
+  llvm::SmallVector<Stmt*, 16> Body;
 public:
   CompoundStmt(Stmt **StmtStart, unsigned NumStmts)
     : Stmt(CompoundStmtClass), Body(StmtStart, StmtStart+NumStmts) {}
   
-  typedef SmallVector<Stmt*, 16>::iterator body_iterator;
+  typedef llvm::SmallVector<Stmt*, 16>::iterator body_iterator;
   body_iterator body_begin() { return Body.begin(); }
   body_iterator body_end() { return Body.end(); }
 
-  typedef SmallVector<Stmt*, 16>::const_iterator const_body_iterator;
+  typedef llvm::SmallVector<Stmt*, 16>::const_iterator const_body_iterator;
   const_body_iterator body_begin() const { return Body.begin(); }
   const_body_iterator body_end() const { return Body.end(); }
   
@@ -374,9 +373,6 @@
   static bool classof(const ReturnStmt *) { return true; }
 };
 
-
-  
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/AST/StmtVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/AST/StmtVisitor.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/AST/StmtVisitor.h (original)
+++ cfe/cfe/trunk/include/clang/AST/StmtVisitor.h Wed Jul 11 11:46:45 2007
@@ -14,7 +14,6 @@
 #ifndef LLVM_CLANG_AST_STMTVISITOR_H
 #define LLVM_CLANG_AST_STMTVISITOR_H
 
-namespace llvm {
 namespace clang {
   class Stmt;
   // Add prototypes for all AST node classes.
@@ -37,6 +36,5 @@
 };
   
 }
-}
 
 #endif

Modified: cfe/cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/AST/Type.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/cfe/trunk/include/clang/AST/Type.h Wed Jul 11 11:46:45 2007
@@ -17,7 +17,12 @@
 #include "llvm/Support/Casting.h"
 #include "llvm/ADT/FoldingSet.h"
 
-namespace llvm {
+using llvm::isa;
+using llvm::cast;
+using llvm::cast_or_null;
+using llvm::dyn_cast;
+using llvm::dyn_cast_or_null;
+
 namespace clang {
   class ASTContext;
   class Type;
@@ -131,16 +136,18 @@
 
 } // end clang.
 
+namespace llvm {
 /// Implement simplify_type for QualType, so that we can dyn_cast from QualType
 /// to a specific Type class.
-template<> struct simplify_type<const clang::QualType> {
-  typedef clang::Type* SimpleType;
-  static SimpleType getSimplifiedValue(const clang::QualType &Val) {
+template<> struct simplify_type<const ::clang::QualType> {
+  typedef ::clang::Type* SimpleType;
+  static SimpleType getSimplifiedValue(const ::clang::QualType &Val) {
     return Val.getTypePtr();
   }
 };
-template<> struct simplify_type<clang::QualType>
-  : public simplify_type<const clang::QualType> {};
+template<> struct simplify_type< ::clang::QualType>
+  : public simplify_type<const ::clang::QualType> {};
+}
 
 namespace clang {
 
@@ -305,7 +312,7 @@
 
 /// PointerType - C99 6.7.5.1 - Pointer Declarators.
 ///
-class PointerType : public Type, public FoldingSetNode {
+class PointerType : public Type, public llvm::FoldingSetNode {
   QualType PointeeType;
   PointerType(QualType Pointee, QualType CanonicalPtr) :
     Type(Pointer, CanonicalPtr), PointeeType(Pointee) {
@@ -318,10 +325,10 @@
   virtual void getAsStringInternal(std::string &InnerString) const;
   
   
-  void Profile(FoldingSetNodeID &ID) {
+  void Profile(llvm::FoldingSetNodeID &ID) {
     Profile(ID, getPointeeType());
   }
-  static void Profile(FoldingSetNodeID &ID, QualType Pointee) {
+  static void Profile(llvm::FoldingSetNodeID &ID, QualType Pointee) {
     ID.AddPointer(Pointee.getAsOpaquePtr());
   }
   
@@ -331,7 +338,7 @@
 
 /// ReferenceType - C++ 8.3.2 - Reference Declarators.
 ///
-class ReferenceType : public Type, public FoldingSetNode {
+class ReferenceType : public Type, public llvm::FoldingSetNode {
   QualType ReferenceeType;
   ReferenceType(QualType Referencee, QualType CanonicalRef) :
     Type(Reference, CanonicalRef), ReferenceeType(Referencee) {
@@ -342,10 +349,10 @@
 
   QualType getReferenceeType() const { return ReferenceeType; }
 
-  void Profile(FoldingSetNodeID &ID) {
+  void Profile(llvm::FoldingSetNodeID &ID) {
     Profile(ID, getReferenceeType());
   }
-  static void Profile(FoldingSetNodeID &ID, QualType Referencee) {
+  static void Profile(llvm::FoldingSetNodeID &ID, QualType Referencee) {
     ID.AddPointer(Referencee.getAsOpaquePtr());
   }
 
@@ -355,7 +362,7 @@
 
 /// ArrayType - C99 6.7.5.2 - Array Declarators.
 ///
-class ArrayType : public Type, public FoldingSetNode {
+class ArrayType : public Type, public llvm::FoldingSetNode {
 public:
   /// ArraySizeModifier - Capture whether this is a normal array (e.g. int X[4])
   /// an array with a static size (e.g. int X[static 4]), or with a star size
@@ -392,11 +399,12 @@
   
   virtual void getAsStringInternal(std::string &InnerString) const;
   
-  void Profile(FoldingSetNodeID &ID) {
+  void Profile(llvm::FoldingSetNodeID &ID) {
     Profile(ID, getSizeModifier(), getIndexTypeQualifier(), getElementType(),
             getSize());
   }
-  static void Profile(FoldingSetNodeID &ID, ArraySizeModifier SizeModifier,
+  static void Profile(llvm::FoldingSetNodeID &ID,
+                      ArraySizeModifier SizeModifier,
                       unsigned IndexTypeQuals, QualType ElementType,
                       Expr *SizeExpr) {
     ID.AddInteger(SizeModifier);
@@ -437,7 +445,7 @@
 
 /// FunctionTypeNoProto - Represents a K&R-style 'int foo()' function, which has
 /// no information available about its arguments.
-class FunctionTypeNoProto : public FunctionType, public FoldingSetNode {
+class FunctionTypeNoProto : public FunctionType, public llvm::FoldingSetNode {
   FunctionTypeNoProto(QualType Result, QualType Canonical)
     : FunctionType(FunctionNoProto, Result, false, Canonical) {}
   friend class ASTContext;  // ASTContext creates these.
@@ -446,10 +454,10 @@
   
   virtual void getAsStringInternal(std::string &InnerString) const;
 
-  void Profile(FoldingSetNodeID &ID) {
+  void Profile(llvm::FoldingSetNodeID &ID) {
     Profile(ID, getResultType());
   }
-  static void Profile(FoldingSetNodeID &ID, QualType ResultType) {
+  static void Profile(llvm::FoldingSetNodeID &ID, QualType ResultType) {
     ID.AddPointer(ResultType.getAsOpaquePtr());
   }
   
@@ -462,7 +470,7 @@
 /// FunctionTypeProto - Represents a prototype with argument type info, e.g.
 /// 'int foo(int)' or 'int foo(void)'.  'void' is represented as having no
 /// arguments, not as having a single void argument.
-class FunctionTypeProto : public FunctionType, public FoldingSetNode {
+class FunctionTypeProto : public FunctionType, public llvm::FoldingSetNode {
   FunctionTypeProto(QualType Result, QualType *ArgArray, unsigned numArgs,
                     bool isVariadic, QualType Canonical)
     : FunctionType(FunctionProto, Result, isVariadic, Canonical),
@@ -495,9 +503,9 @@
   }
   static bool classof(const FunctionTypeProto *) { return true; }
   
-  void Profile(FoldingSetNodeID &ID);
-  static void Profile(FoldingSetNodeID &ID, QualType Result, QualType* ArgTys,
-                      unsigned NumArgs, bool isVariadic);
+  void Profile(llvm::FoldingSetNodeID &ID);
+  static void Profile(llvm::FoldingSetNodeID &ID, QualType Result,
+                      QualType* ArgTys, unsigned NumArgs, bool isVariadic);
 };
 
 
@@ -568,6 +576,5 @@
 }
   
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Basic/Diagnostic.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Basic/Diagnostic.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Basic/Diagnostic.h (original)
+++ cfe/cfe/trunk/include/clang/Basic/Diagnostic.h Wed Jul 11 11:46:45 2007
@@ -16,7 +16,6 @@
 
 #include <string>
 
-namespace llvm {
 namespace clang {
   class DiagnosticClient;
   class SourceLocation;
@@ -154,6 +153,5 @@
 };
 
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Basic/FileManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Basic/FileManager.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Basic/FileManager.h (original)
+++ cfe/cfe/trunk/include/clang/Basic/FileManager.h Wed Jul 11 11:46:45 2007
@@ -20,7 +20,6 @@
 // FIXME: Enhance libsystem to support inode and other fields in stat.
 #include <sys/types.h>
 
-namespace llvm {
 namespace clang {
 class FileManager;
   
@@ -71,8 +70,8 @@
   /// DirEntries/FileEntries - This is a cache of directory/file entries we have
   /// looked up.  The actual Entry is owned by UniqueFiles/UniqueDirs above.
   ///
-  StringMap<DirectoryEntry*> DirEntries;
-  StringMap<FileEntry*> FileEntries;
+  llvm::StringMap<DirectoryEntry*> DirEntries;
+  llvm::StringMap<FileEntry*> FileEntries;
   
   /// NextFileUID - Each FileEntry we create is assigned a unique ID #.
   ///
@@ -108,6 +107,5 @@
 };
 
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Basic/LangOptions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Basic/LangOptions.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Basic/LangOptions.h (original)
+++ cfe/cfe/trunk/include/clang/Basic/LangOptions.h Wed Jul 11 11:46:45 2007
@@ -14,7 +14,6 @@
 #ifndef LLVM_CLANG_LANGOPTIONS_H
 #define LLVM_CLANG_LANGOPTIONS_H
 
-namespace llvm {
 namespace clang {
 
 /// LangOptions - This class keeps track of the various options that can be
@@ -41,6 +40,5 @@
 };
 
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Basic/SourceLocation.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Basic/SourceLocation.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Basic/SourceLocation.h (original)
+++ cfe/cfe/trunk/include/clang/Basic/SourceLocation.h Wed Jul 11 11:46:45 2007
@@ -14,7 +14,6 @@
 #ifndef LLVM_CLANG_SOURCELOCATION_H
 #define LLVM_CLANG_SOURCELOCATION_H
 
-namespace llvm {
 namespace clang {
     
 /// SourceLocation - This is a carefully crafted 32-bit identifier that encodes
@@ -105,6 +104,5 @@
 };
   
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Basic/SourceManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Basic/SourceManager.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Basic/SourceManager.h (original)
+++ cfe/cfe/trunk/include/clang/Basic/SourceManager.h Wed Jul 11 11:46:45 2007
@@ -21,6 +21,7 @@
 
 namespace llvm {
 class MemoryBuffer;
+}
   
 namespace clang {
   
@@ -36,7 +37,7 @@
   struct FileInfo {
     /// Buffer - The actual buffer containing the characters from the input
     /// file.
-    const MemoryBuffer *Buffer;
+    const llvm::MemoryBuffer *Buffer;
     
     /// SourceLineCache - A new[]'d array of offsets for each source line.  This
     /// is lazily computed.
@@ -188,7 +189,7 @@
   /// createFileIDForMemBuffer - Create a new FileID that represents the
   /// specified memory buffer.  This does no caching of the buffer and takes
   /// ownership of the MemoryBuffer, so only pass a MemoryBuffer to this once.
-  unsigned createFileIDForMemBuffer(const MemoryBuffer *Buffer) {
+  unsigned createFileIDForMemBuffer(const llvm::MemoryBuffer *Buffer) {
     return createFileID(createMemBufferInfoRec(Buffer), SourceLocation());
   }
   
@@ -200,7 +201,7 @@
   
   /// getBuffer - Return the buffer for the specified FileID.
   ///
-  const MemoryBuffer *getBuffer(unsigned FileID) const {
+  const llvm::MemoryBuffer *getBuffer(unsigned FileID) const {
     return getFileInfo(FileID)->Buffer;
   }
   
@@ -298,7 +299,7 @@
   
   /// createMemBufferInfoRec - Create a new info record for the specified memory
   /// buffer.  This does no caching.
-  const SrcMgr::InfoRec *createMemBufferInfoRec(const MemoryBuffer *Buffer);
+  const SrcMgr::InfoRec *createMemBufferInfoRec(const llvm::MemoryBuffer *Buf);
 
   const SrcMgr::FileIDInfo *getFIDInfo(unsigned FileID) const {
     assert(FileID-1 < FileIDs.size() && "Invalid FileID!");
@@ -336,6 +337,5 @@
 
 
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Basic/TargetInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Basic/TargetInfo.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Basic/TargetInfo.h (original)
+++ cfe/cfe/trunk/include/clang/Basic/TargetInfo.h Wed Jul 11 11:46:45 2007
@@ -18,7 +18,6 @@
 #include <vector>
 #include <string>
 
-namespace llvm {
 namespace clang {
 
 class TargetInfoImpl;
@@ -205,6 +204,5 @@
 };
 
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Basic/TokenKinds.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Basic/TokenKinds.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Basic/TokenKinds.h (original)
+++ cfe/cfe/trunk/include/clang/Basic/TokenKinds.h Wed Jul 11 11:46:45 2007
@@ -14,7 +14,6 @@
 #ifndef LLVM_CLANG_TOKENKINDS_H
 #define LLVM_CLANG_TOKENKINDS_H
 
-namespace llvm {
 namespace clang {
 
 namespace tok {
@@ -48,6 +47,5 @@
 
 }  // end namespace tok
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/CodeGen/ModuleBuilder.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/CodeGen/ModuleBuilder.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/CodeGen/ModuleBuilder.h (original)
+++ cfe/cfe/trunk/include/clang/CodeGen/ModuleBuilder.h Wed Jul 11 11:46:45 2007
@@ -16,6 +16,8 @@
 
 namespace llvm {
   class Module;
+}
+
 namespace clang {
   class ASTContext;
   class FunctionDecl;
@@ -26,7 +28,7 @@
   typedef void BuilderTy;
   
   /// Init - Create an ModuleBuilder with the specified ASTContext.
-  BuilderTy *Init(ASTContext &Context, Module &M);
+  BuilderTy *Init(ASTContext &Context, llvm::Module &M);
   
   /// CodeGenFunction - Convert the AST node for a FunctionDecl into LLVM.
   ///
@@ -41,6 +43,5 @@
   void Terminate(BuilderTy *Builder);
 }  // end namespace CodeGen
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Lex/DirectoryLookup.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Lex/DirectoryLookup.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Lex/DirectoryLookup.h (original)
+++ cfe/cfe/trunk/include/clang/Lex/DirectoryLookup.h Wed Jul 11 11:46:45 2007
@@ -14,7 +14,6 @@
 #ifndef LLVM_CLANG_LEX_DIRECTORYLOOKUP_H
 #define LLVM_CLANG_LEX_DIRECTORYLOOKUP_H
 
-namespace llvm {
 namespace clang {
 class DirectoryEntry;
 
@@ -66,7 +65,6 @@
   bool isFramework() const { return Framework; }
 };
 
-}  // end namespace llvm
 }  // end namespace clang
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Lex/HeaderSearch.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Lex/HeaderSearch.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Lex/HeaderSearch.h (original)
+++ cfe/cfe/trunk/include/clang/Lex/HeaderSearch.h Wed Jul 11 11:46:45 2007
@@ -18,7 +18,6 @@
 #include "llvm/ADT/StringMap.h"
 #include <vector>
 
-namespace llvm {
 namespace clang {
 class FileEntry;
 class FileManager;
@@ -71,7 +70,7 @@
 
   /// FrameworkMap - This is a collection mapping a framework or subframework
   /// name like "Carbon" to the Carbon.framework directory.
-  StringMap<const DirectoryEntry *> FrameworkMap;
+  llvm::StringMap<const DirectoryEntry *> FrameworkMap;
 
   // Various statistics we track for performance analysis.
   unsigned NumIncluded;
@@ -162,7 +161,6 @@
   PerFileInfo &getFileInfo(const FileEntry *FE);
 };
 
-}  // end namespace llvm
 }  // end namespace clang
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Lex/IdentifierTable.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Lex/IdentifierTable.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Lex/IdentifierTable.h (original)
+++ cfe/cfe/trunk/include/clang/Lex/IdentifierTable.h Wed Jul 11 11:46:45 2007
@@ -18,7 +18,6 @@
 #include "llvm/ADT/StringMap.h"
 #include <string> 
 
-namespace llvm {
 namespace clang {
   class MacroInfo;
   class LangOptions;
@@ -132,7 +131,7 @@
 class IdentifierTable {
   // Shark shows that using MallocAllocator is *much* slower than using this
   // BumpPtrAllocator!
-  typedef StringMap<IdentifierInfo, BumpPtrAllocator> HashTableTy;
+  typedef llvm::StringMap<IdentifierInfo, llvm::BumpPtrAllocator> HashTableTy;
   HashTableTy HashTable;
 public:
   /// IdentifierTable ctor - Create the identifier table, populating it with
@@ -167,7 +166,6 @@
   void AddKeywords(const LangOptions &LangOpts);
 };
 
-}  // end namespace llvm
 }  // end namespace clang
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Lex/Lexer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Lex/Lexer.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Lex/Lexer.h (original)
+++ cfe/cfe/trunk/include/clang/Lex/Lexer.h Wed Jul 11 11:46:45 2007
@@ -21,7 +21,8 @@
 #include <vector>
 
 namespace llvm {
-class MemoryBuffer;
+  class MemoryBuffer;
+}
   
 namespace clang {
 class Diagnostic;
@@ -35,7 +36,7 @@
   //===--------------------------------------------------------------------===//
   // Constant configuration values for this lexer.
   const char * const BufferEnd;  // End of the buffer.
-  const MemoryBuffer *InputFile; // The file we are reading from.
+  const llvm::MemoryBuffer *InputFile; // The file we are reading from.
   unsigned CurFileID;            // FileID for the current input file.
   Preprocessor &PP;              // Preprocessor object controlling lexing.
   LangOptions Features;          // Features enabled by this language (cache).
@@ -98,8 +99,8 @@
   /// with the specified preprocessor managing the lexing process.  This lexer
   /// assumes that the specified MemoryBuffer and Preprocessor objects will
   /// outlive it, but doesn't take ownership of either pointer.
-  Lexer(const MemoryBuffer *InBuffer, unsigned CurFileID, Preprocessor &PP,
-        const char *BufStart = 0, const char *BufEnd = 0);
+    Lexer(const llvm::MemoryBuffer *InBuffer, unsigned CurFileID, 
+          Preprocessor &PP, const char *BufStart = 0, const char *BufEnd = 0);
   
   /// getFeatures - Return the language features currently enabled.  NOTE: this
   /// lexer modifies features as a file is parsed!
@@ -348,6 +349,5 @@
 
 
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Lex/LexerToken.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Lex/LexerToken.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Lex/LexerToken.h (original)
+++ cfe/cfe/trunk/include/clang/Lex/LexerToken.h Wed Jul 11 11:46:45 2007
@@ -17,7 +17,6 @@
 #include "clang/Basic/TokenKinds.h"
 #include "clang/Basic/SourceLocation.h"
 
-namespace llvm {
 namespace clang {
 
 class IdentifierInfo;
@@ -134,6 +133,5 @@
 };
 
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Lex/LiteralSupport.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Lex/LiteralSupport.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Lex/LiteralSupport.h (original)
+++ cfe/cfe/trunk/include/clang/Lex/LiteralSupport.h Wed Jul 11 11:46:45 2007
@@ -12,14 +12,16 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_CLANG_LITERALSUPPORT_H
-#define LLVM_CLANG_LITERALSUPPORT_H
+#ifndef CLANG_LITERALSUPPORT_H
+#define CLANG_LITERALSUPPORT_H
 
 #include <string>
 #include "llvm/ADT/SmallString.h"
 
 namespace llvm {
   class APInt;
+}
+
 namespace clang {
 
 class Diagnostic;
@@ -68,7 +70,7 @@
   /// matches Val's input width.  If there is an overflow (i.e., if the unsigned
   /// value read is larger than the APInt's bits will hold), set Val to the low
   /// bits of the result and return true.  Otherwise, return false.
-  bool GetIntegerValue(APInt &Val);
+  bool GetIntegerValue(llvm::APInt &Val);
 
 private:  
   void Diag(SourceLocation Loc, unsigned DiagID, 
@@ -133,7 +135,7 @@
   unsigned MaxTokenLength;
   unsigned SizeBound;
   unsigned wchar_tByteWidth;
-  SmallString<512> ResultBuf;
+  llvm::SmallString<512> ResultBuf;
   char *ResultPtr; // cursor
 public:
   StringLiteralParser(const LexerToken *StringToks, unsigned NumStringToks,
@@ -146,6 +148,5 @@
 };
   
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif
\ No newline at end of file

Modified: cfe/cfe/trunk/include/clang/Lex/MacroExpander.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Lex/MacroExpander.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Lex/MacroExpander.h (original)
+++ cfe/cfe/trunk/include/clang/Lex/MacroExpander.h Wed Jul 11 11:46:45 2007
@@ -17,7 +17,6 @@
 #include "clang/Basic/SourceLocation.h"
 #include <vector>
 
-namespace llvm {
 namespace clang {
   class MacroInfo;
   class Preprocessor;
@@ -175,7 +174,6 @@
   void ExpandFunctionArguments();
 };
 
-}  // end namespace llvm
 }  // end namespace clang
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Lex/MacroInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Lex/MacroInfo.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Lex/MacroInfo.h (original)
+++ cfe/cfe/trunk/include/clang/Lex/MacroInfo.h Wed Jul 11 11:46:45 2007
@@ -17,7 +17,6 @@
 #include "clang/Lex/LexerToken.h"
 #include <vector>
 
-namespace llvm {
 namespace clang {
   class Preprocessor;
     
@@ -182,7 +181,6 @@
   }
 };
     
-}  // end namespace llvm
 }  // end namespace clang
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Lex/MultipleIncludeOpt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Lex/MultipleIncludeOpt.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Lex/MultipleIncludeOpt.h (original)
+++ cfe/cfe/trunk/include/clang/Lex/MultipleIncludeOpt.h Wed Jul 11 11:46:45 2007
@@ -14,7 +14,6 @@
 #ifndef LLVM_CLANG_MULTIPLEINCLUDEOPT_H
 #define LLVM_CLANG_MULTIPLEINCLUDEOPT_H
 
-namespace llvm {
 namespace clang {
 class IdentifierInfo;
 
@@ -104,6 +103,5 @@
 };
 
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Lex/PPCallbacks.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Lex/PPCallbacks.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Lex/PPCallbacks.h (original)
+++ cfe/cfe/trunk/include/clang/Lex/PPCallbacks.h Wed Jul 11 11:46:45 2007
@@ -18,7 +18,6 @@
 #include "clang/Basic/SourceLocation.h"
 #include <string>
 
-namespace llvm {
 namespace clang {
   class SourceLocation;
     
@@ -50,6 +49,5 @@
 };
 
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Lex/Pragma.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Lex/Pragma.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Lex/Pragma.h (original)
+++ cfe/cfe/trunk/include/clang/Lex/Pragma.h Wed Jul 11 11:46:45 2007
@@ -17,7 +17,6 @@
 #include <cassert>
 #include <vector>
 
-namespace llvm {
 namespace clang {
   class Preprocessor;
   class LexerToken;
@@ -79,6 +78,5 @@
 
 
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Lex/Preprocessor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Lex/Preprocessor.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Lex/Preprocessor.h (original)
+++ cfe/cfe/trunk/include/clang/Lex/Preprocessor.h Wed Jul 11 11:46:45 2007
@@ -19,7 +19,6 @@
 #include "clang/Lex/MacroExpander.h"
 #include "clang/Basic/SourceLocation.h"
 
-namespace llvm {
 namespace clang {
   
 class SourceManager;
@@ -451,6 +450,5 @@
 };
 
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Lex/ScratchBuffer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Lex/ScratchBuffer.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Lex/ScratchBuffer.h (original)
+++ cfe/cfe/trunk/include/clang/Lex/ScratchBuffer.h Wed Jul 11 11:46:45 2007
@@ -14,7 +14,6 @@
 #ifndef LLVM_CLANG_SCRATCHBUFFER_H
 #define LLVM_CLANG_SCRATCHBUFFER_H
 
-namespace llvm {
 namespace clang {
   class SourceManager;
   class SourceLocation;
@@ -47,6 +46,5 @@
 };
 
 } // end namespace clang
-} // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Parse/Action.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Parse/Action.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Parse/Action.h (original)
+++ cfe/cfe/trunk/include/clang/Parse/Action.h Wed Jul 11 11:46:45 2007
@@ -17,7 +17,6 @@
 #include "clang/Basic/SourceLocation.h"
 #include "clang/Basic/TokenKinds.h"
 
-namespace llvm {
 namespace clang {
   // Semantic.
   class DeclSpec;
@@ -397,6 +396,5 @@
 };
 
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Parse/AttributeList.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Parse/AttributeList.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Parse/AttributeList.h (original)
+++ cfe/cfe/trunk/include/clang/Parse/AttributeList.h Wed Jul 11 11:46:45 2007
@@ -17,7 +17,6 @@
 #include "clang/Parse/Action.h"
 #include <cassert>
 
-namespace llvm {
 namespace clang {
 
 /// AttributeList - Represents GCC's __attribute__ declaration. There are
@@ -83,6 +82,5 @@
 };
 
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Parse/DeclSpec.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Parse/DeclSpec.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Parse/DeclSpec.h (original)
+++ cfe/cfe/trunk/include/clang/Parse/DeclSpec.h Wed Jul 11 11:46:45 2007
@@ -19,7 +19,6 @@
 #include "clang/Parse/AttributeList.h"
 #include "llvm/ADT/SmallVector.h"
 
-namespace llvm {
 namespace clang {
   class LangOptions;
   class IdentifierInfo;
@@ -441,7 +440,7 @@
   /// parsed.  This is pushed from the identifier out, which means that element
   /// #0 will be the most closely bound to the identifier, and
   /// DeclTypeInfo.back() will be the least closely bound.
-  SmallVector<DeclaratorChunk, 8> DeclTypeInfo;
+  llvm::SmallVector<DeclaratorChunk, 8> DeclTypeInfo;
 
   // attributes.
   AttributeList *AttrList;  
@@ -549,6 +548,5 @@
 
   
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Parse/Parser.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/cfe/trunk/include/clang/Parse/Parser.h Wed Jul 11 11:46:45 2007
@@ -17,7 +17,6 @@
 #include "clang/Lex/Preprocessor.h"
 #include "clang/Parse/Action.h"
 
-namespace llvm {
 namespace clang {
   class DeclSpec;
   class Declarator;
@@ -368,6 +367,5 @@
 };
 
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Parse/Scope.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Parse/Scope.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Parse/Scope.h (original)
+++ cfe/cfe/trunk/include/clang/Parse/Scope.h Wed Jul 11 11:46:45 2007
@@ -16,9 +16,7 @@
 
 #include "clang/Parse/Action.h"
 #include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/SmallSet.h"
 
-namespace llvm {
 namespace clang {
 
 /// Scope - A scope is a transient data structure that is used while parsing the
@@ -78,7 +76,7 @@
   /// popped, these declarations are removed from the IdentifierTable's notion
   /// of current declaration.  It is up to the current Action implementation to
   /// implement these semantics.
-  typedef SmallPtrSet<Action::DeclTy*, 32> DeclSetTy;
+  typedef llvm::SmallPtrSet<Action::DeclTy*, 32> DeclSetTy;
   DeclSetTy DeclsInScope;
 public:
   Scope(Scope *Parent, unsigned ScopeFlags) {
@@ -144,6 +142,5 @@
 };
     
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif

Modified: cfe/cfe/trunk/include/clang/Sema/ASTStreamer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Sema/ASTStreamer.h?rev=39659&r1=39658&r2=39659&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Sema/ASTStreamer.h (original)
+++ cfe/cfe/trunk/include/clang/Sema/ASTStreamer.h Wed Jul 11 11:46:45 2007
@@ -14,7 +14,6 @@
 #ifndef LLVM_CLANG_AST_ASTSTREAMER_H
 #define LLVM_CLANG_AST_ASTSTREAMER_H
 
-namespace llvm {
 namespace clang {
   class Preprocessor;
   class ASTContext;
@@ -42,6 +41,5 @@
   void ASTStreamer_Terminate(ASTStreamerTy *Streamer);
   
 }  // end namespace clang
-}  // end namespace llvm
 
 #endif





More information about the cfe-commits mailing list