Some minor cleanups

* remove an #ifdef USE_METADATA I accidently left in
* remove now unneeded llvm-version includes
* fix indentation in metadata.h
* prevent the "Found native target" message from interrupting ccmake
This commit is contained in:
Benjamin Kramer 2009-07-20 18:16:11 +02:00
parent 69171c07cd
commit 51c02d192a
8 changed files with 13 additions and 22 deletions

View file

@ -150,7 +150,7 @@ else(LLVM_CONFIG_FILE_PATH STREQUAL "LLVM_CONFIG_FILE_PATH-NOTFOUND")
file(STRINGS ${LLVM_CONFIG_FILE_PATH}/config.h LLVM_NATIVE_ARCH REGEX "^#define LLVM_NATIVE_ARCH") file(STRINGS ${LLVM_CONFIG_FILE_PATH}/config.h LLVM_NATIVE_ARCH REGEX "^#define LLVM_NATIVE_ARCH")
if(LLVM_NATIVE_ARCH) if(LLVM_NATIVE_ARCH)
string(REGEX REPLACE "^#define LLVM_NATIVE_ARCH (.*)Target$" "\\1" LLVM_NATIVE_ARCH ${LLVM_NATIVE_ARCH}) string(REGEX REPLACE "^#define LLVM_NATIVE_ARCH (.*)Target$" "\\1" LLVM_NATIVE_ARCH ${LLVM_NATIVE_ARCH})
message("Found native target ${LLVM_NATIVE_ARCH}") message(STATUS "Found native target ${LLVM_NATIVE_ARCH}")
set(LLVM_MODULES_DEFINE "LLVM_TARGET(${LLVM_NATIVE_ARCH})") set(LLVM_MODULES_DEFINE "LLVM_TARGET(${LLVM_NATIVE_ARCH})")
else(LLVM_NATIVE_ARCH) else(LLVM_NATIVE_ARCH)
message("Couldn't find the LLVM_NATIVE_ARCH define in ${LLVM_CONFIG_FILE_PATH}/config.h. Probably you have an older LLVM and can ignore this warning.") message("Couldn't find the LLVM_NATIVE_ARCH define in ${LLVM_CONFIG_FILE_PATH}/config.h. Probably you have an older LLVM and can ignore this warning.")

View file

@ -1,19 +1,18 @@
#ifndef LDC_GEN_METADATA_H #ifndef LDC_GEN_METADATA_H
#define LDC_GEN_METADATA_H #define LDC_GEN_METADATA_H
#include "gen/llvm-version.h" // MDNode was moved into its own header, and contains Value*s
#include "llvm/MDNode.h"
typedef llvm::Value MDNodeField;
// MDNode was moved into its own header, and contains Value*s // Use getNumElements() and getElement() to access elements.
#include "llvm/MDNode.h" inline unsigned MD_GetNumElements(llvm::MDNode* N) {
typedef llvm::Value MDNodeField; return N->getNumElements();
}
// Use getNumElements() and getElement() to access elements.
inline unsigned MD_GetNumElements(llvm::MDNode* N) { inline MDNodeField* MD_GetElement(llvm::MDNode* N, unsigned i) {
return N->getNumElements(); return N->getElement(i);
} }
inline MDNodeField* MD_GetElement(llvm::MDNode* N, unsigned i) {
return N->getElement(i);
}
#define METADATA_LINKAGE_TYPE llvm::GlobalValue::WeakODRLinkage #define METADATA_LINKAGE_TYPE llvm::GlobalValue::WeakODRLinkage

View file

@ -159,11 +159,9 @@ static void addPassesForOptLevel(PassManager& pm) {
if (!disableLangSpecificPasses) { if (!disableLangSpecificPasses) {
if (!disableSimplifyRuntimeCalls) if (!disableSimplifyRuntimeCalls)
addPass(pm, createSimplifyDRuntimeCalls()); addPass(pm, createSimplifyDRuntimeCalls());
#ifdef USE_METADATA
if (!disableGCToStack) if (!disableGCToStack)
addPass(pm, createGarbageCollect2Stack()); addPass(pm, createGarbageCollect2Stack());
#endif
} }
// Run some clean-up passes // Run some clean-up passes
addPass(pm, createInstructionCombiningPass()); addPass(pm, createInstructionCombiningPass());

View file

@ -15,8 +15,6 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "gen/llvm-version.h"
#define DEBUG_TYPE "strip-externals" #define DEBUG_TYPE "strip-externals"
#include "Passes.h" #include "Passes.h"

View file

@ -1,5 +1,4 @@
#include "gen/llvm.h" #include "gen/llvm.h"
#include "gen/llvm-version.h"
#include "llvm/Module.h" #include "llvm/Module.h"
#include "llvm/Attributes.h" #include "llvm/Attributes.h"
#include "llvm/Bitcode/ReaderWriter.h" #include "llvm/Bitcode/ReaderWriter.h"

View file

@ -20,7 +20,6 @@
#include "gen/complex.h" #include "gen/complex.h"
#include "gen/llvmhelpers.h" #include "gen/llvmhelpers.h"
#include "gen/linkage.h" #include "gen/linkage.h"
#include "gen/llvm-version.h"
#include "ir/irtype.h" #include "ir/irtype.h"
#include "ir/irtypeclass.h" #include "ir/irtypeclass.h"

View file

@ -11,7 +11,6 @@
#include <fstream> #include <fstream>
#include "gen/llvm.h" #include "gen/llvm.h"
#include "gen/llvm-version.h"
#include "llvm/Analysis/Verifier.h" #include "llvm/Analysis/Verifier.h"
#include "llvm/Bitcode/ReaderWriter.h" #include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/Module.h" #include "llvm/Module.h"

View file

@ -42,7 +42,6 @@
#include "gen/linkage.h" #include "gen/linkage.h"
#include "gen/metadata.h" #include "gen/metadata.h"
#include "gen/rttibuilder.h" #include "gen/rttibuilder.h"
#include "gen/llvm-version.h"
#include "ir/irvar.h" #include "ir/irvar.h"
#include "ir/irtype.h" #include "ir/irtype.h"