Rename VMCore directory to IR.

Aside from moving the actual files, this patch only updates the build
system and the source file comments under lib/... that are relevant.

I'll be updating other docs and other files in smaller subsequnet
commits.

While I've tried to test this, but it is entirely possible that there
will still be some build system fallout.

Also, note that I've not changed the library name itself: libLLVMCore.a
is still the library name. I'd be interested in others' opinions about
whether we should rename this as well (I think we should, just not sure
what it might break)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171359 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/ConstantFolding.cpp b/lib/Analysis/ConstantFolding.cpp
index 657ada4..96a5219 100644
--- a/lib/Analysis/ConstantFolding.cpp
+++ b/lib/Analysis/ConstantFolding.cpp
@@ -9,9 +9,9 @@
 //
 // This file defines routines for folding instructions into constants.
 //
-// Also, to supplement the basic VMCore ConstantExpr simplifications,
+// Also, to supplement the basic IR ConstantExpr simplifications,
 // this file defines some additional folding routines that can make use of
-// DataLayout information. These functions cannot go in VMCore due to library
+// DataLayout information. These functions cannot go in IR due to library
 // dependency issues.
 //
 //===----------------------------------------------------------------------===//
@@ -68,7 +68,7 @@
       unsigned FPWidth = SrcEltTy->getPrimitiveSizeInBits();
       Type *SrcIVTy =
         VectorType::get(IntegerType::get(C->getContext(), FPWidth), NumSrcElts);
-      // Ask VMCore to do the conversion now that #elts line up.
+      // Ask IR to do the conversion now that #elts line up.
       C = ConstantExpr::getBitCast(C, SrcIVTy);
       CDV = cast<ConstantDataVector>(C);
     }
@@ -104,7 +104,7 @@
   if (!isa<ConstantDataVector>(C) && !isa<ConstantVector>(C))
     return ConstantExpr::getBitCast(C, DestTy);
 
-  // If the element types match, VMCore can fold it.
+  // If the element types match, IR can fold it.
   unsigned NumDstElt = DestVTy->getNumElements();
   unsigned NumSrcElt = C->getType()->getVectorNumElements();
   if (NumDstElt == NumSrcElt)
@@ -131,7 +131,7 @@
     // Recursively handle this integer conversion, if possible.
     C = FoldBitCast(C, DestIVTy, TD);
 
-    // Finally, VMCore can handle this now that #elts line up.
+    // Finally, IR can handle this now that #elts line up.
     return ConstantExpr::getBitCast(C, DestTy);
   }
 
@@ -141,9 +141,9 @@
     unsigned FPWidth = SrcEltTy->getPrimitiveSizeInBits();
     Type *SrcIVTy =
       VectorType::get(IntegerType::get(C->getContext(), FPWidth), NumSrcElt);
-    // Ask VMCore to do the conversion now that #elts line up.
+    // Ask IR to do the conversion now that #elts line up.
     C = ConstantExpr::getBitCast(C, SrcIVTy);
-    // If VMCore wasn't able to fold it, bail out.
+    // If IR wasn't able to fold it, bail out.
     if (!isa<ConstantVector>(C) &&  // FIXME: Remove ConstantVector.
         !isa<ConstantDataVector>(C))
       return C;
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index c65d496..d1ea027 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -1,6 +1,6 @@
 # `Support' and `TableGen' libraries are added on the top-level CMakeLists.txt
 
