From 0baa4809a8de135a6a7abe9cd78a86f208c99164 Mon Sep 17 00:00:00 2001
From: Chandler Carruth <chandlerc@gmail.com>
Date: Sun, 15 Jul 2012 23:26:50 +0000
Subject: [PATCH] Move llvm/Support/MDBuilder.h to llvm/MDBuilder.h, to live
 with IRBuilder, DIBuilder, etc.

This is the proper layering as MDBuilder can't be used (or implemented)
without the Core Metadata representation.

Patches to Clang and Dragonegg coming up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160237 91177308-0d34-0410-b5e6-96231b3b80d8
---
 include/llvm/{Support => }/MDBuilder.h          | 2 +-
 lib/Transforms/Utils/LowerExpectIntrinsic.cpp   | 8 ++++----
 lib/Transforms/Utils/SimplifyCFG.cpp            | 2 +-
 unittests/Support/CMakeLists.txt                | 1 -
 unittests/VMCore/CMakeLists.txt                 | 1 +
 unittests/VMCore/InstructionsTest.cpp           | 2 +-
 unittests/{Support => VMCore}/MDBuilderTest.cpp | 4 ++--
 7 files changed, 10 insertions(+), 10 deletions(-)
 rename include/llvm/{Support => }/MDBuilder.h (98%)
 rename unittests/{Support => VMCore}/MDBuilderTest.cpp (96%)

diff --git a/include/llvm/Support/MDBuilder.h b/include/llvm/MDBuilder.h
similarity index 98%
rename from include/llvm/Support/MDBuilder.h
rename to include/llvm/MDBuilder.h
index 855e58d699d..add6f2e2f96 100644
--- a/include/llvm/Support/MDBuilder.h
+++ b/include/llvm/MDBuilder.h
@@ -1,4 +1,4 @@
-//===---- llvm/Support/MDBuilder.h - Builder for LLVM metadata --*- C++ -*-===//
+//===---- llvm/MDBuilder.h - Builder for LLVM metadata ----------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
diff --git a/lib/Transforms/Utils/LowerExpectIntrinsic.cpp b/lib/Transforms/Utils/LowerExpectIntrinsic.cpp
index f96581393df..02bdcda3919 100644
--- a/lib/Transforms/Utils/LowerExpectIntrinsic.cpp
+++ b/lib/Transforms/Utils/LowerExpectIntrinsic.cpp
@@ -12,19 +12,19 @@
 //===----------------------------------------------------------------------===//
 
 #define DEBUG_TYPE "lower-expect-intrinsic"
+#include "llvm/BasicBlock.h"
 #include "llvm/Constants.h"
 #include "llvm/Function.h"
-#include "llvm/BasicBlock.h"
-#include "llvm/LLVMContext.h"
 #include "llvm/Instructions.h"
 #include "llvm/Intrinsics.h"
+#include "llvm/LLVMContext.h"
+#include "llvm/MDBuilder.h"
 #include "llvm/Metadata.h"
 #include "llvm/Pass.h"
+#include "llvm/ADT/Statistic.h"
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
-#include "llvm/Support/MDBuilder.h"
-#include "llvm/ADT/Statistic.h"
 #include <vector>
 
 using namespace llvm;
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp
index 70c0f244f68..500a732c930 100644
--- a/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -20,6 +20,7 @@
 #include "llvm/Instructions.h"
 #include "llvm/IntrinsicInst.h"
 #include "llvm/LLVMContext.h"
+#include "llvm/MDBuilder.h"
 #include "llvm/Metadata.h"
 #include "llvm/Operator.h"
 #include "llvm/Type.h"
@@ -35,7 +36,6 @@
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/ConstantRange.h"
 #include "llvm/Support/Debug.h"
-#include "llvm/Support/MDBuilder.h"
 #include "llvm/Support/NoFolder.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Target/TargetData.h"
diff --git a/unittests/Support/CMakeLists.txt b/unittests/Support/CMakeLists.txt
index 6053994d0c7..674da35dce8 100644
--- a/unittests/Support/CMakeLists.txt
+++ b/unittests/Support/CMakeLists.txt
@@ -17,7 +17,6 @@ add_llvm_unittest(SupportTests
   LeakDetectorTest.cpp
   ManagedStatic.cpp
   MathExtrasTest.cpp
-  MDBuilderTest.cpp
   Path.cpp
   raw_ostream_test.cpp
   RegexTest.cpp
diff --git a/unittests/VMCore/CMakeLists.txt b/unittests/VMCore/CMakeLists.txt
index 5a87605b27d..79ee22c186d 100644
--- a/unittests/VMCore/CMakeLists.txt
+++ b/unittests/VMCore/CMakeLists.txt
@@ -8,6 +8,7 @@ set(VMCoreSources
   ConstantsTest.cpp
   DominatorTreeTest.cpp
   InstructionsTest.cpp
+  MDBuilderTest.cpp
   MetadataTest.cpp
   PassManagerTest.cpp
   ValueMapTest.cpp
diff --git a/unittests/VMCore/InstructionsTest.cpp b/unittests/VMCore/InstructionsTest.cpp
index a8902d932e5..72cdc8b9942 100644
--- a/unittests/VMCore/InstructionsTest.cpp
+++ b/unittests/VMCore/InstructionsTest.cpp
@@ -13,10 +13,10 @@
 #include "llvm/IRBuilder.h"
 #include "llvm/Instructions.h"
 #include "llvm/LLVMContext.h"
+#include "llvm/MDBuilder.h"
 #include "llvm/Operator.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Analysis/ValueTracking.h"
-#include "llvm/Support/MDBuilder.h"
 #include "llvm/Target/TargetData.h"
 #include "gtest/gtest.h"
 
diff --git a/unittests/Support/MDBuilderTest.cpp b/unittests/VMCore/MDBuilderTest.cpp
similarity index 96%
rename from unittests/Support/MDBuilderTest.cpp
rename to unittests/VMCore/MDBuilderTest.cpp
index af3f4348ffe..847039b8376 100644
--- a/unittests/Support/MDBuilderTest.cpp
+++ b/unittests/VMCore/MDBuilderTest.cpp
@@ -1,4 +1,4 @@
-//===- llvm/unittests/Support/MDBuilderTest.cpp - MDBuilder unit tests ----===//
+//===- llvm/unittests/MDBuilderTest.cpp - MDBuilder unit tests ------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,8 +8,8 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/IRBuilder.h"
+#include "llvm/MDBuilder.h"
 #include "llvm/Operator.h"
-#include "llvm/Support/MDBuilder.h"
 
 #include "gtest/gtest.h"