From 38b7bf5fd05046a52788f143f18ef599c7070605 Mon Sep 17 00:00:00 2001 From: Abdoulaye Walsimou Gaye Date: Sun, 5 May 2013 00:13:21 +0200 Subject: [Embtk] Give ability to specify default -mcpu Signed-off-by: Abdoulaye Walsimou Gaye (cherry picked from commit 0f3b0d56e88a03d371d2e03ab715e44b2693c96f) --- include/llvm/Config/config.h.in | 3 +++ include/llvm/Support/Host.h | 8 ++++++++ 2 files changed, 11 insertions(+) (limited to 'include') diff --git a/include/llvm/Config/config.h.in b/include/llvm/Config/config.h.in index 950e66f275..1667216953 100644 --- a/include/llvm/Config/config.h.in +++ b/include/llvm/Config/config.h.in @@ -575,6 +575,9 @@ /* Installation directory for data files */ #undef LLVM_DATADIR +/* Default cpu (-mcpu=cpu) to use to all compiler invocations. */ +#undef LLVM_DEFAULT_TARGET_MCPU + /* Target triple LLVM will generate code for by default */ #undef LLVM_DEFAULT_TARGET_TRIPLE diff --git a/include/llvm/Support/Host.h b/include/llvm/Support/Host.h index 9a4036a8af..748e5e2cdf 100644 --- a/include/llvm/Support/Host.h +++ b/include/llvm/Support/Host.h @@ -46,6 +46,14 @@ namespace sys { /// CPU_TYPE-VENDOR-KERNEL-OPERATING_SYSTEM std::string getDefaultTargetTriple(); + /// getDefaultTargetCpu() - Return the default target cpu for which the + /// compiler is configured to generate code for (ie. -mcpu), or "" if empty. + std::string getDefaultTargetCpu(); + + /// hasDefaultTargetCpu() - Return true if the compiler was configured to + /// generate by default code for a given target cpu and false otherwise. + bool hasDefaultTargetCpu(); + /// getProcessTriple() - Return an appropriate target triple for generating /// code to be loaded into the current process, e.g. when using the JIT. std::string getProcessTriple(); -- cgit v1.2.3