-add_subdirectory(VMCore)
+add_subdirectory(IR)
 add_subdirectory(CodeGen)
 add_subdirectory(Bitcode)
 add_subdirectory(Transforms)
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/IR/AsmWriter.cpp
similarity index 100%
rename from lib/VMCore/AsmWriter.cpp
rename to lib/IR/AsmWriter.cpp
diff --git a/lib/VMCore/AttributeImpl.h b/lib/IR/AttributeImpl.h
similarity index 100%
rename from lib/VMCore/AttributeImpl.h
rename to lib/IR/AttributeImpl.h
diff --git a/lib/VMCore/Attributes.cpp b/lib/IR/Attributes.cpp
similarity index 100%
rename from lib/VMCore/Attributes.cpp
rename to lib/IR/Attributes.cpp
diff --git a/lib/VMCore/AutoUpgrade.cpp b/lib/IR/AutoUpgrade.cpp
similarity index 100%
rename from lib/VMCore/AutoUpgrade.cpp
rename to lib/IR/AutoUpgrade.cpp
diff --git a/lib/VMCore/BasicBlock.cpp b/lib/IR/BasicBlock.cpp
similarity index 99%
rename from lib/VMCore/BasicBlock.cpp
rename to lib/IR/BasicBlock.cpp
index f23a496..db20b08 100644
--- a/lib/VMCore/BasicBlock.cpp
+++ b/lib/IR/BasicBlock.cpp
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This file implements the BasicBlock class for the VMCore library.
+// This file implements the BasicBlock class for the IR library.
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/lib/VMCore/CMakeLists.txt b/lib/IR/CMakeLists.txt
similarity index 100%
rename from lib/VMCore/CMakeLists.txt
rename to lib/IR/CMakeLists.txt
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/IR/ConstantFold.cpp
similarity index 99%
rename from lib/VMCore/ConstantFold.cpp
rename to lib/IR/ConstantFold.cpp
index dedae5a..91dc83f 100644
--- a/lib/VMCore/ConstantFold.cpp
+++ b/lib/IR/ConstantFold.cpp
@@ -13,7 +13,7 @@
 //
 // The current constant folding implementation is implemented in two pieces: the
 // pieces that don't need DataLayout, and the pieces that do. This is to avoid
-// a dependence in VMCore on Target.
+// a dependence in IR on Target.
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/lib/VMCore/ConstantFold.h b/lib/IR/ConstantFold.h
similarity index 100%
rename from lib/VMCore/ConstantFold.h
rename to lib/IR/ConstantFold.h
diff --git a/lib/VMCore/Constants.cpp b/lib/IR/Constants.cpp
similarity index 99%
rename from lib/VMCore/Constants.cpp
rename to lib/IR/Constants.cpp
index 008378a..a97b620 100644
--- a/lib/VMCore/Constants.cpp
+++ b/lib/IR/Constants.cpp
@@ -301,7 +301,7 @@
 ///     linker will never see them.
 ///  GlobalRelocations: This entry may have arbitrary relocations.
 ///
