aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Target/CBackend/CBackend.cpp9
-rw-r--r--lib/Target/CBackend/Writer.cpp9
2 files changed, 14 insertions, 4 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index d71a568d28..40800b9d43 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -85,10 +85,15 @@ namespace {
bool runOnFunction(Function &F) {
LI = &getAnalysis<LoopInfo>();
+ // Get rid of intrinsics we can't handle.
+ lowerIntrinsics(F);
+
// Output all floating point constants that cannot be printed accurately.
printFloatingPointConstants(F);
-
- lowerIntrinsics(F);
+
+ // Ensure that no local symbols conflict with global symbols.
+ F.renameLocalSymbols();
+
printFunction(F);
FPConstantMap.clear();
return false;
diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp
index d71a568d28..40800b9d43 100644
--- a/lib/Target/CBackend/Writer.cpp
+++ b/lib/Target/CBackend/Writer.cpp
@@ -85,10 +85,15 @@ namespace {
bool runOnFunction(Function &F) {
LI = &getAnalysis<LoopInfo>();
+ // Get rid of intrinsics we can't handle.
+ lowerIntrinsics(F);
+
// Output all floating point constants that cannot be printed accurately.
printFloatingPointConstants(F);
-
- lowerIntrinsics(F);
+
+ // Ensure that no local symbols conflict with global symbols.
+ F.renameLocalSymbols();
+
printFunction(F);
FPConstantMap.clear();
return false;