summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-11-05 21:16:22 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-11-05 21:16:22 +0000
commitd0637bd1c6c2fd014317a686c4b8733ee30e7ea2 (patch)
tree33fe61c69dca1dc8aa763b019f36fb8883a942ef
parent6ddae31045615b4f4e7005427d013e525b73bbd3 (diff)
downloadbcm5719-llvm-d0637bd1c6c2fd014317a686c4b8733ee30e7ea2.tar.gz
bcm5719-llvm-d0637bd1c6c2fd014317a686c4b8733ee30e7ea2.zip
PR25368: Replace workaround for build failure with modules enabled with a fix
for the root cause. The 'using llvm::isa;' declaration in Basic/LLVM.h only pulls the declarations of llvm::isa that were declared prior to it into namespace clang. In a modules build, this is a hermetic set of just the declarations from LLVM. In a non-modules build, we happened to also pull the declaration from lib/CodeGen/Address.h into namespace clang, which made the code in question accidentally compile. llvm-svn: 252211
-rw-r--r--clang/lib/CodeGen/Address.h7
-rw-r--r--clang/lib/CodeGen/CGExprConstant.cpp2
2 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/Address.h b/clang/lib/CodeGen/Address.h
index b1aa6307e36..9d145fa26b5 100644
--- a/clang/lib/CodeGen/Address.h
+++ b/clang/lib/CodeGen/Address.h
@@ -116,4 +116,11 @@ namespace llvm {
}
}
+namespace clang {
+ // Make our custom isa and cast available in namespace clang, to mirror
+ // what we do for LLVM's versions in Basic/LLVM.h.
+ using llvm::isa;
+ using llvm::cast;
+}
+
#endif
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp
index c97739915da..bbd04dd7514 100644
--- a/clang/lib/CodeGen/CGExprConstant.cpp
+++ b/clang/lib/CodeGen/CGExprConstant.cpp
@@ -1038,7 +1038,7 @@ public:
unsigned Type = cast<PredefinedExpr>(E)->getIdentType();
if (CGF) {
LValue Res = CGF->EmitPredefinedLValue(cast<PredefinedExpr>(E));
- return llvm::cast<ConstantAddress>(Res.getAddress());
+ return cast<ConstantAddress>(Res.getAddress());
} else if (Type == PredefinedExpr::PrettyFunction) {
return CGM.GetAddrOfConstantCString("top level", ".tmp");
}
OpenPOWER on IntegriCloud