Lines Matching full:builder
35 static void DefineBuiltinMacro(MacroBuilder &Builder, StringRef Macro,
46 Builder.defineMacro(MacroName, MacroBody.substr(0, End));
49 Builder.defineMacro(Macro);
55 static void AddImplicitInclude(MacroBuilder &Builder, StringRef File,
57 Builder.append(Twine("#include \"") +
61 static void AddImplicitIncludeMacros(MacroBuilder &Builder,
64 Builder.append(Twine("#__include_macros \"") +
67 Builder.append("##"); // ##?
72 static void AddImplicitIncludePTH(MacroBuilder &Builder, Preprocessor &PP,
84 AddImplicitInclude(Builder, OriginalFile, PP.getFileManager());
89 static void AddImplicitIncludePCH(MacroBuilder &Builder, Preprocessor &PP,
97 AddImplicitInclude(Builder, OriginalFile, PP.getFileManager());
118 static void DefineFloatMacros(MacroBuilder &Builder, StringRef Prefix,
149 Builder.defineMacro(DefPrefix + "DENORM_MIN__", Twine(DenormMin)+Ext);
150 Builder.defineMacro(DefPrefix + "HAS_DENORM__");
151 Builder.defineMacro(DefPrefix + "DIG__", Twine(Digits));
152 Builder.defineMacro(DefPrefix + "EPSILON__", Twine(Epsilon)+Ext);
153 Builder.defineMacro(DefPrefix + "HAS_INFINITY__");
154 Builder.defineMacro(DefPrefix + "HAS_QUIET_NAN__");
155 Builder.defineMacro(DefPrefix + "MANT_DIG__", Twine(MantissaDigits));
157 Builder.defineMacro(DefPrefix + "MAX_10_EXP__", Twine(Max10Exp));
158 Builder.defineMacro(DefPrefix + "MAX_EXP__", Twine(MaxExp));
159 Builder.defineMacro(DefPrefix + "MAX__", Twine(Max)+Ext);
161 Builder.defineMacro(DefPrefix + "MIN_10_EXP__","("+Twine(Min10Exp)+")");
162 Builder.defineMacro(DefPrefix + "MIN_EXP__", "("+Twine(MinExp)+")");
163 Builder.defineMacro(DefPrefix + "MIN__", Twine(Min)+Ext);
172 MacroBuilder &Builder) {
175 Builder.defineMacro(MacroName, MaxVal.toString(10, isSigned) + ValSuffix);
181 const TargetInfo &TI, MacroBuilder &Builder) {
183 TI.isTypeSigned(Ty), Builder);
187 MacroBuilder &Builder) {
188 Builder.defineMacro(MacroName, TargetInfo::getTypeName(Ty));
192 const TargetInfo &TI, MacroBuilder &Builder) {
193 Builder.defineMacro(MacroName, Twine(TI.getTypeWidth(Ty)));
197 const TargetInfo &TI, MacroBuilder &Builder) {
198 Builder.defineMacro(MacroName,
203 const TargetInfo &TI, MacroBuilder &Builder) {
211 DefineType("__INT" + Twine(TypeWidth) + "_TYPE__", Ty, Builder);
215 Builder.defineMacro("__INT" + Twine(TypeWidth) + "_C_SUFFIX__",
236 MacroBuilder &Builder) {
237 Builder.defineMacro("_GLIBCXX_PREDEFINED_OBJC_ARC_IS_SCALAR");
283 Builder.append(Result);
289 MacroBuilder &Builder) {
291 Builder.defineMacro("__STDC__");
293 Builder.defineMacro("__STDC_HOSTED__", "0");
295 Builder.defineMacro("__STDC_HOSTED__");
299 Builder.defineMacro("__STDC_VERSION__", "201112L");
301 Builder.defineMacro("__STDC_VERSION__", "199901L");
303 Builder.defineMacro("__STDC_VERSION__", "199409L");
307 Builder.defineMacro("__cplusplus", "201305L");
312 Builder.defineMacro("__cplusplus", "201103L");
317 Builder.defineMacro("__cplusplus", "199711L");
321 Builder.defineMacro("__OBJC__");
325 Builder.defineMacro("__ASSEMBLER__");
331 MacroBuilder &Builder) {
333 Builder.defineMacro("__llvm__"); // LLVM Backend
334 Builder.defineMacro("__clang__"); // Clang Frontend
337 Builder.defineMacro("__clang_major__", TOSTR(CLANG_VERSION_MAJOR));
338 Builder.defineMacro("__clang_minor__", TOSTR(CLANG_VERSION_MINOR));
340 Builder.defineMacro("__clang_patchlevel__", TOSTR(CLANG_VERSION_PATCHLEVEL));
342 Builder.defineMacro("__clang_patchlevel__", "0");
344 Builder.defineMacro("__clang_version__",
352 Builder.defineMacro("__GNUC_MINOR__", "2");
353 Builder.defineMacro("__GNUC_PATCHLEVEL__", "1");
354 Builder.defineMacro("__GNUC__", "4");
355 Builder.defineMacro("__GXX_ABI_VERSION", "1002");
359 Builder.defineMacro("__ATOMIC_RELAXED", "0");
360 Builder.defineMacro("__ATOMIC_CONSUME", "1");
361 Builder.defineMacro("__ATOMIC_ACQUIRE", "2");
362 Builder.defineMacro("__ATOMIC_RELEASE", "3");
363 Builder.defineMacro("__ATOMIC_ACQ_REL", "4");
364 Builder.defineMacro("__ATOMIC_SEQ_CST", "5");
367 Builder.defineMacro("__PRAGMA_REDEFINE_EXTNAME", "1");
372 Builder.defineMacro("__VERSION__", "\"4.2.1 Compatible " +
379 Builder.defineMacro("__STRICT_ANSI__");
382 Builder.defineMacro("__GXX_EXPERIMENTAL_CXX0X__");
386 Builder.defineMacro("__OBJC2__");
389 Builder.defineMacro("OBJC_ZEROCOST_EXCEPTIONS");
393 Builder.defineMacro("__OBJC_GC__");
396 Builder
398 Builder.defineMacro("IBOutlet", "__attribute__((iboutlet))");
399 Builder.defineMacro("IBOutletCollection(ClassName)",
401 Builder.defineMacro("IBAction", "void)__attribute__((ibaction)");
407 Builder.defineMacro("__CONSTANT_CFSTRINGS__");
410 Builder.defineMacro("OBJC_NEW_PROPERTIES");
413 Builder.defineMacro("__PASCAL_STRINGS__");
416 Builder.defineMacro("__block", "__attribute__((__blocks__(byref)))");
417 Builder.defineMacro("__BLOCKS__");
421 Builder.defineMacro("__EXCEPTIONS");
423 Builder.defineMacro("__GXX_RTTI");
425 Builder.defineMacro("__USING_SJLJ_EXCEPTIONS__");
428 Builder.defineMacro("__DEPRECATED");
431 Builder.defineMacro("__GNUG__", "4");
432 Builder.defineMacro("__GXX_WEAK__");
433 Builder.defineMacro("__private_extern__", "extern");
439 Builder.defineMacro("__PRETTY_FUNCTION__", "__FUNCTION__");
443 Builder.defineMacro("_WCHAR_T_DEFINED");
444 Builder.defineMacro("_NATIVE_WCHAR_T_DEFINED");
448 Builder.append("#define __identifier(x) x");
449 Builder.append("class type_info;");
454 Builder.defineMacro("__OPTIMIZE__");
456 Builder.defineMacro("__OPTIMIZE_SIZE__");
459 Builder.defineMacro("__FAST_MATH__");
468 Builder.defineMacro("__ORDER_LITTLE_ENDIAN__", "1234");
469 Builder.defineMacro("__ORDER_BIG_ENDIAN__", "4321");
470 Builder.defineMacro("__ORDER_PDP_ENDIAN__", "3412");
472 Builder.defineMacro("__BYTE_ORDER__", "__ORDER_BIG_ENDIAN__");
474 Builder.defineMacro("__BYTE_ORDER__", "__ORDER_LITTLE_ENDIAN__");
479 Builder.defineMacro("_LP64");
480 Builder.defineMacro("__LP64__");
485 Builder.defineMacro("__CHAR_BIT__", "8");
487 DefineTypeSize("__SCHAR_MAX__", TI.getCharWidth(), "", true, Builder);
488 DefineTypeSize("__SHRT_MAX__", TargetInfo::SignedShort, TI, Builder);
489 DefineTypeSize("__INT_MAX__", TargetInfo::SignedInt, TI, Builder);
490 DefineTypeSize("__LONG_MAX__", TargetInfo::SignedLong, TI, Builder);
491 DefineTypeSize("__LONG_LONG_MAX__", TargetInfo::SignedLongLong, TI, Builder);
492 DefineTypeSize("__WCHAR_MAX__", TI.getWCharType(), TI, Builder);
493 DefineTypeSize("__INTMAX_MAX__", TI.getIntMaxType(), TI, Builder);
494 DefineTypeSize("__SIZE_MAX__", TI.getSizeType(), TI, Builder);
496 DefineTypeSizeof("__SIZEOF_DOUBLE__", TI.getDoubleWidth(), TI, Builder);
497 DefineTypeSizeof("__SIZEOF_FLOAT__", TI.getFloatWidth(), TI, Builder);
498 DefineTypeSizeof("__SIZEOF_INT__", TI.getIntWidth(), TI, Builder);
499 DefineTypeSizeof("__SIZEOF_LONG__", TI.getLongWidth(), TI, Builder);
500 DefineTypeSizeof("__SIZEOF_LONG_DOUBLE__",TI.getLongDoubleWidth(),TI,Builder);
501 DefineTypeSizeof("__SIZEOF_LONG_LONG__", TI.getLongLongWidth(), TI, Builder);
502 DefineTypeSizeof("__SIZEOF_POINTER__", TI.getPointerWidth(0), TI, Builder);
503 DefineTypeSizeof("__SIZEOF_SHORT__", TI.getShortWidth(), TI, Builder);
505 TI.getTypeWidth(TI.getPtrDiffType(0)), TI, Builder);
507 TI.getTypeWidth(TI.getSizeType()), TI, Builder);
509 TI.getTypeWidth(TI.getWCharType()), TI, Builder);
511 TI.getTypeWidth(TI.getWIntType()), TI, Builder);
513 DefineTypeSizeof("__SIZEOF_INT128__", 128, TI, Builder);
515 DefineType("__INTMAX_TYPE__", TI.getIntMaxType(), Builder);
516 DefineType("__UINTMAX_TYPE__", TI.getUIntMaxType(), Builder);
517 DefineTypeWidth("__INTMAX_WIDTH__", TI.getIntMaxType(), TI, Builder);
518 DefineType("__PTRDIFF_TYPE__", TI.getPtrDiffType(0), Builder);
519 DefineTypeWidth("__PTRDIFF_WIDTH__", TI.getPtrDiffType(0), TI, Builder);
520 DefineType("__INTPTR_TYPE__", TI.getIntPtrType(), Builder);
521 DefineTypeWidth("__INTPTR_WIDTH__", TI.getIntPtrType(), TI, Builder);
522 DefineType("__SIZE_TYPE__", TI.getSizeType(), Builder);
523 DefineTypeWidth("__SIZE_WIDTH__", TI.getSizeType(), TI, Builder);
524 DefineType("__WCHAR_TYPE__", TI.getWCharType(), Builder);
525 DefineTypeWidth("__WCHAR_WIDTH__", TI.getWCharType(), TI, Builder);
526 DefineType("__WINT_TYPE__", TI.getWIntType(), Builder);
527 DefineTypeWidth("__WINT_WIDTH__", TI.getWIntType(), TI, Builder);
528 DefineTypeWidth("__SIG_ATOMIC_WIDTH__", TI.getSigAtomicType(), TI, Builder);
529 DefineType("__CHAR16_TYPE__", TI.getChar16Type(), Builder);
530 DefineType("__CHAR32_TYPE__", TI.getChar32Type(), Builder);
532 DefineFloatMacros(Builder, "FLT", &TI.getFloatFormat(), "F");
533 DefineFloatMacros(Builder, "DBL", &TI.getDoubleFormat(), "");
534 DefineFloatMacros(Builder, "LDBL", &TI.getLongDoubleFormat(), "L");
537 Builder.defineMacro("__POINTER_WIDTH__",
541 Builder.defineMacro("__CHAR_UNSIGNED__");
544 Builder.defineMacro("__WCHAR_UNSIGNED__");
547 Builder.defineMacro("__WINT_UNSIGNED__");
550 Builder.defineMacro("__INT" + Twine(TI.getCharWidth()) + "_TYPE__",
554 DefineExactWidthIntType(TargetInfo::SignedShort, TI, Builder);
557 DefineExactWidthIntType(TargetInfo::SignedInt, TI, Builder);
560 DefineExactWidthIntType(TargetInfo::SignedLong, TI, Builder);
563 DefineExactWidthIntType(TargetInfo::SignedLongLong, TI, Builder);
566 Builder.defineMacro("__USER_LABEL_PREFIX__", Prefix);
569 Builder.defineMacro("__FINITE_MATH_ONLY__", "1");
571 Builder.defineMacro("__FINITE_MATH_ONLY__", "0");
574 Builder.defineMacro("__GNUC_GNU_INLINE__");
576 Builder.defineMacro("__GNUC_STDC_INLINE__");
580 Builder.defineMacro("__GCC_ATOMIC_TEST_AND_SET_TRUEVAL", "1");
585 Builder.defineMacro("__GCC_ATOMIC_" #TYPE "_LOCK_FREE", \
598 Builder.defineMacro("__GCC_ATOMIC_POINTER_LOCK_FREE",
605 Builder.defineMacro("__NO_INLINE__");
608 Builder.defineMacro("__PIC__", Twine(PICLevel));
609 Builder.defineMacro("__pic__", Twine(PICLevel));
612 Builder.defineMacro("__PIE__", Twine(PIELevel));
613 Builder.defineMacro("__pie__", Twine(PIELevel));
617 Builder.defineMacro("__FLT_EVAL_METHOD__", Twine(TI.getFloatEvalMethod()));
618 Builder.defineMacro("__FLT_RADIX__", "2");
620 Builder.defineMacro("__DECIMAL_DIG__", Twine(Dig));
623 Builder.defineMacro("__SSP__");
625 Builder.defineMacro("__SSP_ALL__", "2");
628 Builder.defineMacro("__weak", "__attribute__((objc_gc(weak)))");
632 Builder.defineMacro("__clang_analyzer__");
635 Builder.defineMacro("__FAST_RELAXED_MATH__");
638 Builder.defineMacro("__weak", "__attribute__((objc_ownership(weak)))");
639 Builder.defineMacro("__strong", "__attribute__((objc_ownership(strong)))");
640 Builder.defineMacro("__autoreleasing",
642 Builder.defineMacro("__unsafe_unretained",
653 Builder.defineMacro("_OPENMP", "201107");
657 TI.getTargetDefines(LangOpts, Builder);
733 MacroBuilder Builder(Predefines);
742 Builder.append("# 1 \"<built-in>\" 3");
746 InitializePredefinedMacros(PP.getTargetInfo(), LangOpts, FEOpts, Builder);
757 AddObjCXXARCLibstdcxxDefines(LangOpts, Builder);
767 FEOpts, Builder);
772 Builder.append("# 1 \"<command line>\" 1");
777 Builder.undefineMacro(InitOpts.Macros[i].first);
779 DefineBuiltinMacro(Builder, InitOpts.Macros[i].first,
786 AddImplicitIncludeMacros(Builder, InitOpts.MacroIncludes[i],
791 AddImplicitIncludePCH(Builder, PP, InitOpts.ImplicitPCHInclude);
793 AddImplicitIncludePTH(Builder, PP, InitOpts.ImplicitPTHInclude);
798 AddImplicitInclude(Builder, Path, PP.getFileManager());
803 Builder.append("# 1 \"<built-in>\" 2");