diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-11-05 21:16:22 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-11-05 21:16:22 +0000 |
commit | d4e00edb665596d063322de1a596832c1f7c2452 (patch) | |
tree | 423c471ea999b9cb6d0a9f38da4ae2e3360b01bb | |
parent | 3aa919df2730d506ce5f1f526472446b5e8f805d (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252211 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/Address.h | 7 | ||||
-rw-r--r-- | lib/CodeGen/CGExprConstant.cpp | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/CodeGen/Address.h b/lib/CodeGen/Address.h index b1aa6307e3..9d145fa26b 100644 --- a/lib/CodeGen/Address.h +++ b/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/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index c97739915d..bbd04dd751 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/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"); } |