]> granicus.if.org Git - clang/commitdiff
Move ArrayRef to LLVM.h and eliminate now-redundant qualifiers, patch by Jon Mulder!
authorChris Lattner <sabre@nondot.org>
Sat, 23 Jul 2011 17:14:25 +0000 (17:14 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 23 Jul 2011 17:14:25 +0000 (17:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135855 91177308-0d34-0410-b5e6-96231b3b80d8

19 files changed:
include/clang/Basic/Diagnostic.h
include/clang/Basic/LLVM.h
include/clang/Driver/Driver.h
include/clang/Frontend/Utils.h
include/clang/Lex/Preprocessor.h
lib/ARCMigrate/ARCMT.cpp
lib/ARCMigrate/Internals.h
lib/ARCMigrate/PlistReporter.cpp
lib/ARCMigrate/TransformActions.cpp
lib/Basic/Diagnostic.cpp
lib/CodeGen/CGCall.cpp
lib/CodeGen/CodeGenFunction.h
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/CodeGenModule.h
lib/Driver/Driver.cpp
lib/Frontend/CreateInvocationFromCommandLine.cpp
lib/Lex/PPMacroExpansion.cpp
lib/Sema/SemaStmt.cpp
tools/arcmt-test/arcmt-test.cpp

index 7f6f53739ce1708b9f0ba874f8cb375b167e2126..b7a1f3a627d254f0d99e9f5501a79d1a627cb156 100644 (file)
@@ -987,8 +987,8 @@ public:
                    StringRef Message);
   StoredDiagnostic(Diagnostic::Level Level, unsigned ID, 
                    StringRef Message, FullSourceLoc Loc,
-                   llvm::ArrayRef<CharSourceRange> Ranges,
-                   llvm::ArrayRef<FixItHint> Fixits);
+                   ArrayRef<CharSourceRange> Ranges,
+                   ArrayRef<FixItHint> Fixits);
   ~StoredDiagnostic();
 
   /// \brief Evaluates true when this object stores a diagnostic.
index 7db17f7659d2fe9e58b3027d5c4e9099036c8a13..27c459dee4e24859e6c1a2935b49ca791b2cd12f 100644 (file)
@@ -23,11 +23,12 @@ namespace llvm {
   // ADT's.
   class StringRef;
   class Twine;
+  template<typename T> class ArrayRef;
   template<typename T, unsigned N> class SmallVector;
   template<typename T> class SmallVectorImpl;
 
   class raw_ostream;
-  // TODO: ArrayRef, DenseMap, ...
+  // TODO: DenseMap, ...
 }
 
 
