unsigned char LongWidth, LongAlign;
unsigned char LongLongWidth, LongLongAlign;
const char *DescriptionString;
-
+ const char *UserLabelPrefix;
const llvm::fltSemantics *FloatFormat, *DoubleFormat, *LongDoubleFormat;
// TargetInfo Constructor. Default initializes all fields.
return 64;
}
+ /// getUserLabelPrefix - This returns the default value of the
+ /// __USER_LABEL_PREFIX__ macro, which is the prefix given to user symbols by
+ /// default. On most platforms this is "_", but it is "" on some, and "." on
+ /// others.
+ const char *getUserLabelPrefix() const {
+ return UserLabelPrefix;
+ }
+
///===---- Other target property query methods --------------------------===//
/// getTargetDefines - Appends the target-specific #define values for this
LongDoubleFormat = &llvm::APFloat::IEEEdouble;
DescriptionString = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-"
"i64:64:64-f32:32:32-f64:64:64";
+ UserLabelPrefix = "_";
}
// Out of line virtual dtor for TargetInfo.
Buf.push_back('\n');
}
+ if (const char *Prefix = PP.getTargetInfo().getUserLabelPrefix()) {
+ llvm::SmallString<20> TmpStr;
+ TmpStr += "__USER_LABEL_PREFIX__=";
+ TmpStr += Prefix;
+ DefineBuiltinMacro(Buf, TmpStr.c_str());
+ }
+
// Get the target #defines.
PP.getTargetInfo().getTargetDefines(Buf);