[llvm-commits] [PATCH] [dragonegg] s/TARGET_NAME/TARGET_TRIPLE/
Duncan Sands
baldrick at free.fr
Wed Jan 16 09:21:19 PST 2013
Hi Takumi, this looks good to me, please apply.
Ciao, Duncan.
On 16/01/13 08:40, NAKAMURA Takumi wrote:
> Hi baldrick,
>
> Backend.cpp: s/TARGET_NAME/TARGET_TRIPLE/ Also TARGET_TRIPLE can be normalized as well as TARGET_NAME.
>
> Motivation: I am writing CMakeLists for dragonegg.
>
> In Backend.cpp, TARGET_NAME is normalized immediately.
> In other side in TargetInfo.cpp, TARGET_TRIPLE is normalized as well.
>
> CMake doesn't like dynamic actions. I'd like to reduce generators as possible.
>
> http://llvm-reviews.chandlerc.com/D299
>
> Files:
> dragonegg/Makefile
> dragonegg/src/Backend.cpp
>
> Index: dragonegg/Makefile
> ===================================================================
> --- dragonegg/Makefile
> +++ dragonegg/Makefile
> @@ -80,6 +80,7 @@
> -fno-rtti \
> -MD -MP \
> -DIN_GCC -DLLVM_VERSION=\"$(LLVM_VERSION)\" \
> + -DTARGET_TRIPLE=\"$(TARGET_TRIPLE)\" \
> -DGCC_MAJOR=$(GCC_MAJOR) -DGCC_MINOR=$(GCC_MINOR) \
> -DGCC_MICRO=$(GCC_MICRO) \
> -I$(INCLUDE_DIR) -isystem$(GCC_PLUGIN_DIR)/include
> @@ -96,8 +97,7 @@
> endif
>
> # NOTE: The following flags can only be used after TARGET_UTIL has been built.
> -TARGET_HEADERS+=-DTARGET_NAME=\"$(shell $(TARGET_UTIL) -t)\" \
> - -I$(INCLUDE_DIR)/$(shell $(TARGET_UTIL) -p) \
> +TARGET_HEADERS+=-I$(INCLUDE_DIR)/$(shell $(TARGET_UTIL) -p) \
> -I$(INCLUDE_DIR)/$(shell $(TARGET_UTIL) -o)
>
> ifdef VERBOSE
> @@ -122,7 +122,7 @@
>
> $(TARGET_UTIL_OBJECTS): %.o : $(TOP_DIR)/utils/%.cpp
> @echo Compiling utils/$*.cpp
> - $(QUIET)$(CXX) -c -DTARGET_TRIPLE=\"$(TARGET_TRIPLE)\" \
> + $(QUIET)$(CXX) -c \
> $(CPP_OPTIONS) $(CXXFLAGS) $<
>
> $(TARGET_UTIL): $(TARGET_UTIL_OBJECTS)
> Index: dragonegg/src/Backend.cpp
> ===================================================================
> --- dragonegg/src/Backend.cpp
> +++ dragonegg/src/Backend.cpp
> @@ -378,7 +378,7 @@
> // If the target wants to override the architecture, e.g. turning
> // powerpc-darwin-... into powerpc64-darwin-... when -m64 is enabled, do so
> // now.
> - std::string TargetTriple = Triple::normalize(TARGET_NAME);
> + std::string TargetTriple = Triple::normalize(TARGET_TRIPLE);
> std::string Components[4]; // Arch-Vendor-OS-Environment
> #ifdef LLVM_OVERRIDE_TARGET_ARCH
> Components[0] = LLVM_OVERRIDE_TARGET_ARCH();
>
More information about the llvm-commits
mailing list