summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprConstant.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-01-06 05:10:23 +0000
committerDouglas Gregor <dgregor@apple.com>2009-01-06 05:10:23 +0000
commitc7acfdfe9a6f4c5dc045ca6061b69080e01c89e4 (patch)
tree79e853b3418abe5a1203463a416ef8cf60733ff3 /clang/lib/CodeGen/CGExprConstant.cpp
parenta8a3f73a47e7bf23e7b3f0f5dc098539d973ba81 (diff)
downloadbcm5719-llvm-c7acfdfe9a6f4c5dc045ca6061b69080e01c89e4.tar.gz
bcm5719-llvm-c7acfdfe9a6f4c5dc045ca6061b69080e01c89e4.zip
Add QualifiedDeclRefExpr, which retains additional source-location
information for declarations that were referenced via a qualified-id, e.g., N::C::value. We keep track of the location of the start of the nested-name-specifier. Note that the difference between QualifiedDeclRefExpr and DeclRefExpr does have an effect on the semantics of function calls in two ways: 1) The use of a qualified-id instead of an unqualified-id suppresses argument-dependent lookup 2) If the name refers to a virtual function, the qualified-id version will call the function determined statically while the unqualified-id version will call the function determined dynamically (by looking up the appropriate function in the vtable). Neither of these features is implemented yet, but we do print out qualified names for QualifiedDeclRefExprs as part of the AST printing. llvm-svn: 61789
Diffstat (limited to 'clang/lib/CodeGen/CGExprConstant.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprConstant.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp
index a82efca6148..71216a5d63d 100644
--- a/clang/lib/CodeGen/CGExprConstant.cpp
+++ b/clang/lib/CodeGen/CGExprConstant.cpp
@@ -542,7 +542,8 @@ public:
C, ".compoundliteral", &CGM.getModule());
return C;
}
- case Expr::DeclRefExprClass: {
+ case Expr::DeclRefExprClass:
+ case Expr::QualifiedDeclRefExprClass: {
NamedDecl *Decl = cast<DeclRefExpr>(E)->getDecl();
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(Decl))
return CGM.GetAddrOfFunction(FD);
OpenPOWER on IntegriCloud