aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Basic/TargetInfo.cpp1
-rw-r--r--lib/Lex/Preprocessor.cpp7
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/Basic/TargetInfo.cpp b/lib/Basic/TargetInfo.cpp
index 8a11925e06..20692ba5b1 100644
--- a/lib/Basic/TargetInfo.cpp
+++ b/lib/Basic/TargetInfo.cpp
@@ -39,6 +39,7 @@ TargetInfo::TargetInfo(const std::string &T) : Triple(T) {
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.
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp
index 458eca640a..12f63d6444 100644
--- a/lib/Lex/Preprocessor.cpp
+++ b/lib/Lex/Preprocessor.cpp
@@ -425,6 +425,13 @@ static void InitializePredefinedMacros(Preprocessor &PP,
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);