]> granicus.if.org Git - clang/commitdiff
Work around build failure due to GCC 4.8.1 bug. We don't completely understand
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 2 Feb 2016 23:11:49 +0000 (23:11 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 2 Feb 2016 23:11:49 +0000 (23:11 +0000)
the details of the bug, but avoiding overloading llvm::cast with another
function template sidesteps it.

See gcc.gnu.org/PR58022 for details of the bug, and llvm.org/PR26362 for more
backgound on how it manifested in Clang. Patch by Igor Sugak!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259598 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/Address.h

index 9d145fa26b5f8f0013f24a4e8f8707d26121d5a5..334308081ff3c5b418bed169f591746a371d2dd6 100644 (file)
@@ -103,24 +103,16 @@ public:
   }
 };
 
-}
 }
 
-namespace llvm {
-  // Present a minimal LLVM-like casting interface.
-  template <class U> inline U cast(clang::CodeGen::Address addr) {
-    return U::castImpl(addr);
-  }
-  template <class U> inline bool isa(clang::CodeGen::Address addr) {
-    return U::isaImpl(addr);
-  }
+// Present a minimal LLVM-like casting interface.
+template <class U> inline U cast(CodeGen::Address addr) {
+  return U::castImpl(addr);
+}
+template <class U> inline bool isa(CodeGen::Address addr) {
+  return U::isaImpl(addr);
 }
 
-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