diff --git a/CMakeLists.txt b/CMakeLists.txt index b38f45d12689..6be11c764bca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -797,41 +797,44 @@ endif() add_subdirectory(cmake/modules) -if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - install(DIRECTORY include/llvm include/llvm-c - DESTINATION include - COMPONENT llvm-headers - FILES_MATCHING - PATTERN "*.def" - PATTERN "*.h" - PATTERN "*.td" - PATTERN "*.inc" - PATTERN "LICENSE.TXT" - PATTERN ".svn" EXCLUDE - ) - - install(DIRECTORY ${LLVM_INCLUDE_DIR}/llvm - DESTINATION include - COMPONENT llvm-headers - FILES_MATCHING - PATTERN "*.def" - PATTERN "*.h" - PATTERN "*.gen" - PATTERN "*.inc" - # Exclude include/llvm/CMakeFiles/intrinsics_gen.dir, matched by "*.def" - PATTERN "CMakeFiles" EXCLUDE - PATTERN "config.h" EXCLUDE - PATTERN ".svn" EXCLUDE - ) - - if (NOT CMAKE_CONFIGURATION_TYPES) - add_custom_target(installhdrs - DEPENDS ${name} - COMMAND "${CMAKE_COMMAND}" - -DCMAKE_INSTALL_COMPONENT=llvm-headers - -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") - endif() -endif() +# == Decompiler OFF BEGIN == +# To fix build with MSVC project, do not install any includes. +# if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) +# install(DIRECTORY include/llvm include/llvm-c +# DESTINATION include +# COMPONENT llvm-headers +# FILES_MATCHING +# PATTERN "*.def" +# PATTERN "*.h" +# PATTERN "*.td" +# PATTERN "*.inc" +# PATTERN "LICENSE.TXT" +# PATTERN ".svn" EXCLUDE +# ) +# +# install(DIRECTORY ${LLVM_INCLUDE_DIR}/llvm +# DESTINATION include +# COMPONENT llvm-headers +# FILES_MATCHING +# PATTERN "*.def" +# PATTERN "*.h" +# PATTERN "*.gen" +# PATTERN "*.inc" +# # Exclude include/llvm/CMakeFiles/intrinsics_gen.dir, matched by "*.def" +# PATTERN "CMakeFiles" EXCLUDE +# PATTERN "config.h" EXCLUDE +# PATTERN ".svn" EXCLUDE +# ) +# +# if (NOT CMAKE_CONFIGURATION_TYPES) +# add_custom_target(installhdrs +# DEPENDS ${name} +# COMMAND "${CMAKE_COMMAND}" +# -DCMAKE_INSTALL_COMPONENT=llvm-headers +# -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") +# endif() +# endif() +# == Decompiler OFF END == # This must be at the end of the LLVM root CMakeLists file because it must run # after all targets are created. diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake index 26e439600140..7ceea4198833 100644 --- a/cmake/modules/AddLLVM.cmake +++ b/cmake/modules/AddLLVM.cmake @@ -558,10 +558,13 @@ macro(add_llvm_library name) set(install_type ARCHIVE) endif() - install(TARGETS ${name} - EXPORT LLVMExports - ${install_type} DESTINATION ${install_dir} - COMPONENT ${name}) + # == Decompiler OFF BEGIN == + # To fix build with MSVC project, do not install any libraries. + # install(TARGETS ${name} + # EXPORT LLVMExports + # ${install_type} DESTINATION ${install_dir} + # COMPONENT ${name}) + # == Decompiler OFF END == if (NOT CMAKE_CONFIGURATION_TYPES) add_custom_target(install-${name} @@ -592,10 +595,13 @@ macro(add_llvm_loadable_module name) else() set(dlldir "lib${LLVM_LIBDIR_SUFFIX}") endif() - install(TARGETS ${name} - EXPORT LLVMExports - LIBRARY DESTINATION ${dlldir} - ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) + # == Decompiler OFF BEGIN == + # To fix build with MSVC project, do not install any loadable modules. + # install(TARGETS ${name} + # EXPORT LLVMExports + # LIBRARY DESTINATION ${dlldir} + # ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) + # == Decompiler OFF END == endif() set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) endif() @@ -768,10 +774,17 @@ macro(add_llvm_tool name) list(FIND LLVM_TOOLCHAIN_TOOLS ${name} LLVM_IS_${name}_TOOLCHAIN_TOOL) if (LLVM_IS_${name}_TOOLCHAIN_TOOL GREATER -1 OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) if( LLVM_BUILD_TOOLS ) - install(TARGETS ${name} - EXPORT LLVMExports - RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR} - COMPONENT ${name}) + # == Decompiler BEGIN == + # To fix build with MSVC project, install only llvm-as and llvm-dis. + if("${name}" STREQUAL "llvm-as" OR "${name}" STREQUAL "llvm-dis") + # We always build LLVM in the release mode. Without forcing the release + # mode here (directory "Release"), MSVC always tries to install it from + # the non-existing "Debug" directory, even when CMAKE_BUILD_TYPE is + # "Release. I have no idea why. + install(FILES "${CMAKE_BINARY_DIR}/Release/bin/${name}.exe" + DESTINATION "${CMAKE_BINARY_DIR}/../../../../decompiler/bin") + endif() + # == Decompiler END == if (NOT CMAKE_CONFIGURATION_TYPES) add_custom_target(install-${name} diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt index 826dd366359d..68463d2e68f6 100644 --- a/cmake/modules/CMakeLists.txt +++ b/cmake/modules/CMakeLists.txt @@ -75,22 +75,25 @@ configure_file( ${llvm_cmake_builddir}/LLVMConfigVersion.cmake @ONLY) -if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - install(EXPORT LLVMExports DESTINATION ${LLVM_INSTALL_PACKAGE_DIR}) - - install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/LLVMConfig.cmake - ${llvm_cmake_builddir}/LLVMConfigVersion.cmake - LLVM-Config.cmake - DESTINATION ${LLVM_INSTALL_PACKAGE_DIR}) - - install(DIRECTORY . - DESTINATION ${LLVM_INSTALL_PACKAGE_DIR} - FILES_MATCHING PATTERN *.cmake - PATTERN .svn EXCLUDE - PATTERN LLVMConfig.cmake EXCLUDE - PATTERN LLVMConfigVersion.cmake EXCLUDE - PATTERN LLVM-Config.cmake EXCLUDE - PATTERN GetHostTriple.cmake EXCLUDE - PATTERN CheckAtomic.cmake EXCLUDE) -endif() +# == Decompiler OFF BEGIN == +# To fix build with MSVC project, do not install anything from below. +# if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) +# install(EXPORT LLVMExports DESTINATION ${LLVM_INSTALL_PACKAGE_DIR}) +# +# install(FILES +# ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/LLVMConfig.cmake +# ${llvm_cmake_builddir}/LLVMConfigVersion.cmake +# LLVM-Config.cmake +# DESTINATION ${LLVM_INSTALL_PACKAGE_DIR}) +# +# install(DIRECTORY . +# DESTINATION ${LLVM_INSTALL_PACKAGE_DIR} +# FILES_MATCHING PATTERN *.cmake +# PATTERN .svn EXCLUDE +# PATTERN LLVMConfig.cmake EXCLUDE +# PATTERN LLVMConfigVersion.cmake EXCLUDE +# PATTERN LLVM-Config.cmake EXCLUDE +# PATTERN GetHostTriple.cmake EXCLUDE +# PATTERN CheckAtomic.cmake EXCLUDE) +# endif() +# == Decompiler OFF END == diff --git a/cmake/modules/TableGen.cmake b/cmake/modules/TableGen.cmake index c88ee3fc196b..a1c817db4450 100644 --- a/cmake/modules/TableGen.cmake +++ b/cmake/modules/TableGen.cmake @@ -139,9 +139,12 @@ macro(add_tablegen target project) endif(CMAKE_SIZEOF_VOID_P MATCHES "8") endif( MINGW ) if (${project} STREQUAL LLVM AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - install(TARGETS ${target} - EXPORT LLVMExports - RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR}) + # == Decompiler OFF BEGIN == + # To fix build with MSVC project, do not install the tablegen. + # install(TARGETS ${target} + # EXPORT LLVMExports + # RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR}) + # == Decompiler OFF END == endif() set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${target}) endmacro() diff --git a/include/llvm/Object/MachO.h b/include/llvm/Object/MachO.h index 7906db1e8a77..70fcf9169446 100644 --- a/include/llvm/Object/MachO.h +++ b/include/llvm/Object/MachO.h @@ -154,6 +154,9 @@ class MachOBindEntry { uint32_t flags() const; int64_t addend() const; int ordinal() const; + // DECOMPILER BEGIN (#1790) + bool malformed() const; + // DECOMPILER END (#1790) bool operator==(const MachOBindEntry &) const; diff --git a/include/llvm/Support/COFF.h b/include/llvm/Support/COFF.h index 7dad3e82bda6..0540d8774112 100644 --- a/include/llvm/Support/COFF.h +++ b/include/llvm/Support/COFF.h @@ -23,6 +23,248 @@ #ifndef LLVM_SUPPORT_COFF_H #define LLVM_SUPPORT_COFF_H +// == Decompiler BEGIN == +#undef IMAGE_FILE_MACHINE_UNKNOWN +#undef IMAGE_FILE_MACHINE_AM33 +#undef IMAGE_FILE_MACHINE_AMD64 +#undef IMAGE_FILE_MACHINE_ARM +#undef IMAGE_FILE_MACHINE_ARMNT +#undef IMAGE_FILE_MACHINE_ARM64 +#undef IMAGE_FILE_MACHINE_EBC +#undef IMAGE_FILE_MACHINE_I386 +#undef IMAGE_FILE_MACHINE_IA64 +#undef IMAGE_FILE_MACHINE_M32R +#undef IMAGE_FILE_MACHINE_MIPS16 +#undef IMAGE_FILE_MACHINE_MIPSFPU +#undef IMAGE_FILE_MACHINE_MIPSFPU16 +#undef IMAGE_FILE_MACHINE_POWERPC +#undef IMAGE_FILE_MACHINE_POWERPCFP +#undef IMAGE_FILE_MACHINE_R4000 +#undef IMAGE_FILE_MACHINE_SH3 +#undef IMAGE_FILE_MACHINE_SH3DSP +#undef IMAGE_FILE_MACHINE_SH4 +#undef IMAGE_FILE_MACHINE_SH5 +#undef IMAGE_FILE_MACHINE_THUMB +#undef IMAGE_FILE_MACHINE_WCEMIPSV2 +#undef IMAGE_FILE_RELOCS_STRIPPED +#undef IMAGE_FILE_EXECUTABLE_IMAGE +#undef IMAGE_FILE_LINE_NUMS_STRIPPED +#undef IMAGE_FILE_LOCAL_SYMS_STRIPPED +#undef IMAGE_FILE_AGGRESSIVE_WS_TRIM +#undef IMAGE_FILE_LARGE_ADDRESS_AWARE +#undef IMAGE_FILE_BYTES_REVERSED_LO +#undef IMAGE_FILE_32BIT_MACHINE +#undef IMAGE_FILE_DEBUG_STRIPPED +#undef IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP +#undef IMAGE_FILE_NET_RUN_FROM_SWAP +#undef IMAGE_FILE_SYSTEM +#undef IMAGE_FILE_DLL +#undef IMAGE_FILE_UP_SYSTEM_ONLY +#undef IMAGE_FILE_BYTES_REVERSED_HI + +#undef IMAGE_SYM_DEBUG +#undef IMAGE_SYM_ABSOLUTE +#undef IMAGE_SYM_UNDEFINED +#undef IMAGE_SYM_CLASS_END_OF_FUNCTION +#undef IMAGE_SYM_CLASS_NULL +#undef IMAGE_SYM_CLASS_AUTOMATIC +#undef IMAGE_SYM_CLASS_EXTERNAL +#undef IMAGE_SYM_CLASS_STATIC +#undef IMAGE_SYM_CLASS_REGISTER +#undef IMAGE_SYM_CLASS_EXTERNAL_DEF +#undef IMAGE_SYM_CLASS_LABEL +#undef IMAGE_SYM_CLASS_UNDEFINED_LABEL +#undef IMAGE_SYM_CLASS_MEMBER_OF_STRUCT +#undef IMAGE_SYM_CLASS_ARGUMENT +#undef IMAGE_SYM_CLASS_STRUCT_TAG +#undef IMAGE_SYM_CLASS_MEMBER_OF_UNION +#undef IMAGE_SYM_CLASS_UNION_TAG +#undef IMAGE_SYM_CLASS_TYPE_DEFINITION +#undef IMAGE_SYM_CLASS_UNDEFINED_STATIC +#undef IMAGE_SYM_CLASS_ENUM_TAG +#undef IMAGE_SYM_CLASS_MEMBER_OF_ENUM +#undef IMAGE_SYM_CLASS_REGISTER_PARAM +#undef IMAGE_SYM_CLASS_BIT_FIELD +#undef IMAGE_SYM_CLASS_BLOCK +#undef IMAGE_SYM_CLASS_FUNCTION +#undef IMAGE_SYM_CLASS_END_OF_STRUCT +#undef IMAGE_SYM_CLASS_FILE +#undef IMAGE_SYM_CLASS_SECTION +#undef IMAGE_SYM_CLASS_WEAK_EXTERNAL +#undef IMAGE_SYM_CLASS_CLR_TOKEN +#undef IMAGE_SYM_TYPE_NULL +#undef IMAGE_SYM_TYPE_VOID +#undef IMAGE_SYM_TYPE_CHAR +#undef IMAGE_SYM_TYPE_SHORT +#undef IMAGE_SYM_TYPE_INT +#undef IMAGE_SYM_TYPE_LONG +#undef IMAGE_SYM_TYPE_FLOAT +#undef IMAGE_SYM_TYPE_DOUBLE +#undef IMAGE_SYM_TYPE_STRUCT +#undef IMAGE_SYM_TYPE_UNION +#undef IMAGE_SYM_TYPE_ENUM +#undef IMAGE_SYM_TYPE_MOE +#undef IMAGE_SYM_TYPE_BYTE +#undef IMAGE_SYM_TYPE_WORD +#undef IMAGE_SYM_TYPE_UINT +#undef IMAGE_SYM_TYPE_DWORD +#undef IMAGE_SYM_DTYPE_NULL +#undef IMAGE_SYM_DTYPE_POINTER +#undef IMAGE_SYM_DTYPE_FUNCTION +#undef IMAGE_SYM_DTYPE_ARRAY + +#undef IMAGE_AUX_SYMBOL_TYPE_TOKEN_DEF + +#undef IMAGE_SCN_TYPE_NOLOAD +#undef IMAGE_SCN_TYPE_NO_PAD +#undef IMAGE_SCN_CNT_CODE +#undef IMAGE_SCN_CNT_INITIALIZED_DATA +#undef IMAGE_SCN_CNT_UNINITIALIZED_DATA +#undef IMAGE_SCN_LNK_OTHER +#undef IMAGE_SCN_LNK_INFO +#undef IMAGE_SCN_LNK_REMOVE +#undef IMAGE_SCN_LNK_COMDAT +#undef IMAGE_SCN_GPREL +#undef IMAGE_SCN_MEM_PURGEABLE +#undef IMAGE_SCN_MEM_16BIT +#undef IMAGE_SCN_MEM_LOCKED +#undef IMAGE_SCN_MEM_PRELOAD +#undef IMAGE_SCN_ALIGN_1BYTES +#undef IMAGE_SCN_ALIGN_2BYTES +#undef IMAGE_SCN_ALIGN_4BYTES +#undef IMAGE_SCN_ALIGN_8BYTES +#undef IMAGE_SCN_ALIGN_16BYTES +#undef IMAGE_SCN_ALIGN_32BYTES +#undef IMAGE_SCN_ALIGN_64BYTES +#undef IMAGE_SCN_ALIGN_128BYTES +#undef IMAGE_SCN_ALIGN_256BYTES +#undef IMAGE_SCN_ALIGN_512BYTES +#undef IMAGE_SCN_ALIGN_1024BYTES +#undef IMAGE_SCN_ALIGN_2048BYTES +#undef IMAGE_SCN_ALIGN_4096BYTES +#undef IMAGE_SCN_ALIGN_8192BYTES +#undef IMAGE_SCN_LNK_NRELOC_OVFL +#undef IMAGE_SCN_MEM_DISCARDABLE +#undef IMAGE_SCN_MEM_NOT_CACHED +#undef IMAGE_SCN_MEM_NOT_PAGED +#undef IMAGE_SCN_MEM_SHARED +#undef IMAGE_SCN_MEM_EXECUTE +#undef IMAGE_SCN_MEM_READ +#undef IMAGE_SCN_MEM_WRITE + +#undef IMAGE_REL_I386_ABSOLUTE +#undef IMAGE_REL_I386_DIR16 +#undef IMAGE_REL_I386_REL16 +#undef IMAGE_REL_I386_DIR32 +#undef IMAGE_REL_I386_DIR32NB +#undef IMAGE_REL_I386_SEG12 +#undef IMAGE_REL_I386_SECTION +#undef IMAGE_REL_I386_SECREL +#undef IMAGE_REL_I386_TOKEN +#undef IMAGE_REL_I386_SECREL7 +#undef IMAGE_REL_I386_REL32 +#undef IMAGE_REL_AMD64_ABSOLUTE +#undef IMAGE_REL_AMD64_ADDR64 +#undef IMAGE_REL_AMD64_ADDR32 +#undef IMAGE_REL_AMD64_ADDR32NB +#undef IMAGE_REL_AMD64_REL32 +#undef IMAGE_REL_AMD64_REL32_1 +#undef IMAGE_REL_AMD64_REL32_2 +#undef IMAGE_REL_AMD64_REL32_3 +#undef IMAGE_REL_AMD64_REL32_4 +#undef IMAGE_REL_AMD64_REL32_5 +#undef IMAGE_REL_AMD64_SECTION +#undef IMAGE_REL_AMD64_SECREL +#undef IMAGE_REL_AMD64_SECREL7 +#undef IMAGE_REL_AMD64_TOKEN +#undef IMAGE_REL_AMD64_SREL32 +#undef IMAGE_REL_AMD64_PAIR +#undef IMAGE_REL_AMD64_SSPAN32 +#undef IMAGE_REL_ARM_ABSOLUTE +#undef IMAGE_REL_ARM_ADDR32 +#undef IMAGE_REL_ARM_ADDR32NB +#undef IMAGE_REL_ARM_BRANCH24 +#undef IMAGE_REL_ARM_BRANCH11 +#undef IMAGE_REL_ARM_TOKEN +#undef IMAGE_REL_ARM_BLX24 +#undef IMAGE_REL_ARM_BLX11 +#undef IMAGE_REL_ARM_SECTION +#undef IMAGE_REL_ARM_SECREL +#undef IMAGE_REL_ARM_MOV32A +#undef IMAGE_REL_ARM_MOV32T +#undef IMAGE_REL_ARM_BRANCH20T +#undef IMAGE_REL_ARM_BRANCH24T +#undef IMAGE_REL_ARM_BLX23T + +#undef IMAGE_COMDAT_SELECT_NODUPLICATES +#undef IMAGE_COMDAT_SELECT_ANY +#undef IMAGE_COMDAT_SELECT_SAME_SIZE +#undef IMAGE_COMDAT_SELECT_EXACT_MATCH +#undef IMAGE_COMDAT_SELECT_ASSOCIATIVE +#undef IMAGE_COMDAT_SELECT_LARGEST +#undef IMAGE_COMDAT_SELECT_NEWEST + +#undef IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY +#undef IMAGE_WEAK_EXTERN_SEARCH_LIBRARY +#undef IMAGE_WEAK_EXTERN_SEARCH_ALIAS + +#undef IMAGE_SUBSYSTEM_UNKNOWN +#undef IMAGE_SUBSYSTEM_NATIVE +#undef IMAGE_SUBSYSTEM_WINDOWS_GUI +#undef IMAGE_SUBSYSTEM_WINDOWS_CUI +#undef IMAGE_SUBSYSTEM_OS2_CUI +#undef IMAGE_SUBSYSTEM_POSIX_CUI +#undef IMAGE_SUBSYSTEM_NATIVE_WINDOWS +#undef IMAGE_SUBSYSTEM_WINDOWS_CE_GUI +#undef IMAGE_SUBSYSTEM_EFI_APPLICATION +#undef IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER +#undef IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER +#undef IMAGE_SUBSYSTEM_EFI_ROM +#undef IMAGE_SUBSYSTEM_XBOX +#undef IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION + +#undef IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA +#undef IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE +#undef IMAGE_DLL_CHARACTERISTICS_FORCE_INTEGRITY +#undef IMAGE_DLL_CHARACTERISTICS_NX_COMPAT +#undef IMAGE_DLL_CHARACTERISTICS_NO_ISOLATION +#undef IMAGE_DLL_CHARACTERISTICS_NO_SEH +#undef IMAGE_DLL_CHARACTERISTICS_NO_BIND +#undef IMAGE_DLL_CHARACTERISTICS_APPCONTAINER +#undef IMAGE_DLL_CHARACTERISTICS_WDM_DRIVER +#undef IMAGE_DLL_CHARACTERISTICS_GUARD_CF +#undef IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE + +#undef IMAGE_DEBUG_TYPE_UNKNOWN +#undef IMAGE_DEBUG_TYPE_COFF +#undef IMAGE_DEBUG_TYPE_CODEVIEW +#undef IMAGE_DEBUG_TYPE_FPO +#undef IMAGE_DEBUG_TYPE_MISC +#undef IMAGE_DEBUG_TYPE_EXCEPTION +#undef IMAGE_DEBUG_TYPE_FIXUP +#undef IMAGE_DEBUG_TYPE_OMAP_TO_SRC +#undef IMAGE_DEBUG_TYPE_OMAP_FROM_SRC +#undef IMAGE_DEBUG_TYPE_BORLAND +#undef IMAGE_DEBUG_TYPE_RESERVED10 +#undef IMAGE_DEBUG_TYPE_CLSID +#undef IMAGE_DEBUG_TYPE_VC_FEATURE +#undef IMAGE_DEBUG_TYPE_POGO +#undef IMAGE_DEBUG_TYPE_ILTCG +#undef IMAGE_DEBUG_TYPE_MPX +#undef IMAGE_DEBUG_TYPE_REPRO + +#undef IMAGE_REL_BASED_ABSOLUTE +#undef IMAGE_REL_BASED_HIGH +#undef IMAGE_REL_BASED_LOW +#undef IMAGE_REL_BASED_HIGHLOW +#undef IMAGE_REL_BASED_HIGHADJ +#undef IMAGE_REL_BASED_MIPS_JMPADDR +#undef IMAGE_REL_BASED_ARM_MOV32A +#undef IMAGE_REL_BASED_ARM_MOV32T +#undef IMAGE_REL_BASED_MIPS_JMPADDR16 +#undef IMAGE_REL_BASED_DIR64 +// == Decompiler END == + #include "llvm/Support/DataTypes.h" #include #include @@ -84,7 +326,8 @@ namespace COFF { MT_Invalid = 0xffff, IMAGE_FILE_MACHINE_UNKNOWN = 0x0, - IMAGE_FILE_MACHINE_AM33 = 0x13, + // Decompiler - fix value of IMAGE_FILE_MACHINE_AM33 + IMAGE_FILE_MACHINE_AM33 = 0x1D3, IMAGE_FILE_MACHINE_AMD64 = 0x8664, IMAGE_FILE_MACHINE_ARM = 0x1C0, IMAGE_FILE_MACHINE_ARMNT = 0x1C4, diff --git a/lib/Analysis/LoopAccessAnalysis.cpp b/lib/Analysis/LoopAccessAnalysis.cpp index 5214eb7c051c..cfe47ba9af02 100644 --- a/lib/Analysis/LoopAccessAnalysis.cpp +++ b/lib/Analysis/LoopAccessAnalysis.cpp @@ -150,8 +150,8 @@ const SCEV *llvm::replaceSymbolicStrideSCEV(PredicatedScalarEvolution &PSE, /// Calculate Start and End points of memory access. /// Let's assume A is the first access and B is a memory access on N-th loop -/// iteration. Then B is calculated as: -/// B = A + Step*N . +/// iteration. Then B is calculated as: +/// B = A + Step*N . /// Step value may be positive or negative. /// N is a calculated back-edge taken count: /// N = (TripCount > 0) ? RoundDown(TripCount -1 , VF) : 0 diff --git a/lib/IR/AsmWriter.cpp b/lib/IR/AsmWriter.cpp index 9b2399dd880c..d6d9a8531df5 100644 --- a/lib/IR/AsmWriter.cpp +++ b/lib/IR/AsmWriter.cpp @@ -2819,6 +2819,22 @@ void AssemblyWriter::printInfoComment(const Value &V) { // This member is called for each Instruction in a function.. void AssemblyWriter::printInstruction(const Instruction &I) { + +// Decompiler, matula: comment special StoreInst with hexadecimal values. +if (const StoreInst *SI = dyn_cast(&I)) +{ + if (isa(SI->getValueOperand()) + && isa(SI->getPointerOperand()) + && SI->hasMetadata()) + { + auto val = cast(SI->getValueOperand())->getZExtValue(); + + Out << "\n; "; + Out.write_hex(val); + Out << "\n"; + } +} + if (AnnotationWriter) AnnotationWriter->emitInstructionAnnot(&I, Out); // Print out indentation for an instruction. diff --git a/lib/Object/COFFObjectFile.cpp b/lib/Object/COFFObjectFile.cpp index 0f790086cfc5..2a29f8491830 100644 --- a/lib/Object/COFFObjectFile.cpp +++ b/lib/Object/COFFObjectFile.cpp @@ -716,8 +716,15 @@ COFFObjectFile::COFFObjectFile(MemoryBufferRef Object, std::error_code &EC) } if ((EC = getObject(DataDirectory, Data, DataDirAddr, DataDirSize))) return; + } + + // == Decompiler BEGIN == + // This change fixes issue with section headers (#1672). + // This change was also sent to LLVM upstream (see https://reviews.llvm.org/D22750) + if (COFFHeader) { CurPtr += COFFHeader->SizeOfOptionalHeader; } + // == Decompiler END == if ((EC = getObject(SectionTable, Data, base() + CurPtr, (uint64_t)getNumberOfSections() * sizeof(coff_section)))) diff --git a/lib/Object/MachOObjectFile.cpp b/lib/Object/MachOObjectFile.cpp index 563236f95a5b..7025d4a221d1 100644 --- a/lib/Object/MachOObjectFile.cpp +++ b/lib/Object/MachOObjectFile.cpp @@ -1908,6 +1908,10 @@ uint32_t MachOBindEntry::flags() const { return Flags; } int MachOBindEntry::ordinal() const { return Ordinal; } +// DECOMPILER BEGIN (#1790) +bool MachOBindEntry::malformed() const { return Malformed; } +// DECOMPILER END (#1790) + bool MachOBindEntry::operator==(const MachOBindEntry &Other) const { assert(Opcodes == Other.Opcodes && "compare iterators of different files"); return (Ptr == Other.Ptr) && diff --git a/lib/Transforms/InstCombine/InstCombineAddSub.cpp b/lib/Transforms/InstCombine/InstCombineAddSub.cpp index 221a22007173..5179e18e940b 100644 --- a/lib/Transforms/InstCombine/InstCombineAddSub.cpp +++ b/lib/Transforms/InstCombine/InstCombineAddSub.cpp @@ -1510,9 +1510,11 @@ Instruction *InstCombiner::visitSub(BinaryOperator &I) { if (I.getType()->isIntegerTy(1)) return BinaryOperator::CreateXor(Op0, Op1); +#if 0 // Decompiler - OFF // Replace (-1 - A) with (~A). if (match(Op0, m_AllOnes())) return BinaryOperator::CreateNot(Op1); +#endif if (Constant *C = dyn_cast(Op0)) { // C - ~X == X + (1+C) diff --git a/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp index 1a6459b3d689..2c5a977290a6 100644 --- a/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp +++ b/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp @@ -529,6 +529,7 @@ static unsigned conjugateICmpMask(unsigned Mask) { /// decomposition fails. static bool decomposeBitTestICmp(const ICmpInst *I, ICmpInst::Predicate &Pred, Value *&X, Value *&Y, Value *&Z) { +#if 0 // Decompiler - OFF ConstantInt *C = dyn_cast(I->getOperand(1)); if (!C) return false; @@ -569,6 +570,8 @@ static bool decomposeBitTestICmp(const ICmpInst *I, ICmpInst::Predicate &Pred, X = I->getOperand(0); Z = ConstantInt::getNullValue(C->getType()); return true; +#endif + return false; } /// Handle (icmp(A & B) ==/!= C) &/| (icmp(A & D) ==/!= E) diff --git a/lib/Transforms/InstCombine/InstCombineCalls.cpp b/lib/Transforms/InstCombine/InstCombineCalls.cpp index 8acff91345d6..39fe4bf6d27c 100644 --- a/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -1260,6 +1260,7 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) { IntrinsicInst *II = dyn_cast(&CI); if (!II) return visitCallSite(&CI); +#if 0 // Decompiler - OFF // Intrinsics cannot occur in an invoke, so handle them here instead of in // visitCallSite. if (MemIntrinsic *MI = dyn_cast(II)) { @@ -1316,6 +1317,7 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) { if (Changed) return II; } +#endif auto SimplifyDemandedVectorEltsLow = [this](Value *Op, unsigned Width, unsigned DemandedWidth) { diff --git a/lib/Transforms/InstCombine/InstCombineCasts.cpp b/lib/Transforms/InstCombine/InstCombineCasts.cpp index 20556157188f..9e09cbe368e3 100644 --- a/lib/Transforms/InstCombine/InstCombineCasts.cpp +++ b/lib/Transforms/InstCombine/InstCombineCasts.cpp @@ -582,6 +582,7 @@ Instruction *InstCombiner::visitTrunc(TruncInst &CI) { /// the icmp. Instruction *InstCombiner::transformZExtICmp(ICmpInst *ICI, Instruction &CI, bool DoXform) { +#if 0 // Decompiler - OFF // If we are just checking for a icmp eq of a single bit and zext'ing it // to an integer, then shift the bit to the appropriate place and then // cast to integer to avoid the comparison. @@ -659,6 +660,7 @@ Instruction *InstCombiner::transformZExtICmp(ICmpInst *ICI, Instruction &CI, } } } +#endif // icmp ne A, B is equal to xor A, B when A and B only really have one bit. // It is also profitable to transform icmp eq into not(xor(A, B)) because that @@ -965,6 +967,7 @@ Instruction *InstCombiner::visitZExt(ZExtInst &CI) { /// Transform (sext icmp) to bitwise / integer operations to eliminate the icmp. Instruction *InstCombiner::transformSExtICmp(ICmpInst *ICI, Instruction &CI) { +#if 0 // Decompiler - OFF Value *Op0 = ICI->getOperand(0), *Op1 = ICI->getOperand(1); ICmpInst::Predicate Pred = ICI->getPredicate(); @@ -1046,6 +1049,7 @@ Instruction *InstCombiner::transformSExtICmp(ICmpInst *ICI, Instruction &CI) { } } } +#endif return nullptr; } diff --git a/lib/Transforms/InstCombine/InstCombineCompares.cpp b/lib/Transforms/InstCombine/InstCombineCompares.cpp index 961497fe3c2d..4192eb51b3ad 100644 --- a/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -1570,6 +1570,7 @@ Instruction *InstCombiner::visitICmpInstWithInstAndIntCst(ICmpInst &ICI, break; case Instruction::Xor: // (icmp pred (xor X, XorCst), CI) +#if 0 // Decompiler - OFF if (ConstantInt *XorCst = dyn_cast(LHSI->getOperand(1))) { // If this is a comparison that tests the signbit (X < 0) or (x > -1), // fold the xor. @@ -1634,6 +1635,7 @@ Instruction *InstCombiner::visitICmpInstWithInstAndIntCst(ICmpInst &ICI, XorCst->getValue() == -RHSV && RHSV.isPowerOf2()) return new ICmpInst(ICmpInst::ICMP_UGE, LHSI->getOperand(0), XorCst); } +#endif break; case Instruction::And: // (icmp pred (and X, AndCst), RHS) if (LHSI->hasOneUse() && isa(LHSI->getOperand(1)) && @@ -3189,6 +3191,7 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) { Type *Ty = Op0->getType(); +#if 0 // Decompiler - OFF // icmp's with boolean values can always be turned into bitwise operations if (Ty->getScalarType()->isIntegerTy(1)) { switch (I.getPredicate()) { @@ -3230,6 +3233,7 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) { } } } +#endif if (ICmpInst *NewICmp = canonicalizeCmpWithConstant(I)) return NewICmp; @@ -4105,6 +4109,7 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) { return new ICmpInst(I.getPredicate(), ConstantExpr::getNot(RHSC), A); } +#if 0 // Decompiler - OFF Instruction *AddI = nullptr; if (match(&I, m_UAddWithOverflow(m_Value(A), m_Value(B), m_Instruction(AddI))) && @@ -4127,6 +4132,7 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) { if (Instruction *R = ProcessUMulZExtIdiom(I, Op1, Op0, *this)) return R; } +#endif } if (I.isEquality()) { diff --git a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index d88456ee4adc..5678ecca27b1 100644 --- a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp @@ -496,6 +496,10 @@ static Instruction *combineLoadToOperationType(InstCombiner &IC, LoadInst &LI) { } } +#if 0 // Decompiler - OFF + // See commit 00b816db0d3345b22ad1beabdf36b1f17391d0ae (2015-07-23) for the + // details why this is disabled (the reason is the same). + // Fold away bit casts of the loaded value by loading the desired type. // We can do this for BitCastInsts as well as casts from and to pointer types, // as long as those are noops (i.e., the source or dest type have the same @@ -509,6 +513,7 @@ static Instruction *combineLoadToOperationType(InstCombiner &IC, LoadInst &LI) { return &LI; } } +#endif // FIXME: We should also canonicalize loads of vectors when their elements are // cast to other types. @@ -1163,9 +1168,57 @@ Instruction *InstCombiner::visitStoreInst(StoreInst &SI) { Value *Val = SI.getOperand(0); Value *Ptr = SI.getOperand(1); +#if 0 // Decompiler - OFF +/* + We had to disable combineStoreToValueType() below because it messed up with + bitcasts in a way that is not compatible with how the decompiler generates + C code. Consider the following piece of code: + + 1 target datalayout = "e-p:32:32:32-f80:32:32" + 2 + 3 @g = global i32 0 + 4 + 5 declare double @func() + 6 + 7 define i32 @main(i32 %argc, i8** %argv) { + 8 %func_res = call double @func() + 9 %tmp1 = fptrunc double %func_res to float + 10 %tmp2 = bitcast float %tmp1 to i32 + 11 store i32 %tmp2, i32* @g + 12 ret i32 0 + 13 } + + In LLVM 3.4, opt optimized it to + + define i32 @main(i32 %argc, i8** %argv) { + bb: + %func_res = call double @func() + %tmp1 = fptrunc double %func_res to float + %tmp2 = bitcast float %tmp1 to i32 + store i32 %tmp2, i32* @g, align 4 + ret i32 0 + } + + However, in LLVM 3.6, opt produced the following code: + + define i32 @main(i32 %argc, i8** %argv) { + bb: + %func_res = call double @func() + %tmp1 = fptrunc double %func_res to float + store float %tmp1, float* bitcast (i32* @g to float*), align 4 + ret i32 0 + } + + In the above code, instead of storing %tmp1 via %tmp2 as an int to @g, it + stores %tmp1 as float to a float-casted @g. This is not what we want -- we + want the original behavior because the type casts are important to us (due + to the fact that we generate C). +*/ + // Try to canonicalize the stored type. if (combineStoreToValueType(*this, SI)) return eraseInstFromFunction(SI); +#endif // Attempt to improve the alignment. unsigned KnownAlign = getOrEnforceKnownAlignment( @@ -1179,9 +1232,24 @@ Instruction *InstCombiner::visitStoreInst(StoreInst &SI) { else if (StoreAlign == 0) SI.setAlignment(EffectiveStoreAlign); +#if 0 // Decompiler - OFF +/* + We don't want -instcombine to optimize + + store [10000 x %V] %a, [10000 x %V]* %b + + into + + b[0] = a[0] + b[1] = a[1] + b[2] = a[2] + ... + b[9999] = a[9999] +*/ // Try to canonicalize the stored type. if (unpackStoreToAggregate(*this, SI)) return eraseInstFromFunction(SI); +#endif // Replace GEP indices if possible. if (Instruction *NewGEPI = replaceGEPIdxWithZero(*this, Ptr, SI)) { diff --git a/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp index 788097f33f12..2cff3e82bc25 100644 --- a/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp +++ b/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp @@ -185,6 +185,7 @@ Instruction *InstCombiner::visitMul(BinaryOperator &I) { if (Value *V = SimplifyUsingDistributiveLaws(I)) return replaceInstUsesWith(I, V); +#if 0 // Decompiler - OFF // X * -1 == 0 - X if (match(Op1, m_AllOnes())) { BinaryOperator *BO = BinaryOperator::CreateNeg(Op0, I.getName()); @@ -192,6 +193,7 @@ Instruction *InstCombiner::visitMul(BinaryOperator &I) { BO->setHasNoSignedWrap(); return BO; } +#endif // Also allow combining multiply instructions on vectors. { @@ -213,6 +215,7 @@ Instruction *InstCombiner::visitMul(BinaryOperator &I) { return BO; } +#if 0 // Decompiler - OFF if (match(&I, m_Mul(m_Value(NewOp), m_Constant(C1)))) { Constant *NewCst = nullptr; if (match(C1, m_APInt(IVal)) && IVal->isPowerOf2()) @@ -238,6 +241,7 @@ Instruction *InstCombiner::visitMul(BinaryOperator &I) { return Shl; } } +#endif } if (ConstantInt *CI = dyn_cast(Op1)) { @@ -1017,12 +1021,14 @@ static Instruction *foldUDivShl(Value *Op0, Value *Op1, const BinaryOperator &I, static size_t visitUDivOperand(Value *Op0, Value *Op1, const BinaryOperator &I, SmallVectorImpl &Actions, unsigned Depth = 0) { +#if 0 // Decompiler - OFF // Check to see if this is an unsigned division with an exact power of 2, // if so, convert to a right shift. if (match(Op1, m_Power2())) { Actions.push_back(UDivFoldAction(foldUDivPow2Cst, Op1)); return Actions.size(); } +#endif if (ConstantInt *C = dyn_cast(Op1)) // X udiv C, where C >= signbit @@ -1433,12 +1439,14 @@ Instruction *InstCombiner::visitURem(BinaryOperator &I) { return new ZExtInst(Builder->CreateURem(ZOp0->getOperand(0), ZOp1), I.getType()); +#if 0 // Decompiler - OFF // X urem Y -> X and Y-1, where Y is a power of 2, if (isKnownToBeAPowerOfTwo(Op1, DL, /*OrZero*/ true, 0, AC, &I, DT)) { Constant *N1 = Constant::getAllOnesValue(I.getType()); Value *Add = Builder->CreateAdd(Op1, N1); return BinaryOperator::CreateAnd(Op0, Add); } +#endif // 1 urem X -> zext(X != 1) if (match(Op0, m_One())) { diff --git a/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp b/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp index f3268d2c3471..9d4fc75ef3e1 100644 --- a/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp +++ b/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp @@ -555,11 +555,15 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask, { Value *VarX; ConstantInt *C1; if (match(I->getOperand(0), m_Shr(m_Value(VarX), m_ConstantInt(C1)))) { - Instruction *Shr = cast(I->getOperand(0)); - Value *R = SimplifyShrShlDemandedBits(Shr, I, DemandedMask, +// Decompiler - NEW CODE START (bug #1781). + if (isa(I->getOperand(0))) { +// Decompiler - NEW CODE END. + Instruction *Shr = cast(I->getOperand(0)); + Value *R = SimplifyShrShlDemandedBits(Shr, I, DemandedMask, KnownZero, KnownOne); - if (R) - return R; + if (R) + return R; + } } } diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp index 377ccb9c37f7..558d81ebc8f3 100644 --- a/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -2253,7 +2253,16 @@ Instruction *InstCombiner::visitSwitchInst(SwitchInst &SI) { ConstantInt *AddRHS = nullptr; if (match(Cond, m_Add(m_Value(), m_ConstantInt(AddRHS)))) { - Instruction *I = cast(Cond); +// Decompiler - OLD CODE. +// Instruction *I = cast(Cond); +// Decompiler - NEW CODE START. + // The bug was reported to upstream on 2016-09-22 + // (https://llvm.org/bugs/show_bug.cgi?id=30486). + Instruction *I = dyn_cast(Cond); + if (I == nullptr) { + return nullptr; + } +// Decompiler - NEW CODE END. // Change 'switch (X+4) case 1:' into 'switch (X) case -3'. for (SwitchInst::CaseIt i = SI.case_begin(), e = SI.case_end(); i != e; ++i) { @@ -3094,6 +3103,12 @@ static bool prepareICWorklistFromFunction(Function &F, const DataLayout &DL, MadeIRChange |= AddReachableCodeToWorklist(&F.front(), DL, Visited, ICWorklist, TLI); +// Decompiler - CONDITIONAL OFF +// Do not remove instructions in unreachable BBs if specific named metadata +// are present in the module. +// +auto* nmd = F.getParent()->getNamedMetadata("llvmToAsmGlobalVariableName"); +if (nmd == nullptr) { // Do a quick scan over the function. If we find any blocks that are // unreachable, remove any instructions inside of them. This prevents // the instcombine code from having to deal with some bad special cases. @@ -3105,6 +3120,7 @@ static bool prepareICWorklistFromFunction(Function &F, const DataLayout &DL, MadeIRChange |= NumDeadInstInBB > 0; NumDeadInst += NumDeadInstInBB; } +} return MadeIRChange; } diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp index f1838d891466..e417c67b1d2a 100644 --- a/lib/Transforms/Utils/Local.cpp +++ b/lib/Transforms/Utils/Local.cpp @@ -1548,6 +1548,14 @@ void llvm::removeUnwindEdge(BasicBlock *BB) { /// if they are in a dead cycle. Return true if a change was made, false /// otherwise. bool llvm::removeUnreachableBlocks(Function &F, LazyValueInfo *LVI) { +// Decompiler - CONDITIONAL OFF +// Do not remove unreachable BBs if specific named metadata are present in +// the module. +// +if (F.getParent()->getNamedMetadata("llvmToAsmGlobalVariableName")) { + return false; +} + SmallPtrSet Reachable; bool Changed = markAliveBlocks(F, Reachable); diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp index c197317ac771..752449fb43c5 100644 --- a/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/lib/Transforms/Utils/SimplifyCFG.cpp @@ -5461,6 +5461,12 @@ bool SimplifyCFGOpt::run(BasicBlock *BB) { assert(BB && BB->getParent() && "Block not embedded in function!"); assert(BB->getTerminator() && "Degenerate basic block encountered!"); +// Decompiler - CONDITIONAL OFF +// Do not remove unreachable BBs if specific named metadata are present in +// the module. +// +auto* nmd = BB->getParent()->getParent()->getNamedMetadata("llvmToAsmGlobalVariableName"); +if (nmd == nullptr) { // Remove basic blocks that have no predecessors (except the entry block)... // or that just have themself as a predecessor. These are unreachable. if ((pred_empty(BB) && BB != &BB->getParent()->getEntryBlock()) || @@ -5469,6 +5475,7 @@ bool SimplifyCFGOpt::run(BasicBlock *BB) { DeleteDeadBlock(BB); return true; } +} // Check to see if we can constant propagate this terminator instruction // away... diff --git a/tools/llvm-ar/CMakeLists.txt b/tools/llvm-ar/CMakeLists.txt index 86233dfce9a5..4376ff2fef87 100644 --- a/tools/llvm-ar/CMakeLists.txt +++ b/tools/llvm-ar/CMakeLists.txt @@ -10,5 +10,9 @@ add_llvm_tool(llvm-ar llvm-ar.cpp ) -add_llvm_tool_symlink(llvm-ranlib llvm-ar) -add_llvm_tool_symlink(llvm-lib llvm-ar) +# == Decompiler OFF BEGIN == +# We don't need these, so disable them. The reason is that they break MSVC +# build via project. +# add_llvm_tool_symlink(llvm-ranlib llvm-ar) +# add_llvm_tool_symlink(llvm-lib llvm-ar) +# == Decompiler OFF END == diff --git a/tools/lto/CMakeLists.txt b/tools/lto/CMakeLists.txt index 8a1571ba03f1..d8908e5b629e 100644 --- a/tools/lto/CMakeLists.txt +++ b/tools/lto/CMakeLists.txt @@ -18,9 +18,12 @@ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports) add_llvm_library(LTO SHARED ${SOURCES}) -install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h - DESTINATION include/llvm-c - COMPONENT LTO) +# == Decompiler OFF BEGIN == +# To fix build with MSVC project, do not install any includes. +# install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h +# DESTINATION include/llvm-c +# COMPONENT LTO) +# == Decompiler OFF END == if (APPLE) set(LTO_VERSION ${LLVM_VERSION_MAJOR}) diff --git a/tools/msbuild/CMakeLists.txt b/tools/msbuild/CMakeLists.txt index 4f471e5408ba..40e91115c7d5 100644 --- a/tools/msbuild/CMakeLists.txt +++ b/tools/msbuild/CMakeLists.txt @@ -40,30 +40,37 @@ if (WIN32) set(MSC_VERSION) set(mflag) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v100}" DESTINATION tools/msbuild/${platform}) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v110}" DESTINATION tools/msbuild/${platform}) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v110_xp}" DESTINATION tools/msbuild/${platform}) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v120}" DESTINATION tools/msbuild/${platform}) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v120_xp}" DESTINATION tools/msbuild/${platform}) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v140}" DESTINATION tools/msbuild/${platform}) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v140_xp}" DESTINATION tools/msbuild/${platform}) + # == Decompiler OFF BEGIN == + # To fix build with MSVC project, do not install any files in this + # directory. + # install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v100}" DESTINATION tools/msbuild/${platform}) + # install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v110}" DESTINATION tools/msbuild/${platform}) + # install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v110_xp}" DESTINATION tools/msbuild/${platform}) + # install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v120}" DESTINATION tools/msbuild/${platform}) + # install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v120_xp}" DESTINATION tools/msbuild/${platform}) + # install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v140}" DESTINATION tools/msbuild/${platform}) + # install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v140_xp}" DESTINATION tools/msbuild/${platform}) - install(FILES "Microsoft.Cpp.Win32.LLVM-vs2010.targets" DESTINATION "tools/msbuild/${platform}" RENAME "Microsoft.Cpp.${platform}.LLVM-vs2010.targets") - install(FILES "Microsoft.Cpp.Win32.LLVM-vs2012.targets" DESTINATION "tools/msbuild/${platform}" RENAME "Microsoft.Cpp.${platform}.LLVM-vs2012.targets") - install(FILES "Microsoft.Cpp.Win32.LLVM-vs2012_xp.targets" DESTINATION "tools/msbuild/${platform}" RENAME "Microsoft.Cpp.${platform}.LLVM-vs2012_xp.targets") - install(FILES "toolset-vs2013.targets" DESTINATION "tools/msbuild/${platform}") - install(FILES "toolset-vs2013_xp.targets" DESTINATION "tools/msbuild/${platform}") - install(FILES "toolset-vs2014.targets" DESTINATION "tools/msbuild/${platform}") - install(FILES "toolset-vs2014_xp.targets" DESTINATION "tools/msbuild/${platform}") + # install(FILES "Microsoft.Cpp.Win32.LLVM-vs2010.targets" DESTINATION "tools/msbuild/${platform}" RENAME "Microsoft.Cpp.${platform}.LLVM-vs2010.targets") + # install(FILES "Microsoft.Cpp.Win32.LLVM-vs2012.targets" DESTINATION "tools/msbuild/${platform}" RENAME "Microsoft.Cpp.${platform}.LLVM-vs2012.targets") + # install(FILES "Microsoft.Cpp.Win32.LLVM-vs2012_xp.targets" DESTINATION "tools/msbuild/${platform}" RENAME "Microsoft.Cpp.${platform}.LLVM-vs2012_xp.targets") + # install(FILES "toolset-vs2013.targets" DESTINATION "tools/msbuild/${platform}") + # install(FILES "toolset-vs2013_xp.targets" DESTINATION "tools/msbuild/${platform}") + # install(FILES "toolset-vs2014.targets" DESTINATION "tools/msbuild/${platform}") + # install(FILES "toolset-vs2014_xp.targets" DESTINATION "tools/msbuild/${platform}") + # == Decompiler OFF END == endforeach() set(LIB_PATH_VERSION) set(REG_KEY) - install(DIRECTORY . - DESTINATION tools/msbuild - FILES_MATCHING - PATTERN "*.bat" - PATTERN ".svn" EXCLUDE - ) + # == Decompiler OFF BEGIN == + # To fix build with MSVC project, do not install any files in this directory. + # install(DIRECTORY . + # DESTINATION tools/msbuild + # FILES_MATCHING + # PATTERN "*.bat" + # PATTERN ".svn" EXCLUDE + # ) + # == Decompiler OFF END == endif() diff --git a/utils/vim/syntax/llvm.vim b/utils/vim/syntax/llvm.vim index 0e8824e90a35..8f6829dc9e9f 100644 --- a/utils/vim/syntax/llvm.vim +++ b/utils/vim/syntax/llvm.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: llvm " Maintainer: The LLVM team, http://llvm.org/ -" Version: $Revision$ +" Version: $Revision: 275248 $ if version < 600 syntax clear diff --git a/utils/vim/syntax/tablegen.vim b/utils/vim/syntax/tablegen.vim index a9b0e4e3a4e7..21f484893353 100644 --- a/utils/vim/syntax/tablegen.vim +++ b/utils/vim/syntax/tablegen.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: TableGen " Maintainer: The LLVM team, http://llvm.org/ -" Version: $Revision$ +" Version: $Revision: 235369 $ if version < 600 syntax clear diff --git a/utils/vim/vimrc b/utils/vim/vimrc index fd87d767d6f4..c35eb0ecbbeb 100644 --- a/utils/vim/vimrc +++ b/utils/vim/vimrc @@ -1,5 +1,5 @@ " LLVM coding guidelines conformance for VIM -" $Revision$ +" $Revision: 176235 $ " " Maintainer: The LLVM Team, http://llvm.org " WARNING: Read before you source in all these commands and macros! Some