Xuejie Xiao committed f45d05b

Use customized macro to distinguish clreflect scanning from clang compiling

Comments (0)

Files changed (2)


 #include "Database.h"
-#ifdef __clang__
+// This is a customized macro added into clReflectScan, we use this to distinguish a clReflect scanning
+// from a normal compiling using clang as compiler.
+// This can help cut normal compiling time since starting from XCode 4.3, clang has become the official
+// compiler on Mac OS X
+#ifdef __clcpp_parse__


 	m_CompilerInvocation.reset(new clang::CompilerInvocation);
+	// we add a customized macro here to distinguish a clreflect parsing process from a compling using clang
+	clang::PreprocessorOptions& preprocessor_options = m_CompilerInvocation->getPreprocessorOpts();
+	preprocessor_options.addMacroDef("__clcpp_parse__");
 	// Setup the language parsing options for C++
 	clang::LangOptions& lang_options = m_CompilerInvocation->getLangOpts();
 	m_CompilerInvocation->setLangDefaults(lang_options, clang::IK_CXX, clang::LangStandard::lang_cxx03);