@@ -42,6 +43,7 @@ namespace clang {
   // ADT's.
   using llvm::StringRef;
   using llvm::Twine;
+  using llvm::ArrayRef;
   using llvm::SmallVector;
   using llvm::SmallVectorImpl;
   
index 1af572a5bd1bcbded37d78a8bb67ed1e8ad97253..3ad3fb3ff4de3bdc8842fc953cf24ed39bbb1a18 100644 (file)
@@ -223,14 +223,14 @@ public:
   /// argument vector. A null return value does not necessarily
   /// indicate an error condition, the diagnostics should be queried
   /// to determine if an error occurred.
-  Compilation *BuildCompilation(llvm::ArrayRef<const char *> Args);
+  Compilation *BuildCompilation(ArrayRef<const char *> Args);
 
   /// @name Driver Steps
   /// @{
 
   /// ParseArgStrings - Parse the given list of strings into an
   /// ArgList.
-  InputArgList *ParseArgStrings(llvm::ArrayRef<const char *> Args);
+  InputArgList *ParseArgStrings(ArrayRef<const char *> Args);
 
   /// BuildActions - Construct the list of actions to perform for the
   /// given arguments, which are only done for a single architecture.
index 105e4eb0decf3c4d47e6d6bad2b2f1c7798ed7de..b3ecb363bac34e03fb31c88c9c04148831c78bde 100644 (file)
@@ -100,7 +100,7 @@ void CacheTokens(Preprocessor &PP, llvm::raw_fd_ostream* OS);
 /// \return A CompilerInvocation, or 0 if none was built for the given
 /// argument vector.
 CompilerInvocation *
-createInvocationFromCommandLine(llvm::ArrayRef<const char *> Args,
+createInvocationFromCommandLine(ArrayRef<const char *> Args,
                                 llvm::IntrusiveRefCntPtr<Diagnostic> Diags =
                                     llvm::IntrusiveRefCntPtr<Diagnostic>());
 
index e546b69370458b07384970ae482ea650e28cbedc..2a2f099548f0391377656ec9feb7d9bea179ee92 100644 (file)
@@ -1006,7 +1006,7 @@ private:
   /// going to lex in the cache and when it finishes the tokens are removed
   /// from the end of the cache.
   Token *cacheMacroExpandedTokens(TokenLexer *tokLexer,
-                                  llvm::ArrayRef<Token> tokens);
+                                  ArrayRef<Token> tokens);
   void removeCachedMacroExpandedTokensOfLastLexer();
   friend void TokenLexer::ExpandFunctionArguments();
 
index f2dba72e6616821d2c08729d2caedf8d039de7ca..3b44702fa1d7c0fd798412ac66f55a25927c8b56 100644 (file)
@@ -22,7 +22,7 @@
 using namespace clang;
 using namespace arcmt;
 
-bool CapturedDiagList::clearDiagnostic(llvm::ArrayRef<unsigned> IDs,
+bool CapturedDiagList::clearDiagnostic(ArrayRef<unsigned> IDs,
                                        SourceRange range) {
   if (range.isInvalid())
     return false;
@@ -51,7 +51,7 @@ bool CapturedDiagList::clearDiagnostic(llvm::ArrayRef<unsigned> IDs,
   return cleared;
 }
 
-bool CapturedDiagList::hasDiagnostic(llvm::ArrayRef<unsigned> IDs,
+bool CapturedDiagList::hasDiagnostic(ArrayRef<unsigned> IDs,
                                      SourceRange range) const {
   if (range.isInvalid())
     return false;
index a9ab093f3a9490d6c6045845080e40ae97df39e5..61eeccb3a743ba34cd359192f9b933eb0e7a3c1a 100644 (file)
@@ -26,8 +26,8 @@ class CapturedDiagList {
 public:
   void push_back(const StoredDiagnostic &diag) { List.push_back(diag); }
 
-  bool clearDiagnostic(llvm::ArrayRef<unsigned> IDs, SourceRange range);
-  bool hasDiagnostic(llvm::ArrayRef<unsigned> IDs, SourceRange range) const;
+  bool clearDiagnostic(ArrayRef<unsigned> IDs, SourceRange range);
+  bool hasDiagnostic(ArrayRef<unsigned> IDs, SourceRange range) const;
 
   void reportDiagnostics(Diagnostic &diags) const;
 
@@ -39,7 +39,7 @@ public:
 };
 
 void writeARCDiagsToPlist(const std::string &outPath,
-                          llvm::ArrayRef<StoredDiagnostic> diags,
+                          ArrayRef<StoredDiagnostic> diags,
                           SourceManager &SM, const LangOptions &LangOpts);
 
 class TransformActions {
@@ -69,9 +69,9 @@ public:
   void increaseIndentation(SourceRange range,
                            SourceLocation parentIndent);
 
-  bool clearDiagnostic(llvm::ArrayRef<unsigned> IDs, SourceRange range);
+  bool clearDiagnostic(ArrayRef<unsigned> IDs, SourceRange range);
   bool clearAllDiagnostics(SourceRange range) {
-    return clearDiagnostic(llvm::ArrayRef<unsigned>(), range);
+    return clearDiagnostic(ArrayRef<unsigned>(), range);
   }
   bool clearDiagnostic(unsigned ID1, unsigned ID2, SourceRange range) {
     unsigned IDs[] = { ID1, ID2 };
index 95ef14ac59350e61fcd46033880240ecd4b6f175..ba74caef54048af7fef91dc1fff197c829d3da3b 100644 (file)
@@ -92,7 +92,7 @@ static raw_ostream& EmitString(raw_ostream& o,
 }
 
 void arcmt::writeARCDiagsToPlist(const std::string &outPath,
-                                 llvm::ArrayRef<StoredDiagnostic> diags,
+                                 ArrayRef<StoredDiagnostic> diags,
                                  SourceManager &SM,
                                  const LangOptions &LangOpts) {
   DiagnosticIDs DiagIDs;
@@ -102,7 +102,7 @@ void arcmt::writeARCDiagsToPlist(const std::string &outPath,
   FIDMap FM;
   SmallVector<FileID, 10> Fids;
 
-  for (llvm::ArrayRef<StoredDiagnostic>::iterator
+  for (ArrayRef<StoredDiagnostic>::iterator
          I = diags.begin(), E = diags.end(); I != E; ++I) {
     const StoredDiagnostic &D = *I;
 
@@ -145,7 +145,7 @@ void arcmt::writeARCDiagsToPlist(const std::string &outPath,
        " <key>diagnostics</key>\n"
        " <array>\n";
 
-  for (llvm::ArrayRef<StoredDiagnostic>::iterator
+  for (ArrayRef<StoredDiagnostic>::iterator
          DI = diags.begin(), DE = diags.end(); DI != DE; ++DI) {
     
     const StoredDiagnostic &D = *DI;
index f521358c8e4b49623ec8321c59c656b4f8315c80..ca72aab2949ae9b70090f28f24eed6cb8e566e59 100644 (file)
@@ -140,7 +140,7 @@ public:
   void increaseIndentation(SourceRange range,
                            SourceLocation parentIndent);
 
-  bool clearDiagnostic(llvm::ArrayRef<unsigned> IDs, SourceRange range);
+  bool clearDiagnostic(ArrayRef<unsigned> IDs, SourceRange range);
 
   void applyRewrites(TransformActions::RewriteReceiver &receiver);
 
@@ -159,7 +159,7 @@ private:
   void commitReplaceText(SourceLocation loc, StringRef text,
                          StringRef replacementText);
   void commitIncreaseIndentation(SourceRange range,SourceLocation parentIndent);
-  void commitClearDiagnostic(llvm::ArrayRef<unsigned> IDs, SourceRange range);
+  void commitClearDiagnostic(ArrayRef<unsigned> IDs, SourceRange range);
 
   void addRemoval(CharSourceRange range);
   void addInsertion(SourceLocation loc, StringRef text);
@@ -362,7 +362,7 @@ void TransformActionsImpl::increaseIndentation(SourceRange range,
   CachedActions.push_back(data);
 }
 
-bool TransformActionsImpl::clearDiagnostic(llvm::ArrayRef<unsigned> IDs,
+bool TransformActionsImpl::clearDiagnostic(ArrayRef<unsigned> IDs,
                                            SourceRange range) {
   assert(IsInTransaction && "Actions only allowed during a transaction");
   if (!CapturedDiags.hasDiagnostic(IDs, range))
@@ -494,7 +494,7 @@ void TransformActionsImpl::commitIncreaseIndentation(SourceRange range,
                                 SM.getInstantiationLoc(parentIndent)));
 }
 
-void TransformActionsImpl::commitClearDiagnostic(llvm::ArrayRef<unsigned> IDs,
+void TransformActionsImpl::commitClearDiagnostic(ArrayRef<unsigned> IDs,
                                                  SourceRange range) {
   CapturedDiags.clearDiagnostic(IDs, range);
 }
@@ -661,7 +661,7 @@ void TransformActions::increaseIndentation(SourceRange range,
                                                                 parentIndent);
 }
 
-bool TransformActions::clearDiagnostic(llvm::ArrayRef<unsigned> IDs,
+bool TransformActions::clearDiagnostic(ArrayRef<unsigned> IDs,
                                        SourceRange range) {
   return static_cast<TransformActionsImpl*>(Impl)->clearDiagnostic(IDs, range);
 }
index 48dad6f2e0ed4d729f41cf102c79cb3d93c01602..38dadce98913286ba198aee40c1a8e5580f7e6a3 100644 (file)
@@ -728,8 +728,8 @@ StoredDiagnostic::StoredDiagnostic(Diagnostic::Level Level,
 
 StoredDiagnostic::StoredDiagnostic(Diagnostic::Level Level, unsigned ID, 
                                    StringRef Message, FullSourceLoc Loc,
-                                   llvm::ArrayRef<CharSourceRange> Ranges,
-                                   llvm::ArrayRef<FixItHint> Fixits)
+                                   ArrayRef<CharSourceRange> Ranges,
+                                   ArrayRef<FixItHint> Fixits)
   : ID(ID), Level(Level), Loc(Loc), Message(Message) 
 {
   this->Ranges.assign(Ranges.begin(), Ranges.end());
index d13fd017cd685237ddeed03ea66ed3a4990d03a7..3e5b431c2ed6c8ddf669cd6f0a329b26ae5c5698 100644 (file)
@@ -1431,7 +1431,7 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E,
 /// on the current state of the EH stack.
 llvm::CallSite
 CodeGenFunction::EmitCallOrInvoke(llvm::Value *Callee,
-                                  llvm::ArrayRef<llvm::Value *> Args,
+                                  ArrayRef<llvm::Value *> Args,
                                   const Twine &Name) {
   llvm::BasicBlock *InvokeDest = getInvokeDest();
   if (!InvokeDest)
@@ -1447,7 +1447,7 @@ CodeGenFunction::EmitCallOrInvoke(llvm::Value *Callee,
 llvm::CallSite
 CodeGenFunction::EmitCallOrInvoke(llvm::Value *Callee,
                                   const Twine &Name) {
-  return EmitCallOrInvoke(Callee, llvm::ArrayRef<llvm::Value *>(), Name);
+  return EmitCallOrInvoke(Callee, ArrayRef<llvm::Value *>(), Name);
 }
 
 static void checkArgMatches(llvm::Value *Elt, unsigned &ArgNo,
index 0a76e46077605734fcd9e049a9eae6e90170884e..42864ceb633a233da6e2bdad67f770d3af8917af 100644 (file)
@@ -2074,7 +2074,7 @@ public:
                       ReturnValueSlot ReturnValue = ReturnValueSlot());
 
   llvm::CallSite EmitCallOrInvoke(llvm::Value *Callee,
-                                  llvm::ArrayRef<llvm::Value *> Args,
+                                  ArrayRef<llvm::Value *> Args,
                                   const Twine &Name = "");
   llvm::CallSite EmitCallOrInvoke(llvm::Value *Callee,
                                   const Twine &Name = "");
index d22c0efef1179fe245f821834b6d6593cd705e39..a4fce926ec259df7924194e0457746d55f16db7b 100644 (file)
@@ -1625,7 +1625,7 @@ llvm::Value *CodeGenModule::getBuiltinLibFunction(const FunctionDecl *FD,
 }
 
 llvm::Function *CodeGenModule::getIntrinsic(unsigned IID,
-                                            llvm::ArrayRef<llvm::Type*> Tys) {
+                                            ArrayRef<llvm::Type*> Tys) {
   return llvm::Intrinsic::getDeclaration(&getModule(), (llvm::Intrinsic::ID)IID,
                                          Tys);
 }
index e081caa7bf18995dfbcb29d865f5614eae68fa01..2642df73fc3f24ccc4c97b6cbe51f516dba02336 100644 (file)
@@ -573,8 +573,8 @@ public:
   llvm::Value *getBuiltinLibFunction(const FunctionDecl *FD,
                                      unsigned BuiltinID);
 
-  llvm::Function *getIntrinsic(unsigned IID, llvm::ArrayRef<llvm::Type*> Tys =
-                                                 llvm::ArrayRef<llvm::Type*>());
+  llvm::Function *getIntrinsic(unsigned IID, ArrayRef<llvm::Type*> Tys =
+                                                 ArrayRef<llvm::Type*>());
 
   /// EmitTopLevelDecl - Emit code for a single top level declaration.
   void EmitTopLevelDecl(Decl *D);
index 7a0bb6aa797f853730512aba8730d123b7dbb7fd..014b9152c47acc325e47951057182dd855e431e8 100644 (file)
@@ -96,7 +96,7 @@ Driver::~Driver() {
   delete Host;
 }
 
-InputArgList *Driver::ParseArgStrings(llvm::ArrayRef<const char *> ArgList) {
+InputArgList *Driver::ParseArgStrings(ArrayRef<const char *> ArgList) {
   llvm::PrettyStackTraceString CrashInfo("Command line argument parsing");
   unsigned MissingArgIndex, MissingArgCount;
   InputArgList *Args = getOpts().ParseArgs(ArgList.begin(), ArgList.end(),
@@ -201,7 +201,7 @@ DerivedArgList *Driver::TranslateInputArgs(const InputArgList &Args) const {
   return DAL;
 }
 
-Compilation *Driver::BuildCompilation(llvm::ArrayRef<const char *> ArgList) {
+Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
   llvm::PrettyStackTraceString CrashInfo("Compilation construction");
 
   // FIXME: Handle environment options which effect driver behavior, somewhere
index fa34334b5d1c0bcbe9555af7a8d3365f8f59d156..8fdc06db72c11ef85dc956fe661c50e8146e9bd3 100644 (file)
@@ -29,7 +29,7 @@ using namespace clang;
 /// \return A CompilerInvocation, or 0 if none was built for the given
 /// argument vector.
 CompilerInvocation *
-clang::createInvocationFromCommandLine(llvm::ArrayRef<const char *> ArgList,
+clang::createInvocationFromCommandLine(ArrayRef<const char *> ArgList,
                                    llvm::IntrusiveRefCntPtr<Diagnostic> Diags) {
   if (!Diags.getPtr()) {
     // No diagnostics engine was provided, so create our own diagnostics object
index 5d31b8cb4501f9e967a07852d0983712d003a565..d4fb28046a6035f262cfaf71dfa2d074c1f59804 100644 (file)
@@ -497,7 +497,7 @@ MacroArgs *Preprocessor::ReadFunctionLikeMacroArgs(Token &MacroName,
 /// going to lex in the cache and when it finishes the tokens are removed
 /// from the end of the cache.
 Token *Preprocessor::cacheMacroExpandedTokens(TokenLexer *tokLexer,
-                                              llvm::ArrayRef<Token> tokens) {
+                                              ArrayRef<Token> tokens) {
   assert(tokLexer);
   if (tokens.empty())
     return 0;
index 3b46f1dc2fe44c867022fe13698c730181946d6f..c22555e4dda05e1767ff9339e2efddae40552cbb 100644 (file)
@@ -1883,7 +1883,7 @@ static bool CheckAsmLValue(const Expr *E, Sema &S) {
 /// isOperandMentioned - Return true if the specified operand # is mentioned
 /// anywhere in the decomposed asm string.
 static bool isOperandMentioned(unsigned OpNo, 
-                         llvm::ArrayRef<AsmStmt::AsmStringPiece> AsmStrPieces) {
+                         ArrayRef<AsmStmt::AsmStringPiece> AsmStrPieces) {
   for (unsigned p = 0, e = AsmStrPieces.size(); p != e; ++p) {
     const AsmStmt::AsmStringPiece &Piece = AsmStrPieces[p];
     if (!Piece.isOperand()) continue;
index edef415edbc109b07831069159bc1808e16c8997..7477f943ee4bff589cfd3f690bb08324752b6ea1 100644 (file)
@@ -104,7 +104,7 @@ public:
 } // anonymous namespace
 
 static bool checkForMigration(StringRef resourcesPath,
-                              llvm::ArrayRef<const char *> Args) {
+                              ArrayRef<const char *> Args) {
   DiagnosticClient *DiagClient =
     new TextDiagnosticPrinter(llvm::errs(), DiagnosticOptions());
   llvm::IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
@@ -146,7 +146,7 @@ static void printResult(FileRemapper &remapper, raw_ostream &OS) {
 }
 
 static bool performTransformations(StringRef resourcesPath,
-                                   llvm::ArrayRef<const char *> Args) {
+                                   ArrayRef<const char *> Args) {
   // Check first.
   if (checkForMigration(resourcesPath, Args))
     return true;
@@ -215,7 +215,7 @@ static bool filesCompareEqual(StringRef fname1, StringRef fname2) {
   return file1->getBuffer() == file2->getBuffer();
 }
 
-static bool verifyTransformedFiles(llvm::ArrayRef<std::string> resultFiles) {
+static bool verifyTransformedFiles(ArrayRef<std::string> resultFiles) {
   using namespace llvm;
 
   assert(!resultFiles.empty());
@@ -364,7 +364,7 @@ int main(int argc, const char **argv) {
     return 1;
   }
 
-  llvm::ArrayRef<const char*> Args(argv+optargc+1, argc-optargc-1);
+  ArrayRef<const char*> Args(argv+optargc+1, argc-optargc-1);
 
   if (CheckOnly)
     return checkForMigration(resourcesPath, Args);