-/// FIXME: This really should not be in VMCore.
+/// FIXME: This really should not be in IR.
 Constant::PossibleRelocationsTy Constant::getRelocationInfo() const {
   if (const GlobalValue *GV = dyn_cast<GlobalValue>(this)) {
     if (GV->hasLocalLinkage() || GV->hasHiddenVisibility())
diff --git a/lib/VMCore/ConstantsContext.h b/lib/IR/ConstantsContext.h
similarity index 100%
rename from lib/VMCore/ConstantsContext.h
rename to lib/IR/ConstantsContext.h
diff --git a/lib/VMCore/Core.cpp b/lib/IR/Core.cpp
similarity index 100%
rename from lib/VMCore/Core.cpp
rename to lib/IR/Core.cpp
diff --git a/lib/VMCore/DIBuilder.cpp b/lib/IR/DIBuilder.cpp
similarity index 100%
rename from lib/VMCore/DIBuilder.cpp
rename to lib/IR/DIBuilder.cpp
diff --git a/lib/VMCore/DataLayout.cpp b/lib/IR/DataLayout.cpp
similarity index 100%
rename from lib/VMCore/DataLayout.cpp
rename to lib/IR/DataLayout.cpp
diff --git a/lib/VMCore/DebugInfo.cpp b/lib/IR/DebugInfo.cpp
similarity index 100%
rename from lib/VMCore/DebugInfo.cpp
rename to lib/IR/DebugInfo.cpp
diff --git a/lib/VMCore/DebugLoc.cpp b/lib/IR/DebugLoc.cpp
similarity index 100%
rename from lib/VMCore/DebugLoc.cpp
rename to lib/IR/DebugLoc.cpp
diff --git a/lib/VMCore/Dominators.cpp b/lib/IR/Dominators.cpp
similarity index 100%
rename from lib/VMCore/Dominators.cpp
rename to lib/IR/Dominators.cpp
diff --git a/lib/VMCore/Function.cpp b/lib/IR/Function.cpp
similarity index 99%
rename from lib/VMCore/Function.cpp
rename to lib/IR/Function.cpp
index 3cae4d4..5145129 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/IR/Function.cpp
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This file implements the Function class for the VMCore library.
+// This file implements the Function class for the IR library.
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/lib/VMCore/GCOV.cpp b/lib/IR/GCOV.cpp
similarity index 100%
rename from lib/VMCore/GCOV.cpp
rename to lib/IR/GCOV.cpp
diff --git a/lib/VMCore/GVMaterializer.cpp b/lib/IR/GVMaterializer.cpp
similarity index 100%
rename from lib/VMCore/GVMaterializer.cpp
rename to lib/IR/GVMaterializer.cpp
diff --git a/lib/VMCore/Globals.cpp b/lib/IR/Globals.cpp
similarity index 99%
rename from lib/VMCore/Globals.cpp
rename to lib/IR/Globals.cpp
index 3fa4406..f21cdcc 100644
--- a/lib/VMCore/Globals.cpp
+++ b/lib/IR/Globals.cpp
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This file implements the GlobalValue & GlobalVariable classes for the VMCore
+// This file implements the GlobalValue & GlobalVariable classes for the IR
 // library.
 //
 //===----------------------------------------------------------------------===//
diff --git a/lib/VMCore/IRBuilder.cpp b/lib/IR/IRBuilder.cpp
similarity index 100%
rename from lib/VMCore/IRBuilder.cpp
rename to lib/IR/IRBuilder.cpp
diff --git a/lib/VMCore/InlineAsm.cpp b/lib/IR/InlineAsm.cpp
similarity index 100%
rename from lib/VMCore/InlineAsm.cpp
rename to lib/IR/InlineAsm.cpp
diff --git a/lib/VMCore/Instruction.cpp b/lib/IR/Instruction.cpp
similarity index 99%
rename from lib/VMCore/Instruction.cpp
rename to lib/IR/Instruction.cpp
index 81ee4ce..4be432f 100644
--- a/lib/VMCore/Instruction.cpp
+++ b/lib/IR/Instruction.cpp
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This file implements the Instruction class for the VMCore library.
+// This file implements the Instruction class for the IR library.
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/lib/VMCore/Instructions.cpp b/lib/IR/Instructions.cpp
similarity index 100%
rename from lib/VMCore/Instructions.cpp
rename to lib/IR/Instructions.cpp
diff --git a/lib/VMCore/IntrinsicInst.cpp b/lib/IR/IntrinsicInst.cpp
similarity index 100%
rename from lib/VMCore/IntrinsicInst.cpp
rename to lib/IR/IntrinsicInst.cpp
diff --git a/lib/VMCore/LLVMBuild.txt b/lib/IR/LLVMBuild.txt
similarity index 90%
rename from lib/VMCore/LLVMBuild.txt
rename to lib/IR/LLVMBuild.txt
index bca8b2c..cd90ef5 100644
--- a/lib/VMCore/LLVMBuild.txt
+++ b/lib/IR/LLVMBuild.txt
@@ -1,4 +1,4 @@
-;===- ./lib/VMCore/LLVMBuild.txt -------------------------------*- Conf -*--===;
+;===- ./lib/IR/LLVMBuild.txt -----------------------------------*- Conf -*--===;
 ;
 ;                     The LLVM Compiler Infrastructure
 ;
diff --git a/lib/VMCore/LLVMContext.cpp b/lib/IR/LLVMContext.cpp
similarity index 100%
rename from lib/VMCore/LLVMContext.cpp
rename to lib/IR/LLVMContext.cpp
diff --git a/lib/VMCore/LLVMContextImpl.cpp b/lib/IR/LLVMContextImpl.cpp
similarity index 100%
rename from lib/VMCore/LLVMContextImpl.cpp
rename to lib/IR/LLVMContextImpl.cpp
diff --git a/lib/VMCore/LLVMContextImpl.h b/lib/IR/LLVMContextImpl.h
similarity index 100%
rename from lib/VMCore/LLVMContextImpl.h
rename to lib/IR/LLVMContextImpl.h
diff --git a/lib/VMCore/LeakDetector.cpp b/lib/IR/LeakDetector.cpp
similarity index 100%
rename from lib/VMCore/LeakDetector.cpp
rename to lib/IR/LeakDetector.cpp
diff --git a/lib/VMCore/LeaksContext.h b/lib/IR/LeaksContext.h
similarity index 100%
rename from lib/VMCore/LeaksContext.h
rename to lib/IR/LeaksContext.h
diff --git a/lib/VMCore/Makefile b/lib/IR/Makefile
similarity index 94%
rename from lib/VMCore/Makefile
rename to lib/IR/Makefile
index 8b98651..7b8ef42 100644
--- a/lib/VMCore/Makefile
+++ b/lib/IR/Makefile
@@ -1,4 +1,4 @@
-##===- lib/VMCore/Makefile ---------------------------------*- Makefile -*-===##
+##===- lib/IR/Makefile -------------------------------------*- Makefile -*-===##
 #
 #                     The LLVM Compiler Infrastructure
 #
diff --git a/lib/VMCore/Metadata.cpp b/lib/IR/Metadata.cpp
similarity index 100%
rename from lib/VMCore/Metadata.cpp
rename to lib/IR/Metadata.cpp
diff --git a/lib/VMCore/Module.cpp b/lib/IR/Module.cpp
similarity index 99%
rename from lib/VMCore/Module.cpp
rename to lib/IR/Module.cpp
index 78f4eb8..ee4dc62 100644
--- a/lib/VMCore/Module.cpp
+++ b/lib/IR/Module.cpp
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This file implements the Module class for the VMCore library.
+// This file implements the Module class for the IR library.
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/lib/VMCore/Pass.cpp b/lib/IR/Pass.cpp
similarity index 100%
rename from lib/VMCore/Pass.cpp
rename to lib/IR/Pass.cpp
diff --git a/lib/VMCore/PassManager.cpp b/lib/IR/PassManager.cpp
similarity index 100%
rename from lib/VMCore/PassManager.cpp
rename to lib/IR/PassManager.cpp
diff --git a/lib/VMCore/PassRegistry.cpp b/lib/IR/PassRegistry.cpp
similarity index 100%
rename from lib/VMCore/PassRegistry.cpp
rename to lib/IR/PassRegistry.cpp
diff --git a/lib/VMCore/PrintModulePass.cpp b/lib/IR/PrintModulePass.cpp
similarity index 97%
rename from lib/VMCore/PrintModulePass.cpp
rename to lib/IR/PrintModulePass.cpp
index 34b2918..422aa09 100644
--- a/lib/VMCore/PrintModulePass.cpp
+++ b/lib/IR/PrintModulePass.cpp
@@ -1,4 +1,4 @@
-//===--- VMCore/PrintModulePass.cpp - Module/Function Printer -------------===//
+//===--- IR/PrintModulePass.cpp - Module/Function Printer -----------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
diff --git a/lib/VMCore/SymbolTableListTraitsImpl.h b/lib/IR/SymbolTableListTraitsImpl.h
similarity index 100%
rename from lib/VMCore/SymbolTableListTraitsImpl.h
rename to lib/IR/SymbolTableListTraitsImpl.h
diff --git a/lib/VMCore/TargetTransformInfo.cpp b/lib/IR/TargetTransformInfo.cpp
similarity index 94%
rename from lib/VMCore/TargetTransformInfo.cpp
rename to lib/IR/TargetTransformInfo.cpp
index e91c29c..209e1db 100644
--- a/lib/VMCore/TargetTransformInfo.cpp
+++ b/lib/IR/TargetTransformInfo.cpp
@@ -1,4 +1,4 @@
-//===- llvm/VMCore/TargetTransformInfo.cpp ----------------------*- C++ -*-===//
+//===- llvm/IR/TargetTransformInfo.cpp --------------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
diff --git a/lib/VMCore/Type.cpp b/lib/IR/Type.cpp
similarity index 99%
rename from lib/VMCore/Type.cpp
rename to lib/IR/Type.cpp
index 3c30582..f76eb9e 100644
--- a/lib/VMCore/Type.cpp
+++ b/lib/IR/Type.cpp
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This file implements the Type class for the VMCore library.
+// This file implements the Type class for the IR library.
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/lib/VMCore/TypeFinder.cpp b/lib/IR/TypeFinder.cpp
similarity index 98%
rename from lib/VMCore/TypeFinder.cpp
rename to lib/IR/TypeFinder.cpp
index 56db645..5002774 100644
--- a/lib/VMCore/TypeFinder.cpp
+++ b/lib/IR/TypeFinder.cpp
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This file implements the TypeFinder class for the VMCore library.
+// This file implements the TypeFinder class for the IR library.
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/lib/VMCore/Use.cpp b/lib/IR/Use.cpp
similarity index 100%
rename from lib/VMCore/Use.cpp
rename to lib/IR/Use.cpp
diff --git a/lib/VMCore/User.cpp b/lib/IR/User.cpp
similarity index 100%
rename from lib/VMCore/User.cpp
rename to lib/IR/User.cpp
diff --git a/lib/VMCore/Value.cpp b/lib/IR/Value.cpp
similarity index 100%
rename from lib/VMCore/Value.cpp
rename to lib/IR/Value.cpp
diff --git a/lib/VMCore/ValueSymbolTable.cpp b/lib/IR/ValueSymbolTable.cpp
similarity index 97%
rename from lib/VMCore/ValueSymbolTable.cpp
rename to lib/IR/ValueSymbolTable.cpp
index 8707daa..ea203bc 100644
--- a/lib/VMCore/ValueSymbolTable.cpp
+++ b/lib/IR/ValueSymbolTable.cpp
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This file implements the ValueSymbolTable class for the VMCore library.
+// This file implements the ValueSymbolTable class for the IR library.
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/lib/VMCore/ValueTypes.cpp b/lib/IR/ValueTypes.cpp
similarity index 100%
rename from lib/VMCore/ValueTypes.cpp
rename to lib/IR/ValueTypes.cpp
diff --git a/lib/VMCore/Verifier.cpp b/lib/IR/Verifier.cpp
similarity index 100%
rename from lib/VMCore/Verifier.cpp
rename to lib/IR/Verifier.cpp
diff --git a/lib/LLVMBuild.txt b/lib/LLVMBuild.txt
index e466d82..a31793c 100644
--- a/lib/LLVMBuild.txt
+++ b/lib/LLVMBuild.txt
@@ -16,7 +16,7 @@
 ;===------------------------------------------------------------------------===;
 
 [common]
-subdirectories = Analysis Archive AsmParser Bitcode CodeGen DebugInfo ExecutionEngine Linker MC Object Option Support TableGen Target Transforms VMCore
+subdirectories = Analysis Archive AsmParser Bitcode CodeGen DebugInfo ExecutionEngine Linker IR MC Object Option Support TableGen Target Transforms
 
 [component_0]
 type = Group
diff --git a/lib/Makefile b/lib/Makefile
index e3b03da..043eda6 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -10,7 +10,7 @@
 
 include $(LEVEL)/Makefile.config
 
-PARALLEL_DIRS := VMCore AsmParser Bitcode Archive Analysis Transforms CodeGen \
+PARALLEL_DIRS := IR AsmParser Bitcode Archive Analysis Transforms CodeGen \
                 Target ExecutionEngine Linker MC Object Option DebugInfo
 
 include $(LEVEL)/Makefile.common
diff --git a/utils/GenLibDeps.pl b/utils/GenLibDeps.pl
index 656250c..7748cab 100755
--- a/utils/GenLibDeps.pl
+++ b/utils/GenLibDeps.pl
@@ -98,7 +98,7 @@
     $libpath =~ s/^BitWriter/Bitcode\/Writer/;
     $libpath =~ s/^CppBackend/Target\/CppBackend/;
     $libpath =~ s/^MSIL/Target\/MSIL/;
-    $libpath =~ s/^Core/VMCore/;
+    $libpath =~ s/^Core/IR/;
     $libpath =~ s/^Instrumentation/Transforms\/Instrumentation/;
     $libpath =~ s/^Interpreter/ExecutionEngine\/Interpreter/;
     $libpath =~ s/^JIT/ExecutionEngine\/JIT/;
diff --git a/utils/llvm-build/llvmbuild/main.py b/utils/llvm-build/llvmbuild/main.py
index 32d5395..87e8819 100644
--- a/utils/llvm-build/llvmbuild/main.py
+++ b/utils/llvm-build/llvmbuild/main.py
@@ -809,7 +809,7 @@
     # Determine the LLVM source path, if not given.
     source_root = opts.source_root
     if source_root:
-        if not os.path.exists(os.path.join(source_root, 'lib', 'VMCore',
+        if not os.path.exists(os.path.join(source_root, 'lib', 'IR',
                                            'Function.cpp')):
             parser.error('invalid LLVM source root: %r' % source_root)
     else:
@@ -817,7 +817,7 @@
         llvm_build_path = os.path.dirname(llvmbuild_path)
         utils_path = os.path.dirname(llvm_build_path)
         source_root = os.path.dirname(utils_path)
-        if not os.path.exists(os.path.join(source_root, 'lib', 'VMCore',
+        if not os.path.exists(os.path.join(source_root, 'lib', 'IR',
                                            'Function.cpp')):
             parser.error('unable to infer LLVM source root, please specify')