summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2012-04-16 17:24:31 +0000
committerDuncan Sands <baldrick@free.fr>2012-04-16 17:24:31 +0000
commit8030b810ded6a9573c0e105f05da83956e9842b2 (patch)
treed8fd7157f06c416fb1c5e07a23f3e61cc6a5c606 /clang/lib/CodeGen/CodeGenFunction.cpp
parentdfc9ab2c16345c5a20d2a299e39ac59e6d241e57 (diff)
downloadbcm5719-llvm-8030b810ded6a9573c0e105f05da83956e9842b2.tar.gz
bcm5719-llvm-8030b810ded6a9573c0e105f05da83956e9842b2.zip
Generate fpmath metadata when -ffast-math. Note that no optimizations are hooked
up to this yet. llvm-svn: 154835
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 9cbba066547..f4b483b5158 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -22,8 +22,9 @@
#include "clang/AST/DeclCXX.h"
#include "clang/AST/StmtCXX.h"
#include "clang/Frontend/CodeGenOptions.h"
-#include "llvm/Target/TargetData.h"
#include "llvm/Intrinsics.h"
+#include "llvm/Support/MDBuilder.h"
+#include "llvm/Target/TargetData.h"
using namespace clang;
using namespace CodeGen;
@@ -41,6 +42,10 @@ CodeGenFunction::CodeGenFunction(CodeGenModule &cgm)
TerminateHandler(0), TrapBB(0) {
CatchUndefined = getContext().getLangOpts().CatchUndefined;
+ if (getContext().getLangOpts().FastMath) {
+ llvm::MDBuilder MDHelper(Builder.getContext());
+ Builder.SetDefaultFPMathTag(MDHelper.createFastFPMath());
+ }
CGM.getCXXABI().getMangleContext().startNewFunction();
}
OpenPOWER on IntegriCloud